@opexa/portal-components 0.0.307 → 0.0.309
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/hooks/useCamera.js +2 -2
- package/dist/client/hooks/useControllableState.js +1 -1
- package/dist/client/hooks/useInfiniteQueryHelper.js +2 -3
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +1 -2
- package/dist/client/hooks/useMobileNumberParser.js +1 -1
- package/dist/client/utils/recaptcha.d.ts +14 -0
- package/dist/client/utils/recaptcha.js +18 -0
- package/dist/components/Account/Account.lazy.js +5 -5
- package/dist/components/Account/account.recipe.js +4 -4
- package/dist/components/AccountInfo/AccountInfo.js +6 -6
- package/dist/components/AccountSecurity/AccountSecurity.js +6 -6
- package/dist/components/AccountVerification/AccountVerification.js +7 -7
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/BetRecords/BetRecords.client.js +5 -5
- package/dist/components/Bonus/Bonus.client.js +2 -2
- package/dist/components/Bonuses/Bonuses.client.js +10 -10
- package/dist/components/Bonuses/BonusesTrigger.js +1 -1
- package/dist/components/Bonuses/ClaimSpotBonus.lazy.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +2 -2
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -2
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +2 -2
- package/dist/components/DepositWithdrawal/HasPendingBonuses.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +3 -3
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +2 -4
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +3 -3
- package/dist/components/DepositWithdrawal/Withdrawal/PisoPayWithdrawal/PisoPayWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/TransactionPasswordNotSet.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +4 -4
- package/dist/components/DigitainLauncher/Fallback.js +1 -1
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/DigitainLauncher/utils.js +1 -2
- package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +3 -3
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
- package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
- package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
- package/dist/components/Disclaimer/TermsOfUse.js +13 -0
- package/dist/components/FavoriteGames/FavoriteGames.client.js +4 -4
- package/dist/components/ForgotPassword/ForgotPassword.lazy.js +1 -1
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +5 -5
- package/dist/components/GCashFailed/GCashFailed.js +1 -1
- package/dist/components/GCashSuccess/GCashSuccess.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.lazy.js +4 -4
- package/dist/components/GameLaunch/GameLaunchTrigger.js +2 -4
- package/dist/components/GameProviders/GameProvidersCarousel.js +1 -1
- package/dist/components/GameProviders/GameProvidersList.js +1 -1
- package/dist/components/Games/Game.js +3 -3
- package/dist/components/Games/GamesCarousel.client.js +2 -4
- package/dist/components/Games/GamesList.client.js +2 -2
- package/dist/components/GamesSearch/GamesSearch.js +4 -6
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +54 -54
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +14 -12
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +13 -11
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +1 -1
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +16 -18
- package/dist/components/KYC/BasicInformation.js +1 -1
- package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/KYC/CaptureIdDocument.js +219 -0
- package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/KYC/CaptureSelfie.js +285 -0
- package/dist/components/KYC/DisplayImage.d.ts +5 -0
- package/dist/components/KYC/DisplayImage.js +8 -0
- package/dist/components/KYC/FileUpload.d.ts +10 -0
- package/dist/components/KYC/FileUpload.js +72 -0
- package/dist/components/KYC/IdentityVerification.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +1 -1
- package/dist/components/KYC/KYCReminder.lazy.js +1 -1
- package/dist/components/KYC/NoCameraError.d.ts +7 -0
- package/dist/components/KYC/NoCameraError.js +6 -0
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/KYC/PersonalInformation.js +1 -1
- package/dist/components/KYC/utils.d.ts +9 -0
- package/dist/components/KYC/utils.js +79 -0
- package/dist/components/Marquee/Marquee.js +1 -1
- package/dist/components/Messages/Messages.lazy.js +5 -5
- package/dist/components/Messages/MessagesPopup.js +3 -3
- package/dist/components/Messages/MessagesTrigger.js +1 -1
- package/dist/components/News/News.js +1 -1
- package/dist/components/NewsFeed/News.d.ts +2 -2
- package/dist/components/NewsFeed/News.js +1 -1
- package/dist/components/NewsFeed/NewsFeedCarousel.js +2 -2
- package/dist/components/NewsFeed/NewsFeedList.js +1 -1
- package/dist/components/PortalProvider/Snackbar.js +2 -2
- package/dist/components/Promo/Promo.client.js +2 -2
- package/dist/components/Promos/Cashback.js +1 -1
- package/dist/components/Promos/CustomPromo.d.ts +2 -2
- package/dist/components/Promos/CustomPromo.js +1 -1
- package/dist/components/Promos/Promo.js +1 -1
- package/dist/components/Promos/PromosCarousel.js +2 -2
- package/dist/components/Promos/PromosGrid.js +2 -2
- package/dist/components/Quests/DailyCheckInQuest.js +3 -3
- package/dist/components/Quests/JourneyQuest.js +5 -5
- package/dist/components/Quests/OnboardingQuest.js +2 -2
- package/dist/components/Quests/Quests.client.js +4 -4
- package/dist/components/Quests/WageringQuest.js +2 -2
- package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.js +1 -1
- package/dist/components/Search/Search.lazy.js +7 -9
- package/dist/components/SignIn/MobileNumberSignIn.js +5 -5
- package/dist/components/SignIn/NameAndPasswordSignIn.js +2 -2
- package/dist/components/SignIn/SignIn.lazy.d.ts +1 -1
- package/dist/components/SignIn/SignIn.lazy.js +1 -2
- package/dist/components/SignIn/SignInForm.js +1 -1
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.js +1 -1
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +7 -7
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.client.js +7 -7
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.js +1 -1
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.client.js +6 -6
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +0 -1
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
- package/dist/components/SignUp/SignUpKYC/SignUpKYC.lazy.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +8 -8
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
- package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.lazy.js +1 -1
- package/dist/components/TermsOfUse/TermsOfUse.lazy.js +1 -1
- package/dist/components/TopWins/TopWins.client.js +3 -3
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +10 -8
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentsList.js +2 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +9 -7
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +1 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +8 -6
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.js +1 -1
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.js +1 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +2 -2
- package/dist/components/TransactionRecords/TableFilters.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.suspense.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +2 -2
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +2 -2
- package/dist/components/shared/Empty.js +1 -1
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +7 -7
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.js +1 -1
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +6 -6
- package/dist/components/shared/SelfieImageField/SelfieImageField.js +1 -1
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +0 -1
- package/dist/constants/EnvVar.d.ts +1 -1
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +82 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +82 -0
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +1 -1
- package/dist/services/graphqlRequest.js +0 -1
- package/dist/styles/theme.css +706 -706
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/AlertDialog/alertDialog.recipe.js +6 -6
- package/dist/ui/Avatar/avatar.recipe.js +3 -3
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Badge/badge.recipe.js +7 -7
- package/dist/ui/Button/button.recipe.d.ts +2 -2
- package/dist/ui/Button/button.recipe.js +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/clipboard.recipe.js +2 -2
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Collapsible/collapsible.recipe.js +2 -2
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/Combobox.js +0 -1
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Combobox/combobox.recipe.js +6 -6
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/datePicker.recipe.js +7 -7
- package/dist/ui/Dialog/Dialog.d.ts +154 -154
- package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
- package/dist/ui/Dialog/dialog.recipe.js +4 -4
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +5 -5
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Field/field.recipe.js +3 -3
- package/dist/ui/IconButton/iconButton.recipe.d.ts +2 -2
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/NumberInput/numberInput.recipe.js +5 -5
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/passwordInput.recipe.js +3 -3
- package/dist/ui/PinInput/pinInput.recipe.js +3 -3
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Presence/Presence.js +1 -1
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Progress/progress.recipe.js +2 -2
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +4 -4
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/Select.js +0 -1
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Select/select.recipe.js +7 -7
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Table/table.recipe.js +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.js +4 -4
- package/dist/ui/Tooltip/tooltip.recipe.js +1 -1
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
- package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
- package/dist/utils/getGameName.d.ts +1 -0
- package/dist/utils/getGameName.js +6 -0
- package/dist/utils/getLocaleInfo.js +7 -7
- package/dist/utils/getQueryClient.js +1 -1
- package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
- package/dist/utils/isBetween3amAnd3pm.js +5 -0
- package/dist/utils/parseDecimal.js +1 -1
- package/dist/utils/validateFile.d.ts +1 -1
- package/package.json +159 -164
|
@@ -95,7 +95,7 @@ export function useCamera(options = {}) {
|
|
|
95
95
|
videoRef.current?.pause();
|
|
96
96
|
resolve();
|
|
97
97
|
});
|
|
98
|
-
}, [
|
|
98
|
+
}, []);
|
|
99
99
|
const snap = useCallback(async () => {
|
|
100
100
|
setData(null);
|
|
101
101
|
setError(null);
|
|
@@ -176,7 +176,7 @@ export function useCamera(options = {}) {
|
|
|
176
176
|
setLoading(false);
|
|
177
177
|
setSnapping(false);
|
|
178
178
|
return Promise.resolve();
|
|
179
|
-
}, [
|
|
179
|
+
}, []);
|
|
180
180
|
const reopen = useCallback(async () => {
|
|
181
181
|
setSnapping(false);
|
|
182
182
|
setLoading(true);
|
|
@@ -7,7 +7,7 @@ function useCallbackRef(callback, deps = []) {
|
|
|
7
7
|
callbackRef.current = callback;
|
|
8
8
|
});
|
|
9
9
|
return React.useCallback((...args) => callbackRef.current?.(...args),
|
|
10
|
-
//
|
|
10
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: ""
|
|
11
11
|
deps);
|
|
12
12
|
}
|
|
13
13
|
export function useControllableState(props) {
|
|
@@ -11,9 +11,8 @@ export function useInfiniteQueryHelper(useQuery, variables) {
|
|
|
11
11
|
...variables,
|
|
12
12
|
first: pageSize,
|
|
13
13
|
});
|
|
14
|
-
const availableRows = query.data?.pages
|
|
15
|
-
|
|
16
|
-
.flat() ?? [];
|
|
14
|
+
const availableRows = query.data?.pages.flatMap((page) => page.edges.map((edge) => edge.node)) ??
|
|
15
|
+
[];
|
|
17
16
|
const availablePages = chunk(availableRows, pageSize);
|
|
18
17
|
const totalAvailableRows = availableRows.length;
|
|
19
18
|
const totalAAvailablePages = Math.ceil(availableRows.length / pageSize);
|
|
@@ -24,8 +24,7 @@ export const useMarkGameAsFavoriteMutation = (config) => {
|
|
|
24
24
|
})
|
|
25
25
|
.map(([, arr]) => arr)
|
|
26
26
|
.filter(Boolean)
|
|
27
|
-
.
|
|
28
|
-
.flat();
|
|
27
|
+
.flatMap((obj) => obj.pages.flatMap((q) => q.edges.map((edge) => edge.node)));
|
|
29
28
|
const game = games.find((game) => game.reference === id);
|
|
30
29
|
queryClient.setQueryData(getFavoriteGamesQueryKey(), (prev = []) => {
|
|
31
30
|
if (game) {
|
|
@@ -21,7 +21,7 @@ export function useMobileNumberParser() {
|
|
|
21
21
|
return localeInfo.mobileNumber.areaCode + value.substring(1);
|
|
22
22
|
}
|
|
23
23
|
if (value.startsWith(localeInfo.mobileNumber.areaCode.substring(1))) {
|
|
24
|
-
return
|
|
24
|
+
return `+${value}`;
|
|
25
25
|
}
|
|
26
26
|
return localeInfo.mobileNumber.areaCode + value;
|
|
27
27
|
}, [localeInfo.mobileNumber.areaCode]);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ReCAPTCHAExecuteOptions {
|
|
2
|
+
action: 'submit' | (string & {});
|
|
3
|
+
}
|
|
4
|
+
export interface ReCAPTCHA {
|
|
5
|
+
ready(callback: () => void): void;
|
|
6
|
+
execute(siteKey: string, options: ReCAPTCHAExecuteOptions): Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare function ReCAPTCHAReady(): Promise<void>;
|
|
9
|
+
export declare function ReCAPTCHAExecute(options: ReCAPTCHAExecuteOptions): Promise<string>;
|
|
10
|
+
declare global {
|
|
11
|
+
interface Window {
|
|
12
|
+
grecaptcha: ReCAPTCHA;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RECAPTCHA_SITE_KEY } from '../../constants/index.js';
|
|
2
|
+
let loaded = false;
|
|
3
|
+
export function ReCAPTCHAReady() {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
if (!loaded) {
|
|
6
|
+
window.grecaptcha.ready(() => {
|
|
7
|
+
loaded = true;
|
|
8
|
+
resolve();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
resolve();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export async function ReCAPTCHAExecute(options) {
|
|
17
|
+
return await window.grecaptcha.execute(RECAPTCHA_SITE_KEY, options);
|
|
18
|
+
}
|
|
@@ -66,12 +66,12 @@ export function Account(props) {
|
|
|
66
66
|
strategy: 'fixed',
|
|
67
67
|
}, ids: {
|
|
68
68
|
trigger: 'opexa-portal-components:account-trigger',
|
|
69
|
-
}, children: _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "
|
|
69
|
+
}, children: _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "relative z-popover w-[23.438rem] ui-closed:animate-fade-out ui-open:animate-fade-in overflow-hidden rounded-xl border border-border-primary bg-bg-primary p-xl", children: [_jsx(Profile, {}), _jsx(Wallet, {}), _jsx(Links, { router: router })] }) }) }) })] }));
|
|
70
70
|
}
|
|
71
71
|
function Profile() {
|
|
72
72
|
const accountQuery = useAccountQuery();
|
|
73
73
|
const account = accountQuery.data;
|
|
74
|
-
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "text-text-secondary-700
|
|
74
|
+
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "font-semibold text-text-secondary-700 leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsxs("p", { className: "grow items-center text-text-tertiary-600 leading-tight", children: ["ID: ", account?.id] }), _jsxs(Badge.Root, { colorScheme: account?.verified ? 'success' : 'danger', className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: account?.verified ? 'Verified' : 'Unverified' })] })] })] })] }));
|
|
75
75
|
}
|
|
76
76
|
function Wallet() {
|
|
77
77
|
const localeInfo = useLocaleInfo();
|
|
@@ -86,13 +86,13 @@ function Wallet() {
|
|
|
86
86
|
const depositBalance = parseDecimal(walletQuery.data?.balance, 0);
|
|
87
87
|
const bonusBalance = parseDecimal(walletQuery.data?.bonus, 0);
|
|
88
88
|
const totalBalance = depositBalance + bonusBalance;
|
|
89
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border-primary bg-bg-tertiary
|
|
89
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-3 rounded-xl border border-border-primary bg-bg-tertiary p-xl", children: [_jsx("div", { className: "text-sm text-text-secondary-700", children: "Total Balance" }), _jsx("div", { className: "font-bold text-3xl", children: formatNumber(totalBalance, {
|
|
90
90
|
currency: localeInfo?.currency.code,
|
|
91
91
|
minDecimalPlaces: 2,
|
|
92
|
-
}) }), _jsxs("div", { className: "mt-1.5 flex gap-7xl", children: [_jsxs("div", { children: [_jsx("p", { className: "text-text-secondary-700
|
|
92
|
+
}) }), _jsxs("div", { className: "mt-1.5 flex gap-7xl", children: [_jsxs("div", { children: [_jsx("p", { className: "text-2xs text-text-secondary-700", children: "Deposit Balance" }), _jsx("p", { className: "text-medium text-text-primary-brand", children: formatNumber(depositBalance, {
|
|
93
93
|
currency: localeInfo?.currency.code,
|
|
94
94
|
minDecimalPlaces: 2,
|
|
95
|
-
}) })] }), _jsxs("div", { children: [_jsx("p", { className: "text-text-secondary-700
|
|
95
|
+
}) })] }), _jsxs("div", { children: [_jsx("p", { className: "text-2xs text-text-secondary-700", children: "Bonus Balance" }), _jsx("p", { className: "text-medium text-text-primary-brand", children: formatNumber(bonusBalance, {
|
|
96
96
|
currency: localeInfo?.currency.code,
|
|
97
97
|
minDecimalPlaces: 2,
|
|
98
98
|
}) })] })] })] }), ' ', _jsxs("div", { className: "mt-3 flex gap-lg", children: [_jsx(Button, { size: "xs", variant: "outline", onClick: () => {
|
|
@@ -2,11 +2,11 @@ import { tv } from 'tailwind-variants';
|
|
|
2
2
|
export const accountRecipe = tv({
|
|
3
3
|
slots: {
|
|
4
4
|
nav: 'space-y-xl',
|
|
5
|
-
navItemRoot: 'bg-bg-primary-alt
|
|
6
|
-
navItemLink: 'flex w-full items-center px-xl py-xl text-left text-sm
|
|
7
|
-
navItemIcon: 'text-text-nav-item-button-icon
|
|
5
|
+
navItemRoot: 'block bg-bg-primary-alt first:rounded-t-xl last:rounded-b-xl',
|
|
6
|
+
navItemLink: 'flex w-full items-center px-xl py-xl text-left font-semibold text-sm',
|
|
7
|
+
navItemIcon: 'size-5 text-text-nav-item-button-icon',
|
|
8
8
|
navItemLabel: 'ml-lg grow',
|
|
9
|
-
navItemIndicator: 'text-gray-400 text-text-quarterary-500
|
|
9
|
+
navItemIndicator: 'size-5 text-gray-400 text-text-quarterary-500',
|
|
10
10
|
navItemBadge: [
|
|
11
11
|
'mr-md',
|
|
12
12
|
'flex',
|
|
@@ -24,7 +24,7 @@ export function AccountInfo(props) {
|
|
|
24
24
|
function ProfileInfo() {
|
|
25
25
|
const accountQuery = useAccountQuery();
|
|
26
26
|
const account = accountQuery.data;
|
|
27
|
-
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700
|
|
27
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Profile Info" }), _jsxs("div", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt", children: [_jsx("div", { className: "border-border-secondary border-b px-4 py-5", children: _jsxs("div", { className: "flex items-center gap-xl", children: [_jsx(Image, { src: avatar, alt: "", width: 80, height: 80, className: "size-14 shrink-0 rounded-md object-cover" }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-lg text-text-secondary-700 leading-tight", children: account?.name }), _jsx("p", { className: "text-text-tertiary-600 leading-tight", children: account?.id })] })] }) }), _jsx("div", { className: "flex justify-end px-xl py-lg", children: _jsx(Button, { size: "sm", variant: "outline", fullWidth: false, children: "Upload New Avatar" }) })] })] }));
|
|
28
28
|
}
|
|
29
29
|
function PersonalInfo() {
|
|
30
30
|
const accountQuery = useAccountQuery();
|
|
@@ -78,7 +78,7 @@ function PersonalInfo() {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}, [account, form]);
|
|
81
|
-
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700
|
|
81
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Personal Data" }), _jsxs("form", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", onSubmit: form.handleSubmit((data) => {
|
|
82
82
|
updateAccountMutation.mutate({
|
|
83
83
|
realName: data.realName && account?.realName !== data.realName
|
|
84
84
|
? data.realName
|
|
@@ -87,7 +87,7 @@ function PersonalInfo() {
|
|
|
87
87
|
? data.birthDay
|
|
88
88
|
: undefined,
|
|
89
89
|
});
|
|
90
|
-
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "
|
|
90
|
+
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
91
91
|
}
|
|
92
92
|
function ContactInfo() {
|
|
93
93
|
const localeInfo = useLocaleInfo();
|
|
@@ -132,7 +132,7 @@ function ContactInfo() {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}, [account, form, parse]);
|
|
135
|
-
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700
|
|
135
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Contact Info" }), _jsxs("form", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", onSubmit: form.handleSubmit((data) => {
|
|
136
136
|
updateAccountMutation.mutate({
|
|
137
137
|
emailAddress: data.emailAddress && account?.emailAddress !== data.emailAddress
|
|
138
138
|
? data.emailAddress
|
|
@@ -142,8 +142,8 @@ function ContactInfo() {
|
|
|
142
142
|
? format(data.mobileNumber)
|
|
143
143
|
: undefined,
|
|
144
144
|
});
|
|
145
|
-
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "pointer-events-none absolute
|
|
145
|
+
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5" }), _jsx(Field.Input, { className: "pl-10.5", readOnly: account?.mobileNumber != null, ...form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.emailAddress, children: [_jsx(Field.Label, { children: "Email address" }), _jsx(Field.Input, { ...form.register('emailAddress') }), _jsx(Field.ErrorText, { children: form.formState.errors.emailAddress?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: updateAccountMutation.isPending || !form.formState.isValid, children: "Save Changes" })] }))] })] }));
|
|
146
146
|
}
|
|
147
147
|
function SSO() {
|
|
148
|
-
return (_jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700
|
|
148
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Account Connections" }), _jsxs("div", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt px-4 py-5 shadow-xs", children: [_jsxs("div", { className: "flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(GoogleIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "font-medium text-sm leading-tight", children: "Google" }), _jsx("p", { className: "mt-xs text-text-secondary-700 text-xs leading-tight", children: "Not Connected" })] })] }), _jsx(Button, { fullWidth: false, children: "Connect" })] }), _jsxs("div", { className: "mt-6 flex items-center", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(FacebookIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "font-medium text-sm leading-tight", children: "Facebook" }), _jsx("p", { className: "mt-xs text-text-success-primary-600 text-xs leading-tight", children: "Connected" })] })] }), _jsx("button", { type: "button", className: "font-semibold text-button-tertiary-error-fg text-sm", children: "Disconnect" })] })] })] }));
|
|
149
149
|
}
|
|
@@ -85,9 +85,9 @@ function LoginPassword() {
|
|
|
85
85
|
},
|
|
86
86
|
});
|
|
87
87
|
const secretQuestion = form.watch('secretQuestion');
|
|
88
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700
|
|
88
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Log in password" }), _jsx("p", { className: "text-sm text-text-tertiary-600", children: "Access your account by logging in with your name and password." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
89
89
|
? 'text-text-success-primary'
|
|
90
|
-
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "
|
|
90
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", onSubmit: form.handleSubmit((data) => {
|
|
91
91
|
updateAccountMutation.mutate({
|
|
92
92
|
password: data.password ? data.password : undefined,
|
|
93
93
|
secretAnswer: data.secretAnswer ? data.secretAnswer : undefined,
|
|
@@ -104,7 +104,7 @@ function LoginPassword() {
|
|
|
104
104
|
shouldTouch: true,
|
|
105
105
|
shouldValidate: true,
|
|
106
106
|
});
|
|
107
|
-
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.secretQuestion?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.secretAnswer, children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, { ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "
|
|
107
|
+
}, children: [_jsx(Select.Label, { children: "Security Question" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: secretQuestionCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: secretQuestionCollection.stringifyItem(provider) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.secretQuestion?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.secretAnswer, children: [_jsx(Field.Label, { children: "Answer" }), _jsx(Field.Input, { ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: updateAccountMutation.isPending || !form.formState.isValid, children: "Save Changes" })] }))] })] }));
|
|
108
108
|
}
|
|
109
109
|
function TransactionPassword() {
|
|
110
110
|
const profileCompletionQuery = useProfileCompletionQuery();
|
|
@@ -144,13 +144,13 @@ function TransactionPassword() {
|
|
|
144
144
|
confirmPassword: '',
|
|
145
145
|
},
|
|
146
146
|
});
|
|
147
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700
|
|
147
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Transaction password" }), _jsx("p", { className: "text-sm text-text-tertiary-600", children: "The transaction password secures and confirms your wallet withdrawals." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountPassword
|
|
148
148
|
? 'text-text-success-primary'
|
|
149
|
-
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "
|
|
149
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountPassword ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("form", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", onSubmit: form.handleSubmit((data) => {
|
|
150
150
|
updateAccountMutation.mutate({
|
|
151
151
|
transactionPassword: data.password ? data.password : undefined,
|
|
152
152
|
});
|
|
153
|
-
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.confirmPassword, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.confirmPassword?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "
|
|
153
|
+
}), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.confirmPassword, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.confirmPassword?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
154
154
|
}
|
|
155
155
|
const secretQuestionCollection = createListCollection({
|
|
156
156
|
items: SECRET_QUESTIONS,
|
|
@@ -31,21 +31,21 @@ export function AccountVerification(props) {
|
|
|
31
31
|
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
32
32
|
const failed = verification?.status === 'REJECTED';
|
|
33
33
|
if (verificationQuery.isLoading) {
|
|
34
|
-
return _jsx(Spinner02Icon, { className: "text-text-brand-primary-600
|
|
34
|
+
return _jsx(Spinner02Icon, { className: "size-5 text-text-brand-primary-600" });
|
|
35
35
|
}
|
|
36
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700
|
|
36
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Verify your identity" }), _jsx("p", { className: "text-sm text-text-tertiary-600", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
|
|
37
37
|
? 'text-text-success-primary'
|
|
38
|
-
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "
|
|
38
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "flex icon:size-6 items-center gap-lg icon:text-text-nav-item-button-icon text-text-secondary-700", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "flex icon:size-6 items-center gap-lg icon:text-text-nav-item-button-icon text-text-secondary-700", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "flex icon:size-6 items-center gap-lg icon:text-text-nav-item-button-icon text-text-secondary-700", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), !isKycCompleted && (_jsx("div", { className: "flex justify-end border-border-secondary border-t px-4 py-3 lg:py-xl", children: _jsx(Button, { size: "sm", className: "w-full lg:w-fit", onClick: () => globalStore.kyc.setOpen(true), children: "Verify Now" }) }))] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
39
39
|
}
|
|
40
40
|
function VerificationNotSubmitted() {
|
|
41
|
-
return (_jsxs("div", { className: "
|
|
41
|
+
return (_jsxs("div", { className: "mt-6 flex flex-col gap-2 rounded-xl border border-border-primary bg-bg-primary-alt p-xl shadow-xs lg:flex-row", children: [_jsx("div", { className: "flex size-[2.1875rem] items-center justify-center rounded-full border-2 border-text-warning-primary/10", children: _jsx("div", { className: "flex size-[1.666625rem] items-center justify-center rounded-full border-2 border-text-warning-primary/30", children: _jsx(AlertCircleIcon, { className: "size-5 text-text-warning-primary" }) }) }), _jsx("p", { className: "max-w-[800px] text-sm text-text-tertiary-600", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
42
42
|
}
|
|
43
43
|
function VerificationInProgress() {
|
|
44
|
-
return (_jsxs("div", { className: "
|
|
44
|
+
return (_jsxs("div", { className: "mt-6 flex flex-col gap-2 rounded-xl border border-border-primary bg-bg-primary-alt p-xl shadow-xs lg:flex-row", children: [_jsx("div", { className: "flex size-[2.1875rem] items-center justify-center rounded-full border-2 border-text-warning-primary/10", children: _jsx("div", { className: "flex size-[1.666625rem] items-center justify-center rounded-full border-2 border-text-warning-primary/30", children: _jsx(FileSearch02Icon, { className: "size-5 text-text-warning-primary" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Under review" }), _jsx("p", { className: "mt-xs text-sm text-text-tertiary-600", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] })] }));
|
|
45
45
|
}
|
|
46
46
|
function VerificationSuccess() {
|
|
47
|
-
return (_jsxs("div", { className: "
|
|
47
|
+
return (_jsxs("div", { className: "mt-6 flex flex-col gap-2 rounded-xl border border-border-primary bg-bg-primary-alt p-xl shadow-xs lg:flex-row", children: [_jsx("div", { className: "flex size-[2.1875rem] items-center justify-center rounded-full border-2 border-text-success-primary/10", children: _jsx("div", { className: "flex size-[1.666625rem] items-center justify-center rounded-full border-2 border-text-success-primary/30", children: _jsx(FileCheck02Icon, { className: "size-5 text-text-success-primary" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Verification successful" }), _jsx("p", { className: "mt-xs text-sm text-text-tertiary-600", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] })] }));
|
|
48
48
|
}
|
|
49
49
|
function VerificationFailed() {
|
|
50
|
-
return (_jsxs("div", { className: "
|
|
50
|
+
return (_jsxs("div", { className: "mt-6 flex flex-col gap-2 rounded-xl border border-border-primary bg-bg-primary-alt p-xl shadow-xs lg:flex-row", children: [_jsx("div", { className: "flex size-[2.1875rem] items-center justify-center rounded-full border-2 border-text-error-primary/10", children: _jsx("div", { className: "flex size-[1.666625rem] items-center justify-center rounded-full border-2 border-text-error-primary/30", children: _jsx(FileX02Icon, { className: "size-5 text-text-error-primary" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Verification failed" }), _jsx("p", { className: "mt-xs text-sm text-text-tertiary-600", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] })] }));
|
|
51
51
|
}
|
|
@@ -43,7 +43,7 @@ export function Banner(props) {
|
|
|
43
43
|
return (_jsxs("div", { className: twMerge('relative', props.className), children: [_jsx("div", { ref: emblaRef, className: "overflow-hidden", children: _jsx("div", { className: "flex gap-2", children: props.banners.map((banner, index) => {
|
|
44
44
|
const img = (_jsx(Image, { src: banner.src, alt: "", width: isMobile() ? imageWidth[0] : imageWidth[1], height: isMobile() ? imageHeight[0] : imageHeight[1], className: "block h-auto w-full", priority: index === 0 }));
|
|
45
45
|
return (_jsx(Fragment, { children: !banner.redirectUrl ? (_jsx("div", { className: "w-full shrink-0", children: img })) : (_jsx(Link, { href: banner.redirectUrl, className: "block w-full shrink-0", "aria-label": `Open ${banner.redirectUrl}`, children: img })) }, index));
|
|
46
|
-
}) }) }), _jsx("div", { className: "absolute bottom-lg left-1/2 flex w-fit
|
|
46
|
+
}) }) }), _jsx("div", { className: "-translate-x-1/2 absolute bottom-lg left-1/2 flex w-fit gap-2", children: props.banners.map((_, index) => (_jsx("button", { type: "button", className: "size-3 ui-active:w-9 shrink-0 rounded-full border border-white bg-gray-300 ui-active:bg-brand-500 transition-all duration-300", onClick: () => {
|
|
47
47
|
emblaApi?.scrollTo(index);
|
|
48
48
|
}, "aria-label": `Go to slide ${index + 1}`, "data-active": dataAttr(index === currentIndex) }, index))) })] }));
|
|
49
49
|
}
|
|
@@ -93,13 +93,13 @@ export function BetRecords__client(props) {
|
|
|
93
93
|
setTab('all');
|
|
94
94
|
},
|
|
95
95
|
});
|
|
96
|
-
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-sm
|
|
96
|
+
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "font-semibold text-sm leading-tight lg:text-lg", children: "Bet Records" }), _jsx("p", { className: "mt-xs text-sm text-text-tertiary-600 leading-tight", children: "Review your betting history" }), _jsx("div", { className: "mt-lg lg:mt-2xl", children: _jsxs(SegmentGroup.Root, { value: state.type ?? 'all', onValueChange: (details) => {
|
|
97
97
|
firstPage();
|
|
98
98
|
setState({
|
|
99
99
|
type: z.enum(GAME_TYPES).safeParse(details.value).data ?? null,
|
|
100
100
|
provider: null,
|
|
101
101
|
});
|
|
102
|
-
}, className: "w-full overflow-x-auto lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), gameTypes.map((type) => (_jsxs(SegmentGroup.Item, { value: type.id, children: [_jsx(SegmentGroup.ItemText, { children: type.name }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }, type.id))), _jsx(SegmentGroup.Indicator, {})] }) }), _jsx("div", { className: "
|
|
102
|
+
}, className: "w-full overflow-x-auto lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), gameTypes.map((type) => (_jsxs(SegmentGroup.Item, { value: type.id, children: [_jsx(SegmentGroup.ItemText, { children: type.name }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }, type.id))), _jsx(SegmentGroup.Indicator, {})] }) }), _jsx("div", { className: "mt-2xl hidden border-border-secondary border-t lg:block" }), _jsx("h3", { className: "mt-3xl font-semibold text-sm text-text-secondary-700", children: "Table" }), _jsxs("div", { className: "mt-xl flex flex-col gap-lg lg:flex-row lg:items-center", children: [_jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
|
|
103
103
|
const value = TabDefinition.parse(details.value);
|
|
104
104
|
if (value === 'today') {
|
|
105
105
|
const now = new Date();
|
|
@@ -154,7 +154,7 @@ export function BetRecords__client(props) {
|
|
|
154
154
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
155
155
|
}) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, status))) }) }) }) })] })] }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
156
156
|
? 'Fetching latest bet records...'
|
|
157
|
-
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "
|
|
157
|
+
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Bet Time" }), _jsx(Table.Heading, { children: "Settlement Time" }), _jsx(Table.Heading, { children: "Bet Content" }), _jsx(Table.Heading, { children: "Odds" }), _jsx(Table.Heading, { children: "Bet Amount" }), _jsx(Table.Heading, { children: "Valid Bet" }), _jsx(Table.Heading, { children: "Settled Amount" }), _jsx(Table.Heading, { children: "Jackpot Contribution" }), _jsx(Table.Heading, { children: "Jackpot Payout" }), _jsx(Table.Heading, { children: "Bet Status" }), _jsx(Table.Heading, { children: "Game Name" }), _jsx(Table.Heading, { children: "Vendor Round ID" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsxs(Table.Cell, { className: "!py-1", children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeCreated, 'MM/dd/yyyy', {
|
|
158
158
|
in: tz(localeInfo.timezone),
|
|
159
159
|
}) }), _jsx("div", { className: "text-text-tertiary-600 leading-tight", children: format(data.dateTimeCreated, 'hh:mm a', {
|
|
160
160
|
in: tz(localeInfo.timezone),
|
|
@@ -183,7 +183,7 @@ export function BetRecords__client(props) {
|
|
|
183
183
|
? 'blue'
|
|
184
184
|
: 'danger', children: _jsx(Badge.Label, { children: capitalize(data.status, {
|
|
185
185
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
186
|
-
}) }) }) }), _jsx(Table.Cell, { className: "!py-1", children: data.game.name }), _jsx(Table.Cell, { className: "!py-1", children: data.vendorRoundId })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700
|
|
186
|
+
}) }) }) }), _jsx(Table.Cell, { className: "!py-1", children: data.game.name }), _jsx(Table.Cell, { className: "!py-1", children: data.vendorRoundId })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "font-medium text-sm text-text-secondary-700", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
|
|
187
187
|
}
|
|
188
188
|
const statusCollection = createListCollection({
|
|
189
189
|
items: ['SETTLED', 'NOT_SETTLED'],
|
|
@@ -231,5 +231,5 @@ function RangeDatePickerCalendar({ monthOffset }) {
|
|
|
231
231
|
const offset = datePicker.getOffset({
|
|
232
232
|
months: monthOffset,
|
|
233
233
|
});
|
|
234
|
-
return (_jsxs(DatePicker.View, { view: "day", className: "border-border-secondary px-6 py-5 lg:first:border-r", children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx("span", { className: "text-text-secondary-700
|
|
234
|
+
return (_jsxs(DatePicker.View, { view: "day", className: "border-border-secondary px-6 py-5 lg:first:border-r", children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx("span", { className: "font-semibold text-base text-text-secondary-700", children: offset.visibleRangeText.start }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: datePicker.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.slice(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: offset.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, visibleRange: offset.visibleRange, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] }));
|
|
235
235
|
}
|
|
@@ -26,9 +26,9 @@ export function Bonus__client(props) {
|
|
|
26
26
|
return null;
|
|
27
27
|
const turnoverRequirement = parseDecimal(bonus.turnoverRequirement, 0);
|
|
28
28
|
const currentTurnoverRequirementContribution = parseDecimal(bonus.currentTurnoverRequirementContribution, 0);
|
|
29
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/rewards', className: "
|
|
29
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/rewards', className: "flex items-center gap-lg font-semibold text-button-tertiary-fg text-lg", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Rewards"] }), _jsx("div", { className: "mt-3xl", children: bonus.promo.banner?.url ? (_jsx(Image, { src: bonus.promo.banner.url, alt: "", width: 1024, height: 600, unoptimized: true, priority: true, className: "h-auto w-full rounded-xl" })) : (_jsx(DefaultImage, {})) }), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'brand-dark', className: "mt-xl lg:mt-6", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.expired ? 'Expired' : remainingTime.toString() })] }), _jsx("h1", { className: "mt-xl font-semibold text-2xl text-text-primary-900 lg:mt-6 lg:text-3xl", children: bonus.promo.name }), _jsx("p", { className: "mt-xl text-base text-text-primary-brand lg:mt-6 lg:text-lg", children: "Complete the wagering before time runs out to convert your bonus balance into real money!" }), _jsxs("div", { className: "mt-xl flex items-center justify-between rounded-md border border-border-primary bg-bg-tertiary px-3.5 py-xl text-text-secondary-700 lg:mt-6", children: [_jsx("p", { children: "Your bonus balance" }), _jsx("p", { children: _jsx("span", { className: "text-text-primary-900", children: formatNumber(bonus.balance, {
|
|
30
30
|
currency: localeInfo.currency.code,
|
|
31
|
-
}) }) })] }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary
|
|
31
|
+
}) }) })] }), _jsxs("div", { className: "mt-xl rounded-md border border-border-primary bg-bg-tertiary px-3.5 py-xl text-text-secondary-700 lg:mt-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("p", { children: ["Wagering ", bonus.currentTurnoverRequirementContributionPercentage, "%"] }), _jsxs("p", { children: [currentTurnoverRequirementContribution, "/", turnoverRequirement] })] }), _jsx(Progress.Root, { className: "mt-2", min: 0, max: turnoverRequirement, value: clamp(currentTurnoverRequirementContribution, 0, turnoverRequirement), children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] }), _jsxs(Collapsible.Root, { className: "mt-xl lg:mt-6", children: [_jsxs(Collapsible.Trigger, { className: "flex items-center gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["Game Provider Contribution", _jsx(Collapsible.Indicator, { asChild: true, children: _jsx(ChevronRightIcon, { className: "size-5" }) })] }), _jsx(Collapsible.Content, { className: "mt-xl space-y-1.5 rounded-md border border-border-primary bg-bg-tertiary px-3.5 py-xl text-text-secondary-700 lg:mt-6", children: Object.entries(bonus.promo
|
|
32
32
|
.turnoverRequirementContributionPercentagePerGameProvider ?? {}).map(([provider, valueAsString]) => {
|
|
33
33
|
const value = parseDecimal(valueAsString, 0);
|
|
34
34
|
return (_jsxs("div", { className: "flex items-center justify-between gap-md", children: [_jsx("p", { className: "w-[11.25rem] shrink-0", children: capitalize(provider, {
|
|
@@ -62,7 +62,7 @@ export function Bonuses__client(props) {
|
|
|
62
62
|
});
|
|
63
63
|
const bonuses = bonusesQuery.data ?? [];
|
|
64
64
|
const cashbackBonuses = cashbackBonusesQuery.data ?? [];
|
|
65
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-lg
|
|
65
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Rewards' }), _jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
|
|
66
66
|
setTab(TabSchema.parse(details.value));
|
|
67
67
|
}, className: "mt-3", children: [_jsxs(SegmentGroup.Item, { value: "all", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "active", children: [_jsx(SegmentGroup.ItemText, { children: "Active" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "cashbacks", children: [_jsx(SegmentGroup.ItemText, { children: "Cashbacks" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(SegmentGroup.Indicator, {})] }), _jsxs("div", { className: "mt-3xl grid gap-3xl lg:mt-lg lg:grid-cols-3", children: [tab === 'all' && _jsx(SpotBonus, {}), tab !== 'cashbacks' &&
|
|
68
68
|
bonuses.map((bonus) => (_jsx(Bonus, { data: bonus, viewDetailsUrl: props.viewBonusDetailsUrl ?? '/rewards' }, bonus.id))), cashbackBonuses.map((cashbackBonus) => (_jsx(CashbackBonus, { data: cashbackBonus }, cashbackBonus.id)))] })] }), _jsx(ClaimSpotBonus, {})] }));
|
|
@@ -74,11 +74,11 @@ function Bonus(props) {
|
|
|
74
74
|
const remainingTime = useRemainingTime(bonus.expiration);
|
|
75
75
|
const currentTurnoverRequirementContributionPercentage = parseDecimal(bonus.currentTurnoverRequirementContributionPercentage, 0);
|
|
76
76
|
const turnoverRequirement = parseDecimal(bonus.turnoverRequirement, 0);
|
|
77
|
-
return (_jsxs("div", { className: "
|
|
77
|
+
return (_jsxs("div", { className: "flex flex-col overflow-hidden rounded-2xl border border-border-primary bg-bg-tertiary", children: [_jsxs("div", { className: "relative", children: [promo.banner?.url ? (_jsx(Image, { src: promo.banner.url, alt: "", width: 400, height: 200, className: "h-[11.25rem] w-full object-cover" })) : (_jsx("div", { style: {
|
|
78
78
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
79
|
-
}, children: _jsx(Image, { src: piggyBank, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'gray', className: "absolute
|
|
79
|
+
}, children: _jsx(Image, { src: piggyBank, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'gray', className: "absolute top-4 right-4", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.expired ? 'Expired' : remainingTime.toString() })] })] }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("h2", { className: "line-clamp-1 text-center font-semibold text-white text-xl", children: promo.name }), _jsx("div", { className: "mt-2 flex items-baseline justify-center gap-2", children: _jsx("p", { className: "font-semibold text-3xl leading-none", children: formatNumber(bonus.balance, {
|
|
80
80
|
currency: localeInfo.currency.code,
|
|
81
|
-
}) }) }), _jsxs("div", { className: "
|
|
81
|
+
}) }) }), _jsxs("div", { className: "mt-md flex justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Wagering ", currentTurnoverRequirementContributionPercentage, "%"] }), _jsxs("p", { children: [bonus.currentTurnoverRequirementContribution, "/", turnoverRequirement] })] }), _jsx(Progress.Root, { min: 0, max: 100, value: clamp(currentTurnoverRequirementContributionPercentage, 0, 100), className: "mt-2", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", variant: "outline", className: "mt-6", asChild: true, children: _jsx(Link, { href: `${props.viewDetailsUrl}/${bonus.id}`, children: "See More" }) })] })] }));
|
|
82
82
|
}
|
|
83
83
|
function CashbackBonus(props) {
|
|
84
84
|
const bonus = props.data;
|
|
@@ -111,15 +111,15 @@ function CashbackBonus(props) {
|
|
|
111
111
|
const disabled = hasNoCashback ||
|
|
112
112
|
hasReachedOrExceededMonthlyLimit ||
|
|
113
113
|
belowMinimumCashbackThreshold;
|
|
114
|
-
return (_jsxs("div", { className: "
|
|
114
|
+
return (_jsxs("div", { className: "flex flex-col overflow-hidden rounded-2xl border border-border-primary bg-bg-tertiary", children: [cashback.banner?.url ? (_jsx(Image, { src: cashback.banner.url, alt: "", width: 400, height: 200, className: "h-[11.25rem] w-full object-cover" })) : (_jsx("div", { style: {
|
|
115
115
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
116
|
-
}, children: _jsx(Image, { src: moneyOnHand, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "line-clamp-1 text-center
|
|
116
|
+
}, children: _jsx(Image, { src: moneyOnHand, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "line-clamp-1 text-center font-semibold text-white text-xl", children: cashback.name }), _jsx("h2", { className: "mt-2 text-center font-semibold text-3xl text-white", children: formatNumber(currentAccumulatedCashbackAmount, {
|
|
117
117
|
currency: localeInfo.currency.code,
|
|
118
|
-
}) }), _jsx("div", { className: "
|
|
118
|
+
}) }), _jsx("div", { className: "mt-2 line-clamp-1 text-center text-sm text-text-secondary-700", dangerouslySetInnerHTML: {
|
|
119
119
|
__html: cashback.description,
|
|
120
120
|
} }), _jsx("div", { className: "grow" }), disabled ? (_jsxs(Popover.Root, { lazyMount: true, unmountOnExit: true, positioning: {
|
|
121
121
|
placement: 'top',
|
|
122
|
-
}, children: [_jsx(Button, { size: "sm", className: "mt-6", "aria-disabled": true, asChild: true, children: _jsx(Popover.Trigger, { children: "Claim" }) }), _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "bg-bg-quaternary
|
|
122
|
+
}, children: [_jsx(Button, { size: "sm", className: "mt-6", "aria-disabled": true, asChild: true, children: _jsx(Popover.Trigger, { children: "Claim" }) }), _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "rounded-md bg-bg-quaternary px-2.5 py-2 font-medium text-sm", children: [_jsx(Popover.Arrow, { className: "arrow-bg-bg-quaternary arrow-size-3", children: _jsx(Popover.ArrowTip, {}) }), hasReachedOrExceededMonthlyLimit ? (_jsx(_Fragment, { children: "You've claimed the maximum cashback for this month." })) : (_jsxs(_Fragment, { children: ["You need", ' ', formatNumber(minimumCashback - currentAccumulatedCashbackAmount, {
|
|
123
123
|
currency: localeInfo.currency.code,
|
|
124
124
|
}), ' ', "to claim this cashback."] }))] }) })] })) : (_jsx(Button, { size: "sm", className: "mt-6", disabled: claimCashbackBonusMutation.isPending || disabled, onClick: () => {
|
|
125
125
|
claimCashbackBonusMutation.mutate(bonus.id);
|
|
@@ -129,9 +129,9 @@ function SpotBonus() {
|
|
|
129
129
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
130
130
|
spotBonus: ctx.spotBonus,
|
|
131
131
|
})));
|
|
132
|
-
return (_jsxs("div", { className: "
|
|
132
|
+
return (_jsxs("div", { className: "flex flex-col overflow-hidden rounded-2xl border border-border-primary bg-bg-tertiary", children: [_jsx("div", { style: {
|
|
133
133
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
134
|
-
}, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[11.25rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "text-center
|
|
134
|
+
}, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[11.25rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "text-center font-semibold text-white text-xl", children: "Special Rewards" }), _jsx("p", { className: "mt-2 text-center font-semibold text-3xl text-white", children: "Promo Code" }), _jsx("p", { className: "mt-2 text-center text-sm text-text-secondary-700", children: "Have a promo code? Don\u2019t miss out, redeem it now\u00A0and\u00A0enjoy exclusive rewards!" }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", onClick: () => {
|
|
135
135
|
globalStore.spotBonus.setOpen(true);
|
|
136
136
|
}, className: "mt-6", children: "Enter Promo Code" })] })] }));
|
|
137
137
|
}
|
|
@@ -20,5 +20,5 @@ export function BonusesTrigger({ children, className, ...props }) {
|
|
|
20
20
|
size: 'sm',
|
|
21
21
|
colorScheme: 'gray',
|
|
22
22
|
className: twMerge('relative', className),
|
|
23
|
-
}), children: children ?? (_jsxs(_Fragment, { children: [totalCount > 0 && (_jsx("div", { className: "
|
|
23
|
+
}), children: children ?? (_jsxs(_Fragment, { children: [totalCount > 0 && (_jsx("div", { className: "-right-1.5 -top-1.5 absolute min-w-5 rounded-full border bg-brand-500 px-1.5 font-semibold text-2xs text-button-primary-fg leading-4.5", children: totalCount })), _jsx(Gift01Icon, {})] })) }));
|
|
24
24
|
}
|
|
@@ -47,7 +47,7 @@ export function ClaimSpotBonus() {
|
|
|
47
47
|
background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
|
|
48
48
|
}, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[12.5rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("form", { className: "mt-3xl", onSubmit: form.handleSubmit((data) => {
|
|
49
49
|
claimSpotBonusMutation.mutate(data.code);
|
|
50
|
-
}), children: [_jsx("h2", { className: "text-center text-lg
|
|
50
|
+
}), children: [_jsx("h2", { className: "text-center font-semibold text-lg", children: "Enter Promo Code" }), _jsx("p", { className: "mt-xs text-center text-sm text-text-tertiary-600", children: "Claim your reward by entering a promo or gift code!" }), _jsxs(Field.Root, { invalid: !!form.formState.errors.code, className: "mt-2xl", children: [_jsx(Field.Input, { size: "sm", placeholder: "Enter promo code", ...form.register('code') }), _jsx(Field.ErrorText, { children: form.formState.errors.code?.message })] }), _jsxs("div", { className: "mt-4xl flex gap-lg", children: [_jsx(Button, { variant: "outline", onClick: () => {
|
|
51
51
|
globalStore.spotBonus.setOpen(false);
|
|
52
52
|
form.reset();
|
|
53
53
|
}, disabled: claimSpotBonusMutation.isPending, children: "Cancel" }), _jsx(Button, { type: "submit", disabled: claimSpotBonusMutation.isPending, children: "Claim" })] })] })] }) })] }) }));
|
|
@@ -24,10 +24,10 @@ export function Cashback__client(props) {
|
|
|
24
24
|
})));
|
|
25
25
|
if (!cashback)
|
|
26
26
|
return null;
|
|
27
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "
|
|
27
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "flex w-fit items-center gap-lg font-semibold text-button-tertiary-fg text-lg", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), cashback.banner?.url && (_jsx(Image, { src: cashback.banner.url, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" })), claimable && (_jsx(Button, { className: "mt-xl lg:mt-6", onClick: () => {
|
|
28
28
|
globalStore.depositWithdrawal.setOpen(true);
|
|
29
29
|
globalStore.depositWithdrawal.setPromo(cashback.id);
|
|
30
|
-
}, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl text-2xl
|
|
30
|
+
}, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl font-semibold text-2xl lg:mt-6 lg:text-3xl", children: cashback.name }), _jsxs("p", { className: "mt-xl text-text-secondary-700 lg:mt-6", children: ["Ends", ' ', format(cashback.activationEndDateTime, 'MM/dd/yyy hh:mm:ss a', {
|
|
31
31
|
in: tz(localeInfo.timezone),
|
|
32
32
|
})] }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
|
|
33
33
|
__html: cashback.description,
|
|
@@ -6,7 +6,7 @@ import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
|
6
6
|
import { Prose } from '../../ui/Prose/index.js';
|
|
7
7
|
import { stripTags } from '../../utils/stripTags.js';
|
|
8
8
|
export async function CustomPromo(props) {
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "flex w-fit items-center gap-lg font-semibold text-button-tertiary-fg text-lg", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl font-semibold text-2xl lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
|
|
10
10
|
__html: props.promo.description,
|
|
11
11
|
} })] })] }));
|
|
12
12
|
}
|
|
@@ -27,7 +27,7 @@ export function AvailablePromos(props) {
|
|
|
27
27
|
setValue(value ?? null);
|
|
28
28
|
}, className: props.className, children: [_jsx(Select.Label, { children: "Choose a bonus" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, { placeholder: "Pay without bonus" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
29
29
|
e.stopPropagation();
|
|
30
|
-
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Select.Positioner, { children: _jsxs(Select.Content, { children: [collection.items.length <= 0 && (_jsxs("div", { className: "p-2", children: [_jsx(Image, { src: gift, alt: "", width: 160, height: 160, className: "mx-auto size-[8.313rem] grayscale" }), _jsx("p", { className: "
|
|
30
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Select.Positioner, { children: _jsxs(Select.Content, { children: [collection.items.length <= 0 && (_jsxs("div", { className: "p-2", children: [_jsx(Image, { src: gift, alt: "", width: 160, height: 160, className: "mx-auto size-[8.313rem] grayscale" }), _jsx("p", { className: "mx-auto mt-1 max-w-[20rem] text-center text-sm text-text-tertiary-600", children: "No Bonuses are available at the moment. Please check back later!" })] })), collection.items.length > 0 && (_jsx(Select.ItemGroup, { children: collection.items.map((promo) => (_jsxs(Select.Item, { item: promo, children: [_jsxs(Select.ItemText, { children: [_jsx("span", { className: "block font-medium", children: promo.name }), _jsx("span", { className: "line-clamp-1 text-text-warning-primary-600", dangerouslySetInnerHTML: {
|
|
31
31
|
__html: promo.description,
|
|
32
32
|
} })] }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, promo.id))) }))] }) })] }));
|
|
33
33
|
}
|