@opexa/portal-components 0.0.289 → 0.0.290
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/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/News/News.js +1 -1
- package/dist/components/PortalProvider/FeatureFlag.js +1 -1
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Quests/JourneyQuest.d.ts +1 -0
- package/dist/components/Quests/JourneyQuest.js +61 -0
- package/dist/components/Quests/Quests.client.js +2 -0
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/constants/GameProvider.d.ts +1 -1
- package/dist/constants/GameProvider.js +1 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +55 -55
- package/dist/ui/Dialog/dialog.recipe.d.ts +5 -5
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/package.json +1 -1
- package/dist/client/hooks/index.d.ts +0 -65
- package/dist/client/hooks/index.js +0 -65
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
- package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
- package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
- package/dist/components/CashbackBonus/index.d.ts +0 -1
- package/dist/components/CashbackBonus/index.js +0 -1
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
- package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
- package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
- package/dist/components/Disclaimer/TermsOfUse.js +0 -13
- package/dist/components/Empty.d.ts +0 -9
- package/dist/components/Empty.js +0 -7
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/InfiniteScroll.d.ts +0 -10
- package/dist/components/InfiniteScroll.js +0 -25
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -93
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -45
- package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/KYC/CaptureIdDocument.js +0 -219
- package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/KYC/CaptureSelfie.js +0 -285
- package/dist/components/KYC/DisplayImage.d.ts +0 -5
- package/dist/components/KYC/DisplayImage.js +0 -8
- package/dist/components/KYC/FileUpload.d.ts +0 -10
- package/dist/components/KYC/FileUpload.js +0 -72
- package/dist/components/KYC/Header.d.ts +0 -1
- package/dist/components/KYC/Header.js +0 -8
- package/dist/components/KYC/NoCameraError.d.ts +0 -7
- package/dist/components/KYC/NoCameraError.js +0 -6
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -13
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -13
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -13
- package/dist/components/KYC/Step4.d.ts +0 -1
- package/dist/components/KYC/Step4.js +0 -7
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/KYC/utils.d.ts +0 -9
- package/dist/components/KYC/utils.js +0 -79
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -34
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Messages/MessageItem.js +0 -34
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -19
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Promo/PromoContent.d.ts +0 -2
- package/dist/components/Promo/PromoContent.js +0 -9
- package/dist/components/Promos/PromoCarousel.d.ts +0 -2
- package/dist/components/Promos/PromoCarousel.js +0 -41
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -12
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -10
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -314
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpForm.js +0 -288
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
- package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -72
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -33
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/constants/endpoints.d.ts +0 -10
- package/dist/constants/endpoints.js +0 -41
- package/dist/constants/envVars.d.ts +0 -5
- package/dist/constants/envVars.js +0 -28
- package/dist/constants/gameProviders.d.ts +0 -76
- package/dist/constants/gameProviders.js +0 -361
- package/dist/constants/gameTypes.d.ts +0 -3
- package/dist/constants/gameTypes.js +0 -64
- package/dist/constants/headerKeys.d.ts +0 -2
- package/dist/constants/headerKeys.js +0 -2
- package/dist/constants/secretQuestions.d.ts +0 -3
- package/dist/constants/secretQuestions.js +0 -24
- package/dist/constants/storageKeys.d.ts +0 -2
- package/dist/constants/storageKeys.js +0 -2
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/icons/index.d.ts +0 -65
- package/dist/icons/index.js +0 -65
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -29
- package/dist/server/utils/index.js +0 -29
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +0 -1
- package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
- package/dist/third-parties/FacebookPixel/index.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
- package/dist/third-parties/index.d.ts +0 -2
- package/dist/third-parties/index.js +0 -2
- package/dist/ui/Presence.d.ts +0 -2
- package/dist/ui/Presence.js +0 -7
- package/dist/ui/Prose.d.ts +0 -2
- package/dist/ui/Prose.js +0 -5
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/createErrorFromCode.d.ts +0 -2
- package/dist/utils/createErrorFromCode.js +0 -11
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
- package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
- package/dist/utils/getGameName.d.ts +0 -1
- package/dist/utils/getGameName.js +0 -6
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -17
- package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
- package/dist/utils/isBetween3amAnd3pm.js +0 -5
- package/dist/utils/isMobile.d.ts +0 -5
- package/dist/utils/isMobile.js +0 -9
- package/dist/utils/resizeImageSize.d.ts +0 -1
- package/dist/utils/resizeImageSize.js +0 -6
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// useJackpotItemData.ts
|
|
3
|
-
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { useLocaleInfo } from '../../client/hooks/index.js';
|
|
6
|
-
import { useJackpotPayoutsQuery } from '../../client/hooks/useJackpotPayoutsQuery.js';
|
|
7
|
-
import { GAME_PROVIDER_DATA } from '../../constants/index.js';
|
|
8
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '../../icons/index.js';
|
|
9
|
-
import styles from '../JackpotCounter/JackpotCounterItem.module.css';
|
|
10
|
-
import { useJackpotContext, useJackpotsPropsContext } from './JackpotsContext.js';
|
|
11
|
-
export function useJackpotData() {
|
|
12
|
-
const jackpotsProps = useJackpotsPropsContext();
|
|
13
|
-
const jackpot = useJackpotContext();
|
|
14
|
-
const gameProviders = jackpotsProps.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
|
|
15
|
-
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
16
|
-
first: 30,
|
|
17
|
-
filter: {
|
|
18
|
-
jackpot: {
|
|
19
|
-
equal: jackpot.id,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
sort: {
|
|
23
|
-
cursor: 'AMOUNT',
|
|
24
|
-
order: 'DESC',
|
|
25
|
-
},
|
|
26
|
-
}, {
|
|
27
|
-
enabled: typeof window !== 'undefined',
|
|
28
|
-
});
|
|
29
|
-
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
30
|
-
const topJackpotPayout = jackpotPayouts[0] ?? [];
|
|
31
|
-
const enabledJackpotGameProviders = useMemo(() => {
|
|
32
|
-
const gameProvider = Object.entries(jackpot?.jackpotTurnoverContributionPercentagePerGameProvider ?? {})
|
|
33
|
-
.filter(([, value]) => Number(value) > 0)
|
|
34
|
-
.map(([key]) => key);
|
|
35
|
-
return gameProvider;
|
|
36
|
-
}, [jackpot]);
|
|
37
|
-
const filteredGameProviders = gameProviders.filter((provider) => enabledJackpotGameProviders.includes(provider.id));
|
|
38
|
-
const localeInfo = useLocaleInfo();
|
|
39
|
-
const isPayingOut = jackpot.drawing;
|
|
40
|
-
const jackpotAmount = isPayingOut
|
|
41
|
-
? jackpot.maximumJackpotPoolLimit
|
|
42
|
-
: jackpot.pool;
|
|
43
|
-
const Arrow = useCallback(({ index }) => {
|
|
44
|
-
const Icon = isPayingOut ? ChevronLeftIcon : ChevronRightIcon;
|
|
45
|
-
return (_jsx(Icon, { className: twMerge('scale-400 lg:scale-250 text-brand-300 min-w-2.5 lg:min-w-4', isPayingOut
|
|
46
|
-
? styles['animate-wave-color-error']
|
|
47
|
-
: styles['animate-wave-color-success']), style: {
|
|
48
|
-
animationDelay: isPayingOut
|
|
49
|
-
? `${(40 - index - 1) * 0.1}s`
|
|
50
|
-
: `${index * 0.1}s`,
|
|
51
|
-
} }));
|
|
52
|
-
}, [isPayingOut]);
|
|
53
|
-
const arrowImages = useMemo(() => Array.from({ length: 40 }, (_, i) => (_jsx(Arrow, { isFirst: i === 0, index: i }, i))), [Arrow]);
|
|
54
|
-
const getAccumulatingJackpotDescription = (part, total) => {
|
|
55
|
-
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
56
|
-
return percentage <= 90
|
|
57
|
-
? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
|
|
58
|
-
: '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
|
|
59
|
-
};
|
|
60
|
-
const starTierStyles = [
|
|
61
|
-
{
|
|
62
|
-
starColor: 'text-yellow-400',
|
|
63
|
-
numberColor: 'text-bg-primary',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
starColor: 'text-utility-gray-700',
|
|
67
|
-
numberColor: 'text-bg-primary',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
starColor: 'text-yellow-700',
|
|
71
|
-
numberColor: 'text-bg-primary',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
starColor: 'text-bg-quaternary',
|
|
75
|
-
numberColor: 'text-text-primary-900',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
starColor: 'text-bg-quaternary',
|
|
79
|
-
numberColor: 'text-text-primary-900',
|
|
80
|
-
},
|
|
81
|
-
];
|
|
82
|
-
return {
|
|
83
|
-
jackpotPayouts,
|
|
84
|
-
topJackpotPayout,
|
|
85
|
-
filteredGameProviders,
|
|
86
|
-
localeInfo,
|
|
87
|
-
isPayingOut,
|
|
88
|
-
jackpotAmount,
|
|
89
|
-
arrowImages,
|
|
90
|
-
getAccumulatingJackpotDescription,
|
|
91
|
-
starTierStyles,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Jackpot } from '@opexa/portal-sdk-core';
|
|
2
|
-
import type { GameProviderData } from '../../types';
|
|
3
|
-
export interface JackpotItemProps {
|
|
4
|
-
jackpot: Jackpot;
|
|
5
|
-
gameProviders: GameProviderData[];
|
|
6
|
-
}
|
|
7
|
-
export declare function useJackpotItemData({ jackpot, gameProviders, }: JackpotItemProps): {
|
|
8
|
-
jackpotPayouts: import("@opexa/portal-sdk-core").JackpotPayout[];
|
|
9
|
-
topJackpotPayout: import("@opexa/portal-sdk-core").JackpotPayout;
|
|
10
|
-
filteredGameProviders: GameProviderData[];
|
|
11
|
-
localeInfo: import("../../utils").LocaleInfo;
|
|
12
|
-
isPayingOut: boolean;
|
|
13
|
-
jackpotAmount: string;
|
|
14
|
-
arrowImages: import("react/jsx-runtime").JSX.Element[];
|
|
15
|
-
getAccumulatingJackpotDescription: (part: number, total: number) => string;
|
|
16
|
-
starTierStyles: {
|
|
17
|
-
starColor: string;
|
|
18
|
-
numberColor: string;
|
|
19
|
-
}[];
|
|
20
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo } from 'react';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { useLocaleInfo } from '../../client/hooks/index.js';
|
|
5
|
-
import { useJackpotPayoutsQuery } from '../../client/hooks/useJackpotPayoutsQuery.js';
|
|
6
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '../../icons/index.js';
|
|
7
|
-
import styles from '../JackpotCounter/JackpotCounterItem.module.css';
|
|
8
|
-
export function useJackpotItemData({ jackpot, gameProviders, }) {
|
|
9
|
-
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
10
|
-
first: 30,
|
|
11
|
-
filter: {
|
|
12
|
-
jackpot: {
|
|
13
|
-
equal: jackpot.id,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
sort: {
|
|
17
|
-
cursor: 'AMOUNT',
|
|
18
|
-
order: 'DESC',
|
|
19
|
-
},
|
|
20
|
-
}, {
|
|
21
|
-
enabled: typeof window !== 'undefined',
|
|
22
|
-
});
|
|
23
|
-
const jackpotPayouts = jackpotPayoutsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
|
|
24
|
-
const topJackpotPayout = jackpotPayouts[0] ?? [];
|
|
25
|
-
const enabledJackpotGameProviders = useMemo(() => {
|
|
26
|
-
const gameProvider = Object.entries(jackpot?.jackpotTurnoverContributionPercentagePerGameProvider ?? {})
|
|
27
|
-
.filter(([, value]) => Number(value) > 0)
|
|
28
|
-
.map(([key]) => key);
|
|
29
|
-
return gameProvider;
|
|
30
|
-
}, [jackpot]);
|
|
31
|
-
const filteredGameProviders = gameProviders.filter((provider) => enabledJackpotGameProviders.includes(provider.id));
|
|
32
|
-
const localeInfo = useLocaleInfo();
|
|
33
|
-
const isPayingOut = jackpot.drawing;
|
|
34
|
-
const jackpotAmount = isPayingOut
|
|
35
|
-
? jackpot.maximumJackpotPoolLimit
|
|
36
|
-
: jackpot.pool;
|
|
37
|
-
const Arrow = useCallback(({ index }) => {
|
|
38
|
-
const Icon = isPayingOut ? ChevronLeftIcon : ChevronRightIcon;
|
|
39
|
-
return (_jsx(Icon, { className: twMerge('scale-400 lg:scale-250 text-brand-300 min-w-2.5 lg:min-w-4', isPayingOut
|
|
40
|
-
? styles['animate-wave-color-error']
|
|
41
|
-
: styles['animate-wave-color-success']), style: {
|
|
42
|
-
animationDelay: isPayingOut
|
|
43
|
-
? `${(40 - index - 1) * 0.1}s`
|
|
44
|
-
: `${index * 0.1}s`,
|
|
45
|
-
} }));
|
|
46
|
-
}, [isPayingOut]);
|
|
47
|
-
const arrowImages = useMemo(() => Array.from({ length: 40 }, (_, i) => (_jsx(Arrow, { isFirst: i === 0, index: i }, i))), [Arrow]);
|
|
48
|
-
const getAccumulatingJackpotDescription = (part, total) => {
|
|
49
|
-
const percentage = total === 0 ? 0 : (part / total) * 100;
|
|
50
|
-
return percentage <= 90
|
|
51
|
-
? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
|
|
52
|
-
: '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
|
|
53
|
-
};
|
|
54
|
-
const starTierStyles = [
|
|
55
|
-
{
|
|
56
|
-
starColor: 'text-yellow-400',
|
|
57
|
-
numberColor: 'text-bg-primary',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
starColor: 'text-utility-gray-700',
|
|
61
|
-
numberColor: 'text-bg-primary',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
starColor: 'text-yellow-700',
|
|
65
|
-
numberColor: 'text-bg-primary',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
starColor: 'text-bg-quaternary',
|
|
69
|
-
numberColor: 'text-text-primary-900',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
starColor: 'text-bg-quaternary',
|
|
73
|
-
numberColor: 'text-text-primary-900',
|
|
74
|
-
},
|
|
75
|
-
];
|
|
76
|
-
return {
|
|
77
|
-
jackpotPayouts,
|
|
78
|
-
topJackpotPayout,
|
|
79
|
-
filteredGameProviders,
|
|
80
|
-
localeInfo,
|
|
81
|
-
isPayingOut,
|
|
82
|
-
jackpotAmount,
|
|
83
|
-
arrowImages,
|
|
84
|
-
getAccumulatingJackpotDescription,
|
|
85
|
-
starTierStyles,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AutoOpen(): null;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useShallow } from 'zustand/shallow';
|
|
3
|
-
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
4
|
-
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
|
-
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
6
|
-
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
7
|
-
import { KYC_PROMPT_LOCALSTORAGE_KEY } from '../../constants/index.js';
|
|
8
|
-
export function AutoOpen() {
|
|
9
|
-
const kycStore = useGlobalStore(useShallow((ctx) => ctx.kyc));
|
|
10
|
-
const { data: session } = useSessionQuery();
|
|
11
|
-
const { data: account } = useAccountQuery();
|
|
12
|
-
const { data: verification } = useMemberVerificationQuery();
|
|
13
|
-
const isBasicInfoCompleted = account?.realName !== null && account?.birthDay !== null;
|
|
14
|
-
const isUploadCompleted = verification &&
|
|
15
|
-
verification.idFrontImage !== null &&
|
|
16
|
-
verification.selfieImage !== null;
|
|
17
|
-
const isRejected = Boolean(verification?.status === 'REJECTED');
|
|
18
|
-
const step = !isBasicInfoCompleted
|
|
19
|
-
? 1
|
|
20
|
-
: isRejected
|
|
21
|
-
? 2
|
|
22
|
-
: isUploadCompleted
|
|
23
|
-
? 3
|
|
24
|
-
: 2;
|
|
25
|
-
const shouldOpen = !account?.realName ||
|
|
26
|
-
!account?.birthDay ||
|
|
27
|
-
!verification ||
|
|
28
|
-
verification.status === 'REJECTED' ||
|
|
29
|
-
verification.status === 'UNVERIFIED';
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (session?.status == 'authenticated' &&
|
|
32
|
-
!kycStore['~touched'] &&
|
|
33
|
-
shouldOpen &&
|
|
34
|
-
localStorage.getItem(KYC_PROMPT_LOCALSTORAGE_KEY) == null) {
|
|
35
|
-
kycStore.setOpen(true);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
}, [kycStore, session?.status, shouldOpen]);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (step) {
|
|
41
|
-
kycStore.setStep(step);
|
|
42
|
-
}
|
|
43
|
-
}, [kycStore, step]);
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CaptureIdDocument(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { useUploadImageFileMutation } from '../../client/hooks/useUploadImageFileMutation.js';
|
|
6
|
-
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
7
|
-
import { Camera01Icon } from '../../icons/Camera01Icon.js';
|
|
8
|
-
import { CheckCircleIcon } from '../../icons/CheckCircleIcon.js';
|
|
9
|
-
import { XIcon } from '../../icons/XIcon.js';
|
|
10
|
-
import { Button } from '../../ui/Button/index.js';
|
|
11
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
12
|
-
import { useKYCContext } from './KYCContext.js';
|
|
13
|
-
import NoCameraError from './NoCameraError.js';
|
|
14
|
-
import { cameraErrorDescriptions, dataURLtoBlob, resizeFile, showPermissionInstructions, } from './utils.js';
|
|
15
|
-
export function CaptureIdDocument() {
|
|
16
|
-
const kyc = useKYCContext();
|
|
17
|
-
const { mutate, isPending } = useUploadImageFileMutation();
|
|
18
|
-
const [videoStream, setVideoStream] = useState(null);
|
|
19
|
-
const [cameraError, setCameraError] = useState(null);
|
|
20
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
21
|
-
const [selectedImage, setSelectedImage] = useState(null);
|
|
22
|
-
const [captureInProgress, setCaptureInProgress] = useState(false);
|
|
23
|
-
const [proccessImageCanvas, setProccessImageCanvas] = useState(null);
|
|
24
|
-
const videoElement = useRef(null);
|
|
25
|
-
const containerRef = useRef(null);
|
|
26
|
-
function stopCamera() {
|
|
27
|
-
if (videoStream) {
|
|
28
|
-
videoStream.getTracks().forEach((track) => track.stop());
|
|
29
|
-
setVideoStream(null);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
return () => {
|
|
34
|
-
stopCamera();
|
|
35
|
-
};
|
|
36
|
-
}, [videoStream]);
|
|
37
|
-
async function startCamera() {
|
|
38
|
-
try {
|
|
39
|
-
setIsLoading(true);
|
|
40
|
-
setCameraError(null);
|
|
41
|
-
setCaptureInProgress(true);
|
|
42
|
-
console.log('Starting camera...');
|
|
43
|
-
const stream = await navigator.mediaDevices.getUserMedia({
|
|
44
|
-
video: {
|
|
45
|
-
facingMode: 'environment',
|
|
46
|
-
aspectRatio: 16 / 9,
|
|
47
|
-
width: { ideal: 1920, max: 1920 },
|
|
48
|
-
height: { ideal: 1080, max: 1080 },
|
|
49
|
-
frameRate: {
|
|
50
|
-
ideal: 30,
|
|
51
|
-
max: 60,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
audio: false,
|
|
55
|
-
});
|
|
56
|
-
// Set the stream directly to the video element
|
|
57
|
-
if (videoElement.current) {
|
|
58
|
-
videoElement.current.srcObject = stream;
|
|
59
|
-
videoElement.current.onloadedmetadata = () => {
|
|
60
|
-
console.log('Video metadata loaded, starting playback...');
|
|
61
|
-
videoElement.current
|
|
62
|
-
?.play()
|
|
63
|
-
.then(() => {
|
|
64
|
-
setVideoStream(stream);
|
|
65
|
-
setIsLoading(false);
|
|
66
|
-
})
|
|
67
|
-
.catch(() => {
|
|
68
|
-
setCameraError('Failed to start camera stream. Please try again.');
|
|
69
|
-
setIsLoading(false);
|
|
70
|
-
// Stop the stream if playback fails
|
|
71
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
videoElement.current.onerror = (err) => {
|
|
75
|
-
console.error('Video element error:', err);
|
|
76
|
-
setCameraError('Video playback error. Please try again.');
|
|
77
|
-
setIsLoading(false);
|
|
78
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
console.error('Video element not available');
|
|
83
|
-
setCameraError('Camera initialization failed. Please try again.');
|
|
84
|
-
setCaptureInProgress(false);
|
|
85
|
-
setIsLoading(false);
|
|
86
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
setIsLoading(false);
|
|
91
|
-
if (error instanceof DOMException) {
|
|
92
|
-
console.error('Error accessing camera:', error.message);
|
|
93
|
-
setCameraError(error.name);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
console.error('Unknown error accessing camera:', error);
|
|
97
|
-
setCameraError('An unknown error occurred. Please check permissions and try again.');
|
|
98
|
-
}
|
|
99
|
-
setCaptureInProgress(false);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function captureAndProcessImage() {
|
|
103
|
-
if (!videoElement.current || !videoStream) {
|
|
104
|
-
console.error('Video element or stream not available for capture');
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const canvas = document.createElement('canvas');
|
|
109
|
-
const parentDiv = document.getElementById('parent');
|
|
110
|
-
canvas.width = parentDiv?.clientWidth || videoElement.current.width;
|
|
111
|
-
canvas.height = parentDiv?.clientHeight || videoElement.current.height;
|
|
112
|
-
const ctx = canvas.getContext('2d');
|
|
113
|
-
if (!ctx) {
|
|
114
|
-
console.error('Could not get 2D context for canvas');
|
|
115
|
-
setCameraError('Failed to process image. Please try again.');
|
|
116
|
-
setCaptureInProgress(false);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
ctx.drawImage(videoElement.current, 0, 0, canvas.width, canvas.height);
|
|
120
|
-
const imageSrc = canvas.toDataURL('image/png', 1.0);
|
|
121
|
-
setSelectedImage({ src: imageSrc });
|
|
122
|
-
setCaptureInProgress(false);
|
|
123
|
-
stopCamera();
|
|
124
|
-
const newImg = document.createElement('img');
|
|
125
|
-
newImg.src = imageSrc;
|
|
126
|
-
//@ts-expect-error jscanify is not typed
|
|
127
|
-
const scanner = new jscanify();
|
|
128
|
-
newImg.onload = () => {
|
|
129
|
-
try {
|
|
130
|
-
if (containerRef.current) {
|
|
131
|
-
// containerRef.current.innerHTML = '';
|
|
132
|
-
const paperWidth = parentDiv?.clientWidth || videoElement.current?.videoWidth;
|
|
133
|
-
const paperHeight = parentDiv?.clientHeight || videoElement.current?.videoHeight;
|
|
134
|
-
//@ts-expect-error jscanify is not typed
|
|
135
|
-
const contour = scanner.findPaperContour(cv.imread(newImg));
|
|
136
|
-
const cornerPoints = scanner.getCornerPoints(contour);
|
|
137
|
-
const resultCanvas = scanner.extractPaper(newImg, paperWidth, paperHeight, cornerPoints);
|
|
138
|
-
newImg.className =
|
|
139
|
-
'absolute inset-0 m-auto w-full h-auto md:max-h-[333px] md:max-w-[643px] aspect-video rounded-lg object-contain';
|
|
140
|
-
setProccessImageCanvas(resultCanvas);
|
|
141
|
-
containerRef.current.appendChild(resultCanvas);
|
|
142
|
-
setCaptureInProgress(false);
|
|
143
|
-
setSelectedImage({ src: resultCanvas.toDataURL('image/png') });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.error('Error processing image:', error);
|
|
148
|
-
setCameraError('Failed to process image. Please try again.');
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
newImg.onerror = () => {
|
|
152
|
-
console.error('Error loading image');
|
|
153
|
-
setCameraError('NoIdDetectedError');
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
console.error('Error capturing image:', error);
|
|
158
|
-
setCameraError('NoIdDetectedError');
|
|
159
|
-
setCaptureInProgress(false);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
async function uploadPhoto() {
|
|
163
|
-
if (!proccessImageCanvas) {
|
|
164
|
-
console.error('Failed to process the image. Please try again.');
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const blob = proccessImageCanvas.toDataURL('image/png', 1.0);
|
|
168
|
-
const processedBlob = dataURLtoBlob(blob);
|
|
169
|
-
const img = new File([processedBlob], 'frontImage', { type: 'image/jpeg' });
|
|
170
|
-
const resizedImage = (await resizeFile(img));
|
|
171
|
-
if (resizedImage) {
|
|
172
|
-
await mutate({
|
|
173
|
-
file: resizedImage,
|
|
174
|
-
}, {
|
|
175
|
-
onSuccess: (data) => {
|
|
176
|
-
kyc.setFrontImageId(data);
|
|
177
|
-
kyc.setCapturing(null);
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function retakePhoto() {
|
|
183
|
-
setSelectedImage(null);
|
|
184
|
-
setCaptureInProgress(true);
|
|
185
|
-
setCameraError(null);
|
|
186
|
-
if (containerRef.current) {
|
|
187
|
-
const canvas = containerRef.current.querySelector('canvas');
|
|
188
|
-
if (canvas) {
|
|
189
|
-
canvas.width = canvas.width;
|
|
190
|
-
}
|
|
191
|
-
containerRef.current.innerHTML = '';
|
|
192
|
-
}
|
|
193
|
-
if (videoElement.current) {
|
|
194
|
-
videoElement.current.play();
|
|
195
|
-
}
|
|
196
|
-
startCamera();
|
|
197
|
-
}
|
|
198
|
-
function checkCameraPermission() {
|
|
199
|
-
const constraints = { video: true };
|
|
200
|
-
navigator.mediaDevices
|
|
201
|
-
.getUserMedia(constraints)
|
|
202
|
-
.then(() => {
|
|
203
|
-
setCameraError(null);
|
|
204
|
-
startCamera();
|
|
205
|
-
})
|
|
206
|
-
.catch(() => {
|
|
207
|
-
showPermissionInstructions();
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full p-4 lg:w-[640px] lg:px-12 lg:py-4xl", children: [_jsxs("button", { type: "button", className: "flex items-center gap-lg lg:absolute lg:right-5 lg:top-5 lg:p-md", onClick: () => {
|
|
211
|
-
stopCamera();
|
|
212
|
-
kyc.setCapturing(null);
|
|
213
|
-
}, children: [_jsx(XIcon, { className: "text-text-senary-300 hidden size-5 lg:block" }), _jsx(ArrowLeftIcon, { className: "text-text-senary-300 size-5 lg:hidden" }), _jsx("span", { className: "text-lg font-semibold lg:hidden", children: "Back" })] }), _jsx(Dialog.Title, { className: "mt-6 text-center text-lg font-semibold lg:mt-0", children: "Take a Picture of Your Front ID" }), _jsxs(Dialog.Description, { className: "lg:max-w-auto text-text-tertiary-600 mx-auto mt-sm max-w-[19rem] text-center text-sm lg:max-w-full", children: ["Make sure your ID is clearly visible, well-lit, and not blurry.", _jsx("br", { className: "hidden lg:block" }), " Avoid glare or reflections, and ensure all corners are within the frame."] }), _jsx("div", { id: "parent", className: "border-border-disabled mt-6 aspect-video rounded-xl border bg-black lg:mt-8", children: [
|
|
214
|
-
'NotAllowedError',
|
|
215
|
-
'NotReadableError',
|
|
216
|
-
'NotFoundError',
|
|
217
|
-
'NoIdDetectedError',
|
|
218
|
-
].includes(cameraError) ? (_jsx(NoCameraError, { onRetry: checkCameraPermission, title: "Camera Access Required", description: cameraErrorDescriptions[cameraError] })) : captureInProgress ? (_jsxs("div", { className: "relative flex h-fit w-full flex-col items-center justify-center", children: [_jsx("video", { ref: videoElement, autoPlay: true, muted: true, playsInline: true, className: "relative h-[50vh] w-full rounded-lg object-cover md:aspect-video md:max-h-[333px]", width: "100%", height: "100%" }), _jsxs("div", { className: "pointer-events-none absolute inset-0 z-50", children: [_jsx("div", { className: twMerge('absolute inset-0 w-full bg-black/60 backdrop-blur-sm [clip-path:polygon(0%_0%,0%_100%,calc(50%-158px)_100%,calc(50%-158px)_calc(50%-100px),calc(50%+158px)_calc(50%-100px),calc(50%+158px)_calc(50%+100px),calc(50%-158px)_calc(50%+100px),calc(50%-158px)_100%,100%_100%,100%_0%)] md:[clip-path:polygon(0%_0%,0%_100%,calc(50%-225px)_100%,calc(50%-225px)_calc(50%-142px),calc(50%+225px)_calc(50%-142px),calc(50%+225px)_calc(50%+142px),calc(50%-225px)_calc(50%+142px),calc(50%-225px)_100%,100%_100%,100%_0%)]') }), _jsx("div", { className: "absolute inset-0 z-[60] mx-auto flex items-center justify-center", children: _jsx("div", { className: "relative aspect-[1011/638] h-[200px] md:h-[295px] md:w-[450px]", children: _jsx("div", { className: "h-full w-full rounded-lg border-4 border-dashed border-[#B54708]" }) }) })] })] })) : (_jsx("div", { ref: containerRef, className: "relative grid h-full w-full place-items-center rounded-lg object-contain md:max-h-[333px]" })) }), captureInProgress ? (_jsxs(Button, { className: "disabled:bg-bg-disabled disabled:text-text-disabled mx-auto mt-6 px-xl disabled:opacity-100 lg:mt-8 lg:w-fit", onClick: captureAndProcessImage, children: ["Capture Image", _jsx(Camera01Icon, { className: "size-5" })] })) : selectedImage && selectedImage.src ? (_jsxs("div", { className: "mt-4 flex flex-col items-center justify-center gap-2 md:flex-row", children: [_jsxs(Button, { className: "lg:w-fit", type: "button", onClick: retakePhoto, children: ["Retake Photo ", _jsx(Camera01Icon, { className: "ml-1" })] }), _jsxs(Button, { className: "lg:w-fit", type: "button", onClick: uploadPhoto, disabled: isPending, children: ["Use Photo ", _jsx(CheckCircleIcon, { className: "ml-1" })] })] })) : (_jsxs(Button, { className: twMerge('disabled:bg-bg-disabled disabled:text-text-disabled mx-auto mt-6 px-xl disabled:opacity-100 lg:mt-8 lg:w-fit', cameraError && 'hidden'), onClick: startCamera, disabled: isLoading || !!videoStream, children: [isLoading ? 'Starting Camera...' : 'Start Camera', _jsx(Camera01Icon, { className: "size-5" })] }))] }) }));
|
|
219
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CaptureSelfie(): import("react/jsx-runtime").JSX.Element;
|