@opexa/portal-components 0.0.276 → 0.0.278
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.
- package/dist/client/hooks/useGlobalStore.d.ts +16 -6
- package/dist/client/hooks/useGlobalStore.js +99 -0
- package/dist/client/hooks/useJackpotsQuery.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.d.ts +3 -14
- package/dist/components/Disclaimer/Disclaimer.js +14 -5
- package/dist/components/Disclaimer/DisclaimerV1.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.d.ts +3 -7
- package/dist/components/Disclaimer/DisclaimerV2.js +23 -51
- package/dist/components/Disclaimer/useDisclaimer.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +12 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +12 -1
- package/dist/components/ResponsibleGaming/ResponsibleGaming.d.ts +3 -0
- package/dist/components/ResponsibleGaming/ResponsibleGaming.js +14 -0
- package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.d.ts +8 -0
- package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.js +35 -0
- package/dist/components/ResponsibleGaming/index.d.ts +1 -0
- package/dist/components/ResponsibleGaming/index.js +1 -0
- package/dist/components/SignIn/MobileNumberSignIn.js +32 -26
- package/dist/components/SignIn/NameAndPasswordSignIn.js +31 -26
- package/dist/components/SignIn/SignIn.lazy.d.ts +4 -7
- package/dist/components/SignIn/SignIn.lazy.js +1 -0
- package/dist/components/SignUp/SignUp.d.ts +3 -3
- package/dist/components/SignUp/SignUp.js +7 -4
- package/dist/components/SignUp/{SignUpPagcor/SignUpPagcor.lazy.d.ts → SignUpDefault/SignUpDefault.lazy.d.ts} +7 -6
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.js +18 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.d.ts +1 -0
- package/dist/components/SignUp/{SignUpForm.js → SignUpDefault/SignUpDefaultForm.js} +89 -54
- package/dist/components/SignUp/SignUpKYC/SignUpKYC.lazy.d.ts +5 -8
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +37 -31
- package/dist/components/TermsAndConditions/TermsAndConditions.d.ts +2 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.js +14 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.lazy.d.ts +9 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.lazy.js +35 -0
- package/dist/components/TermsAndConditions/index.d.ts +1 -0
- package/dist/components/TermsAndConditions/index.js +1 -0
- package/dist/components/TermsOfUse/TermsOfUse.d.ts +3 -0
- package/dist/components/TermsOfUse/TermsOfUse.js +14 -0
- package/dist/components/TermsOfUse/TermsOfUse.lazy.d.ts +9 -0
- package/dist/components/TermsOfUse/TermsOfUse.lazy.js +35 -0
- package/dist/components/TermsOfUse/index.d.ts +1 -0
- package/dist/components/TermsOfUse/index.js +1 -0
- package/dist/constants/EnvVar.d.ts +1 -1
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/postTransformIdFrontImage.js +21 -6
- package/dist/handlers/postTransformSelfieImage.js +20 -9
- package/dist/next.config.js +1 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +72 -72
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +88 -88
- package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +306 -306
- package/dist/ui/Menu/menu.recipe.d.ts +17 -17
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +3 -3
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -40
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -35
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -20
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/resizeImageSize.d.ts +0 -2
- package/dist/utils/resizeImageSize.js +0 -11
|
@@ -6,8 +6,8 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|
|
6
6
|
import { ObjectId } from '@opexa/object-id';
|
|
7
7
|
import { differenceInYears, format } from 'date-fns';
|
|
8
8
|
import Image from 'next/image';
|
|
9
|
-
import { useSearchParams } from 'next/navigation';
|
|
10
|
-
import {
|
|
9
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
10
|
+
import { useRef, useState } from 'react';
|
|
11
11
|
import { Controller, useForm } from 'react-hook-form';
|
|
12
12
|
import { twMerge } from 'tailwind-merge';
|
|
13
13
|
import { z } from 'zod';
|
|
@@ -48,8 +48,6 @@ import { Select } from '../../../ui/Select/index.js';
|
|
|
48
48
|
import { createPoll } from '../../../utils/createPoll.js';
|
|
49
49
|
import { getQueryClient } from '../../../utils/getQueryClient.js';
|
|
50
50
|
import { getMemberVerificationQueryKey } from '../../../utils/queryKeys.js';
|
|
51
|
-
import { ResponsibleGaming } from '../../Disclaimer/ResponsibleGaming.js';
|
|
52
|
-
import { TermsOfUse } from '../../Disclaimer/TermsOfUse.js';
|
|
53
51
|
import { IdFrontImageField } from './IdFrontImageField/index.js';
|
|
54
52
|
import { SelfieImageField } from './SelfieImageField/index.js';
|
|
55
53
|
import { useSignUpKYCPropsContext } from './SignUpKYCContext.js';
|
|
@@ -60,19 +58,23 @@ export function SignUpKYCForm() {
|
|
|
60
58
|
itemToValue: (item) => item.code,
|
|
61
59
|
itemToString: (item) => `${item.code} - ${item.name}`,
|
|
62
60
|
});
|
|
61
|
+
const router = useRouter();
|
|
63
62
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
63
|
+
signIn: ctx.signIn,
|
|
64
|
+
signUp: ctx.signUp,
|
|
64
65
|
kycReminder: ctx.kycReminder,
|
|
66
|
+
termsAndConditions: ctx.termsAndConditions,
|
|
67
|
+
responsibleGaming: ctx.responsibleGaming,
|
|
65
68
|
})));
|
|
66
|
-
const [step, setStep] = useState(1);
|
|
67
69
|
const dialog = useDialogContext();
|
|
68
70
|
const search = useSearchParams();
|
|
69
|
-
const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
|
|
70
71
|
const signUpMutation = useSignUpMutation();
|
|
71
72
|
const signInMutation = useSignInMutation();
|
|
72
73
|
const updateAccountMutation = useUpdateAccountMutation();
|
|
73
74
|
const sendVerificationCodeMutation = useSendVerificationCodeMutation();
|
|
74
75
|
const localeInfo = useLocaleInfo();
|
|
75
76
|
const mobileNumberParser = useMobileNumberParser();
|
|
77
|
+
const [step, setStep] = useState(1);
|
|
76
78
|
const fileSchema = z
|
|
77
79
|
.instanceof(File)
|
|
78
80
|
.nullable()
|
|
@@ -170,9 +172,12 @@ export function SignUpKYCForm() {
|
|
|
170
172
|
middleName: '',
|
|
171
173
|
lastName: '',
|
|
172
174
|
branchCode: props?.branches?.[0]?.code ?? BRANCHES[0].code,
|
|
173
|
-
termsAccepted: false,
|
|
174
175
|
frontImage: undefined,
|
|
175
176
|
selfieImage: undefined,
|
|
177
|
+
termsAccepted: globalStore.responsibleGaming.accepted &&
|
|
178
|
+
globalStore.termsAndConditions.accepted
|
|
179
|
+
? true
|
|
180
|
+
: false,
|
|
176
181
|
},
|
|
177
182
|
});
|
|
178
183
|
const step2Form = useForm({
|
|
@@ -188,8 +193,6 @@ export function SignUpKYCForm() {
|
|
|
188
193
|
const form2Ref = useRef(null);
|
|
189
194
|
const birthDay = step1Form.watch('birthDay');
|
|
190
195
|
const branchCode = step1Form.watch('branchCode', '');
|
|
191
|
-
const [isTermsOfUseOpen, setTermsOfUseOpen] = useState(false);
|
|
192
|
-
const [isResponsibleGamingOpen, setResponsibleGamingOpen] = useState(false);
|
|
193
196
|
const { mutateAsync: createMemberVerification } = useCreateMemberVerificationMutation({
|
|
194
197
|
onError: (error) => {
|
|
195
198
|
toaster.error({
|
|
@@ -220,20 +223,7 @@ export function SignUpKYCForm() {
|
|
|
220
223
|
const memberVerification = useMemberVerificationQuery();
|
|
221
224
|
const memberId = memberVerification.data?.id;
|
|
222
225
|
const { mutate: uploadImageFile } = useUploadImageFileMutation();
|
|
223
|
-
|
|
224
|
-
const [isResponsibleGamingAccepted, setIsResponsibleGamingAccepted] = useState(false);
|
|
225
|
-
useEffect(() => {
|
|
226
|
-
if (isTermsOfUseAccepted && isResponsibleGamingAccepted) {
|
|
227
|
-
step1Form.setValue('termsAccepted', true);
|
|
228
|
-
}
|
|
229
|
-
}, [isResponsibleGamingAccepted, isTermsOfUseAccepted, step1Form]);
|
|
230
|
-
return (_jsxs(_Fragment, { children: [_jsx(TermsOfUse, { termsOfUseContent: props.termsOfUseContent ?? 'Terms of Use content', siteName: props.siteName ?? 'Site', logo: props.logo, open: isTermsOfUseOpen, onCloseAction: () => {
|
|
231
|
-
setIsTermsOfUseAccepted(true);
|
|
232
|
-
setTermsOfUseOpen(false);
|
|
233
|
-
}, responsibleGamingLogo: props.responsibleGamingLogo }), _jsx(ResponsibleGaming, { responsibleGamingContent: props.responsibleGamingContent ?? 'Responsible Gaming content', logo: props.logo, open: isResponsibleGamingOpen, onCloseAction: () => {
|
|
234
|
-
setIsResponsibleGamingAccepted(true);
|
|
235
|
-
setResponsibleGamingOpen(false);
|
|
236
|
-
}, responsibleGamingLogo: props.responsibleGamingLogo }), step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
226
|
+
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
237
227
|
try {
|
|
238
228
|
await sendVerificationCodeMutation.mutateAsync({
|
|
239
229
|
channel: 'SMS',
|
|
@@ -288,18 +278,34 @@ export function SignUpKYCForm() {
|
|
|
288
278
|
message: error.message,
|
|
289
279
|
});
|
|
290
280
|
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsxs("div", { className: "mt-xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-9.5 w-auto object-contain" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
281
|
+
if (details.checked === 'indeterminate')
|
|
282
|
+
return;
|
|
291
283
|
o.field.onChange(details.checked);
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
setIsResponsibleGamingAccepted(false);
|
|
295
|
-
}
|
|
284
|
+
globalStore.termsAndConditions.setAccepted(details.checked);
|
|
285
|
+
globalStore.responsibleGaming.setAccepted(details.checked);
|
|
296
286
|
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I have read and accept the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
297
|
-
|
|
287
|
+
if (props.termsAndConditionsUrl) {
|
|
288
|
+
globalStore.signUp.setOpen(false);
|
|
289
|
+
router.push(props.termsAndConditionsUrl);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
globalStore.termsAndConditions.setOpen(true);
|
|
293
|
+
globalStore.termsAndConditions.setNext('SIGN_UP');
|
|
294
|
+
globalStore.signUp.setOpen(false);
|
|
295
|
+
}
|
|
298
296
|
}, children: "Terms and Conditions" }), ' ', "and", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
299
|
-
|
|
297
|
+
if (props.responsibleGamingUrl) {
|
|
298
|
+
globalStore.signUp.setOpen(false);
|
|
299
|
+
router.push(props.responsibleGamingUrl);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
globalStore.responsibleGaming.setOpen(true);
|
|
303
|
+
globalStore.responsibleGaming.setNext('SIGN_UP');
|
|
304
|
+
globalStore.signUp.setOpen(false);
|
|
305
|
+
}
|
|
300
306
|
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
301
307
|
dialog.setOpen(false);
|
|
302
|
-
|
|
308
|
+
globalStore.signIn.setOpen(true);
|
|
303
309
|
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
304
310
|
const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
305
311
|
const { mobileNumber } = step1Form.getValues();
|
|
@@ -331,7 +337,7 @@ export function SignUpKYCForm() {
|
|
|
331
337
|
});
|
|
332
338
|
const ok = await pollLogin();
|
|
333
339
|
if (!ok) {
|
|
334
|
-
|
|
340
|
+
globalStore.signIn.setOpen(true);
|
|
335
341
|
}
|
|
336
342
|
else {
|
|
337
343
|
const pollUpdateAccount = createPoll(async () => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./TermsAndConditions.lazy.js').then((m) => m.TermsAndConditions), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
10
|
+
export function TermsAndConditions(props) {
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.termsAndConditions['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, { ...props });
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface TermsAndConditionsProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
content: string | ReactNode;
|
|
6
|
+
siteName: string;
|
|
7
|
+
responsibleGamingLogo?: ImageProps['src'];
|
|
8
|
+
}
|
|
9
|
+
export declare function TermsAndConditions({ logo, siteName, content, ...props }: TermsAndConditionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image, {} from 'next/image';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
4
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
|
+
import pagcorLogo from '../../images/pagcor.png';
|
|
6
|
+
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
7
|
+
import { Button } from '../../ui/Button/index.js';
|
|
8
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
9
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
10
|
+
export function TermsAndConditions({ logo, siteName, content, ...props }) {
|
|
11
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
+
signIn: ctx.signIn,
|
|
13
|
+
signUp: ctx.signUp,
|
|
14
|
+
disclaimer: ctx.disclaimer,
|
|
15
|
+
termsAndConditions: ctx.termsAndConditions,
|
|
16
|
+
})));
|
|
17
|
+
return (_jsx(Dialog.Root, { open: globalStore.termsAndConditions.open, onOpenChange: (details) => {
|
|
18
|
+
globalStore.termsAndConditions.setOpen(details.open);
|
|
19
|
+
if (!details.open)
|
|
20
|
+
globalStore.termsAndConditions.setAccepted(true);
|
|
21
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
|
|
22
|
+
if (globalStore.termsAndConditions.next === 'SIGN_IN') {
|
|
23
|
+
globalStore.signIn.setOpen(true);
|
|
24
|
+
}
|
|
25
|
+
if (globalStore.termsAndConditions.next === 'SIGN_UP') {
|
|
26
|
+
globalStore.signUp.setOpen(true);
|
|
27
|
+
}
|
|
28
|
+
if (globalStore.termsAndConditions.next === 'DISCLAIMER') {
|
|
29
|
+
globalStore.disclaimer.setOpen(true);
|
|
30
|
+
}
|
|
31
|
+
globalStore.termsAndConditions.setNext(null);
|
|
32
|
+
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsxs(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: [siteName, " Terms of Use"] }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: content }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx(Dialog.Context, { children: (api) => (_jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
33
|
+
api.setOpen(false);
|
|
34
|
+
}, children: "I Agree" })) })] }) })] }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsAndConditions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsAndConditions.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
const Component = dynamic(() => import('./TermsOfUse.lazy.js').then((m) => m.TermsOfUse), {
|
|
7
|
+
ssr: false,
|
|
8
|
+
loading: () => null,
|
|
9
|
+
});
|
|
10
|
+
export function TermsOfUse(props) {
|
|
11
|
+
const touched = useGlobalStore(useShallow((ctx) => ctx.termsOfUse['~touched']));
|
|
12
|
+
if (touched)
|
|
13
|
+
return _jsx(Component, { ...props });
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface TermsOfUseProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
content: string | ReactNode;
|
|
6
|
+
siteName: string;
|
|
7
|
+
responsibleGamingLogo?: ImageProps['src'];
|
|
8
|
+
}
|
|
9
|
+
export declare function TermsOfUse({ logo, siteName, content, ...props }: TermsOfUseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image, {} from 'next/image';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
4
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
|
+
import pagcorLogo from '../../images/pagcor.png';
|
|
6
|
+
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
7
|
+
import { Button } from '../../ui/Button/index.js';
|
|
8
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
9
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
10
|
+
export function TermsOfUse({ logo, siteName, content, ...props }) {
|
|
11
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
12
|
+
signIn: ctx.signIn,
|
|
13
|
+
signUp: ctx.signUp,
|
|
14
|
+
disclaimer: ctx.disclaimer,
|
|
15
|
+
termsOfUse: ctx.termsOfUse,
|
|
16
|
+
})));
|
|
17
|
+
return (_jsx(Dialog.Root, { open: globalStore.termsOfUse.open, onOpenChange: (details) => {
|
|
18
|
+
globalStore.termsOfUse.setOpen(details.open);
|
|
19
|
+
if (!details.open)
|
|
20
|
+
globalStore.termsOfUse.setAccepted(true);
|
|
21
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
|
|
22
|
+
if (globalStore.termsOfUse.next === 'SIGN_IN') {
|
|
23
|
+
globalStore.signIn.setOpen(true);
|
|
24
|
+
}
|
|
25
|
+
if (globalStore.termsOfUse.next === 'SIGN_UP') {
|
|
26
|
+
globalStore.signUp.setOpen(true);
|
|
27
|
+
}
|
|
28
|
+
if (globalStore.termsOfUse.next === 'DISCLAIMER') {
|
|
29
|
+
globalStore.disclaimer.setOpen(true);
|
|
30
|
+
}
|
|
31
|
+
globalStore.termsOfUse.setNext(null);
|
|
32
|
+
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsxs(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: [siteName, " Terms of Use"] }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: content }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx(Dialog.Context, { children: (api) => (_jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
33
|
+
api.setOpen(false);
|
|
34
|
+
}, children: "I Agree" })) })] }) })] }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsOfUse';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TermsOfUse.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const SITE_ID: string;
|
|
2
2
|
export declare const PLATFORM_ID: string;
|
|
3
3
|
export declare const PLATFORM_CODE: string;
|
|
4
|
-
export declare const ENVIRONMENT: "
|
|
4
|
+
export declare const ENVIRONMENT: "production" | "development";
|
|
5
5
|
export declare const BYPASS_RECAPTCHA: boolean;
|
|
6
6
|
export declare const INTERNALS__REPORT_WEB_VITALS: boolean;
|
package/dist/handlers/index.d.ts
CHANGED
|
@@ -18,14 +18,14 @@ export declare const GET: (req: NextRequest, { params }: Context) => Promise<Nex
|
|
|
18
18
|
__error?: unknown;
|
|
19
19
|
} | {
|
|
20
20
|
ok: true;
|
|
21
|
-
data:
|
|
21
|
+
data: Record<string, unknown>;
|
|
22
22
|
}> | NextResponse<{
|
|
23
23
|
ok: false;
|
|
24
24
|
message: string;
|
|
25
25
|
__error?: unknown;
|
|
26
26
|
} | {
|
|
27
27
|
ok: true;
|
|
28
|
-
data:
|
|
28
|
+
data: import("../types").Session;
|
|
29
29
|
}>>;
|
|
30
30
|
export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
31
31
|
ok: true;
|
|
@@ -44,19 +44,34 @@ export async function postTransformIdFrontImage(request) {
|
|
|
44
44
|
height: parsed.data.cropHeight,
|
|
45
45
|
})
|
|
46
46
|
.resize({
|
|
47
|
+
fit: 'contain',
|
|
47
48
|
width: 1200,
|
|
48
49
|
height: 757,
|
|
49
50
|
kernel: sharp.kernel.lanczos3,
|
|
50
51
|
withoutEnlargement: true,
|
|
51
52
|
})
|
|
52
53
|
.modulate({
|
|
53
|
-
brightness: 1.
|
|
54
|
-
saturation: 1.
|
|
54
|
+
brightness: 1.03,
|
|
55
|
+
saturation: 1.05,
|
|
56
|
+
})
|
|
57
|
+
.median(1)
|
|
58
|
+
.blur(0.3)
|
|
59
|
+
.sharpen({
|
|
60
|
+
sigma: 1,
|
|
61
|
+
m1: 0.5,
|
|
62
|
+
m2: 1.0,
|
|
63
|
+
x1: 2,
|
|
64
|
+
y2: 10,
|
|
65
|
+
y3: 20,
|
|
66
|
+
})
|
|
67
|
+
.webp({
|
|
68
|
+
effort: 6,
|
|
69
|
+
quality: 100,
|
|
70
|
+
alphaQuality: 100,
|
|
71
|
+
lossless: false,
|
|
72
|
+
nearLossless: false,
|
|
73
|
+
smartSubsample: true,
|
|
55
74
|
})
|
|
56
|
-
.median(3)
|
|
57
|
-
.blur()
|
|
58
|
-
.sharpen()
|
|
59
|
-
.webp()
|
|
60
75
|
.toBuffer();
|
|
61
76
|
return new NextResponse(cropped, {
|
|
62
77
|
headers: {
|
|
@@ -44,23 +44,34 @@ export async function postTransformSelfieImage(request) {
|
|
|
44
44
|
height: parsed.data.cropHeight,
|
|
45
45
|
})
|
|
46
46
|
.resize({
|
|
47
|
+
fit: 'contain',
|
|
47
48
|
width: 1200,
|
|
48
49
|
height: 1200,
|
|
49
50
|
kernel: sharp.kernel.lanczos3,
|
|
50
51
|
withoutEnlargement: true,
|
|
51
52
|
})
|
|
53
|
+
.modulate({
|
|
54
|
+
brightness: 1.03,
|
|
55
|
+
saturation: 1.05,
|
|
56
|
+
})
|
|
57
|
+
.median(1)
|
|
58
|
+
.blur(0.3)
|
|
52
59
|
.sharpen({
|
|
53
|
-
sigma: 1
|
|
54
|
-
m1:
|
|
55
|
-
m2:
|
|
60
|
+
sigma: 1,
|
|
61
|
+
m1: 0.5,
|
|
62
|
+
m2: 1.0,
|
|
63
|
+
x1: 2,
|
|
64
|
+
y2: 10,
|
|
65
|
+
y3: 20,
|
|
56
66
|
})
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
.webp({
|
|
68
|
+
effort: 6,
|
|
69
|
+
quality: 100,
|
|
70
|
+
alphaQuality: 100,
|
|
71
|
+
lossless: false,
|
|
72
|
+
nearLossless: false,
|
|
73
|
+
smartSubsample: true,
|
|
60
74
|
})
|
|
61
|
-
.median(3)
|
|
62
|
-
.blur()
|
|
63
|
-
.webp()
|
|
64
75
|
.toBuffer();
|
|
65
76
|
return new NextResponse(cropped, {
|
|
66
77
|
headers: {
|