@opexa/portal-components 0.0.360 → 0.0.361

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 (59) hide show
  1. package/dist/client/hooks/useFacebookClientQuery.d.ts +2 -0
  2. package/dist/client/hooks/useFacebookClientQuery.js +13 -0
  3. package/dist/client/hooks/useUnlinkFacebookMutation.d.ts +2 -0
  4. package/dist/client/hooks/useUnlinkFacebookMutation.js +31 -0
  5. package/dist/components/AccountInfo/AccountInfo.js +53 -2
  6. package/dist/components/AccountInfo/GoogleDisconnect.d.ts +7 -0
  7. package/dist/components/AccountInfo/GoogleDisconnect.js +11 -0
  8. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +8 -3
  9. package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
  10. package/dist/components/DigitainLauncher/Loading.js +5 -0
  11. package/dist/components/KYC/BasicInformation.d.ts +1 -0
  12. package/dist/components/KYC/BasicInformation.js +101 -0
  13. package/dist/components/KYC/IdentityVerification.d.ts +1 -0
  14. package/dist/components/KYC/IdentityVerification.js +120 -0
  15. package/dist/components/KYC/Indicator.d.ts +1 -0
  16. package/dist/components/KYC/Indicator.js +8 -0
  17. package/dist/components/KYC/KYC.lazy.d.ts +6 -0
  18. package/dist/components/KYC/KYC.lazy.js +45 -0
  19. package/dist/components/KYC/KYCContext.d.ts +6 -0
  20. package/dist/components/KYC/KYCContext.js +2 -0
  21. package/dist/components/KYC/PersonalInformation.d.ts +1 -0
  22. package/dist/components/KYC/PersonalInformation.js +122 -0
  23. package/dist/components/KYC/useKYC.d.ts +25 -0
  24. package/dist/components/KYC/useKYC.js +38 -0
  25. package/dist/components/SignIn/FacebookSignInTrigger.d.ts +1 -0
  26. package/dist/components/SignIn/FacebookSignInTrigger.js +51 -0
  27. package/dist/components/SignIn/MobileNumberSignIn.js +2 -1
  28. package/dist/components/SignIn/SignIn.lazy.d.ts +1 -0
  29. package/dist/handlers/index.d.ts +7 -7
  30. package/dist/icons/LinkBrokenIcon.d.ts +2 -0
  31. package/dist/icons/LinkBrokenIcon.js +4 -0
  32. package/dist/images/responsible-gaming-yellow.png +0 -0
  33. package/dist/services/account.d.ts +14 -0
  34. package/dist/services/account.js +8 -1
  35. package/dist/services/queries.d.ts +3 -1
  36. package/dist/services/queries.js +11 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  39. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  40. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  41. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  42. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  43. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  44. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  45. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  46. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  47. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  48. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  49. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  50. package/dist/ui/Select/Select.d.ts +45 -45
  51. package/dist/ui/Select/select.recipe.d.ts +3 -3
  52. package/dist/ui/Table/Table.d.ts +21 -21
  53. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  54. package/dist/ui/Table/table.recipe.d.ts +3 -3
  55. package/dist/utils/mutationKeys.d.ts +1 -0
  56. package/dist/utils/mutationKeys.js +4 -0
  57. package/dist/utils/queryKeys.d.ts +1 -0
  58. package/dist/utils/queryKeys.js +1 -0
  59. package/package.json +2 -1
@@ -0,0 +1,122 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import { useForm } from 'react-hook-form';
4
+ import { z } from 'zod';
5
+ import { useShallow } from 'zustand/shallow';
6
+ import { useApproveMemberVerification } from '../../client/hooks/useApproveMemberVerification.js';
7
+ import { useCreateMemberVerificationMutation } from '../../client/hooks/useCreateMemberVerificationMutation.js';
8
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
9
+ import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
10
+ import { useUpdateMemberVerificationMutation } from '../../client/hooks/useUpdateMemberVerificationMutation.js';
11
+ import { toaster } from '../../client/utils/toaster.js';
12
+ import { CheckIcon } from '../../icons/CheckIcon.js';
13
+ import { Button } from '../../ui/Button/index.js';
14
+ import { Checkbox } from '../../ui/Checkbox/index.js';
15
+ import { Dialog } from '../../ui/Dialog/index.js';
16
+ import { Field } from '../../ui/Field/index.js';
17
+ import { getQueryClient } from '../../utils/getQueryClient.js';
18
+ import { getMemberVerificationQueryKey } from '../../utils/queryKeys.js';
19
+ import { useKYCContext } from './KYCContext.js';
20
+ const definition = z.object({
21
+ address: z.string().trim().min(1, 'Current address is required'),
22
+ permanentAddress: z.string().trim().min(1, 'Permanent address is required'),
23
+ sourceOfIncome: z.string().trim().min(1, 'Source of Income is required'),
24
+ natureOfWork: z.string().trim().min(1, 'Nature of Work is required'),
25
+ placeOfBirth: z.string().trim().min(1, 'Place of Birth is required'),
26
+ nationality: z.string().trim().min(1, 'Nationality is required'),
27
+ });
28
+ export function PersonalInformation() {
29
+ const kyc = useKYCContext();
30
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
31
+ kyc: ctx.kyc,
32
+ })));
33
+ const memberVerificationQuery = useMemberVerificationQuery();
34
+ const memberVerificationId = memberVerificationQuery.data?.id;
35
+ const approveMemberVerificationMutation = useApproveMemberVerification();
36
+ const updateMemberVerificationMutation = useUpdateMemberVerificationMutation({
37
+ onError(error) {
38
+ toaster.error({
39
+ description: error.message,
40
+ });
41
+ },
42
+ onSuccess() {
43
+ const queryClient = getQueryClient();
44
+ queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
45
+ if (!prev)
46
+ return prev;
47
+ return {
48
+ ...prev,
49
+ status: 'PENDING',
50
+ };
51
+ });
52
+ kyc.setDone(true);
53
+ globalStore.kyc.setOpen(false);
54
+ toaster.success({
55
+ title: 'Success',
56
+ description: 'Personal information has been set successfully.',
57
+ });
58
+ },
59
+ });
60
+ const createMemberVerificationMutation = useCreateMemberVerificationMutation({
61
+ onError(error) {
62
+ toaster.error({
63
+ description: error.message,
64
+ });
65
+ },
66
+ onSuccess() {
67
+ kyc.setDone(true);
68
+ globalStore.kyc.setOpen(false);
69
+ toaster.success({
70
+ title: 'Success',
71
+ description: 'Personal information has been set successfully.',
72
+ });
73
+ },
74
+ });
75
+ const form = useForm({
76
+ resolver: zodResolver(definition),
77
+ defaultValues: {
78
+ address: '',
79
+ nationality: '',
80
+ natureOfWork: '',
81
+ placeOfBirth: '',
82
+ permanentAddress: '',
83
+ },
84
+ mode: 'all',
85
+ });
86
+ async function onSubmit(values) {
87
+ if (!memberVerificationId) {
88
+ createMemberVerificationMutation.mutate({
89
+ ...values,
90
+ });
91
+ }
92
+ else {
93
+ await updateMemberVerificationMutation.mutateAsync({
94
+ id: memberVerificationId,
95
+ data: {
96
+ ...values,
97
+ },
98
+ });
99
+ //approve status of member to be pending
100
+ await approveMemberVerificationMutation.mutateAsync({
101
+ id: memberVerificationId,
102
+ });
103
+ }
104
+ }
105
+ const address = form.watch('address');
106
+ const permanentAddress = form.watch('permanentAddress');
107
+ return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center font-semibold text-lg", children: "Personal Information" }), _jsx(Dialog.Description, { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Provide your basic details and work info." }), _jsxs("form", { className: "mt-7", onSubmit: form.handleSubmit(onSubmit), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.permanentAddress, children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, { placeholder: "Enter your permanent address", ...form.register('permanentAddress') }), _jsx(Field.ErrorText, { children: form.formState.errors.permanentAddress?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.address, children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, { placeholder: "Enter your current address", ...form.register('address') }), _jsx(Field.ErrorText, { children: form.formState.errors.address?.message })] }), _jsxs(Checkbox.Root, { className: "mt-md", checked: address !== '' &&
108
+ permanentAddress !== '' &&
109
+ address === permanentAddress, onCheckedChange: (details) => {
110
+ if (details.checked === true) {
111
+ form.setValue('address', form.getValues('permanentAddress'), {
112
+ shouldDirty: true,
113
+ shouldTouch: true,
114
+ shouldValidate: true,
115
+ });
116
+ }
117
+ }, disabled: !permanentAddress, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Use permanent address as current address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.sourceOfIncome, children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, { placeholder: "Enter your source of income", ...form.register('sourceOfIncome') }), _jsx(Field.ErrorText, { children: form.formState.errors.sourceOfIncome?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.natureOfWork, children: [_jsx(Field.Label, { children: "Work Description" }), _jsx(Field.Input, { placeholder: "Enter your work description", ...form.register('natureOfWork') }), _jsx(Field.ErrorText, { children: form.formState.errors.natureOfWork?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.placeOfBirth, children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, { placeholder: "Enter your place of birth", ...form.register('placeOfBirth') }), _jsx(Field.ErrorText, { children: form.formState.errors.placeOfBirth?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.nationality, children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, { placeholder: "Enter your nationality", ...form.register('nationality') }), _jsx(Field.ErrorText, { children: form.formState.errors.nationality?.message })] }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: updateMemberVerificationMutation.isPending ||
118
+ createMemberVerificationMutation.isPending, children: "Continue" }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", onClick: () => {
119
+ globalStore.kyc.setOpen(false);
120
+ }, disabled: updateMemberVerificationMutation.isPending ||
121
+ createMemberVerificationMutation.isPending, children: "Skip for now" })] })] }));
122
+ }
@@ -0,0 +1,25 @@
1
+ type EventDetail = {
2
+ type: 'SELFIE_CAPTURED';
3
+ data: string;
4
+ } | {
5
+ type: 'ID_DOCUMENT_CAPTURED';
6
+ data: string;
7
+ };
8
+ type UnsubscribeFn = () => void;
9
+ type Subscriber = (detail: EventDetail) => UnsubscribeFn;
10
+ export type CaptureSubject = 'SELFIE' | 'ID_DOCUMENT';
11
+ export interface UseKYCReturn {
12
+ step: number;
13
+ setStep: (step: number) => void;
14
+ done: boolean;
15
+ setDone: (done: boolean) => void;
16
+ subscribe: (subscriber: Subscriber) => UnsubscribeFn;
17
+ triggerEvent: (detail: EventDetail) => void;
18
+ idFrontImageId: string | null;
19
+ setFrontImageId: (id: string | null) => void;
20
+ selfieImageId: string | null;
21
+ setSelfieImageId: (id: string | null) => void;
22
+ reset: () => void;
23
+ }
24
+ export declare function useKYC(): UseKYCReturn;
25
+ export {};
@@ -0,0 +1,38 @@
1
+ import { useRef, useState } from 'react';
2
+ export function useKYC() {
3
+ const [step, setStep] = useState(2);
4
+ const [done, setDone] = useState(false);
5
+ const [idFrontImageId, setFrontImageId] = useState(null);
6
+ const [selfieImageId, setSelfieImageId] = useState(null);
7
+ const subscribers = useRef([]);
8
+ const subscribe = (subscriber) => {
9
+ subscribers.current.push(subscriber);
10
+ return () => {
11
+ subscribers.current = subscribers.current.filter((item) => item !== subscriber);
12
+ };
13
+ };
14
+ const triggerEvent = (detail) => {
15
+ subscribers.current.forEach((subscriber) => {
16
+ subscriber(detail);
17
+ });
18
+ };
19
+ const reset = () => {
20
+ setStep(1);
21
+ setDone(false);
22
+ setFrontImageId(null);
23
+ setSelfieImageId(null);
24
+ };
25
+ return {
26
+ step,
27
+ setStep,
28
+ done,
29
+ setDone,
30
+ idFrontImageId,
31
+ setFrontImageId,
32
+ selfieImageId,
33
+ setSelfieImageId,
34
+ subscribe,
35
+ triggerEvent,
36
+ reset,
37
+ };
38
+ }
@@ -0,0 +1 @@
1
+ export declare const FacebookSignInTrigger: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import FacebookLogin from '@greatsumini/react-facebook-login';
3
+ import { useShallow } from 'zustand/shallow';
4
+ import { useFacebookClientQuery } from '../../client/hooks/useFacebookClientQuery.js';
5
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
+ import { useSignInMutation } from '../../client/hooks/useSignInMutation.js';
7
+ import { toaster } from '../../client/utils/toaster.js';
8
+ import { AUTH_ENDPOINT, PLATFORM_CODE } from '../../constants/index.js';
9
+ import { FacebookIcon } from '../../icons/FacebookIcon.js';
10
+ import { httpRequest } from '../../services/httpRequest.js';
11
+ import { Button } from '../../ui/Button/index.js';
12
+ export const FacebookSignInTrigger = () => {
13
+ const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
14
+ const signIn = useSignInMutation({
15
+ onError: () => {
16
+ toaster.error({
17
+ title: 'Account Not Found',
18
+ description: 'Account not found. Please try again or contact support.',
19
+ });
20
+ },
21
+ onSuccess: () => {
22
+ signInStore.setOpen(false);
23
+ },
24
+ });
25
+ const facebookClientIdQuery = useFacebookClientQuery();
26
+ const facebookClientId = facebookClientIdQuery.data;
27
+ if (!facebookClientId)
28
+ return null;
29
+ return (_jsx(FacebookLogin, { appId: facebookClientId, onSuccess: async (res) => {
30
+ try {
31
+ const { token } = await httpRequest.json(`${AUTH_ENDPOINT}/facebook/auth?state=${encodeURIComponent(`${window.location.origin},${PLATFORM_CODE}`)}&code=${res.accessToken}`);
32
+ signIn.mutate({
33
+ type: 'SOCIALS',
34
+ token,
35
+ });
36
+ }
37
+ catch {
38
+ toaster.error({
39
+ title: 'Account Not Found',
40
+ description: 'The Facebook account you used isn’t connected to any existing account in our system. Please connect it to continue.',
41
+ });
42
+ }
43
+ }, onFail: () => {
44
+ toaster.error({
45
+ title: 'Facebook Sign In Failed',
46
+ description: 'Failed to sign in with Facebook. Please try again.',
47
+ });
48
+ }, render: ({ onClick }) => {
49
+ return (_jsxs(Button, { variant: "outline", onClick: onClick, colorScheme: "gray", className: "mt-lg border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(FacebookIcon, { className: "size-6" }), "Continue with Facebook"] }));
50
+ } }));
51
+ };
@@ -22,6 +22,7 @@ import { Button } from '../../ui/Button/index.js';
22
22
  import { Checkbox } from '../../ui/Checkbox/index.js';
23
23
  import { Field } from '../../ui/Field/index.js';
24
24
  import { PinInput } from '../../ui/PinInput/index.js';
25
+ import { FacebookSignInTrigger } from './FacebookSignInTrigger.js';
25
26
  import { useSignInContext, useSignInPropsContext } from './SignInContext.js';
26
27
  const GoogleSignInButton = dynamic(() => import('./GoogleSignInTrigger.js').then((m) => m.GoogleSignInTrigger), {
27
28
  ssr: false,
@@ -153,7 +154,7 @@ export function MobileNumberSignIn() {
153
154
  globalStore.responsibleGaming.setNext('SIGN_IN');
154
155
  globalStore.signIn.setOpen(false);
155
156
  }
156
- }, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2", 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 })] })] })), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "h-px flex-grow bg-text-tertiary-600/50" }), _jsx("span", { className: "font-semibold text-sm text-text-tertiary-600", children: "Log in directly with" }), _jsx("div", { className: "h-px flex-grow bg-text-tertiary-600/50" })] }), _jsx("div", { className: "mt-6", children: signInProps.googleSso && _jsx(GoogleSignInButton, {}) }), _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: "Don't have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
157
+ }, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2", 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 })] })] })), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "h-px flex-grow bg-text-tertiary-600/50" }), _jsx("span", { className: "font-semibold text-sm text-text-tertiary-600", children: "Log in directly with" }), _jsx("div", { className: "h-px flex-grow bg-text-tertiary-600/50" })] }), _jsxs("div", { className: "mt-6", children: [signInProps.googleSso && _jsx(GoogleSignInButton, {}), signInProps.facebookSso && _jsx(FacebookSignInTrigger, {})] }), _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: "Don't have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
157
158
  globalStore.signIn.setOpen(false);
158
159
  globalStore.signUp.setOpen(true);
159
160
  }, children: "Sign up" })] })] })), context.step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", 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 }) => {
@@ -7,6 +7,7 @@ export interface SignInProps {
7
7
  responsibleGamingUrl?: string;
8
8
  className?: string;
9
9
  googleSso?: boolean;
10
+ facebookSso?: boolean;
10
11
  showPublicPlayProhibition?: boolean;
11
12
  children?: ReactNode;
12
13
  }
@@ -6,13 +6,6 @@ interface Context {
6
6
  params: Promise<Params>;
7
7
  }
8
8
  export declare const GET: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
9
- ok: false;
10
- message: string;
11
- __error?: unknown;
12
- } | {
13
- ok: true;
14
- data: import("../types").Session;
15
- }> | NextResponse<{
16
9
  ok: true;
17
10
  data?: never;
18
11
  } | {
@@ -26,6 +19,13 @@ export declare const GET: (req: NextRequest, { params }: Context) => Promise<Nex
26
19
  } | {
27
20
  ok: true;
28
21
  data: Record<string, unknown>;
22
+ }> | NextResponse<{
23
+ ok: false;
24
+ message: string;
25
+ __error?: unknown;
26
+ } | {
27
+ ok: true;
28
+ data: import("../types").Session;
29
29
  }>>;
30
30
  export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
31
31
  ok: true;
@@ -0,0 +1,2 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ export declare function LinkBrokenIcon(props: ComponentPropsWithRef<'svg'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function LinkBrokenIcon(props) {
3
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props, children: _jsx("path", { d: "M8.5 15.5L15.5 8.49998M9 4V2M15 20V22M4 9H2M20 15H22M4.91421 4.91421L3.5 3.5M19.0858 19.0857L20.5 20.4999M12 17.6568L9.87871 19.7781C8.31662 21.3402 5.78396 21.3402 4.22186 19.7781C2.65976 18.216 2.65976 15.6833 4.22186 14.1212L6.34318 11.9999M17.6569 11.9999L19.7782 9.87859C21.3403 8.31649 21.3403 5.78383 19.7782 4.22174C18.2161 2.65964 15.6835 2.65964 14.1214 4.22174L12 6.34306", stroke: "#FEDF89", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
4
+ }
@@ -364,7 +364,11 @@ export declare const getPointsClubSettings: (options?: GraphQLRequestOptions) =>
364
364
  export interface GoogleClientIdQuery {
365
365
  googleClientId?: string | null;
366
366
  }
367
+ export interface FacebookClientIdQuery {
368
+ facebookClientId?: string | null;
369
+ }
367
370
  export declare const getGoogleClientId: (options?: GraphQLRequestOptions) => Promise<string | null>;
371
+ export declare const getFacebookClientId: (options?: GraphQLRequestOptions) => Promise<string | null>;
368
372
  export interface UnlinkGoogleMutation {
369
373
  unlinkGoogle: boolean;
370
374
  }
@@ -375,6 +379,16 @@ export interface UnlinkGoogleMutationVariables {
375
379
  input: UnlinkGoogleInput;
376
380
  }
377
381
  export declare const unlinkGoogle: (id: string, options?: GraphQLRequestOptions) => Promise<void>;
382
+ export interface UnlinkFacebookMutation {
383
+ unlinkFacebook: boolean;
384
+ }
385
+ export interface UnlinkFacebookInput {
386
+ id: string;
387
+ }
388
+ export interface UnlinkFacebookMutationVariables {
389
+ input: UnlinkFacebookInput;
390
+ }
391
+ export declare const unlinkFacebook: (id: string, options?: GraphQLRequestOptions) => Promise<void>;
378
392
  export interface GenerateSumsubVerificationTokenMutation {
379
393
  generateSumsubVerificationToken: string;
380
394
  }
@@ -1,7 +1,7 @@
1
1
  import { cache } from 'react';
2
2
  import { ACCOUNT_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
3
  import { graphqlRequest } from './graphqlRequest.js';
4
- import { ANNOUNCEMENTS, APPROVE_MEMBER_VERIFICATION__NEXT, CREATE_MEMBER_VERIFICATION, CREATE_MEMBER_VERIFICATION__NEXT, DELETE_MEMBER_ACCOUNT, GENERATE_SUMSUB_VERIFICATION_TOKEN, GOOGLE_CLIENT_ID, MEMBER_ACCOUNT, MEMBER_VERIFICATION, PAYMENT_SETTINGS, POINTS_CLUB_SETTINGS, PROFILE_COMPLETION, REFERRAL_CODE, REGISTER_MAYA_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT__NEXT, REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER, REGISTER_MEMBER_ACCOUNT_BY_NAME, REGISTER_MEMBER_ACCOUNT_VIA_MOBILE, RESET_PASSWORD, UNLINK_GOOGLE, UPDATE_MEMBER_ACCOUNT, UPDATE_MEMBER_VERIFICATION, UPDATE_MEMBER_VERIFICATION__NEXT, UPDATE_REFERRAL_CODE, VERIFY_MOBILE_NUMBER, } from './queries.js';
4
+ import { ANNOUNCEMENTS, APPROVE_MEMBER_VERIFICATION__NEXT, CREATE_MEMBER_VERIFICATION, CREATE_MEMBER_VERIFICATION__NEXT, DELETE_MEMBER_ACCOUNT, FACEBOOK_CLIENT_ID, GENERATE_SUMSUB_VERIFICATION_TOKEN, GOOGLE_CLIENT_ID, MEMBER_ACCOUNT, MEMBER_VERIFICATION, PAYMENT_SETTINGS, POINTS_CLUB_SETTINGS, PROFILE_COMPLETION, REFERRAL_CODE, REGISTER_MAYA_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT__NEXT, REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER, REGISTER_MEMBER_ACCOUNT_BY_NAME, REGISTER_MEMBER_ACCOUNT_VIA_MOBILE, RESET_PASSWORD, UNLINK_FACEBOOK, UNLINK_GOOGLE, UPDATE_MEMBER_ACCOUNT, UPDATE_MEMBER_VERIFICATION, UPDATE_MEMBER_VERIFICATION__NEXT, UPDATE_REFERRAL_CODE, VERIFY_MOBILE_NUMBER, } from './queries.js';
5
5
  import { sha256 } from './sha256.js';
6
6
  export const getMemberAccount = cache(async (options) => {
7
7
  const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, MEMBER_ACCOUNT, undefined, options);
@@ -257,9 +257,16 @@ export const getGoogleClientId = cache(async (options) => {
257
257
  const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, GOOGLE_CLIENT_ID, undefined, options);
258
258
  return res.googleClientId ?? null;
259
259
  });
260
+ export const getFacebookClientId = cache(async (options) => {
261
+ const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, FACEBOOK_CLIENT_ID, undefined, options);
262
+ return res.facebookClientId ?? null;
263
+ });
260
264
  export const unlinkGoogle = async (id, options) => {
261
265
  await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UNLINK_GOOGLE, { input: { id } }, options);
262
266
  };
267
+ export const unlinkFacebook = async (id, options) => {
268
+ await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UNLINK_FACEBOOK, { input: { id } }, options);
269
+ };
263
270
  export const generateSumsubVerificationToken = async (options) => {
264
271
  const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, GENERATE_SUMSUB_VERIFICATION_TOKEN, undefined, options);
265
272
  return res.generateSumsubVerificationToken;
@@ -67,7 +67,7 @@ export declare const MEMBER = "\n query Member {\n member {\n dateTimeL
67
67
  /**
68
68
  * _aka_ `Query.self`
69
69
  */
70
- export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n }\n }\n }\n";
70
+ export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n }\n }\n }\n";
71
71
  export declare const MEMBER_VERIFICATION = "\n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n query MemberVerification {\n memberAccount: self {\n ... on MemberAccount {\n verification {\n id\n status\n address\n permanentAddress\n sourceOfIncome\n natureOfWork\n nationality\n placeOfBirth\n idFrontImage {\n ...FileFragment\n }\n selfieImage {\n ...FileFragment\n }\n }\n }\n }\n }\n";
72
72
  export declare const REGISTER_MEMBER_ACCOUNT = "\n mutation RegisterMemberAccount(\n $input: RegisterMemberAccountInput!\n $referralCode: String\n $verificationCode: String\n $reCAPTCHAResponse: String\n ) {\n registerMemberAccount(\n input: $input\n referralCode: $referralCode\n verificationCode: $verificationCode\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n ... on InvalidSMSVerificationCodeError {\n name: __typename\n message\n }\n ... on MinimumAgeRequirementError {\n name: __typename\n message\n }\n ... on MobileNumberNotAvailableError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n }\n }\n";
73
73
  export declare const REGISTER_MEMBER_ACCOUNT_BY_NAME = "\n mutation RegisterMemberAccountByName(\n $input: RegisterMemberAccountByNameInput!\n $reCAPTCHAResponse: String!\n ) {\n registerMemberAccountByName(\n input: $input\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n }\n }\n";
@@ -125,7 +125,9 @@ export declare const MARK_GAME_AS_FAVORITE = "\n mutation MarkGameAsFavorite($i
125
125
  export declare const UNMARK_GAME_AS_FAVORITE = "\n mutation UnmarkGameAsFavorite($input: UnmarkGameAsFavoriteInput!) {\n unmarkGameAsFavorite(input: $input)\n }\n";
126
126
  export declare const FAVORITE_GAMES = "\n query FavoriteGames {\n favoriteGames {\n ... on Game {\n id\n name\n type\n provider\n }\n }\n }\n";
127
127
  export declare const GOOGLE_CLIENT_ID = "\n query GoogleClientId {\n googleClientId\n }\n";
128
+ export declare const FACEBOOK_CLIENT_ID = "\n query FacebookClientId {\n facebookClientId\n }\n";
128
129
  export declare const UNLINK_GOOGLE = "\n mutation UnlinkGoogle($input: UnlinkGoogleInput!) {\n unlinkGoogle(input: $input)\n }\n";
130
+ export declare const UNLINK_FACEBOOK = "\n mutation UnlinkFacebook($input: UnlinkFacebookInput!) {\n unlinkFacebook(input: $input)\n }\n";
129
131
  export declare const TOURNAMENTS = "\n query Tournaments(\n $first: Int\n $after: Cursor\n $filter: TournamentFilterInput\n ) {\n tournaments(first: $first, after: $after, filter: $filter) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n ... on MultiplierTournament {\n id\n type\n name\n winnersCount\n status\n description\n activationStartDateTime\n activationEndDateTime\n topPayouts {\n id\n multiplier\n amount\n member {\n id\n name\n }\n }\n currentLeaderboard {\n totalCount\n edges {\n node {\n ... on TournamentLeaderboard {\n id\n username\n multiplier\n dateTimeCreated\n }\n }\n }\n }\n previousLeaderboard {\n totalCount\n edges {\n node {\n ... on TournamentLeaderboard {\n id\n username\n multiplier\n dateTimeCreated\n }\n }\n }\n }\n enabledGameProviders\n frequency\n mode\n mobileBanner {\n id\n url\n mimeType\n }\n webBanner {\n id\n url\n mimeType\n }\n rewardSettings\n }\n }\n }\n }\n }\n";
130
132
  export declare const TOURNAMENTS_COUNT = "\n query TournamentsCount($filter: TournamentFilterInput) {\n tournaments(filter: $filter) {\n totalCount\n }\n }\n";
131
133
  export declare const GENERATE_SUMSUB_VERIFICATION_TOKEN = "\n mutation GenerateSumsubVerificationToken {\n generateSumsubVerificationToken\n }\n";
@@ -1531,6 +1531,7 @@ export const MEMBER_ACCOUNT = /* GraphQL */ `
1531
1531
  dateTimeCreated
1532
1532
  dateTimeLastUpdated
1533
1533
  googleId
1534
+ facebookId
1534
1535
  }
1535
1536
  }
1536
1537
  }
@@ -2559,11 +2560,21 @@ export const GOOGLE_CLIENT_ID = /* GraphQL */ `
2559
2560
  googleClientId
2560
2561
  }
2561
2562
  `;
2563
+ export const FACEBOOK_CLIENT_ID = /* GraphQL */ `
2564
+ query FacebookClientId {
2565
+ facebookClientId
2566
+ }
2567
+ `;
2562
2568
  export const UNLINK_GOOGLE = /* GraphQL */ `
2563
2569
  mutation UnlinkGoogle($input: UnlinkGoogleInput!) {
2564
2570
  unlinkGoogle(input: $input)
2565
2571
  }
2566
2572
  `;
2573
+ export const UNLINK_FACEBOOK = /* GraphQL */ `
2574
+ mutation UnlinkFacebook($input: UnlinkFacebookInput!) {
2575
+ unlinkFacebook(input: $input)
2576
+ }
2577
+ `;
2567
2578
  export const TOURNAMENTS = /* GraphQL */ `
2568
2579
  query Tournaments(
2569
2580
  $first: Int
@@ -460,6 +460,7 @@ export interface MemberAccount {
460
460
  dateTimeCreated: string;
461
461
  dateTimeLastUpdated: string;
462
462
  googleId?: string | null;
463
+ facebookId?: string | null;
463
464
  }
464
465
  export interface MemberVerification {
465
466
  id: string;