@opexa/portal-components 0.0.152 → 0.0.153

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 (66) hide show
  1. package/dist/client/hooks/useGlobalStore.d.ts +8 -1
  2. package/dist/client/hooks/useGlobalStore.js +30 -0
  3. package/dist/client/hooks/useMarkMessageAsReadMutation.js +25 -10
  4. package/dist/components/Messages/Message.js +10 -8
  5. package/dist/components/Messages/MessageContext.d.ts +1 -1
  6. package/dist/components/Messages/MessageContext.js +1 -1
  7. package/dist/components/Messages/MessagePopup.d.ts +1 -1
  8. package/dist/components/Messages/MessagePopup.js +11 -7
  9. package/dist/components/Messages/Messages.js +7 -3
  10. package/dist/components/Messages/Messages.lazy.d.ts +1 -0
  11. package/dist/components/Messages/Messages.lazy.js +38 -32
  12. package/dist/components/Messages/MessagesPopup.js +59 -13
  13. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  14. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  15. package/dist/ui/Badge/Badge.d.ts +12 -12
  16. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  17. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  18. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  19. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  20. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  21. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  22. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  23. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  24. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  25. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  26. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  27. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  28. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  29. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  30. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  31. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  32. package/dist/ui/Menu/Menu.d.ts +90 -90
  33. package/dist/ui/Menu/menu.recipe.d.ts +5 -5
  34. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  35. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  36. package/dist/ui/Progress/Progress.d.ts +27 -27
  37. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  38. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  39. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  40. package/dist/ui/Select/Select.d.ts +45 -45
  41. package/dist/ui/Select/select.recipe.d.ts +3 -3
  42. package/dist/ui/Table/Table.d.ts +21 -21
  43. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  44. package/dist/ui/Table/table.recipe.d.ts +3 -3
  45. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  46. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  47. package/dist/ui/Tooltip/Tooltip.d.ts +30 -30
  48. package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
  49. package/dist/utils/queryKeys.js +42 -128
  50. package/package.json +1 -1
  51. package/dist/components/Quests/CountdownTimer.d.ts +0 -15
  52. package/dist/components/Quests/CountdownTimer.js +0 -33
  53. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
  54. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
  55. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  56. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  57. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
  58. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
  59. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
  60. package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
  61. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  62. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  63. package/dist/utils/dataUrlToBlob.d.ts +0 -1
  64. package/dist/utils/dataUrlToBlob.js +0 -11
  65. package/dist/utils/resizeImageSize.d.ts +0 -2
  66. package/dist/utils/resizeImageSize.js +0 -11
@@ -2,9 +2,9 @@ export declare const tooltipRecipe: import("tailwind-variants").TVReturnType<{
2
2
  [key: string]: {
3
3
  [key: string]: import("tailwind-variants").ClassValue | {
4
4
  content?: import("tailwind-variants").ClassValue;
5
- trigger?: import("tailwind-variants").ClassValue;
6
5
  arrow?: import("tailwind-variants").ClassValue;
7
6
  arrowTip?: import("tailwind-variants").ClassValue;
7
+ trigger?: import("tailwind-variants").ClassValue;
8
8
  positioner?: import("tailwind-variants").ClassValue;
9
9
  };
10
10
  };
@@ -12,20 +12,20 @@ export declare const tooltipRecipe: import("tailwind-variants").TVReturnType<{
12
12
  [x: string]: {
13
13
  [x: string]: import("tailwind-variants").ClassValue | {
14
14
  content?: import("tailwind-variants").ClassValue;
15
- trigger?: import("tailwind-variants").ClassValue;
16
15
  arrow?: import("tailwind-variants").ClassValue;
17
16
  arrowTip?: import("tailwind-variants").ClassValue;
17
+ trigger?: import("tailwind-variants").ClassValue;
18
18
  positioner?: import("tailwind-variants").ClassValue;
19
19
  };
20
20
  };
21
- } | {}, Record<"content" | "trigger" | "arrow" | "arrowTip" | "positioner", string | string[]>, undefined, {
21
+ } | {}, Record<"content" | "arrow" | "arrowTip" | "trigger" | "positioner", string | string[]>, undefined, {
22
22
  [key: string]: {
23
23
  [key: string]: import("tailwind-variants").ClassValue | {
24
24
  content?: import("tailwind-variants").ClassValue;
25
- trigger?: import("tailwind-variants").ClassValue;
26
25
  arrow?: import("tailwind-variants").ClassValue;
27
26
  arrowTip?: import("tailwind-variants").ClassValue;
27
+ trigger?: import("tailwind-variants").ClassValue;
28
28
  positioner?: import("tailwind-variants").ClassValue;
29
29
  };
30
30
  };
31
- } | {}, Record<"content" | "trigger" | "arrow" | "arrowTip" | "positioner", string | string[]>, import("tailwind-variants").TVReturnType<unknown, Record<"content" | "trigger" | "arrow" | "arrowTip" | "positioner", string | string[]>, undefined, unknown, unknown, undefined>>;
31
+ } | {}, Record<"content" | "arrow" | "arrowTip" | "trigger" | "positioner", string | string[]>, import("tailwind-variants").TVReturnType<unknown, Record<"content" | "arrow" | "arrowTip" | "trigger" | "positioner", string | string[]>, undefined, unknown, unknown, undefined>>;
@@ -1,130 +1,44 @@
1
1
  import { SITE_ID } from '../constants/index.js';
2
2
  const PARENT_KEY = 'queries';
3
- export const getAccountQueryKey = () => [PARENT_KEY, 'account'];
4
- export const getProfileCompletionQueryKey = () => [
5
- PARENT_KEY,
6
- 'profileCompletion',
7
- ];
8
- export const getAvailablePromosQueryKey = (input) => [PARENT_KEY, 'availablePromos', input];
9
- export const getAvailableQuestsQueryKey = () => [
10
- PARENT_KEY,
11
- 'availableQuests',
12
- ];
13
- export const getBetRecordsQueryKey = (input) => [
14
- PARENT_KEY,
15
- 'betRecords',
16
- input,
17
- ];
18
- export const getCashbacksQueryKey = () => [PARENT_KEY, 'cashbacks'];
19
- export const getCashbackBonusesQueryKey = () => [
20
- PARENT_KEY,
21
- 'cashbackBonuses',
22
- ];
23
- export const getCashbackBonusesCountQueryKey = () => [
24
- PARENT_KEY,
25
- 'cashbackBonusesCount',
26
- ];
27
- export const getDepositQueryKey = (id) => [
28
- PARENT_KEY,
29
- 'deposit',
30
- id,
31
- ];
32
- export const getDepositRecordsQueryKey = (input) => [PARENT_KEY, 'depositRecords', input];
33
- export const getDepositsCountQueryKey = () => [
34
- PARENT_KEY,
35
- 'depositsCount',
36
- ];
37
- export const getGamesQueryKey = (input) => [
38
- PARENT_KEY,
39
- 'games',
40
- input,
41
- ];
42
- export const getFavoriteGamesQueryKey = () => [
43
- PARENT_KEY,
44
- 'favoriteGames',
45
- ];
46
- export const getInstapayBankListQueryKey = () => [
47
- PARENT_KEY,
48
- 'instapayBankList',
49
- ];
50
- export const getIsMayaSessionValidQueryKey = () => [
51
- PARENT_KEY,
52
- 'isMayaSessionValidQueryKey',
53
- ];
54
- export const getJackpotsQueryKey = (input) => [
55
- PARENT_KEY,
56
- 'jackpots',
57
- input,
58
- ];
59
- export const getJackpotsCountQueryKey = (input) => [PARENT_KEY, 'jackpotsCount', input];
60
- export const getJackpotPayoutsQueryKey = (input) => [PARENT_KEY, 'jackpotPayouts', input];
61
- export const getMemberVerificationQueryKey = () => [
62
- PARENT_KEY,
63
- 'memberVerification',
64
- ];
65
- export const getPaymentSettingsQueryKey = () => [
66
- PARENT_KEY,
67
- 'paymentSettings',
68
- ];
69
- export const getPlatformQueryKey = () => [PARENT_KEY, 'platform'];
70
- export const getPromoQueryKey = (id) => [
71
- PARENT_KEY,
72
- 'promo',
73
- id,
74
- ];
75
- export const getCashbackQueryKey = (id) => [
76
- PARENT_KEY,
77
- 'cashback',
78
- id,
79
- ];
80
- export const getPromosQueryKey = () => [PARENT_KEY, 'promos'];
81
- export const getSessionQueryKey = () => [PARENT_KEY, 'session'];
82
- export const getTopWinsQueryKey = () => [PARENT_KEY, 'topWins'];
83
- export const getTournamentsQueryKey = (input) => [
84
- PARENT_KEY,
85
- 'tournaments',
86
- input,
87
- ];
88
- export const getTournamentsCountQueryKey = (input) => [PARENT_KEY, 'tournamentsCount', input];
89
- export const getTransactionRecordsQueryKey = (input) => [PARENT_KEY, 'transactionRecords', input];
90
- export const getMessagesQueryKey = (input) => [
91
- PARENT_KEY,
92
- 'messages',
93
- input,
94
- ];
95
- export const getWalletQueryKey = () => [PARENT_KEY, 'wallet'];
96
- export const getWithdrawalRecordsQueryKey = (input) => [PARENT_KEY, 'withdrawalRecords', input];
97
- export const getUnreadMessagesCountQueryKey = (input) => [PARENT_KEY, 'unreadMessagesCount', input];
98
- export const getBonusQueryKey = (id) => [
99
- PARENT_KEY,
100
- 'bonus',
101
- id,
102
- ];
103
- export const getCashbackBonusQueryKey = (id) => [
104
- PARENT_KEY,
105
- 'cashbackBonus',
106
- id,
107
- ];
108
- export const getBonusesQueryKey = () => [PARENT_KEY, 'bonuses'];
109
- export const getBonusesCountQueryKey = () => [
110
- PARENT_KEY,
111
- 'bonusesCount',
112
- ];
113
- export const getAvailableQuestsCountQueryKey = () => [
114
- PARENT_KEY,
115
- 'availableQuestsCount',
116
- ];
117
- export const getOnboardingStatusQueryKey = () => [
118
- PARENT_KEY,
119
- 'onboardingStatus',
120
- ];
121
- export const getRecommendedGamesQueryKey = () => [
122
- PARENT_KEY,
123
- 'recommendedGames',
124
- ];
125
- export const getFileQueryKey = (id) => [
126
- PARENT_KEY,
127
- 'file',
128
- id,
129
- ];
130
- export const getSiteQueryKey = () => [PARENT_KEY, 'site', SITE_ID];
3
+ export const getAccountQueryKey = () => [PARENT_KEY, 'account'].filter(Boolean);
4
+ export const getProfileCompletionQueryKey = () => [PARENT_KEY, 'profileCompletion'].filter(Boolean);
5
+ export const getAvailablePromosQueryKey = (input) => [PARENT_KEY, 'availablePromos', input].filter(Boolean);
6
+ export const getAvailableQuestsQueryKey = () => [PARENT_KEY, 'availableQuests'].filter(Boolean);
7
+ export const getBetRecordsQueryKey = (input) => [PARENT_KEY, 'betRecords', input].filter(Boolean);
8
+ export const getCashbacksQueryKey = () => [PARENT_KEY, 'cashbacks'].filter(Boolean);
9
+ export const getCashbackBonusesQueryKey = () => [PARENT_KEY, 'cashbackBonuses'].filter(Boolean);
10
+ export const getCashbackBonusesCountQueryKey = () => [PARENT_KEY, 'cashbackBonusesCount'].filter(Boolean);
11
+ export const getDepositQueryKey = (id) => [PARENT_KEY, 'deposit', id].filter(Boolean);
12
+ export const getDepositRecordsQueryKey = (input) => [PARENT_KEY, 'depositRecords', input].filter(Boolean);
13
+ export const getDepositsCountQueryKey = () => [PARENT_KEY, 'depositsCount'].filter(Boolean);
14
+ export const getGamesQueryKey = (input) => [PARENT_KEY, 'games', input].filter(Boolean);
15
+ export const getFavoriteGamesQueryKey = () => [PARENT_KEY, 'favoriteGames'].filter(Boolean);
16
+ export const getInstapayBankListQueryKey = () => [PARENT_KEY, 'instapayBankList'].filter(Boolean);
17
+ export const getIsMayaSessionValidQueryKey = () => [PARENT_KEY, 'isMayaSessionValidQueryKey'].filter(Boolean);
18
+ export const getJackpotsQueryKey = (input) => [PARENT_KEY, 'jackpots', input].filter(Boolean);
19
+ export const getJackpotsCountQueryKey = (input) => [PARENT_KEY, 'jackpotsCount', input].filter(Boolean);
20
+ export const getJackpotPayoutsQueryKey = (input) => [PARENT_KEY, 'jackpotPayouts', input].filter(Boolean);
21
+ export const getMemberVerificationQueryKey = () => [PARENT_KEY, 'memberVerification'].filter(Boolean);
22
+ export const getPaymentSettingsQueryKey = () => [PARENT_KEY, 'paymentSettings'].filter(Boolean);
23
+ export const getPlatformQueryKey = () => [PARENT_KEY, 'platform'].filter(Boolean);
24
+ export const getPromoQueryKey = (id) => [PARENT_KEY, 'promo', id].filter(Boolean);
25
+ export const getCashbackQueryKey = (id) => [PARENT_KEY, 'cashback', id].filter(Boolean);
26
+ export const getPromosQueryKey = () => [PARENT_KEY, 'promos'].filter(Boolean);
27
+ export const getSessionQueryKey = () => [PARENT_KEY, 'session'].filter(Boolean);
28
+ export const getTopWinsQueryKey = () => [PARENT_KEY, 'topWins'].filter(Boolean);
29
+ export const getTournamentsQueryKey = (input) => [PARENT_KEY, 'tournaments', input].filter(Boolean);
30
+ export const getTournamentsCountQueryKey = (input) => [PARENT_KEY, 'tournamentsCount', input].filter(Boolean);
31
+ export const getTransactionRecordsQueryKey = (input) => [PARENT_KEY, 'transactionRecords', input].filter(Boolean);
32
+ export const getMessagesQueryKey = (input) => [PARENT_KEY, 'messages', input].filter(Boolean);
33
+ export const getWalletQueryKey = () => [PARENT_KEY, 'wallet'].filter(Boolean);
34
+ export const getWithdrawalRecordsQueryKey = (input) => [PARENT_KEY, 'withdrawalRecords', input].filter(Boolean);
35
+ export const getUnreadMessagesCountQueryKey = (input) => [PARENT_KEY, 'unreadMessagesCount', input].filter(Boolean);
36
+ export const getBonusQueryKey = (id) => [PARENT_KEY, 'bonus', id].filter(Boolean);
37
+ export const getCashbackBonusQueryKey = (id) => [PARENT_KEY, 'cashbackBonus', id].filter(Boolean);
38
+ export const getBonusesQueryKey = () => [PARENT_KEY, 'bonuses'].filter(Boolean);
39
+ export const getBonusesCountQueryKey = () => [PARENT_KEY, 'bonusesCount'].filter(Boolean);
40
+ export const getAvailableQuestsCountQueryKey = () => [PARENT_KEY, 'availableQuestsCount'].filter(Boolean);
41
+ export const getOnboardingStatusQueryKey = () => [PARENT_KEY, 'onboardingStatus'].filter(Boolean);
42
+ export const getRecommendedGamesQueryKey = () => [PARENT_KEY, 'recommendedGames'].filter(Boolean);
43
+ export const getFileQueryKey = (id) => [PARENT_KEY, 'file', id].filter(Boolean);
44
+ export const getSiteQueryKey = () => [PARENT_KEY, 'site', SITE_ID].filter(Boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.152",
3
+ "version": "0.0.153",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",
@@ -1,15 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- type TimeLeft = {
3
- days: number;
4
- hours: number;
5
- minutes: number;
6
- seconds: number;
7
- };
8
- interface CountdownTimerProps {
9
- startDateTime?: string;
10
- endDateTime?: string;
11
- renderAction: (timeLeft: TimeLeft) => ReactNode;
12
- onEnd?: () => void;
13
- }
14
- export default function CountdownTimer({ startDateTime, endDateTime, renderAction, onEnd, }: CountdownTimerProps): import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,33 +0,0 @@
1
- 'use client';
2
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
- import { differenceInSeconds, parseISO } from 'date-fns';
4
- import { useCallback, useEffect, useState } from 'react';
5
- export default function CountdownTimer({ startDateTime, endDateTime, renderAction, onEnd, }) {
6
- const calculateTimeLeft = useCallback(() => {
7
- const start = startDateTime ? parseISO(startDateTime) : new Date();
8
- const end = endDateTime ? parseISO(endDateTime) : new Date();
9
- const totalSeconds = Math.max(differenceInSeconds(end, start), 0);
10
- const days = Math.floor(totalSeconds / (60 * 60 * 24));
11
- const hours = Math.floor((totalSeconds % (60 * 60 * 24)) / (60 * 60));
12
- const minutes = Math.floor((totalSeconds % (60 * 60)) / 60);
13
- const seconds = totalSeconds % 60;
14
- return { days, hours, minutes, seconds };
15
- }, [startDateTime, endDateTime]);
16
- const [timeLeft, setTimeLeft] = useState(calculateTimeLeft);
17
- useEffect(() => {
18
- const interval = setInterval(() => {
19
- const newTimeLeft = calculateTimeLeft();
20
- setTimeLeft(newTimeLeft);
21
- const isZero = newTimeLeft.days === 0 &&
22
- newTimeLeft.hours === 0 &&
23
- newTimeLeft.minutes === 0 &&
24
- newTimeLeft.seconds === 0;
25
- if (isZero) {
26
- clearInterval(interval);
27
- onEnd?.();
28
- }
29
- }, 1000);
30
- return () => clearInterval(interval);
31
- }, [calculateTimeLeft, onEnd]);
32
- return _jsx(_Fragment, { children: renderAction(timeLeft) });
33
- }
@@ -1,4 +0,0 @@
1
- import type { Quest } from '../../../types';
2
- export declare function DailyCheckInQuest({ quest }: {
3
- quest: Quest;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,78 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { addDays, isEqual, startOfDay } from 'date-fns';
4
- import { useState } from 'react';
5
- import { twMerge } from 'tailwind-merge';
6
- import { useCheckInDailyCheckInQuestMutation } from '../../../client/hooks/useCheckInDailyCheckInQuestMutation.js';
7
- import { toaster } from '../../../client/utils/toaster.js';
8
- import { CalendarIcon } from '../../../icons/CalendarIcon.js';
9
- import { CheckIcon } from '../../../icons/CheckIcon.js';
10
- import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
11
- import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
12
- import { Badge } from '../../../ui/Badge/index.js';
13
- import { Button } from '../../../ui/Button/index.js';
14
- import { getQueryClient } from '../../../utils/getQueryClient.js';
15
- import { getAvailableQuestsQueryKey } from '../../../utils/queryKeys.js';
16
- import CountdownTimer from '../CountdownTimer.js';
17
- import { DailyCheckInQuestModal } from './DailyCheckInQuestModal.js';
18
- export function DailyCheckInQuest({ quest }) {
19
- const queryClient = getQueryClient();
20
- const [showRules, setShowRules] = useState(false);
21
- const [isExpired, setIsExpired] = useState(false);
22
- const { name, description, status, lastCheckInDate, progressPercentage, checkInStreak, thirdDayBonusAmount, sixthDayBonusAmount, seventhDayBonusAmount, endDateTime, id, } = quest;
23
- const today = startOfDay(new Date());
24
- const hasCheckedInToday = lastCheckInDate
25
- ? isEqual(today, startOfDay(new Date(lastCheckInDate)))
26
- : false;
27
- const checkedInRewards = {
28
- 3: thirdDayBonusAmount,
29
- 6: sixthDayBonusAmount,
30
- 7: seventhDayBonusAmount,
31
- };
32
- const dailyCheckedInData = Array.from({ length: 7 }, (_, i) => {
33
- const day = i + 1;
34
- return {
35
- day,
36
- reward: checkedInRewards[day] ?? 0,
37
- };
38
- });
39
- const { mutate } = useCheckInDailyCheckInQuestMutation({
40
- onSuccess() {
41
- toaster.success({
42
- title: 'Check-in successful 🎉',
43
- description: 'You’ve successfully checked in for today! Keep it up to maintain your streak!',
44
- });
45
- queryClient.invalidateQueries({
46
- queryKey: getAvailableQuestsQueryKey(),
47
- });
48
- },
49
- onError(e) {
50
- toaster.error({
51
- title: 'Check-in successful 🎉',
52
- description: e.message ?? 'Check-In Failed',
53
- });
54
- },
55
- });
56
- const handleCheckIn = async () => mutate(id);
57
- return (_jsxs(_Fragment, { children: [_jsx(DailyCheckInQuestModal, { modalState: {
58
- isOpen: showRules,
59
- setIsOpen: setShowRules,
60
- } }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", 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(CountdownTimer, { endDateTime: endDateTime, renderAction: (timeLeft) => (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsxs(Badge.Label, { children: [timeLeft.days, "d:", timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => setIsExpired(true) }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => setShowRules((prev) => !prev), children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsx("div", { className: "grid grid-cols-7", children: dailyCheckedInData.map((item) => {
61
- const reward = item.reward ? `+₱${item.reward}` : '-';
62
- return (_jsx("div", { className: twMerge('flex items-center justify-center', item.day <= (checkInStreak || 0)
63
- ? 'text-brand-400'
64
- : 'text-text-secondary-700'), children: _jsx("p", { children: reward }) }, item.day));
65
- }) }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) }), _jsx("div", { className: "grid grid-cols-7", children: dailyCheckedInData.map((item) => (_jsx("div", { className: "flex items-center justify-center", children: _jsx(CalendarWithDayNumber, { day: item.day, currentCheckedInDays: checkInStreak || 0 }, item.day) }, item.day))) })] }), _jsx(Button, { onClick: handleCheckIn, className: "disabled:bg-bg-primary disabled:text-text-disabled", disabled: isExpired ||
66
- status === 'COMPLETED' ||
67
- status === 'FAILED' ||
68
- hasCheckedInToday, children: hasCheckedInToday && status === 'IN_PROGRESS' ? (_jsx(CountdownTimer, { endDateTime: startOfDay(addDays(new Date(), 1)).toISOString(), renderAction: (timeLeft) => (_jsxs("div", { className: "flex items-center space-x-0.5", children: [_jsx(CheckIcon, {}), _jsxs("p", { children: [timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => {
69
- queryClient.invalidateQueries({
70
- queryKey: getAvailableQuestsQueryKey(),
71
- });
72
- } })) : ('Check-In') })] })] }));
73
- }
74
- function CalendarWithDayNumber({ day, currentCheckedInDays, }) {
75
- return (_jsxs("div", { className: twMerge('group relative h-fit w-fit', day <= currentCheckedInDays
76
- ? 'text-brand-400'
77
- : 'text-text-secondary-700'), children: [_jsx(CalendarIcon, {}), _jsx("div", { className: "absolute inset-0 mt-1 flex items-center justify-center text-2xs lg:mt-[2px]", children: _jsx("p", { className: "text-center", children: day }) })] }));
78
- }
@@ -1,8 +0,0 @@
1
- interface Props {
2
- modalState: {
3
- isOpen: boolean;
4
- setIsOpen: (isOpen: boolean) => void;
5
- };
6
- }
7
- export declare function DailyCheckInQuestModal(props: Props): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { XIcon } from '../../../icons/XIcon.js';
4
- import { Button } from '../../../ui/Button/index.js';
5
- import { Dialog } from '../../../ui/Dialog/index.js';
6
- import { Portal } from '../../../ui/Portal/index.js';
7
- export function DailyCheckInQuestModal(props) {
8
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("p", { className: "text-text-primary-900 text-lg font-semibold", children: "Daily Check-In Rules" }), _jsxs("ul", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn rewards just for checking in each day!" }), _jsx("li", { children: "Stay consistent to unlock special rewards on the 3rd, 5th, and 7th day." }), _jsx("li", { children: "Missing a day will reset your streak, starting again from Day 1." }), _jsx("li", { children: "Each check-in unlocks the next one on the following day." }), _jsx("li", { children: "Successfully check in for 7 consecutive days to complete the quest and reset the cycle." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
9
- }
@@ -1,4 +0,0 @@
1
- import type { Quest } from '../../../types';
2
- export declare function OnboardingQuest(props: {
3
- quest: Quest;
4
- }): null;
@@ -1,4 +0,0 @@
1
- export function OnboardingQuest(props) {
2
- console.log('OnboardingQuest not implemented', props.quest);
3
- return null;
4
- }
@@ -1,4 +0,0 @@
1
- import type { Quest } from '../../../types';
2
- export declare function WageringQuest({ quest }: {
3
- quest: Quest;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useState } from 'react';
4
- import { twMerge } from 'tailwind-merge';
5
- import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
6
- import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
7
- import { Badge } from '../../../ui/Badge/index.js';
8
- import CountdownTimer from '../CountdownTimer.js';
9
- import { WageringQuestModal } from './WageringQuestModal.js';
10
- export function WageringQuest({ quest }) {
11
- const [showRules, setShowRules] = useState(false);
12
- const [isExpired, setIsExpired] = useState(false);
13
- const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
14
- return (_jsxs(_Fragment, { children: [_jsx(WageringQuestModal, { questName: name, modalState: {
15
- isOpen: showRules,
16
- setIsOpen: setShowRules,
17
- } }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", 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(CountdownTimer, { endDateTime: endDateTime, renderAction: (timeLeft) => (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsxs(Badge.Label, { children: [timeLeft.days, "d:", timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => setIsExpired(true) }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => setShowRules((prev) => !prev), children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "text-text-primary-brand group flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", parseInt(progressPercentage).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " PHP"] })] })] }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "bg-button-secondary-bg border-bg-primary-hover w-full rounded-md border px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { className: twMerge(isExpired || status === 'COMPLETED' || status === 'FAILED'
18
- ? ['opacity-50 grayscale']
19
- : ''), children: ["Complete to get ", _jsxs("span", { className: "text-brand-400", children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] })] }));
20
- }
@@ -1,9 +0,0 @@
1
- interface Props {
2
- questName: string;
3
- modalState: {
4
- isOpen: boolean;
5
- setIsOpen: (isOpen: boolean) => void;
6
- };
7
- }
8
- export declare function WageringQuestModal(props: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { XIcon } from '../../../icons/XIcon.js';
4
- import { Button } from '../../../ui/Button/index.js';
5
- import { Dialog } from '../../../ui/Dialog/index.js';
6
- import { Portal } from '../../../ui/Portal/index.js';
7
- export function WageringQuestModal(props) {
8
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("p", { className: "text-text-primary-900 text-lg font-semibold", children: props.questName }), _jsxs("ul", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn extra rewards just by playing Slots, every bet counts, win or lose!" }), _jsx("li", { children: "Reach the wagering requirement in bets to complete the quest and claim your reward." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
9
- }
@@ -1 +0,0 @@
1
- export declare function dataURLtoBlob(dataURL: string): Blob;
@@ -1,11 +0,0 @@
1
- export function dataURLtoBlob(dataURL) {
2
- const parts = dataURL.split(';base64,');
3
- const contentType = parts[0].split(':')[1];
4
- const raw = window.atob(parts[1]);
5
- const rawLength = raw.length;
6
- const uInt8Array = new Uint8Array(rawLength);
7
- for (let i = 0; i < rawLength; ++i) {
8
- uInt8Array[i] = raw.charCodeAt(i);
9
- }
10
- return new Blob([uInt8Array], { type: contentType });
11
- }
@@ -1,2 +0,0 @@
1
- export declare const resizeFile: (file: File) => Promise<unknown>;
2
- export declare const resizeFileBase64: (file: File) => Promise<string>;
@@ -1,11 +0,0 @@
1
- import Resizer from 'react-image-file-resizer';
2
- export const resizeFile = (file) => new Promise((resolve) => {
3
- Resizer.imageFileResizer(file, 300, 300, 'jpeg', 100, 0, (uri) => {
4
- resolve(uri);
5
- }, 'file');
6
- });
7
- export const resizeFileBase64 = (file) => new Promise((resolve) => {
8
- Resizer.imageFileResizer(file, 1200, 300, 'WEBP', 100, 0, (uri) => {
9
- resolve(uri);
10
- }, 'base64');
11
- });