@opexa/portal-components 0.0.411 → 0.0.413

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 (57) hide show
  1. package/dist/components/KYC/KYCDefault/IdentityVerification.js +5 -2
  2. package/dist/components/KYC/KYCDefault/KYCDefault.js +2 -1
  3. package/dist/components/KYC/KYCReminder.lazy.d.ts +2 -0
  4. package/dist/components/KYC/KYCReminder.lazy.js +26 -4
  5. package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
  6. package/dist/components/Quests/Quests.client.d.ts +2 -0
  7. package/dist/components/Quests/Quests.client.js +1 -1
  8. package/dist/components/Quests/WageringQuest.d.ts +3 -0
  9. package/dist/components/Quests/WageringQuest.js +11 -3
  10. package/dist/handlers/index.d.ts +7 -7
  11. package/dist/types/index.d.ts +1 -1
  12. package/dist/ui/Carousel/Carousel.d.ts +72 -72
  13. package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
  14. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  15. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  16. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  17. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  18. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  19. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  20. package/dist/ui/Menu/Menu.d.ts +90 -90
  21. package/dist/ui/Menu/menu.recipe.d.ts +5 -5
  22. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  23. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  24. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  25. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  26. package/dist/ui/Select/Select.d.ts +45 -45
  27. package/dist/ui/Select/select.recipe.d.ts +3 -3
  28. package/package.json +1 -1
  29. package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
  30. package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
  31. package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
  32. package/dist/components/DigitainLauncher/Loading.js +0 -5
  33. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +0 -184
  34. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +0 -184
  35. package/dist/components/KYC/BasicInformation.d.ts +0 -1
  36. package/dist/components/KYC/BasicInformation.js +0 -101
  37. package/dist/components/KYC/IdentityVerification.d.ts +0 -1
  38. package/dist/components/KYC/IdentityVerification.js +0 -120
  39. package/dist/components/KYC/Indicator.d.ts +0 -1
  40. package/dist/components/KYC/Indicator.js +0 -8
  41. package/dist/components/KYC/KYC.lazy.d.ts +0 -6
  42. package/dist/components/KYC/KYC.lazy.js +0 -45
  43. package/dist/components/KYC/KYCContext.d.ts +0 -6
  44. package/dist/components/KYC/KYCContext.js +0 -2
  45. package/dist/components/KYC/PersonalInformation.d.ts +0 -1
  46. package/dist/components/KYC/PersonalInformation.js +0 -122
  47. package/dist/components/KYC/useKYC.d.ts +0 -25
  48. package/dist/components/KYC/useKYC.js +0 -38
  49. package/dist/components/PortalProvider/LinkGoogleAccountObserver.d.ts +0 -1
  50. package/dist/components/PortalProvider/LinkGoogleAccountObserver.js +0 -29
  51. package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
  52. package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
  53. package/dist/components/SessionWatcher/index.d.ts +0 -1
  54. package/dist/components/SessionWatcher/index.js +0 -1
  55. package/dist/icons/LinkBrokenIcon.d.ts +0 -2
  56. package/dist/icons/LinkBrokenIcon.js +0 -4
  57. package/dist/images/responsible-gaming-yellow.png +0 -0
@@ -18,12 +18,15 @@ import { getMemberVerificationQueryKey } from '../../../utils/queryKeys.js';
18
18
  import { IdFrontImageField } from '../../shared/IdFrontImageField/index.js';
19
19
  import { SelfieImageField } from '../../shared/SelfieImageField/index.js';
20
20
  import { useKYCDefaultContext } from './KYCDefaultContext.js';
21
+ import { useAccountQuery } from '../../../client/hooks/useAccountQuery.js';
21
22
  const formSchema = z.object({
22
23
  selfieImage: z.string().min(1, 'Selfie image is required.'),
23
24
  idFrontImage: z.string().min(1, 'Front image of ID is required.'),
24
25
  });
25
26
  export function IdentityVerification() {
26
27
  const kyc = useKYCDefaultContext();
28
+ const { data: account, isLoading: accountLoading } = useAccountQuery();
29
+ const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
27
30
  const { mutate: createMemberVerification, isPending: createPending } = useCreateMemberVerificationMutation({
28
31
  onSuccess: () => {
29
32
  toaster.success({
@@ -114,7 +117,7 @@ export function IdentityVerification() {
114
117
  type: 'validate',
115
118
  message: error.message,
116
119
  });
117
- } }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", type: "button", onClick: () => {
120
+ } }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), !isVerificationLocked && (_jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", type: "button", onClick: () => {
118
121
  globalStore.kyc.setOpen(false);
119
- }, children: "Skip for now" })] })] }));
122
+ }, children: "Skip for now" }))] })] }));
120
123
  }
@@ -20,6 +20,7 @@ export function KYCDefault(props) {
20
20
  const kyc = useKYCDefault();
21
21
  const { data: account } = useAccountQuery();
22
22
  const { data: verification } = useMemberVerificationQuery();
23
+ const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
23
24
  const isBasicInfoCompleted = account?.realName !== null && account?.birthDay !== null;
24
25
  const isUploadCompleted = verification?.idFrontImage && verification?.selfieImage;
25
26
  const isVerified = verification?.status === 'VERIFIED' ||
@@ -41,5 +42,5 @@ export function KYCDefault(props) {
41
42
  }, [steps, kyc]);
42
43
  return (_jsxs(_Fragment, { children: [_jsx(KYCDefaultContext, { value: kyc, children: _jsx(Dialog.Root, { open: globalStore.kyc.open && hasMissingData, onOpenChange: (details) => {
43
44
  globalStore.kyc.setOpen(details.open);
44
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: "mx-auto min-h-full w-full overflow-y-auto bg-bg-primary-alt lg:min-h-auto lg:w-fit", children: _jsxs("div", { className: "flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit sm:overflow-auto lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(BasicInformation, {}), kyc.step === 2 && _jsx(IdentityVerification, {}), kyc.step === 3 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
45
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: "mx-auto min-h-full w-full overflow-y-auto bg-bg-primary-alt lg:min-h-auto lg:w-fit", children: _jsxs("div", { className: "flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit sm:overflow-auto lg:w-[400px]", children: [!isVerificationLocked && (_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) })), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(BasicInformation, {}), kyc.step === 2 && _jsx(IdentityVerification, {}), kyc.step === 3 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
45
46
  }
@@ -1,4 +1,6 @@
1
+ import type { ImageProps } from 'next/image';
1
2
  export interface KYCReminderProps {
2
3
  siteName: string;
4
+ logo: ImageProps['src'];
3
5
  }
4
6
  export declare function KYCReminder(props: KYCReminderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,7 @@
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 { isEmpty, isNil } from 'lodash-es';
3
+ import { useMemo } from 'react';
4
+ import { differenceInCalendarDays } from 'date-fns';
3
5
  import { useShallow } from 'zustand/shallow';
4
6
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
5
7
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
@@ -10,14 +12,27 @@ import { XIcon } from '../../icons/XIcon.js';
10
12
  import { Button } from '../../ui/Button/index.js';
11
13
  import { Dialog } from '../../ui/Dialog/index.js';
12
14
  import { Portal } from '../../ui/Portal/index.js';
15
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
16
+ import pagcorLogo from '../../images/pagcor.png';
17
+ import responsibleGamingLogo from '../../images/responsible-gaming-gold.png';
18
+ import Image from 'next/image';
13
19
  export function KYCReminder(props) {
14
20
  const globalStore = useGlobalStore(useShallow((ctx) => ({
15
21
  kyc: ctx.kyc,
16
22
  kycReminder: ctx.kycReminder,
17
23
  })));
24
+ const { enabled } = useFeatureFlag();
18
25
  const { data: session, isLoading: sessionLoading } = useSessionQuery();
19
26
  const { data: account, isLoading: accountLoading } = useAccountQuery();
20
27
  const { data: verification, isLoading: verificationLoading } = useMemberVerificationQuery();
28
+ const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
29
+ const daysFromCreationToNow = useMemo(() => {
30
+ if (!account?.dateTimeCreated)
31
+ return 0;
32
+ const creationDate = new Date(account.dateTimeCreated);
33
+ const now = new Date();
34
+ return differenceInCalendarDays(now, creationDate);
35
+ }, [account?.dateTimeCreated]);
21
36
  const hasMissingData = account?.verified
22
37
  ? false
23
38
  : isNil(account?.realName) ||
@@ -33,10 +48,17 @@ export function KYCReminder(props) {
33
48
  !verificationLoading &&
34
49
  globalStore.kycReminder.open &&
35
50
  session?.status === 'authenticated' &&
36
- hasMissingData, onOpenChange: (details) => {
51
+ hasMissingData ||
52
+ isVerificationLocked, onOpenChange: (details) => {
37
53
  globalStore.kycReminder.setOpen(details.open);
38
- }, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt lg:max-w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: "mt-4 text-lg", children: "Personal Verification" }), _jsxs("p", { className: "mt-xs text-sm text-text-tertiary-600", children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
54
+ }, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt lg:max-w-[400px]", children: isVerificationLocked && enabled ? (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2 mb-4", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: "mt-4 text-lg", children: "Temporarily Locked" }), _jsx("p", { className: "mt-xs text-sm text-text-tertiary-600", children: "Your account has been locked due to incomplete verification. Please complete your verification to restore full access." }), _jsxs("div", { className: "flex w-full items-center justify-center gap-3xl mt-6", children: [_jsx(Image, { src: pagcorLogo, alt: "PAGCOR logo", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false, unoptimized: true }), _jsx(Image, { src: responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
55
+ api.setOpen(false);
56
+ globalStore.kyc.setOpen(true);
57
+ }, children: "Complete KYC" }) })) })] })) : enabled && daysFromCreationToNow <= 3 && daysFromCreationToNow >= 1 ? (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2 mb-4", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: "mt-4 text-lg", children: "JUST A FRIENDLY REMINDER" }), _jsxs("p", { className: "mt-xs text-sm text-text-tertiary-600", children: ["Please complete your KYC information within ", _jsx("span", { className: 'text-[#FF0000] font-semibold', children: "3 days" }), " to avoid temporary lock on your account."] }), _jsxs("div", { className: "flex w-full items-center justify-center gap-3xl mt-6", children: [_jsx(Image, { src: pagcorLogo, alt: "PAGCOR logo", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false, unoptimized: true }), _jsx(Image, { src: responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
39
58
  api.setOpen(false);
40
59
  globalStore.kyc.setOpen(true);
41
- }, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] }) })] }) }));
60
+ }, children: "Complete KYC" }) })) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: "mt-4 text-lg", children: "Personal Verification" }), _jsxs("p", { className: "mt-xs text-sm text-text-tertiary-600", children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
61
+ api.setOpen(false);
62
+ globalStore.kyc.setOpen(true);
63
+ }, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] })) }) })] }) }));
42
64
  }
@@ -1,30 +1,30 @@
1
1
  'use client';
2
2
  import { addHours } from 'date-fns';
3
3
  import { clamp } from 'lodash-es';
4
- import { useSearchParams } from 'next/navigation';
5
4
  import { useLocalStorage, useTimeout } from 'usehooks-ts';
6
5
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
7
6
  export function CXDTokenObserver() {
8
- const searchParams = useSearchParams();
9
- const cxdToken = searchParams.get('cxd');
10
- const accountQuery = useAccountQuery();
11
- const account = accountQuery.data;
12
- const [cxd, setCxd, removeCxd] = useLocalStorage('WebPortalCellxpertCxd', null);
7
+ const { data: account } = useAccountQuery();
8
+ const accountCxd = {
9
+ cxd: account?.cellxpertDetails?.cxd,
10
+ };
11
+ const [cxd, setCxd, removeCxd] = useLocalStorage('cxd', null);
13
12
  const now = new Date();
14
- const shouldTimeoutRun = cxdToken && account;
15
13
  const removeCxdUntilInMs = cxd?.timestamp
16
14
  ? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
17
15
  : 0;
18
16
  useTimeout(() => {
19
- const isSame = cxd?.cxd === cxdToken;
17
+ const isSame = cxd?.cxd === accountCxd.cxd;
20
18
  if (!isSame) {
21
19
  const extendedTimestamp = addHours(new Date(), 6).getTime();
22
20
  setCxd({
23
- cxd: cxdToken,
21
+ cxd: accountCxd.cxd,
24
22
  timestamp: extendedTimestamp,
25
23
  });
26
24
  }
27
- }, shouldTimeoutRun ? 100 : null);
28
- useTimeout(() => removeCxd(), shouldTimeoutRun ? removeCxdUntilInMs : null);
25
+ }, account ? 100 : null);
26
+ useTimeout(() => {
27
+ removeCxd();
28
+ }, account ? removeCxdUntilInMs : null);
29
29
  return null;
30
30
  }
@@ -12,5 +12,7 @@ export interface QuestsProps {
12
12
  className?: string | ClassNameEntries;
13
13
  style?: CSSProperties;
14
14
  uncompletedIcon?: 'x' | 'minus';
15
+ customComplete?: ReactNode;
16
+ showTurnoverDecimals?: boolean;
15
17
  }
16
18
  export declare function Quests__client(props: QuestsProps): import("react/jsx-runtime").JSX.Element;
@@ -56,6 +56,6 @@ export function Quests__client(props) {
56
56
  ? classNames?.wageringQuest
57
57
  : quest.type === 'DAILY_CHECKIN'
58
58
  ? classNames?.dailyCheckInQuest
59
- : '', uncompletedIcon: props.uncompletedIcon }) }, quest.id));
59
+ : '', uncompletedIcon: props.uncompletedIcon, customComplete: quest.type === 'WAGERING' ? props.customComplete : undefined, showTurnoverDecimals: props.showTurnoverDecimals }) }, quest.id));
60
60
  }) })] }));
61
61
  }
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  export interface ClassNameEntries {
2
3
  root?: string;
3
4
  progressBarContainer?: string;
@@ -8,4 +9,6 @@ export interface ClassNameEntries {
8
9
  }
9
10
  export declare function WageringQuest(props: {
10
11
  className?: string | ClassNameEntries;
12
+ customComplete?: ReactNode;
13
+ showTurnoverDecimals?: boolean;
11
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -16,17 +16,25 @@ import { parseDecimal } from '../../utils/parseDecimal.js';
16
16
  import { useQuestContext } from './QuestsContext.js';
17
17
  import { RemainingTime } from './RemainingTime.js';
18
18
  export function WageringQuest(props) {
19
- const { className } = props;
19
+ const { className, customComplete, showTurnoverDecimals = true } = props;
20
20
  const classNames = isString(className) ? { root: className } : className;
21
21
  const quest = useQuestContext();
22
22
  const disclosure = useDisclosure();
23
23
  const localeInfo = useLocaleInfo();
24
24
  const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
25
25
  const remainingTime = useRemainingTime(endDateTime);
26
- 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-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: twMerge('w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center', classNames?.bonusContainer), children: _jsxs("p", { className: twMerge((remainingTime.expired ||
26
+ const formatTurnover = (value) => {
27
+ if (showTurnoverDecimals) {
28
+ return value;
29
+ }
30
+ // Remove decimals and format as whole number
31
+ const numericValue = parseFloat(value);
32
+ return Math.floor(numericValue).toString();
33
+ };
34
+ 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-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [formatTurnover(turnover), _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: twMerge('w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center', classNames?.bonusContainer), children: status === 'COMPLETED' && customComplete ? (_jsx("div", { className: twMerge(classNames?.bonusText), children: customComplete })) : (_jsxs("p", { className: twMerge((remainingTime.expired ||
27
35
  status === 'COMPLETED' ||
28
36
  status === 'FAILED') &&
29
- 'opacity-50 grayscale', classNames?.bonusText), children: ["Complete to get", ' ', _jsxs("span", { className: twMerge('text-brand-400', classNames?.bonusAmount), children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
37
+ 'opacity-50 grayscale', classNames?.bonusText), children: ["Complete to get", ' ', _jsxs("span", { className: twMerge('text-brand-400', classNames?.bonusAmount), children: ["\u20B1", bonus] }), ' ', "bonus!"] })) }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
30
38
  }
31
39
  function Rules(props) {
32
40
  const quest = useQuestContext();
@@ -6,26 +6,26 @@ interface Context {
6
6
  params: Promise<Params>;
7
7
  }
8
8
  export declare const GET: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
9
- ok: true;
10
- data?: never;
11
- } | {
12
9
  ok: false;
13
10
  message: string;
14
11
  __error?: unknown;
12
+ } | {
13
+ ok: true;
14
+ data: import("../types").Session;
15
15
  }> | NextResponse<{
16
+ ok: true;
17
+ data?: never;
18
+ } | {
16
19
  ok: false;
17
20
  message: string;
18
21
  __error?: unknown;
19
- } | {
20
- ok: true;
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: import("../types").Session;
28
+ data: Record<string, unknown>;
29
29
  }>>;
30
30
  export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
31
31
  ok: true;
@@ -436,7 +436,7 @@ export interface PointsWalletTransaction {
436
436
  balance: string;
437
437
  dateTimeCreated: string;
438
438
  }
439
- export type MemberAccountStatus = 'ACTIVE' | 'DISABLED' | 'BLACKLISTED' | 'SUSPENDED';
439
+ export type MemberAccountStatus = 'ACTIVE' | 'DISABLED' | 'BLACKLISTED' | 'SUSPENDED' | 'VERIFICATION_LOCKED';
440
440
  export type MemberAccountVerificationStatus = 'UNVERIFIED' | 'PENDING' | 'VERIFIED';
441
441
  export type MemberVerificationStatus = 'CREATED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'VERIFIED' | 'UNVERIFIED';
442
442
  export interface MemberAccount {