@opexa/portal-components 0.0.365 → 0.0.367

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/dist/client/hooks/useCellxpertCxd.d.ts +7 -0
  2. package/dist/client/hooks/useCellxpertCxd.js +4 -0
  3. package/dist/client/hooks/useCreateGCashStandardCashInWithdrawal.d.ts +4 -0
  4. package/dist/client/hooks/useCreateGCashStandardCashInWithdrawal.js +28 -0
  5. package/dist/client/hooks/useIdle.d.ts +1 -0
  6. package/dist/client/hooks/useIdle.js +35 -0
  7. package/dist/client/hooks/useIdleLogout.d.ts +4 -0
  8. package/dist/client/hooks/useIdleLogout.js +97 -0
  9. package/dist/client/hooks/useMarkAllMessagesAsReadMutation.d.ts +2 -0
  10. package/dist/client/hooks/useMarkAllMessagesAsReadMutation.js +48 -0
  11. package/dist/client/hooks/useMayaAuth.d.ts +5 -0
  12. package/dist/client/hooks/useMayaAuth.js +22 -0
  13. package/dist/components/ForgotPassword/ForgotPasswordForm.js +1 -1
  14. package/dist/components/IdleLogout/IdleLogout.d.ts +7 -0
  15. package/dist/components/IdleLogout/IdleLogout.js +6 -0
  16. package/dist/components/IdleLogout/index.d.ts +1 -0
  17. package/dist/components/IdleLogout/index.js +1 -0
  18. package/dist/components/Jackpots/Jackpots.module.css +184 -0
  19. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  20. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  21. package/dist/components/KYC/KYCReminder.lazy.js +1 -3
  22. package/dist/components/KYC/KycOpenOnHomeMount.d.ts +1 -0
  23. package/dist/components/KYC/KycOpenOnHomeMount.js +16 -0
  24. package/dist/components/Maya/Maya.d.ts +26 -0
  25. package/dist/components/Maya/Maya.js +90 -0
  26. package/dist/components/Maya/index.d.ts +1 -0
  27. package/dist/components/Maya/index.js +1 -0
  28. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
  29. package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
  30. package/dist/components/PortalProvider/SocialAccountLinkObserver.d.ts +1 -0
  31. package/dist/components/PortalProvider/SocialAccountLinkObserver.js +39 -0
  32. package/dist/components/Quests/MultiWageringQuest.d.ts +1 -0
  33. package/dist/components/Quests/MultiWageringQuest.js +111 -0
  34. package/dist/components/Quests/NoQuests.d.ts +6 -0
  35. package/dist/components/Quests/NoQuests.js +6 -0
  36. package/dist/components/SignIn/MobileNumberSignIn.js +1 -1
  37. package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +1 -1
  38. package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +1 -1
  39. package/dist/components/TopProgress/TopProgressBar.d.ts +6 -0
  40. package/dist/components/TopProgress/TopProgressBar.js +145 -0
  41. package/dist/components/TopProgress/index.d.ts +1 -0
  42. package/dist/components/TopProgress/index.js +1 -0
  43. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  44. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  45. package/dist/components/TransactionRecords/TransactionContext.d.ts +6 -0
  46. package/dist/components/TransactionRecords/TransactionContext.js +2 -0
  47. package/dist/handlers/index.d.ts +7 -7
  48. package/dist/icons/MinusIcon.d.ts +2 -0
  49. package/dist/icons/MinusIcon.js +4 -0
  50. package/dist/icons/NotifExitIcon.d.ts +2 -0
  51. package/dist/icons/NotifExitIcon.js +4 -0
  52. package/dist/images/game-providers/SAGAMING.png +0 -0
  53. package/dist/images/pagcor-round-icon.png +0 -0
  54. package/dist/services/queries.js +2662 -2662
  55. package/dist/styles/theme.css +706 -706
  56. package/dist/ui/Badge/Badge.d.ts +12 -12
  57. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  58. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  59. package/dist/ui/Carousel/Carousel.d.ts +99 -99
  60. package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
  61. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  62. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  63. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  64. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  65. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  66. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  67. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  68. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  69. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  70. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  71. package/dist/ui/Menu/Menu.d.ts +144 -144
  72. package/dist/ui/Menu/menu.recipe.d.ts +8 -8
  73. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  74. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  75. package/dist/ui/Popover/Popover.d.ts +55 -55
  76. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  77. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  78. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  79. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  80. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  81. package/dist/ui/Select/Select.d.ts +45 -45
  82. package/dist/ui/Select/select.recipe.d.ts +3 -3
  83. package/dist/ui/Table/Table.d.ts +21 -21
  84. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  85. package/dist/ui/Table/table.recipe.d.ts +3 -3
  86. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  87. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  88. package/package.json +161 -161
  89. package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
  90. package/dist/components/DigitainLauncher/Loading.js +0 -5
  91. package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
  92. package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
  93. package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
  94. package/dist/components/Disclaimer/TermsOfUse.js +0 -13
  95. package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
  96. package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
  97. package/dist/components/FeatureFlag/index.d.ts +0 -1
  98. package/dist/components/FeatureFlag/index.js +0 -1
  99. package/dist/components/KYC/AutoOpen.d.ts +0 -1
  100. package/dist/components/KYC/AutoOpen.js +0 -40
  101. package/dist/components/KYC/BasicInformation.d.ts +0 -1
  102. package/dist/components/KYC/BasicInformation.js +0 -101
  103. package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
  104. package/dist/components/KYC/CaptureIdDocument.js +0 -219
  105. package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
  106. package/dist/components/KYC/CaptureSelfie.js +0 -285
  107. package/dist/components/KYC/DisplayImage.d.ts +0 -5
  108. package/dist/components/KYC/DisplayImage.js +0 -8
  109. package/dist/components/KYC/FileUpload.d.ts +0 -10
  110. package/dist/components/KYC/FileUpload.js +0 -72
  111. package/dist/components/KYC/IdentityVerification.d.ts +0 -1
  112. package/dist/components/KYC/IdentityVerification.js +0 -120
  113. package/dist/components/KYC/Indicator.d.ts +0 -1
  114. package/dist/components/KYC/Indicator.js +0 -8
  115. package/dist/components/KYC/KYC.lazy.d.ts +0 -6
  116. package/dist/components/KYC/KYC.lazy.js +0 -45
  117. package/dist/components/KYC/KYCContext.d.ts +0 -6
  118. package/dist/components/KYC/KYCContext.js +0 -2
  119. package/dist/components/KYC/NoCameraError.d.ts +0 -7
  120. package/dist/components/KYC/NoCameraError.js +0 -6
  121. package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
  122. package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
  123. package/dist/components/KYC/PersonalInformation.d.ts +0 -1
  124. package/dist/components/KYC/PersonalInformation.js +0 -122
  125. package/dist/components/KYC/backup/Header.d.ts +0 -1
  126. package/dist/components/KYC/backup/Header.js +0 -8
  127. package/dist/components/KYC/backup/Indicator.d.ts +0 -1
  128. package/dist/components/KYC/backup/Indicator.js +0 -9
  129. package/dist/components/KYC/backup/KYC.d.ts +0 -1
  130. package/dist/components/KYC/backup/KYC.js +0 -14
  131. package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
  132. package/dist/components/KYC/backup/KYC.lazy.js +0 -26
  133. package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
  134. package/dist/components/KYC/backup/KYCContext.js +0 -2
  135. package/dist/components/KYC/backup/Step1.d.ts +0 -1
  136. package/dist/components/KYC/backup/Step1.js +0 -13
  137. package/dist/components/KYC/backup/Step2.d.ts +0 -1
  138. package/dist/components/KYC/backup/Step2.js +0 -13
  139. package/dist/components/KYC/backup/Step3.d.ts +0 -1
  140. package/dist/components/KYC/backup/Step3.js +0 -13
  141. package/dist/components/KYC/backup/Step4.d.ts +0 -1
  142. package/dist/components/KYC/backup/Step4.js +0 -7
  143. package/dist/components/KYC/backup/useKYC.d.ts +0 -10
  144. package/dist/components/KYC/backup/useKYC.js +0 -8
  145. package/dist/components/KYC/loadModels.d.ts +0 -1
  146. package/dist/components/KYC/loadModels.js +0 -9
  147. package/dist/components/KYC/useKYC.d.ts +0 -25
  148. package/dist/components/KYC/useKYC.js +0 -38
  149. package/dist/components/KYC/utils.d.ts +0 -9
  150. package/dist/components/KYC/utils.js +0 -79
  151. package/dist/components/Messages/Message.d.ts +0 -1
  152. package/dist/components/Messages/Message.js +0 -35
  153. package/dist/components/Messages/MessageContext.d.ts +0 -6
  154. package/dist/components/Messages/MessageContext.js +0 -2
  155. package/dist/components/Messages/MessagePopup.d.ts +0 -1
  156. package/dist/components/Messages/MessagePopup.js +0 -20
  157. package/dist/components/Messages/MessageTrigger.d.ts +0 -8
  158. package/dist/components/Messages/MessageTrigger.js +0 -19
  159. package/dist/components/Quests/CountdownTimer.d.ts +0 -15
  160. package/dist/components/Quests/CountdownTimer.js +0 -33
  161. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
  162. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
  163. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  164. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  165. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
  166. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
  167. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
  168. package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
  169. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  170. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  171. package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
  172. package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
  173. package/dist/components/SessionWatcher/index.d.ts +0 -1
  174. package/dist/components/SessionWatcher/index.js +0 -1
  175. package/dist/components/SignIn/utils.d.ts +0 -8
  176. package/dist/components/SignIn/utils.js +0 -26
  177. package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
  178. package/dist/components/SignUp/SignUp.lazy.js +0 -18
  179. package/dist/components/SignUp/SignUpContext.d.ts +0 -6
  180. package/dist/components/SignUp/SignUpContext.js +0 -2
  181. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
  182. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
  183. package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
  184. package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
  185. package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
  186. package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -310
  187. package/dist/components/SignUp/SignUpForm.d.ts +0 -1
  188. package/dist/components/SignUp/SignUpForm.js +0 -284
  189. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
  190. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
  191. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
  192. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
  193. package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
  194. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
  195. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
  196. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
  197. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
  198. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
  199. package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
  200. package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
  201. package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
  202. package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
  203. package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
  204. package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
  205. package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
  206. package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
  207. package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
  208. package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
  209. package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
  210. package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
  211. package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
  212. package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
  213. package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
  214. package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
  215. package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
  216. package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
  217. package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
  218. package/dist/components/shared/IdDocumentField.client.js +0 -204
  219. package/dist/components/shared/IdDocumentField.d.ts +0 -2
  220. package/dist/components/shared/IdDocumentField.js +0 -11
  221. package/dist/components/shared/SelfieField.client.d.ts +0 -20
  222. package/dist/components/shared/SelfieField.client.js +0 -327
  223. package/dist/components/shared/SelfieField.d.ts +0 -2
  224. package/dist/components/shared/SelfieField.js +0 -11
  225. package/dist/constants/BranchCode.d.ts +0 -4
  226. package/dist/constants/BranchCode.js +0 -42
  227. package/dist/constants/Branches.d.ts +0 -2
  228. package/dist/constants/Branches.js +0 -42
  229. package/dist/handlers/postTransformIdFrontImage.d.ts +0 -3
  230. package/dist/handlers/postTransformIdFrontImage.js +0 -67
  231. package/dist/handlers/postTransformSelfieImage.d.ts +0 -3
  232. package/dist/handlers/postTransformSelfieImage.js +0 -71
  233. package/dist/handlers.d.ts +0 -43
  234. package/dist/handlers.js +0 -297
  235. package/dist/icons/BellRingIcon.d.ts +0 -2
  236. package/dist/icons/BellRingIcon.js +0 -4
  237. package/dist/images/responsible-gaming-yellow.png +0 -0
  238. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
  239. package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
  240. package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
  241. package/dist/third-parties/FacebookPixel/index.js +0 -1
  242. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
  243. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
  244. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  245. package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
  246. package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
  247. package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
  248. package/dist/third-parties/index.d.ts +0 -2
  249. package/dist/third-parties/index.js +0 -2
  250. package/dist/utils/dataUrlToBlob.d.ts +0 -1
  251. package/dist/utils/dataUrlToBlob.js +0 -11
  252. package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
  253. package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
  254. package/dist/utils/getGameName.d.ts +0 -1
  255. package/dist/utils/getGameName.js +0 -6
  256. package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
  257. package/dist/utils/isBetween3amAnd3pm.js +0 -5
  258. package/dist/utils/resizeImageSize.d.ts +0 -2
  259. package/dist/utils/resizeImageSize.js +0 -11
  260. /package/dist/{third-parties/FacebookPixel/api.d.ts → components/KYCNotRequired/KYCNotRequired.d.ts} +0 -0
  261. /package/dist/{third-parties/FacebookPixel/api.js → components/KYCNotRequired/KYCNotRequired.js} +0 -0
@@ -0,0 +1,7 @@
1
+ export declare function useCellxpertCxd(): [{
2
+ value: string;
3
+ expires: number;
4
+ } | null, import("react").Dispatch<import("react").SetStateAction<{
5
+ value: string;
6
+ expires: number;
7
+ } | null>>, () => void];
@@ -0,0 +1,4 @@
1
+ import { useLocalStorage } from 'usehooks-ts';
2
+ export function useCellxpertCxd() {
3
+ return useLocalStorage('WebPortalCellxpertCxd', null);
4
+ }
@@ -0,0 +1,4 @@
1
+ import type { SetOptional } from "type-fest";
2
+ import { type CreateGCashStandardCashInWithdrawalInput } from "../../services/wallet";
3
+ import type { Mutation } from "../../types";
4
+ export declare const useCreateGCashStandardCashInWithdrawalMutation: Mutation<string, SetOptional<CreateGCashStandardCashInWithdrawalInput, "id">>;
@@ -0,0 +1,28 @@
1
+ import { ObjectId } from "@opexa/object-id";
2
+ import { useMutation } from "@tanstack/react-query";
3
+ import invariant from "tiny-invariant";
4
+ import { ObjectType } from "../../services/ObjectType.js";
5
+ import { createGCashStandardCashInWithdrawal, } from "../../services/wallet.js";
6
+ import { getCreateGCashStandardCashInWithdrawalMutationKey } from "../../utils/mutationKeys.js";
7
+ import { getSession } from "../services/getSession.js";
8
+ export const useCreateGCashStandardCashInWithdrawalMutation = (config) => {
9
+ const mutation = useMutation({
10
+ ...config,
11
+ mutationKey: getCreateGCashStandardCashInWithdrawalMutationKey(),
12
+ mutationFn: async (input) => {
13
+ const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
14
+ const session = await getSession();
15
+ invariant(session.status === "authenticated");
16
+ await createGCashStandardCashInWithdrawal({ ...input, id }, {
17
+ headers: {
18
+ Authorization: `Bearer ${session.token}`,
19
+ ...(session.domain && {
20
+ Domain: session.domain,
21
+ }),
22
+ },
23
+ });
24
+ return id;
25
+ },
26
+ });
27
+ return mutation;
28
+ };
@@ -0,0 +1 @@
1
+ export declare function useIdle(timeout: number): boolean;
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+ import { useCallback, useEffect, useState } from 'react';
3
+ const IDLE_EVENTS = [
4
+ 'scroll',
5
+ 'resize',
6
+ 'keydown',
7
+ 'mousedown',
8
+ 'touchstart',
9
+ 'mousemove',
10
+ ];
11
+ export function useIdle(timeout) {
12
+ const [isIdle, setIsIdle] = useState(false);
13
+ const handleWorkerMessage = useCallback(() => {
14
+ setIsIdle(true);
15
+ }, []);
16
+ useEffect(() => {
17
+ const worker = new Worker('/idle-worker.js');
18
+ worker.onmessage = handleWorkerMessage;
19
+ const handleActivity = () => {
20
+ setIsIdle(false);
21
+ worker.postMessage({ command: 'reset', idleTime: timeout });
22
+ };
23
+ worker.postMessage({ command: 'start', idleTime: timeout });
24
+ for (const event of IDLE_EVENTS) {
25
+ window.addEventListener(event, handleActivity);
26
+ }
27
+ return () => {
28
+ worker.terminate();
29
+ for (const event of IDLE_EVENTS) {
30
+ window.removeEventListener(event, handleActivity);
31
+ }
32
+ };
33
+ }, [timeout, handleWorkerMessage]);
34
+ return isIdle;
35
+ }
@@ -0,0 +1,4 @@
1
+ export declare function useIdleLogout(timer?: number): {
2
+ isIdle: boolean;
3
+ isLoggingOut: boolean;
4
+ };
@@ -0,0 +1,97 @@
1
+ 'use client';
2
+ import { useRouter } from 'next/navigation';
3
+ import { startTransition, useCallback, useEffect, useRef } from 'react';
4
+ import { toaster } from '../utils/toaster.js';
5
+ import { useIdle } from './useIdle.js';
6
+ import { useSessionQuery } from './useSessionQuery.js';
7
+ import { useSignOutMutation } from './useSignOutMutation.js';
8
+ const IDLE_TIMESTAMP_KEY = 'idle-logout-timestamp';
9
+ const DEFAULT_IDLE_TIMER = 1000 * 60 * 15; // 15 minutes
10
+ export function useIdleLogout(timer = DEFAULT_IDLE_TIMER) {
11
+ const router = useRouter();
12
+ const logoutInitiated = useRef(false);
13
+ const isLoggingOut = useRef(false);
14
+ const sessionQuery = useSessionQuery();
15
+ const isIdle = useIdle(timer);
16
+ const signOutMutation = useSignOutMutation({
17
+ onSuccess: () => {
18
+ router.push('/');
19
+ try {
20
+ localStorage.removeItem(IDLE_TIMESTAMP_KEY);
21
+ }
22
+ catch (error) {
23
+ console.error('Error removing idle timestamp:', error);
24
+ }
25
+ logoutInitiated.current = false;
26
+ isLoggingOut.current = false;
27
+ },
28
+ onError: () => {
29
+ isLoggingOut.current = false;
30
+ logoutInitiated.current = false;
31
+ },
32
+ });
33
+ const handleIdleLogout = useCallback(() => {
34
+ if (!isIdle || logoutInitiated.current || isLoggingOut.current) {
35
+ return;
36
+ }
37
+ const isAuthenticated = sessionQuery.data?.status === 'authenticated';
38
+ if (!isAuthenticated) {
39
+ return;
40
+ }
41
+ startTransition(() => {
42
+ try {
43
+ logoutInitiated.current = true;
44
+ isLoggingOut.current = true;
45
+ localStorage.setItem(IDLE_TIMESTAMP_KEY, Date.now().toString());
46
+ signOutMutation.mutate();
47
+ }
48
+ catch (error) {
49
+ console.error('Error during idle logout:', error);
50
+ isLoggingOut.current = false;
51
+ logoutInitiated.current = false;
52
+ }
53
+ });
54
+ }, [isIdle, sessionQuery.data?.status, signOutMutation]);
55
+ useEffect(() => {
56
+ handleIdleLogout();
57
+ }, [handleIdleLogout]);
58
+ useEffect(() => {
59
+ if (sessionQuery.data?.status === 'unauthenticated') {
60
+ logoutInitiated.current = false;
61
+ isLoggingOut.current = false;
62
+ try {
63
+ localStorage.removeItem(IDLE_TIMESTAMP_KEY);
64
+ }
65
+ catch (error) {
66
+ console.error('Error removing idle timestamp:', error);
67
+ }
68
+ }
69
+ }, [sessionQuery.data?.status]);
70
+ useEffect(() => {
71
+ const handleStorageChange = (e) => {
72
+ if (e.key !== IDLE_TIMESTAMP_KEY || !e.newValue) {
73
+ return;
74
+ }
75
+ const isAuthenticated = sessionQuery.data?.status === 'authenticated';
76
+ if (!isAuthenticated || logoutInitiated.current) {
77
+ return;
78
+ }
79
+ try {
80
+ logoutInitiated.current = true;
81
+ router.push('/');
82
+ }
83
+ catch {
84
+ toaster.warning({
85
+ description: 'You have been logged out due to inactivity.',
86
+ });
87
+ window.location.href = '/';
88
+ }
89
+ };
90
+ window.addEventListener('storage', handleStorageChange);
91
+ return () => window.removeEventListener('storage', handleStorageChange);
92
+ }, [router, sessionQuery.data?.status]);
93
+ return {
94
+ isIdle,
95
+ isLoggingOut: isLoggingOut.current,
96
+ };
97
+ }
@@ -0,0 +1,2 @@
1
+ import type { Mutation } from '../../types';
2
+ export declare const useMarkAllMessagesAsReadMutation: Mutation<void, void>;
@@ -0,0 +1,48 @@
1
+ import { useMutation } from '@tanstack/react-query';
2
+ import invariant from 'tiny-invariant';
3
+ import { markAllMessagesAsRead } from '../../services/trigger.js';
4
+ import { getQueryClient } from '../../utils/getQueryClient.js';
5
+ import { getMessagesQueryKey, getUnreadMessagesCountQueryKey, } from '../../utils/queryKeys.js';
6
+ import { getSession } from '../services/getSession.js';
7
+ export const useMarkAllMessagesAsReadMutation = (config) => {
8
+ const queryClient = getQueryClient();
9
+ const mutation = useMutation({
10
+ ...config,
11
+ mutationFn: async () => {
12
+ const session = await getSession();
13
+ invariant(session.status === 'authenticated');
14
+ await markAllMessagesAsRead({
15
+ headers: {
16
+ Authorization: `Bearer ${session.token}`,
17
+ },
18
+ });
19
+ queryClient.setQueriesData({
20
+ queryKey: getMessagesQueryKey(),
21
+ exact: false,
22
+ type: 'all',
23
+ }, (prev) => {
24
+ if (!prev)
25
+ return prev;
26
+ return {
27
+ ...prev,
28
+ pages: prev.pages.map((page) => ({
29
+ ...page,
30
+ edges: page.edges.map((edge) => ({
31
+ ...edge,
32
+ node: {
33
+ ...edge.node,
34
+ markedAsRead: true,
35
+ },
36
+ })),
37
+ })),
38
+ };
39
+ });
40
+ queryClient.setQueriesData({
41
+ queryKey: getUnreadMessagesCountQueryKey(),
42
+ exact: false,
43
+ type: 'all',
44
+ }, () => 0);
45
+ },
46
+ });
47
+ return mutation;
48
+ };
@@ -0,0 +1,5 @@
1
+ export declare function useMayaAuth(): {
2
+ onMaya: boolean;
3
+ setOnMaya: (value: boolean) => void;
4
+ mayaSessIdKey: string;
5
+ };
@@ -0,0 +1,22 @@
1
+ import { useCallback, useEffect, useState } from 'react';
2
+ const mayaSessIdKey = 'mayaSessionId';
3
+ export function useMayaAuth() {
4
+ const [onMaya, setOnMayaState] = useState(false);
5
+ const setOnMaya = useCallback((value) => {
6
+ setOnMayaState(value);
7
+ }, []);
8
+ useEffect(() => {
9
+ const initialValue = !!localStorage.getItem(mayaSessIdKey);
10
+ setOnMayaState(initialValue);
11
+ const handleStorageChange = () => {
12
+ setOnMayaState(!!localStorage.getItem(mayaSessIdKey));
13
+ };
14
+ window.addEventListener('storage', handleStorageChange);
15
+ return () => window.removeEventListener('storage', handleStorageChange);
16
+ }, []);
17
+ return {
18
+ onMaya,
19
+ setOnMaya,
20
+ mayaSessIdKey,
21
+ };
22
+ }
@@ -127,7 +127,7 @@ export function ForgotPasswordForm() {
127
127
  o.field.onChange(details.value);
128
128
  }, onValueComplete: () => {
129
129
  form2Ref.current?.requestSubmit();
130
- }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: resetPasswordMutation.isPending, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "font-semibold text-button-secondary-fg disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
130
+ }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: resetPasswordMutation.isPending, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't receive the code?" }), _jsx("button", { type: "button", className: "font-semibold text-button-secondary-fg disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
131
131
  await sendVerificationCodeMutation.mutateAsync({
132
132
  channel: 'SMS',
133
133
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
@@ -0,0 +1,7 @@
1
+ export interface IdleLogoutProps {
2
+ /**
3
+ * Idle timer in milliseconds before logout. Defaults to 15 minutes (900000 ms).
4
+ */
5
+ timer?: number;
6
+ }
7
+ export declare function IdleLogout({ timer }: IdleLogoutProps): null;
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+ import { useIdleLogout } from '../../client/hooks/useIdleLogout.js';
3
+ export function IdleLogout({ timer }) {
4
+ useIdleLogout(timer);
5
+ return null;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './IdleLogout';
@@ -0,0 +1 @@
1
+ export * from './IdleLogout.js';
@@ -0,0 +1,184 @@
1
+ @keyframes arrow-green-flash {
2
+ 0% {
3
+ color: #abefc6;
4
+ }
5
+ 100% {
6
+ color: #079455;
7
+ }
8
+ }
9
+
10
+ .animate-arrow-green-flash-1 {
11
+ animation: arrow-green-flash 0.4s infinite;
12
+ animation-delay: -0.2s;
13
+ }
14
+
15
+ .animate-arrow-green-flash-2 {
16
+ animation: arrow-green-flash 0.4s infinite;
17
+ animation-delay: -0.1s;
18
+ }
19
+
20
+ .animate-arrow-green-flash-3 {
21
+ animation: arrow-green-flash 0.4s infinite;
22
+ }
23
+
24
+ @keyframes arrow-red-flash {
25
+ 0%,
26
+ 100% {
27
+ color: #f97066;
28
+ }
29
+ 50% {
30
+ color: #fecdca;
31
+ }
32
+ }
33
+
34
+ .animate-arrow-red-flash-1 {
35
+ animation: arrow-red-flash 0.4s infinite;
36
+ }
37
+
38
+ .animate-arrow-red-flash-2 {
39
+ animation: arrow-red-flash 0.4s infinite;
40
+ animation-delay: -0.1s;
41
+ }
42
+
43
+ .animate-arrow-red-flash-3 {
44
+ animation: arrow-red-flash 0.4s infinite;
45
+ animation-delay: -0.2s;
46
+ }
47
+
48
+ /* Animated BG */
49
+ @keyframes rotate {
50
+ to {
51
+ transform: rotate(1turn);
52
+ }
53
+ }
54
+
55
+ .light-rays {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ right: 0;
60
+ bottom: 0;
61
+ overflow: hidden;
62
+
63
+ --first: var(--color-jackpot-rays-primary);
64
+ --second: var(--color-jackpot-rays-secondary);
65
+ }
66
+
67
+ .light-rays::before,
68
+ .light-rays::after {
69
+ content: '';
70
+ position: absolute;
71
+ top: var(--light-rays-top, 150px);
72
+ left: calc(50% - 90px);
73
+ margin: -100vmax;
74
+ width: 200vmax;
75
+ height: 200vmax;
76
+ opacity: 0.6;
77
+ transform-origin: center;
78
+ }
79
+
80
+ .light-rays::before {
81
+ background: conic-gradient(
82
+ var(--first) 0deg 7.2deg,
83
+ var(--second) 7.2deg 14.4deg,
84
+ var(--first) 14.4deg 21.6deg,
85
+ var(--second) 21.6deg 28.8deg,
86
+ var(--first) 28.8deg 36deg,
87
+ var(--second) 36deg 43.2deg,
88
+ var(--first) 43.2deg 50.4deg,
89
+ var(--second) 50.4deg 57.6deg,
90
+ var(--first) 57.6deg 64.8deg,
91
+ var(--second) 64.8deg 72deg,
92
+ var(--first) 72deg 79.2deg,
93
+ var(--second) 79.2deg 86.4deg,
94
+ var(--first) 86.4deg 93.6deg,
95
+ var(--second) 93.6deg 100.8deg,
96
+ var(--first) 100.8deg 108deg,
97
+ var(--second) 108deg 115.2deg,
98
+ var(--first) 115.2deg 122.4deg,
99
+ var(--second) 122.4deg 129.6deg,
100
+ var(--first) 129.6deg 136.8deg,
101
+ var(--second) 136.8deg 144deg,
102
+ var(--first) 144deg 151.2deg,
103
+ var(--second) 151.2deg 158.4deg,
104
+ var(--first) 158.4deg 165.6deg,
105
+ var(--second) 165.6deg 172.8deg,
106
+ var(--first) 172.8deg 180deg,
107
+ var(--second) 180deg 187.2deg,
108
+ var(--first) 187.2deg 194.4deg,
109
+ var(--second) 194.4deg 201.6deg,
110
+ var(--first) 201.6deg 208.8deg,
111
+ var(--second) 208.8deg 216deg,
112
+ var(--first) 216deg 223.2deg,
113
+ var(--second) 223.2deg 230.4deg,
114
+ var(--first) 230.4deg 237.6deg,
115
+ var(--second) 237.6deg 244.8deg,
116
+ var(--first) 244.8deg 252deg,
117
+ var(--second) 252deg 259.2deg,
118
+ var(--first) 259.2deg 266.4deg,
119
+ var(--second) 266.4deg 273.6deg,
120
+ var(--first) 273.6deg 280.8deg,
121
+ var(--second) 280.8deg 288deg,
122
+ var(--first) 288deg 295.2deg,
123
+ var(--second) 295.2deg 302.4deg,
124
+ var(--first) 302.4deg 309.6deg,
125
+ var(--second) 309.6deg 316.8deg,
126
+ var(--first) 316.8deg 324deg,
127
+ var(--second) 324deg 331.2deg,
128
+ var(--first) 331.2deg 338.4deg,
129
+ var(--second) 338.4deg 345.6deg,
130
+ var(--first) 345.6deg 352.8deg,
131
+ var(--second) 352.8deg 360deg
132
+ );
133
+ animation: rotate 20s linear infinite;
134
+ }
135
+
136
+ @media (max-width: 1024px) {
137
+ .light-rays::before,
138
+ .light-rays::after {
139
+ left: auto;
140
+ right: 11%;
141
+ }
142
+ }
143
+
144
+ /* ScrollArea.module.css */
145
+ .scrollArea {
146
+ overflow-y: scroll;
147
+ padding-right: 4px;
148
+ }
149
+
150
+ /* WebKit-based browsers */
151
+ .scrollArea::-webkit-scrollbar {
152
+ width: 8px;
153
+ }
154
+
155
+ .scrollArea::-webkit-scrollbar-track {
156
+ background: var(--color-jackpot-table-scrollbar-track);
157
+ border-radius: 9999px;
158
+ }
159
+
160
+ .scrollArea::-webkit-scrollbar-thumb {
161
+ background-color: var(--color-jackpot-table-scrollbar-thumb);
162
+ border-radius: 9999px;
163
+ }
164
+
165
+ @keyframes waveColor {
166
+ 0%,
167
+ 2.5% {
168
+ color: var(--wave-highlight-color);
169
+ }
170
+ 2.51%,
171
+ 100% {
172
+ color: var(--color-brand-300);
173
+ }
174
+ }
175
+
176
+ .animate-wave-color-success {
177
+ --wave-highlight-color: var(--color-success-800);
178
+ animation: waveColor 4s ease-in-out infinite;
179
+ }
180
+
181
+ .animate-wave-color-error {
182
+ --wave-highlight-color: var(--color-error-600);
183
+ animation: waveColor 4s ease-in-out infinite;
184
+ }