@opexa/portal-components 0.0.896 → 0.0.898

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 (25) hide show
  1. package/dist/components/DepositStatus/DepositStatus.client.d.ts +6 -0
  2. package/dist/components/DepositStatus/DepositStatus.client.js +38 -0
  3. package/dist/components/DepositStatus/DepositStatus.d.ts +3 -0
  4. package/dist/components/DepositStatus/DepositStatus.js +21 -0
  5. package/dist/components/DepositStatus/index.d.ts +1 -0
  6. package/dist/components/DepositStatus/index.js +1 -0
  7. package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js +1 -1
  8. package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +1 -1
  9. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +1 -1
  10. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +2 -2
  11. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +1 -1
  12. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.js +1 -1
  13. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +44 -10
  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/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +76 -24
  17. package/dist/components/KYC/KYCNonPagCor/IdentityVerification.js +6 -0
  18. package/dist/components/Quests/JourneyQuest.d.ts +10 -0
  19. package/dist/components/Quests/JourneyQuest.js +12 -5
  20. package/dist/components/Quests/RemainingTime.d.ts +7 -1
  21. package/dist/components/Quests/RemainingTime.js +3 -3
  22. package/dist/services/queries.d.ts +1 -1
  23. package/dist/services/queries.js +33 -30
  24. package/dist/utils/sanitizeGamesSearch.js +1 -1
  25. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import type { ImageProps } from 'next/image';
2
+ export interface DepositStatusProps {
3
+ id: string;
4
+ logo: ImageProps['src'];
5
+ }
6
+ export declare function DepositStatus__client(props: DepositStatusProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from 'next/image';
4
+ import { useRouter } from 'next/navigation';
5
+ import { useCooldown } from '../../client/hooks/useCooldown.js';
6
+ import { useDepositQuery } from '../../client/hooks/useDepositQuery.js';
7
+ import { CheckCircleIcon } from '../../icons/CheckCircleIcon.js';
8
+ import { XCircleIcon } from '../../icons/XCircleIcon.js';
9
+ import { Button } from '../../ui/Button/index.js';
10
+ export function DepositStatus__client(props) {
11
+ const query = useDepositQuery(props.id);
12
+ const router = useRouter();
13
+ const closeWindow = () => {
14
+ window.close();
15
+ /* fail safe */
16
+ setTimeout(() => {
17
+ router.push('/');
18
+ }, 2500);
19
+ };
20
+ const cooldown = useCooldown({
21
+ autoplay: true,
22
+ allowPause: false,
23
+ onCooldown: closeWindow,
24
+ });
25
+ if (query.data == null)
26
+ return null;
27
+ return (_jsx("div", { className: "flex min-h-dvh flex-col items-center justify-center p-4", children: _jsxs("main", { className: "mx-auto w-[26rem] max-w-full rounded-xl bg-bg-secondary p-10", children: [_jsx(Image, { src: props.logo, alt: "Logo", height: 52, width: 232, className: "mx-auto h-13 w-auto" }), _jsxs("div", { className: "mt-20", children: [(query.data.status === 'CONFIRMED' ||
28
+ query.data.status === 'APPROVED') && (_jsx(CheckCircleIcon, { className: "mx-auto size-12 text-text-success-primary" })), (query.data.status === 'REJECTED' ||
29
+ query.data.status === 'FAILED') && (_jsx(XCircleIcon, { className: "mx-auto size-12 text-text-error-primary" }))] }), _jsxs("h2", { className: "mt-6 text-center font-bold text-2xl", children: [(query.data.status === 'CONFIRMED' ||
30
+ query.data.status === 'APPROVED') &&
31
+ 'Success', (query.data.status === 'REJECTED' ||
32
+ query.data.status === 'FAILED') &&
33
+ 'Failed'] }), _jsxs("p", { className: "mt-1 text-center font-medium text-text-secondary-700", children: [(query.data.status === 'CONFIRMED' ||
34
+ query.data.status === 'APPROVED') &&
35
+ 'Your deposit request has been credited', (query.data.status === 'REJECTED' ||
36
+ query.data.status === 'FAILED') &&
37
+ 'Sorry, your deposit request didn’t go through. You can try to deposit again on the Deposit page.'] }), _jsxs("p", { className: "mt-18 px-4 text-center text-sm text-text-secondary-700", children: ["You will be auto-redirected to the deposit page shortly, in about", ' ', _jsx("span", { className: "font-bold text-base text-brand-500", children: cooldown.countdown }), ' ', "second/s."] }), _jsx(Button, { className: "mt-6", onClick: closeWindow, children: "Back to deposit page" })] }) }));
38
+ }
@@ -0,0 +1,3 @@
1
+ import { type DepositStatusProps } from './DepositStatus.client';
2
+ export declare function DepositStatus(props: DepositStatusProps): Promise<import("react/jsx-runtime").JSX.Element>;
3
+ export type { DepositStatusProps };
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { redirect } from 'next/navigation';
3
+ import { prefetchDepositQuery } from '../../server/utils/prefetchDepositQuery.js';
4
+ import { getQueryClient } from '../../utils/getQueryClient.js';
5
+ import { getDepositQueryKey } from '../../utils/queryKeys.js';
6
+ import { DepositStatus__client, } from './DepositStatus.client.js';
7
+ export async function DepositStatus(props) {
8
+ await prefetchDepositQuery(props.id);
9
+ const client = getQueryClient();
10
+ const deposit = client.getQueryData(getDepositQueryKey(props.id));
11
+ if (deposit == null) {
12
+ return redirect('/');
13
+ }
14
+ if (deposit.status !== 'CONFIRMED' &&
15
+ deposit.status !== 'APPROVED' &&
16
+ deposit.status !== 'REJECTED' &&
17
+ deposit.status !== 'FAILED') {
18
+ return redirect('/');
19
+ }
20
+ return _jsx(DepositStatus__client, { ...props });
21
+ }
@@ -0,0 +1 @@
1
+ export * from './DepositStatus';
@@ -0,0 +1 @@
1
+ export * from './DepositStatus.js';
@@ -175,7 +175,7 @@ export function AurixPayGCashDeposit() {
175
175
  const redirectUrl = (() => {
176
176
  const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
177
177
  const origin = window.location.origin.includes('localhost')
178
- ? 'https://uat.powerplay.ph/deposit-success' +
178
+ ? 'https://uat.powerplay.ph' +
179
179
  depositWithdrawalProps.depositSuccessPageUrl
180
180
  : window.location.origin;
181
181
  return `${origin}${path}`;
@@ -175,7 +175,7 @@ export function AurixPayPayMayaDeposit() {
175
175
  const redirectUrl = (() => {
176
176
  const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
177
177
  const origin = window.location.origin.includes('localhost')
178
- ? 'https://uat.powerplay.ph/deposit-success' +
178
+ ? 'https://uat.powerplay.ph' +
179
179
  depositWithdrawalProps.depositSuccessPageUrl
180
180
  : window.location.origin;
181
181
  return `${origin}${path}`;
@@ -175,7 +175,7 @@ export function AurixPayGrabPayDeposit() {
175
175
  const redirectUrl = (() => {
176
176
  const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
177
177
  const origin = window.location.origin.includes('localhost')
178
- ? 'https://uat.powerplay.ph/deposit-success' +
178
+ ? 'https://uat.powerplay.ph' +
179
179
  depositWithdrawalProps.depositSuccessPageUrl
180
180
  : window.location.origin;
181
181
  return `${origin}${path}`;
@@ -1,6 +1,6 @@
1
1
  export declare const AurixPayQRPHDepositContext: (props: {
2
2
  value: {
3
- status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
3
+ status: "confirmed" | "failed" | "idle" | "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" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
16
+ status: "confirmed" | "failed" | "idle" | "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" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
8
+ status: "confirmed" | "failed" | "idle" | "generating-qr-code" | "qr-code-generated";
9
9
  deposit: Deposit | null;
10
10
  errorMessage: {
11
11
  name: string;
@@ -65,7 +65,7 @@ export function useAurixPayQRPHDeposit() {
65
65
  const redirectUrl = (() => {
66
66
  const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
67
67
  const origin = window.location.origin.includes('localhost')
68
- ? 'https://uat.powerplay.ph/deposit-success' +
68
+ ? 'https://uat.powerplay.ph' +
69
69
  depositWithdrawalProps.depositSuccessPageUrl
70
70
  : window.location.origin;
71
71
  return `${origin}${path}`;
@@ -8,10 +8,6 @@ import { AlertCircleIcon } from '../../../icons/AlertCircleIcon.js';
8
8
  import { SpinnerIcon } from '../../../icons/SpinnerIcon.js';
9
9
  import { onMobileDevice } from '../../../utils/onMobileDevice.js';
10
10
  import { PaymentMethods } from '../PaymentMethods.js';
11
- import { AurixPayGCashDeposit } from './AurixPayGCashDeposit/AurixPayGCashDeposit.js';
12
- import { AurixPayPayMayaDeposit } from './AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js';
13
- import { AurixPayGrabPayDeposit } from './AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js';
14
- import { AurixPayQRPHDeposit } from './AurixPayQRPHDeposit/AurixPayQRPHDeposit.js';
15
11
  const QRPHDeposit = lazy(() => import('./QRPHDeposit/QRPHDeposit.js').then((m) => ({ default: m.QRPHDeposit })));
16
12
  const GCashDeposit = lazy(() => import('./GCashDeposit/GCashDeposit.js').then((m) => ({
17
13
  default: m.GCashDeposit,
@@ -52,6 +48,26 @@ export function Deposit() {
52
48
  const paymentSettingsQuery = usePaymentSettingsQuery();
53
49
  const paymentSettings = paymentSettingsQuery.data;
54
50
  const featureFlag = useFeatureFlag();
51
+ const nodeEnv = (process.env.NEXT_PUBLIC_ENVIRONMENT ?? '');
52
+ const enableAurix = nodeEnv === 'development' || nodeEnv === 'staging';
53
+ const aurixComponents = useMemo(() => {
54
+ if (!enableAurix)
55
+ return null;
56
+ return {
57
+ gcash: lazy(() => import('./AurixPayGCashDeposit/AurixPayGCashDeposit.js').then((m) => ({
58
+ default: m.AurixPayGCashDeposit,
59
+ }))),
60
+ payMaya: lazy(() => import('./AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js').then((m) => ({
61
+ default: m.AurixPayPayMayaDeposit,
62
+ }))),
63
+ grabPay: lazy(() => import('./AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js').then((m) => ({
64
+ default: m.AurixPayGrabPayDeposit,
65
+ }))),
66
+ qrph: lazy(() => import('./AurixPayQRPHDeposit/AurixPayQRPHDeposit.js').then((m) => ({
67
+ default: m.AurixPayQRPHDeposit,
68
+ }))),
69
+ };
70
+ }, [enableAurix]);
55
71
  const enabledPaymentMethods = useMemo(() => {
56
72
  const l = [];
57
73
  if (onMaya) {
@@ -113,20 +129,26 @@ export function Deposit() {
113
129
  },
114
130
  {
115
131
  method: 'AURIX_PAY_GCASH',
116
- enabled: paymentSettings?.aurixPayGCashDepositGatewaySettings?.[enabledKey] &&
132
+ enabled: enableAurix &&
133
+ paymentSettings?.aurixPayGCashDepositGatewaySettings?.[enabledKey] &&
117
134
  featureFlag.enabled,
118
135
  },
119
136
  {
120
137
  method: 'AURIX_PAY_GRAB_PAY',
121
- enabled: paymentSettings?.aurixPayGrabPayDepositGatewaySettings?.[enabledKey] && featureFlag.enabled,
138
+ enabled: enableAurix &&
139
+ paymentSettings?.aurixPayGrabPayDepositGatewaySettings?.[enabledKey] &&
140
+ featureFlag.enabled,
122
141
  },
123
142
  {
124
143
  method: 'AURIX_PAY_PAYMAYA',
125
- enabled: paymentSettings?.aurixPayPayMayaDepositGatewaySettings?.[enabledKey] && featureFlag.enabled,
144
+ enabled: enableAurix &&
145
+ paymentSettings?.aurixPayPayMayaDepositGatewaySettings?.[enabledKey] &&
146
+ featureFlag.enabled,
126
147
  },
127
148
  {
128
149
  method: 'AURIX_PAY_QRPH',
129
- enabled: paymentSettings?.aurixPayQrphDepositGatewaySettings?.[enabledKey] &&
150
+ enabled: enableAurix &&
151
+ paymentSettings?.aurixPayQrphDepositGatewaySettings?.[enabledKey] &&
130
152
  featureFlag.enabled,
131
153
  },
132
154
  ];
@@ -136,7 +158,7 @@ export function Deposit() {
136
158
  }
137
159
  });
138
160
  return l;
139
- }, [onMaya, paymentSettings, featureFlag.enabled]);
161
+ }, [enableAurix, featureFlag.enabled, onMaya, paymentSettings]);
140
162
  const [paymentMethod, setPaymentMethod] = useState();
141
163
  useEffect(() => {
142
164
  if (enabledPaymentMethods.length > 0 && !paymentMethod) {
@@ -157,7 +179,19 @@ export function Deposit() {
157
179
  if (enabledPaymentMethods.length <= 0) {
158
180
  return _jsx(NoAvailablePaymentMethods, {});
159
181
  }
160
- return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: handlePaymentMethodChange, options: enabledPaymentMethods }), _jsxs(Suspense, { fallback: _jsx(SpinnerIcon, { className: "mx-auto size-6" }), children: [paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN_PAY_IN' && _jsx(LibanganDeposit, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayDeposit, {}), paymentMethod === 'AIO_GCASH' && _jsx(AiOGCashDeposit, {}), paymentMethod === 'AIO_PAY_MAYA' && _jsx(AiOPayMayaDeposit, {}), paymentMethod === 'AIO_GRAB_PAY' && _jsx(AiOGrabPayDeposit, {}), paymentMethod === 'AIO_PALAWAN_PAY' && _jsx(AiOPalawanPayDeposit, {}), paymentMethod === 'GCASH_WEBPAY' && _jsx(GCashWebpayDeposit, {}), paymentMethod === 'MAYA_WEBPAY' && _jsx(MayaWebpayDeposit, {}), paymentMethod === 'AURIX_PAY_GCASH' && _jsx(AurixPayGCashDeposit, {}), paymentMethod === 'AURIX_PAY_PAYMAYA' && _jsx(AurixPayPayMayaDeposit, {}), paymentMethod === 'AURIX_PAY_GRAB_PAY' && _jsx(AurixPayGrabPayDeposit, {}), paymentMethod === 'AURIX_PAY_QRPH' && _jsx(AurixPayQRPHDeposit, {})] })] }));
182
+ const AurixPayGCashDeposit = aurixComponents?.gcash;
183
+ const AurixPayPayMayaDeposit = aurixComponents?.payMaya;
184
+ const AurixPayGrabPayDeposit = aurixComponents?.grabPay;
185
+ const AurixPayQRPHDeposit = aurixComponents?.qrph;
186
+ return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: handlePaymentMethodChange, options: enabledPaymentMethods }), _jsxs(Suspense, { fallback: _jsx(SpinnerIcon, { className: "mx-auto size-6" }), children: [paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN_PAY_IN' && _jsx(LibanganDeposit, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayDeposit, {}), paymentMethod === 'AIO_GCASH' && _jsx(AiOGCashDeposit, {}), paymentMethod === 'AIO_PAY_MAYA' && _jsx(AiOPayMayaDeposit, {}), paymentMethod === 'AIO_GRAB_PAY' && _jsx(AiOGrabPayDeposit, {}), paymentMethod === 'AIO_PALAWAN_PAY' && _jsx(AiOPalawanPayDeposit, {}), paymentMethod === 'GCASH_WEBPAY' && _jsx(GCashWebpayDeposit, {}), paymentMethod === 'MAYA_WEBPAY' && _jsx(MayaWebpayDeposit, {}), enableAurix &&
187
+ paymentMethod === 'AURIX_PAY_GCASH' &&
188
+ AurixPayGCashDeposit && _jsx(AurixPayGCashDeposit, {}), enableAurix &&
189
+ paymentMethod === 'AURIX_PAY_PAYMAYA' &&
190
+ AurixPayPayMayaDeposit && _jsx(AurixPayPayMayaDeposit, {}), enableAurix &&
191
+ paymentMethod === 'AURIX_PAY_GRAB_PAY' &&
192
+ AurixPayGrabPayDeposit && _jsx(AurixPayGrabPayDeposit, {}), enableAurix &&
193
+ paymentMethod === 'AURIX_PAY_QRPH' &&
194
+ AurixPayQRPHDeposit && _jsx(AurixPayQRPHDeposit, {})] })] }));
161
195
  }
162
196
  function MayaSessionSessionExpired() {
163
197
  return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-warning-secondary", children: _jsx(AlertCircleIcon, { className: "size-6 text-text-featured-icon-light-warning" }) }), _jsx("h2", { className: "mt-lg text-center font-semibold text-lg", children: "Session Expired" }), _jsx("p", { className: "mx-auto mt-xs max-w-[25rem] text-center text-sm text-text-tertiary-600", children: "Your session has timed out. To continue with deposits or withdrawals, Please try reloading the app." })] }));
@@ -1,6 +1,6 @@
1
1
  export declare const QRPHDepositContext: (props: {
2
2
  value: {
3
- status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
3
+ status: "confirmed" | "failed" | "idle" | "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" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
16
+ status: "confirmed" | "failed" | "idle" | "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" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
8
+ status: "confirmed" | "failed" | "idle" | "generating-qr-code" | "qr-code-generated";
9
9
  deposit: Deposit | null;
10
10
  errorMessage: {
11
11
  name: string;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { createListCollection } from '@ark-ui/react/collection';
3
3
  import { zodResolver } from '@hookform/resolvers/zod';
4
4
  import Link from 'next/link';
@@ -6,11 +6,11 @@ import { useEffect, useMemo, useState } from 'react';
6
6
  import { Controller, useForm } from 'react-hook-form';
7
7
  import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
+ import { useAccountQuery } from '../../../../client/hooks/useAccountQuery.js';
9
10
  import { useCreateVentajaDisbursementWithdrawalMutation } from '../../../../client/hooks/useCreateVentajaWithdrawalMutation.js';
10
11
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
11
12
  import { useInstapayBankListQuery } from '../../../../client/hooks/useInstapayBankListQuery.js';
12
13
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
13
- import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
14
14
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
15
15
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
16
16
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
@@ -29,15 +29,16 @@ import { Select } from '../../../../ui/Select/index.js';
29
29
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
30
30
  import { AmountChoices } from '../../AmountChoices.js';
31
31
  import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
32
- import { explainError } from '../../utils.js';
32
+ import { PaymentMethods } from '../../PaymentMethods.js';
33
33
  import { ActiveTurnoverRequirement } from '../ActiveTurnoverRequirement.js';
34
34
  import { RequireFirstDeposit } from '../RequireFirstDeposit.js';
35
35
  import { TransactionPasswordNotSet } from '../TransactionPasswordNotSet.js';
36
36
  export function VentajaWithdrawal() {
37
37
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
38
+ const [paymentMethod, setPaymentMethod] = useState('INSTAPAY');
38
39
  const globalStore = useGlobalStore(useShallow((ctx) => ({
39
40
  depositWithdrawal: ctx.depositWithdrawal,
40
- pendingBonus: ctx.pendingBonus,
41
+ hasPendingBonus: ctx.pendingBonus,
41
42
  })));
42
43
  const [status, setStatus] = useState('waiting');
43
44
  const createWithdrawalMutation = useCreateVentajaDisbursementWithdrawalMutation({
@@ -53,14 +54,20 @@ export function VentajaWithdrawal() {
53
54
  },
54
55
  });
55
56
  const instapayBankListQuery = useInstapayBankListQuery();
56
- const instapayBankList = instapayBankListQuery.data;
57
+ const instapayBankList = useMemo(() => [
58
+ {
59
+ code: 'LBNGAN',
60
+ name: 'Libangan',
61
+ },
62
+ ...(instapayBankListQuery.data ?? []),
63
+ ], [instapayBankListQuery.data]);
57
64
  const paymentSettingsQuery = usePaymentSettingsQuery();
58
65
  const paymentSettings = paymentSettingsQuery.data;
59
- const gatewaySettings = paymentSettings?.instapayWithdrawalGatewaySettings;
66
+ const gatewaySettings = paymentSettings?.ventajaWithdrawalGatewaySettings;
60
67
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
61
68
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
62
- const walletQuery = useWalletQuery();
63
- const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
69
+ const accountQuery = useAccountQuery();
70
+ const account = accountQuery.data;
64
71
  const definition = z.object({
65
72
  amount: z.string().superRefine((val, ctx) => {
66
73
  const n = parseDecimal(val, 0);
@@ -70,7 +77,7 @@ export function VentajaWithdrawal() {
70
77
  code: z.ZodIssueCode.too_small,
71
78
  inclusive: true,
72
79
  minimum: minimumAmount,
73
- message: `Please enter ${minimumAmount.toLocaleString()} or more to proceed with your withdrawal.`,
80
+ message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
74
81
  });
75
82
  }
76
83
  if (n > maximumAmount) {
@@ -85,9 +92,16 @@ export function VentajaWithdrawal() {
85
92
  }),
86
93
  password: z
87
94
  .string()
88
- .min(8, 'Password must be 8 or more characters')
89
- .max(64, 'Password must be not be more than 64 characters'),
90
- accountNumber: z.string().min(1).trim(),
95
+ .min(1, 'Transaction Password is required')
96
+ .min(8, 'Transaction Password must be 8 or more characters')
97
+ .max(64, 'Transaction Password must be not be more than 64 characters'),
98
+ accountNumber: z
99
+ .string()
100
+ .min(1, paymentMethod === 'INSTAPAY'
101
+ ? 'Bank Account Number is required'
102
+ : 'Phone Number is required')
103
+ .trim(),
104
+ accountName: z.string().min(1, 'Account Name is required').trim(),
91
105
  bankCode: z.string().min(1, 'Bank is required').trim(),
92
106
  });
93
107
  const form = useForm({
@@ -97,6 +111,7 @@ export function VentajaWithdrawal() {
97
111
  amount: '0',
98
112
  password: '',
99
113
  accountNumber: '',
114
+ accountName: '',
100
115
  bankCode: '',
101
116
  },
102
117
  });
@@ -107,6 +122,7 @@ export function VentajaWithdrawal() {
107
122
  bankCode: form.getValues('bankCode'),
108
123
  password: '',
109
124
  accountNumber: '',
125
+ accountName: '',
110
126
  });
111
127
  }
112
128
  }, [form, minimumAmount]);
@@ -117,20 +133,21 @@ export function VentajaWithdrawal() {
117
133
  bankCode: instapayBankList[0].code,
118
134
  password: '',
119
135
  accountNumber: '',
136
+ accountName: '',
120
137
  });
121
138
  }
122
139
  }, [form, instapayBankList]);
123
140
  const handleSubmit = form.handleSubmit(async (data) => {
124
- if (globalStore.pendingBonus.shouldShowWarning) {
125
- globalStore.pendingBonus.setOpen(true);
141
+ if (globalStore.hasPendingBonus.shouldShowWarning) {
142
+ globalStore.hasPendingBonus.setOpen(true);
126
143
  return;
127
144
  }
128
145
  createWithdrawalMutation.mutate({
129
146
  input: {
130
- amount: data.amount,
147
+ amount: data.amount.replaceAll(',', '').toString(),
131
148
  accountNumber: data.accountNumber,
132
149
  bankCode: data.bankCode,
133
- accountName: '',
150
+ accountName: data.accountName,
134
151
  },
135
152
  transactionPassword: data.password,
136
153
  });
@@ -140,11 +157,46 @@ export function VentajaWithdrawal() {
140
157
  itemToValue: (item) => item.code,
141
158
  itemToString: (item) => item.name,
142
159
  }), [instapayBankList]);
143
- return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsx(Controller, { control: form.control, name: "bankCode", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.bankCode, children: [_jsxs(Select.Root, { collection: bankCollection, positioning: {
144
- sameWidth: true,
145
- }, value: o.field.value ? [o.field.value] : [], onValueChange: (details) => {
146
- o.field.onChange(details.value.at(0) ?? '');
147
- }, children: [_jsx(Select.Label, { children: "Bank" }), _jsx(Select.Control, { children: _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }) }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: bankCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: item.name }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item.id))) }) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.bankCode?.message })] })) }), _jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Bank 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-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
160
+ return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: (props) => {
161
+ setPaymentMethod(props);
162
+ let bankCode = '';
163
+ if (props !== 'INSTAPAY') {
164
+ const accountName = account?.realName ?? account?.name ?? '';
165
+ form.setValue('accountName', accountName, {
166
+ shouldTouch: false,
167
+ shouldDirty: false,
168
+ shouldValidate: false,
169
+ });
170
+ }
171
+ switch (props) {
172
+ case 'MAYA':
173
+ bankCode = 'BNKMYA';
174
+ break;
175
+ case 'GCASH':
176
+ bankCode = 'BNKGCH';
177
+ break;
178
+ default:
179
+ bankCode = '';
180
+ break;
181
+ }
182
+ form.setValue('bankCode', bankCode, {
183
+ shouldTouch: false,
184
+ shouldDirty: false,
185
+ shouldValidate: false,
186
+ });
187
+ form.setValue('accountNumber', '', {
188
+ shouldTouch: false,
189
+ shouldDirty: false,
190
+ shouldValidate: false,
191
+ });
192
+ form.clearErrors(['bankCode', 'accountNumber', 'password']);
193
+ } }), paymentMethod === 'INSTAPAY' && (_jsxs(_Fragment, { children: [_jsx(Controller, { control: form.control, name: "bankCode", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.bankCode, children: [_jsxs(Select.Root, { collection: bankCollection, positioning: {
194
+ sameWidth: true,
195
+ }, value: o.field.value ? [o.field.value] : [], onValueChange: (details) => {
196
+ o.field.onChange(details.value.at(0) ?? '');
197
+ }, children: [_jsx(Select.Label, { children: "Bank" }), _jsx(Select.Control, { children: _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }) }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: bankCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: item.name }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item.code))) }) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.bankCode?.message })] })) }), _jsxs(Field.Root, { invalid: !!form.formState.errors.accountName, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Account Name" }), _jsx(Field.Input, { ...form.register('accountName') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountName?.message })] })] })), _jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, className: "mt-3xl", children: [_jsx(Field.Label, { children: paymentMethod === 'INSTAPAY'
198
+ ? 'Bank account number'
199
+ : 'Phone 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-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
148
200
  o.field.onChange(details.value);
149
201
  }, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _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) => {
150
202
  form.setValue('amount', value.toString(), {
@@ -152,14 +204,14 @@ export function VentajaWithdrawal() {
152
204
  shouldDirty: true,
153
205
  shouldValidate: true,
154
206
  });
155
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...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 })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(RequireFirstDeposit, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, 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: status !== 'waiting', onOpenChange: (details) => {
207
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), account?.transactionPassword && (_jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter Transaction password", ...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 })] })), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(RequireFirstDeposit, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || !account?.transactionPassword, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, 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.termsOfUseUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
156
208
  if (!details.open) {
157
209
  setStatus('waiting');
158
210
  }
159
- }, 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, { disabled: status === 'processing', 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 Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
211
+ }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', 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 Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
160
212
  "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
161
213
  'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
162
- explainError(createWithdrawalMutation.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
214
+ 'First deposit is required before making a withdrawal.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
163
215
  api.setOpen(false);
164
216
  }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
165
217
  }
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Capacitor } from '@capacitor/core';
4
4
  import { zodResolver } from '@hookform/resolvers/zod';
5
+ import { ObjectId } from '@opexa/object-id';
5
6
  import { useRouter } from 'next/navigation';
6
7
  import { useEffect } from 'react';
7
8
  import { Controller, useForm } from 'react-hook-form';
@@ -16,6 +17,7 @@ import { useSignOutMutation } from '../../../client/hooks/useSignOutMutation.js'
16
17
  import { useUpdateMemberVerificationMutation } from '../../../client/hooks/useUpdateMemberVerificationMutation.js';
17
18
  import { getSession } from '../../../client/services/getSession.js';
18
19
  import { toaster } from '../../../client/utils/toaster.js';
20
+ import { ObjectType } from '../../../services/ObjectType.js';
19
21
  import { unregisterFCMDevice } from '../../../services/trigger.js';
20
22
  import { Button } from '../../../ui/Button/index.js';
21
23
  import { Dialog } from '../../../ui/Dialog/index.js';
@@ -106,6 +108,7 @@ export function IdentityVerification() {
106
108
  },
107
109
  });
108
110
  async function onSubmit(values) {
111
+ //if member verification id is not available (first time doing kyc to trigger notifications)
109
112
  if (!memberId) {
110
113
  createMemberVerification({
111
114
  selfieImage: values.selfieImage,
@@ -117,7 +120,10 @@ export function IdentityVerification() {
117
120
  placeOfBirth: '',
118
121
  sourceOfIncome: '',
119
122
  });
123
+ const id = ObjectId.generate(ObjectType.MemberVerification).toString();
124
+ await approveMemberVerificationMutation.mutateAsync(id);
120
125
  }
126
+ //if member verification id is available (updating kyc)
121
127
  else {
122
128
  updateMemberVerification({
123
129
  id: memberId,
@@ -1,9 +1,19 @@
1
1
  import { type CSSProperties } from 'react';
2
2
  export interface ClassNameEntries {
3
3
  root?: string;
4
+ completedBadgeRoot?: string;
5
+ completedBadgeLabel?: string;
6
+ failedBadgeRoot?: string;
7
+ failedBadgeLabel?: string;
8
+ progressRoot?: string;
9
+ progressTrack?: string;
10
+ progressRange?: string;
11
+ progressLabel?: string;
4
12
  checkboxName?: string;
5
13
  checkboxBonus?: string;
6
14
  dialogRoot?: string;
15
+ dialogTitle?: string;
16
+ dialogDescription?: string;
7
17
  dialogMilestone?: string;
8
18
  dialogMilestoneName?: string;
9
19
  dialogMilestoneDescription?: string;
@@ -85,13 +85,20 @@ export function JourneyQuest(props) {
85
85
  disclosure.setOpen(true);
86
86
  }, [disclosure]);
87
87
  const localeInfo = useLocaleInfo();
88
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-center justify-between", children: [_jsx(RemainingTime, { endOfDay: true }), quest.status === 'COMPLETED' && (_jsx(Badge.Root, { colorScheme: "success", size: "lg", round: false, children: _jsxs(Badge.Label, { children: ["Final Bonus:", ' ', formatNumber(quest.bonus, {
88
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-center justify-between", children: [_jsx(RemainingTime, { endOfDay: true, className: {
89
+ completedBadgeRoot: classNames?.completedBadgeRoot,
90
+ completedBadgeLabel: classNames?.completedBadgeLabel,
91
+ failedBadgeRoot: classNames?.failedBadgeRoot,
92
+ failedBadgeLabel: classNames?.failedBadgeLabel,
93
+ } }), quest.status === 'COMPLETED' && (_jsx(Badge.Root, { colorScheme: "success", size: "lg", round: false, children: _jsxs(Badge.Label, { children: ["Final Bonus:", ' ', formatNumber(quest.bonus, {
89
94
  currency: localeInfo.currency.code,
90
- })] }) }))] }), _jsx("p", { className: "font-semibold text-xl", children: quest?.name || 'Journey Quest' }), _jsxs("div", { className: "flex w-full items-center space-x-2", children: [_jsx(Progress.Root, { max: 100, className: "h-2 rounded-full bg-bg-primary", value: progressValue, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsxs("p", { className: "text-text-quarterary-brand text-xs", children: [currentMilestone, "/", totalMilestones] })] }), _jsx("div", { className: "flex w-full flex-col space-y-3", children: milestones.map((milestone, index) => (_jsx(QuestMilestone, { label: milestone.label, bonus: milestone.bonus, isCompleted: milestone.isCompleted, checkboxControlStyle: props.checkboxControlStyle, className: {
95
+ })] }) }))] }), _jsx("p", { className: "font-semibold text-xl", children: quest?.name || 'Journey Quest' }), _jsxs("div", { className: "flex w-full items-center space-x-2", children: [_jsx(Progress.Root, { max: 100, className: twMerge('h-2 rounded-full bg-bg-primary', classNames?.progressRoot), value: progressValue, children: _jsx(Progress.Track, { className: classNames?.progressTrack, children: _jsx(Progress.Range, { className: classNames?.progressRange }) }) }), _jsxs("p", { className: twMerge('text-text-quarterary-brand text-xs', classNames?.progressLabel), children: [currentMilestone, "/", totalMilestones] })] }), _jsx("div", { className: "flex w-full flex-col space-y-3", children: milestones.map((milestone, index) => (_jsx(QuestMilestone, { label: milestone.label, bonus: milestone.bonus, isCompleted: milestone.isCompleted, checkboxControlStyle: props.checkboxControlStyle, className: {
91
96
  name: classNames?.checkboxName,
92
97
  bonus: classNames?.checkboxBonus,
93
98
  } }, index))) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx(Button, { size: "sm", onClick: handleViewDetails, "aria-label": "View Details", disabled: false, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: "View Details" }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen, quest: quest, milestones: milestones, className: {
94
99
  root: classNames?.dialogRoot,
100
+ title: classNames?.dialogTitle,
101
+ description: classNames?.dialogDescription,
95
102
  milestone: classNames?.dialogMilestone,
96
103
  milestoneName: classNames?.dialogMilestoneName,
97
104
  milestoneDescription: classNames?.dialogMilestoneDescription,
@@ -124,9 +131,9 @@ function Rules(props) {
124
131
  }, [milestones]);
125
132
  const sessionQuery = useSessionQuery();
126
133
  const session = sessionQuery.data;
127
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center p-4", children: _jsxs(Dialog.Content, { className: twMerge('mx-auto max-h-[80vh] min-h-auto min-w-[21.438rem] max-w-[400px] overflow-y-auto rounded-xl px-4 py-10 md:scrollbar:h-2 md:scrollbar:w-2 md:scrollbar-thumb:rounded-full md:scrollbar-thumb:bg-bg-quaternary md:scrollbar-track:bg-transparent', props.className?.root), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest?.name || 'Quest' }), _jsxs("div", { className: "relative", children: [_jsx("div", { className: "max-h-[30vh] overflow-y-auto", children: quest?.description ? (_jsx(Prose, { dangerouslySetInnerHTML: {
128
- __html: quest.description,
129
- }, className: "mb-3" })) : (_jsx("p", { children: "Ready for a challenge? Complete them all and get amazing rewards!" })) }), _jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-safe-area-inset-bottom h-8 bg-gradient-to-t from-bg-primary to-transparent" })] }), milestones.map((milestone) => {
134
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center p-4", children: _jsxs(Dialog.Content, { className: twMerge('mx-auto max-h-[80vh] min-h-auto min-w-[21.438rem] max-w-[400px] overflow-y-auto rounded-xl px-4 py-10 md:scrollbar:h-2 md:scrollbar:w-2 md:scrollbar-thumb:rounded-full md:scrollbar-thumb:bg-bg-quaternary md:scrollbar-track:bg-transparent', props.className?.root), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: twMerge('font-semibold text-lg text-text-primary-900', props.className?.title), children: quest?.name || 'Quest' }), _jsx("div", { className: "relative", children: _jsx("div", { className: "max-h-[30vh] overflow-y-auto", children: quest?.description ? (_jsx(Prose, { dangerouslySetInnerHTML: {
135
+ __html: quest.description,
136
+ }, className: twMerge('mb-3', props.className?.description) })) : (_jsx("p", { className: twMerge(props.className?.description), children: "Ready for a challenge? Complete them all and get amazing rewards!" })) }) }), milestones.map((milestone) => {
130
137
  const milestoneType = quest?.milestones?.find((m) => m.id === milestone.id)?.type;
131
138
  const accountVerificationMessage = milestoneType === 'ACCOUNT_VERIFICATION'
132
139
  ? verificationStatus === 'PENDING'
@@ -1,5 +1,11 @@
1
1
  interface RemainingTimeProps {
2
2
  endOfDay?: boolean;
3
+ className?: {
4
+ completedBadgeRoot?: string;
5
+ completedBadgeLabel?: string;
6
+ failedBadgeRoot?: string;
7
+ failedBadgeLabel?: string;
8
+ };
3
9
  }
4
- export declare function RemainingTime({ endOfDay: useEndOfDay, }: RemainingTimeProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function RemainingTime({ endOfDay: useEndOfDay, className, }: RemainingTimeProps): import("react/jsx-runtime").JSX.Element;
5
11
  export {};
@@ -4,17 +4,17 @@ import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
4
4
  import { ClockStopWatchIcon } from '../../icons/ClockStopWatchIcon.js';
5
5
  import { Badge } from '../../ui/Badge/index.js';
6
6
  import { useQuestContext } from './QuestsContext.js';
7
- export function RemainingTime({ endOfDay: useEndOfDay = false, }) {
7
+ export function RemainingTime({ endOfDay: useEndOfDay = false, className, }) {
8
8
  const quest = useQuestContext();
9
9
  const targetDateTime = useEndOfDay
10
10
  ? endOfDay(new Date(quest.endDateTime)).toISOString()
11
11
  : quest.endDateTime;
12
12
  const remainingTime = useRemainingTime(targetDateTime);
13
13
  if (quest.status === 'COMPLETED') {
14
- return (_jsx(Badge.Root, { size: "lg", colorScheme: "success", round: false, children: _jsx(Badge.Label, { children: "Completed" }) }));
14
+ return (_jsx(Badge.Root, { size: "lg", colorScheme: "success", round: false, className: className?.completedBadgeRoot, children: _jsx(Badge.Label, { className: className?.completedBadgeLabel, children: "Completed" }) }));
15
15
  }
16
16
  if (quest.status === 'FAILED' || remainingTime.expired) {
17
- return (_jsx(Badge.Root, { size: "lg", colorScheme: "danger", round: false, children: _jsx(Badge.Label, { children: "Failed" }) }));
17
+ return (_jsx(Badge.Root, { size: "lg", colorScheme: "danger", round: false, className: className?.failedBadgeRoot, children: _jsx(Badge.Label, { className: className?.failedBadgeLabel, children: "Failed" }) }));
18
18
  }
19
19
  return (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.toString() })] }));
20
20
  }
@@ -48,7 +48,7 @@ export declare const CREATE_AIO_QRPH_DEPOSIT = "\n mutation CreateAIOQRPHDeposi
48
48
  export declare const CREATE_AIO_ONLINE_BANK_DEPOSIT = "\n mutation CreateAIOOnlineBankDeposit(\n $input: CreateAIOOnlineBankDepositInput!\n ) {\n createAIOOnlineBankDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
49
49
  export declare const CREATE_MANUAL_BANK_DEPOSIT = "\n mutation CreateManualBankDeposit($input: CreateManualBankDepositInput!) {\n createManualBankDeposit(input: $input) {\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on FileDoesNotExistError {\n name: __typename\n message\n }\n ... on FileNotReadyError {\n name: __typename\n message\n }\n }\n }\n";
50
50
  export declare const CREATE_MANUAL_UPI_DEPOSIT = "\n mutation CreateManualUPIDeposit($input: CreateManualUPIDepositInput!) {\n createManualUPIDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on UPIReferenceNotAvailableError {\n name: __typename\n message\n }\n }\n }\n";
51
- export declare const DEPOSIT = "\n query Deposit($id: ObjectId!) {\n node(id: $id) {\n ... on GCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaDeposit {\n id\n type\n status\n checkoutUrl\n }\n ... on MayaAppDeposit {\n id\n type\n status\n error\n }\n ... on BankDeposit {\n id\n type\n status\n error\n }\n ... on ManualDeposit {\n id\n type\n status\n error\n }\n ... on QRPHDeposit {\n id\n type\n status\n qrCode\n error\n }\n ... on OnlineBankDeposit {\n id\n type\n status\n vca\n error\n }\n ... on GCashWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on LibanganPayInDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on PisoPayCheckoutDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on AiOGCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOGrabPayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOPalawanPayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOPayMayaDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n # comment for now since it's not yet in production could cause bad requests\n \n # ... on AurixPayQRPHDeposit {\n # id\n # type\n # status\n # qrCode\n # error\n # }\n # ... on AurixPayGCashDeposit {\n # id\n # type\n # status\n # checkoutUrl\n # error\n # }\n # ... on AurixPayPayMayaDeposit {\n # id\n # type\n # status\n # checkoutUrl\n # error\n # }\n # ... on AurixPayGrabPayDeposit {\n # id\n # type\n # status\n # checkoutUrl\n # error\n # }\n }\n }\n";
51
+ export declare const DEPOSIT: string;
52
52
  export declare const DEPOSITS_COUNT = "\n query DepositsCount {\n member {\n depositsCount\n }\n }\n";
53
53
  export declare const TOUCH_GCASH_DEPOSIT = "\n mutation TouchGCashDeposit($input: TouchGCashDepositInput!) {\n touchGCashDeposit(input: $input)\n }\n";
54
54
  export declare const TOUCH_QRPH_DEPOSIT = "\n mutation TouchQRPHDeposit($input: TouchQRPHDepositInput!) {\n touchQRPHDeposit(input: $input)\n }\n";
@@ -1698,36 +1698,39 @@ export const DEPOSIT = /* GraphQL */ `
1698
1698
  checkoutUrl
1699
1699
  error
1700
1700
  }
1701
- # comment for now since it's not yet in production could cause bad requests
1702
-
1703
- # ... on AurixPayQRPHDeposit {
1704
- # id
1705
- # type
1706
- # status
1707
- # qrCode
1708
- # error
1709
- # }
1710
- # ... on AurixPayGCashDeposit {
1711
- # id
1712
- # type
1713
- # status
1714
- # checkoutUrl
1715
- # error
1716
- # }
1717
- # ... on AurixPayPayMayaDeposit {
1718
- # id
1719
- # type
1720
- # status
1721
- # checkoutUrl
1722
- # error
1723
- # }
1724
- # ... on AurixPayGrabPayDeposit {
1725
- # id
1726
- # type
1727
- # status
1728
- # checkoutUrl
1729
- # error
1730
- # }
1701
+ ${process.env.NEXT_PUBLIC_ENVIRONMENT === 'development' ||
1702
+ process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'
1703
+ ? `
1704
+ ... on AurixPayQRPHDeposit {
1705
+ id
1706
+ type
1707
+ status
1708
+ qrCode
1709
+ error
1710
+ }
1711
+ ... on AurixPayGCashDeposit {
1712
+ id
1713
+ type
1714
+ status
1715
+ checkoutUrl
1716
+ error
1717
+ }
1718
+ ... on AurixPayPayMayaDeposit {
1719
+ id
1720
+ type
1721
+ status
1722
+ checkoutUrl
1723
+ error
1724
+ }
1725
+ ... on AurixPayGrabPayDeposit {
1726
+ id
1727
+ type
1728
+ status
1729
+ checkoutUrl
1730
+ error
1731
+ }
1732
+ `
1733
+ : ''}
1731
1734
  }
1732
1735
  }
1733
1736
  `;
@@ -3,7 +3,7 @@ export function sanitizeGamesSearch(search) {
3
3
  return search || '';
4
4
  }
5
5
  // Strip disallowed punctuation before sending to backend search
6
- const cleaned = search.replace(/[!@#$%^&*()?><}{\][|\\/`:;"',=+\-_]/g, '');
6
+ const cleaned = search.replace(/[!@#$%^&*()?><}{\][|\\/`:;",=+\-_]/g, '');
7
7
  const normalized = cleaned.trim().replace(/\s+/g, ' ');
8
8
  return normalized.length > 0 ? normalized : '';
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.896",
3
+ "version": "0.0.898",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",