@opexa/portal-components 0.0.124 → 0.0.126

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 (223) hide show
  1. package/dist/components/BetRecords/BetRecords.client.d.ts +13 -0
  2. package/dist/components/BetRecords/BetRecords.client.js +10 -1
  3. package/dist/components/Bonus/Bonus.client.js +1 -1
  4. package/dist/components/Cashback/Cashback.client.js +1 -1
  5. package/dist/components/CustomPromo/CustomPromo.js +1 -1
  6. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  7. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  8. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  9. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  10. package/dist/components/FavoriteGames/FavoriteGames.client.js +13 -1
  11. package/dist/components/ForgotPassword/ForgotPasswordForm.js +14 -7
  12. package/dist/components/GameLaunch/GameLaunch.lazy.js +26 -3
  13. package/dist/components/Games/Game.js +25 -2
  14. package/dist/components/GamesSearch/GamesSearch.js +1 -1
  15. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  16. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +12 -1
  17. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  18. package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +14 -7
  19. package/dist/components/KYC/CaptureSelfie.js +5 -3
  20. package/dist/components/News/News.js +1 -1
  21. package/dist/components/Promo/Promo.client.js +1 -1
  22. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -4
  23. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +28 -25
  24. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +6 -0
  25. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +15 -0
  26. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -4
  27. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +27 -3
  28. package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +6 -0
  29. package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +15 -0
  30. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -4
  31. package/dist/components/Quests/WageringQuest/WageringQuest.js +12 -9
  32. package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +7 -0
  33. package/dist/components/Quests/WageringQuest/WageringQuestRules.js +17 -0
  34. package/dist/components/Search/Search.lazy.js +1 -1
  35. package/dist/components/SignIn/MobileNumberSignIn.js +14 -6
  36. package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -1
  37. package/dist/components/SignUp/SignUpForm.js +21 -10
  38. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  39. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  40. package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +12 -1
  41. package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +11 -1
  42. package/dist/components/TransactionRecords/DepositRecordsTable.js +29 -17
  43. package/dist/components/TransactionRecords/TableFilters.d.ts +5 -1
  44. package/dist/components/TransactionRecords/TableFilters.js +105 -31
  45. package/dist/components/TransactionRecords/TransactionRecordsTable.js +21 -9
  46. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +29 -17
  47. package/dist/constants/EnvVar.d.ts +1 -1
  48. package/dist/services/queries.d.ts +5 -5
  49. package/dist/services/queries.js +2364 -2369
  50. package/dist/services/trigger.js +2 -2
  51. package/dist/services/wallet.d.ts +7 -6
  52. package/dist/services/wallet.js +14 -12
  53. package/dist/styles/theme.css +699 -699
  54. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  55. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  56. package/dist/ui/Avatar/Avatar.d.ts +9 -9
  57. package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
  58. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  59. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  60. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  61. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  62. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  63. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  64. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  65. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  66. package/dist/ui/Dialog/Dialog.d.ts +121 -121
  67. package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
  68. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  69. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  70. package/dist/ui/Field/Field.d.ts +21 -21
  71. package/dist/ui/Field/field.recipe.d.ts +3 -3
  72. package/dist/ui/Menu/Menu.d.ts +360 -360
  73. package/dist/ui/Menu/menu.recipe.d.ts +20 -20
  74. package/dist/ui/Popover/Popover.d.ts +88 -88
  75. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  76. package/dist/ui/Progress/Progress.d.ts +27 -27
  77. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  78. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  79. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  80. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  81. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  82. package/dist/ui/Select/Select.d.ts +45 -45
  83. package/dist/ui/Select/select.recipe.d.ts +3 -3
  84. package/dist/ui/Table/Table.d.ts +21 -21
  85. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  86. package/dist/ui/Table/table.recipe.d.ts +3 -3
  87. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  88. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  89. package/package.json +164 -164
  90. package/dist/client/hooks/index.d.ts +0 -65
  91. package/dist/client/hooks/index.js +0 -65
  92. package/dist/client/services/index.d.ts +0 -4
  93. package/dist/client/services/index.js +0 -4
  94. package/dist/client/utils/index.d.ts +0 -3
  95. package/dist/client/utils/index.js +0 -3
  96. package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
  97. package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
  98. package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
  99. package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
  100. package/dist/components/CashbackBonus/index.d.ts +0 -1
  101. package/dist/components/CashbackBonus/index.js +0 -1
  102. package/dist/components/Empty.d.ts +0 -9
  103. package/dist/components/Empty.js +0 -7
  104. package/dist/components/Games/GameContext.d.ts +0 -2
  105. package/dist/components/Games/GameContext.js +0 -2
  106. package/dist/components/InfiniteScroll.d.ts +0 -10
  107. package/dist/components/InfiniteScroll.js +0 -25
  108. package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
  109. package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
  110. package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
  111. package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
  112. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
  113. package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
  114. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
  115. package/dist/components/JackpotCounter/index.d.ts +0 -1
  116. package/dist/components/JackpotCounter/index.js +0 -1
  117. package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
  118. package/dist/components/Jackpots/JackpotDesktop.js +0 -45
  119. package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
  120. package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
  121. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
  122. package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
  123. package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
  124. package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
  125. package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
  126. package/dist/components/Jackpots/JackpotMobile.js +0 -46
  127. package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
  128. package/dist/components/Jackpots/JackpotRules.js +0 -11
  129. package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
  130. package/dist/components/Jackpots/Jackpots.client.js +0 -29
  131. package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
  132. package/dist/components/Jackpots/JackpotsContext.js +0 -3
  133. package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
  134. package/dist/components/Jackpots/useJackpotData.js +0 -93
  135. package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
  136. package/dist/components/Jackpots/useJackpotItemData.js +0 -87
  137. package/dist/components/KYC/Header.d.ts +0 -1
  138. package/dist/components/KYC/Header.js +0 -8
  139. package/dist/components/KYC/Step1.d.ts +0 -1
  140. package/dist/components/KYC/Step1.js +0 -13
  141. package/dist/components/KYC/Step2.d.ts +0 -1
  142. package/dist/components/KYC/Step2.js +0 -13
  143. package/dist/components/KYC/Step3.d.ts +0 -1
  144. package/dist/components/KYC/Step3.js +0 -13
  145. package/dist/components/KYC/Step4.d.ts +0 -1
  146. package/dist/components/KYC/Step4.js +0 -7
  147. package/dist/components/Messages/MessageItem.d.ts +0 -4
  148. package/dist/components/Messages/MessageItem.js +0 -34
  149. package/dist/components/PortalProvider/WebVitals.d.ts +0 -1
  150. package/dist/components/PortalProvider/WebVitals.js +0 -8
  151. package/dist/components/Promo/PromoContent.d.ts +0 -2
  152. package/dist/components/Promo/PromoContent.js +0 -9
  153. package/dist/components/Promos/PromoCarousel.d.ts +0 -2
  154. package/dist/components/Promos/PromoCarousel.js +0 -41
  155. package/dist/components/Promos/PromoGrid.d.ts +0 -2
  156. package/dist/components/Promos/PromoGrid.js +0 -12
  157. package/dist/components/Promos/PromoItem.d.ts +0 -7
  158. package/dist/components/Promos/PromoItem.js +0 -10
  159. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  160. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  161. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  162. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  163. package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
  164. package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
  165. package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
  166. package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
  167. package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
  168. package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
  169. package/dist/components/TournamentCounter/index.d.ts +0 -1
  170. package/dist/components/TournamentCounter/index.js +0 -1
  171. package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
  172. package/dist/components/Tournaments/TournamentDesktop.js +0 -57
  173. package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
  174. package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
  175. package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
  176. package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
  177. package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
  178. package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
  179. package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
  180. package/dist/components/Tournaments/TournamentMobile.js +0 -55
  181. package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
  182. package/dist/components/Tournaments/TournamentRules.js +0 -11
  183. package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
  184. package/dist/components/Tournaments/Tournaments.client.js +0 -20
  185. package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
  186. package/dist/components/Tournaments/TournamentsContext.js +0 -3
  187. package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
  188. package/dist/components/Tournaments/useTournamentData.js +0 -72
  189. package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
  190. package/dist/components/Tournaments/useTournamentItemData.js +0 -64
  191. package/dist/components/index.d.ts +0 -33
  192. package/dist/components/index.js +0 -33
  193. package/dist/constants/endpoints.d.ts +0 -10
  194. package/dist/constants/endpoints.js +0 -41
  195. package/dist/constants/envVars.d.ts +0 -5
  196. package/dist/constants/envVars.js +0 -28
  197. package/dist/constants/gameProviders.d.ts +0 -4
  198. package/dist/constants/gameProviders.js +0 -368
  199. package/dist/constants/gameTypes.d.ts +0 -3
  200. package/dist/constants/gameTypes.js +0 -64
  201. package/dist/constants/headerKeys.d.ts +0 -2
  202. package/dist/constants/headerKeys.js +0 -2
  203. package/dist/constants/secretQuestions.d.ts +0 -3
  204. package/dist/constants/secretQuestions.js +0 -24
  205. package/dist/constants/storageKeys.d.ts +0 -2
  206. package/dist/constants/storageKeys.js +0 -2
  207. package/dist/icons/index.d.ts +0 -65
  208. package/dist/icons/index.js +0 -65
  209. package/dist/images/hacksaw-gaming.png +0 -0
  210. package/dist/server/services/index.d.ts +0 -4
  211. package/dist/server/services/index.js +0 -4
  212. package/dist/server/utils/index.d.ts +0 -29
  213. package/dist/server/utils/index.js +0 -29
  214. package/dist/ui/Presence.d.ts +0 -2
  215. package/dist/ui/Presence.js +0 -7
  216. package/dist/ui/Prose.d.ts +0 -2
  217. package/dist/ui/Prose.js +0 -5
  218. package/dist/ui/index.d.ts +0 -26
  219. package/dist/ui/index.js +0 -26
  220. package/dist/utils/index.d.ts +0 -17
  221. package/dist/utils/index.js +0 -17
  222. package/dist/utils/isMobile.d.ts +0 -5
  223. package/dist/utils/isMobile.js +0 -9
@@ -1,4 +1,28 @@
1
- export function OnboardingQuest(props) {
2
- console.log('OnboardingQuest not implemented', props.quest);
3
- return null;
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useShallow } from 'zustand/shallow';
3
+ import { useDisclosure } from '../../../client/hooks/useDisclosure.js';
4
+ import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
5
+ import { CheckIcon } from '../../../icons/CheckIcon.js';
6
+ import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
7
+ import { CoinsHandIcon } from '../../../icons/CoinsHandIcon.js';
8
+ import { FileCheck02Icon } from '../../../icons/FileCheck02Icon.js';
9
+ import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
10
+ import { Badge } from '../../../ui/Badge/index.js';
11
+ import { Button } from '../../../ui/Button/index.js';
12
+ import { Checkbox } from '../../../ui/Checkbox/index.js';
13
+ import { useQuestContext } from '../QuestsContext.js';
14
+ import { OnboardingQuestRules } from './OnboardingQuestRules.js';
15
+ export function OnboardingQuest() {
16
+ const quest = useQuestContext();
17
+ const disclosure = useDisclosure();
18
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
19
+ kyc: ctx.kyc,
20
+ depositWithdrawal: ctx.depositWithdrawal,
21
+ })));
22
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsx(Badge.Label, { children: "123" })] }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("h2", { className: "text-xl font-semibold", children: quest.name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: quest.description } })] }), _jsxs("div", { className: "w-full grow space-y-2", children: [_jsxs(Checkbox.Root, { children: [_jsx(Checkbox.Control, { className: "bg-transparent", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { className: "text-sm font-medium leading-tight", children: "Complete personal verification" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Checkbox.Root, { children: [_jsx(Checkbox.Control, { className: "bg-transparent", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { className: "text-sm font-medium leading-tight", children: "Make your first deposit" }), _jsx(Checkbox.HiddenInput, {})] })] }), _jsxs("div", { className: "flex gap-lg", children: [_jsxs(Button, { size: "sm", onClick: () => {
23
+ globalStore.kyc.setOpen(true);
24
+ }, children: [_jsx(FileCheck02Icon, { className: "size-5" }), "Verify"] }), _jsxs(Button, { size: "sm", onClick: () => {
25
+ globalStore.depositWithdrawal.setTab('DEPOSIT');
26
+ globalStore.depositWithdrawal.setOpen(true);
27
+ }, children: [_jsx(CoinsHandIcon, { className: "size-5" }), "Deposit"] })] })] }), _jsx(OnboardingQuestRules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
4
28
  }
@@ -0,0 +1,6 @@
1
+ export interface OnboardingQuestRulesProps {
2
+ open?: boolean;
3
+ onOpenChange?: (open: boolean) => void;
4
+ defaultOpen?: boolean;
5
+ }
6
+ export declare function OnboardingQuestRules(props: OnboardingQuestRulesProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useControllableState } from '../../../client/hooks/useControllableState.js';
4
+ import { XIcon } from '../../../icons/XIcon.js';
5
+ import { Button } from '../../../ui/Button/index.js';
6
+ import { Dialog } from '../../../ui/Dialog/index.js';
7
+ import { Portal } from '../../../ui/Portal/index.js';
8
+ export function OnboardingQuestRules(props) {
9
+ const [open, setOpen] = useControllableState({
10
+ value: props.open,
11
+ defaultValue: props.defaultOpen ?? false,
12
+ onChange: props.onOpenChange,
13
+ });
14
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: "Welcome Quest Rules" }), _jsxs("ol", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Begin your quest whenever you're ready" }), _jsx("li", { children: "Tackle the tasks in any order you like" }), _jsx("li", { children: "Finish all tasks and we'll credit your reward automatically!" })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => setOpen(false), children: "Ok" }) })] }) })] }) }));
15
+ }
@@ -1,4 +1 @@
1
- import type { Quest } from '../../../types';
2
- export declare function WageringQuest({ quest }: {
3
- quest: Quest;
4
- }): import("react/jsx-runtime").JSX.Element;
1
+ export declare function WageringQuest(): import("react/jsx-runtime").JSX.Element;
@@ -2,19 +2,22 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
4
  import { twMerge } from 'tailwind-merge';
5
+ import { useDisclosure } from '../../../client/hooks/useDisclosure.js';
6
+ import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
5
7
  import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
6
8
  import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
7
9
  import { Badge } from '../../../ui/Badge/index.js';
10
+ import { parseDecimal } from '../../../utils/parseDecimal.js';
8
11
  import CountdownTimer from '../CountdownTimer.js';
9
- import { WageringQuestModal } from './WageringQuestModal.js';
10
- export function WageringQuest({ quest }) {
11
- const [showRules, setShowRules] = useState(false);
12
+ import { useQuestContext } from '../QuestsContext.js';
13
+ import { WageringQuestModal } from './WageringQuestRules.js';
14
+ export function WageringQuest() {
15
+ const quest = useQuestContext();
16
+ const disclosure = useDisclosure();
17
+ const localeInfo = useLocaleInfo();
12
18
  const [isExpired, setIsExpired] = useState(false);
13
19
  const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
14
- return (_jsxs(_Fragment, { children: [_jsx(WageringQuestModal, { questName: name, modalState: {
15
- isOpen: showRules,
16
- setIsOpen: setShowRules,
17
- } }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(CountdownTimer, { endDateTime: endDateTime, renderAction: (timeLeft) => (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsxs(Badge.Label, { children: [timeLeft.days, "d:", timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => setIsExpired(true) }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => setShowRules((prev) => !prev), children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "text-text-primary-brand group flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", parseInt(progressPercentage).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " PHP"] })] })] }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "bg-button-secondary-bg border-bg-primary-hover w-full rounded-md border px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { className: twMerge(isExpired || status === 'COMPLETED' || status === 'FAILED'
18
- ? ['opacity-50 grayscale']
19
- : ''), children: ["Complete to get ", _jsxs("span", { className: "text-brand-400", children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] })] }));
20
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(CountdownTimer, { endDateTime: endDateTime, renderAction: (timeLeft) => (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsxs(Badge.Label, { children: [timeLeft.days, "d:", timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => setIsExpired(true) }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => disclosure.setOpen(true), children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "text-text-primary-brand group flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "bg-button-secondary-bg border-bg-primary-hover w-full rounded-md border px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { className: twMerge(isExpired || status === 'COMPLETED' || status === 'FAILED'
21
+ ? 'opacity-50 grayscale'
22
+ : ''), children: ["Complete to get ", _jsxs("span", { className: "text-brand-400", children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] }), _jsx(WageringQuestModal, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
20
23
  }
@@ -0,0 +1,7 @@
1
+ interface WageringQuestModalProps {
2
+ open?: boolean;
3
+ onOpenChange?: (open: boolean) => void;
4
+ defaultOpen?: boolean;
5
+ }
6
+ export declare function WageringQuestModal(props: WageringQuestModalProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useControllableState } from '../../../client/hooks/useControllableState.js';
4
+ import { XIcon } from '../../../icons/XIcon.js';
5
+ import { Button } from '../../../ui/Button/index.js';
6
+ import { Dialog } from '../../../ui/Dialog/index.js';
7
+ import { Portal } from '../../../ui/Portal/index.js';
8
+ import { useQuestContext } from '../QuestsContext.js';
9
+ export function WageringQuestModal(props) {
10
+ const quest = useQuestContext();
11
+ const [open, setOpen] = useControllableState({
12
+ value: props.open,
13
+ defaultValue: props.defaultOpen ?? false,
14
+ onChange: props.onOpenChange,
15
+ });
16
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: quest.name }), _jsxs("ol", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn extra rewards just by playing Slots, every bet counts, win or lose!" }), _jsx("li", { children: "Reach the wagering requirement in bets to complete the quest and claim your reward." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => setOpen(false), children: "Ok" }) })] }) })] }) }));
17
+ }
@@ -18,7 +18,7 @@ import { Dialog } from '../../ui/Dialog/index.js';
18
18
  import { Field } from '../../ui/Field/index.js';
19
19
  import { IconButton } from '../../ui/IconButton/index.js';
20
20
  import { Portal } from '../../ui/Portal/index.js';
21
- import { Presence } from '../../ui/Presence.js';
21
+ import { Presence } from '../../ui/Presence/index.js';
22
22
  import { callIfFn } from '../../utils/callIfFn.js';
23
23
  import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
24
24
  import { GameLaunchTrigger } from '../GameLaunch/index.js';
@@ -53,7 +53,14 @@ export function MobileNumberSignIn() {
53
53
  }),
54
54
  });
55
55
  const Step2Definition = z.object({
56
- verificationCode: z.array(z.string().min(1).max(1).trim()).min(6).max(6),
56
+ verificationCode: z.array(z.string()).superRefine((val, ctx) => {
57
+ if (val.length !== 6 || val.some((v) => v.length !== 1)) {
58
+ ctx.addIssue({
59
+ code: z.ZodIssueCode.custom,
60
+ message: 'Please Enter your 6 digits verification code',
61
+ });
62
+ }
63
+ }),
57
64
  });
58
65
  const step1Form = useForm({
59
66
  resolver: zodResolver(Step1Definition),
@@ -119,11 +126,12 @@ export function MobileNumberSignIn() {
119
126
  description: 'Invalid Verification Code',
120
127
  });
121
128
  }
122
- }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(PinInput.Root, { placeholder: "0", invalid: o.fieldState.invalid, value: o.field.value, onValueChange: (details) => {
123
- o.field.onChange(details.value);
124
- }, otp: true, onValueComplete: () => {
125
- form2Ref.current?.requestSubmit();
126
- }, 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: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, 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: "text-button-secondary-fg font-semibold", disabled: cooldown.cooling, onClick: async () => {
129
+ }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", value: o.field.value, onValueChange: (details) => {
130
+ o.field.onChange(details.value);
131
+ o.field.onBlur();
132
+ }, otp: true, onValueComplete: () => {
133
+ form2Ref.current?.requestSubmit();
134
+ }, 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: "text-text-placeholder-subtle text-2xl font-medium", 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.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, 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: "text-button-secondary-fg font-semibold", disabled: cooldown.cooling, onClick: async () => {
127
135
  await sendVerificationCodeMutation.mutateAsync({
128
136
  channel: 'SMS',
129
137
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
@@ -119,7 +119,7 @@ export function NameAndPasswordSignIn() {
119
119
  signInMutation.reset();
120
120
  form.setValue('secretAnswer', '');
121
121
  },
122
- }) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.name, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...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 })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm font-semibold", onClick: () => {
122
+ }) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.password, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...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 })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm font-semibold", onClick: () => {
123
123
  globalStore.forgotPassword.setOpen(true);
124
124
  dialog.setOpen(false);
125
125
  }, children: "Forgot Password" }) })] }) }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
@@ -54,7 +54,10 @@ export function SignUpForm() {
54
54
  const localeInfo = useLocaleInfo();
55
55
  const mobileNumberParser = useMobileNumberParser();
56
56
  const Step1Definition = z.object({
57
- mobileNumber: z.string().superRefine((v, ctx) => {
57
+ mobileNumber: z
58
+ .string()
59
+ .min(1, 'Mobile number is required')
60
+ .superRefine((v, ctx) => {
58
61
  if (!mobileNumberParser.validate(v)) {
59
62
  ctx.addIssue({
60
63
  code: z.ZodIssueCode.custom,
@@ -93,7 +96,14 @@ export function SignUpForm() {
93
96
  branchCode: z.string().min(1, 'Branch is required').trim(),
94
97
  });
95
98
  const Step2Definition = z.object({
96
- verificationCode: z.array(z.string().min(1).max(1).trim()).min(6).max(6),
99
+ verificationCode: z.array(z.string()).superRefine((val, ctx) => {
100
+ if (val.length !== 6 || val.some((v) => v.length !== 1)) {
101
+ ctx.addIssue({
102
+ code: z.ZodIssueCode.custom,
103
+ message: 'Please Enter your 6 digits verification code',
104
+ });
105
+ }
106
+ }),
97
107
  });
98
108
  const step1Form = useForm({
99
109
  mode: 'all',
@@ -118,7 +128,7 @@ export function SignUpForm() {
118
128
  const form2Ref = useRef(null);
119
129
  const birthDay = step1Form.watch('birthDay');
120
130
  const branchCode = step1Form.watch('branchCode', '');
121
- return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
131
+ return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
122
132
  try {
123
133
  await sendVerificationCodeMutation.mutateAsync({
124
134
  channel: 'SMS',
@@ -145,7 +155,9 @@ export function SignUpForm() {
145
155
  shouldValidate: true,
146
156
  });
147
157
  }
148
- }, children: [_jsx(DatePicker.Label, { children: "Date of Birth" }), _jsxs(DatePicker.Control, { children: [_jsx(DatePicker.Input, {}), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.birthDay?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.branchCode, className: "mt-xl", children: [_jsxs(Select.Root, { value: [branchCode], onValueChange: (details) => {
158
+ }, children: [_jsx(DatePicker.Label, { children: "Date of Birth" }), _jsxs(DatePicker.Control, { children: [_jsx(DatePicker.Input, { onBlur: () => {
159
+ step1Form.trigger('birthDay');
160
+ } }), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.birthDay?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.branchCode, className: "mt-xl", children: [_jsxs(Select.Root, { value: [branchCode], onValueChange: (details) => {
149
161
  step1Form.setValue('branchCode', details.value.at(0) ?? BRANCH_CODES[0].code, {
150
162
  shouldDirty: true,
151
163
  shouldTouch: true,
@@ -213,17 +225,16 @@ export function SignUpForm() {
213
225
  }
214
226
  catch (error) {
215
227
  toaster.error({
216
- title: 'Login Failed',
217
228
  description: error instanceof Error
218
229
  ? error.message
219
230
  : 'Invalid Verification Code',
220
231
  });
221
232
  }
222
- }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(PinInput.Root, { placeholder: "0", invalid: o.fieldState.invalid, value: o.field.value, onValueChange: (details) => {
223
- o.field.onChange(details.value);
224
- }, onValueComplete: () => {
225
- form2Ref.current?.requestSubmit();
226
- }, 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: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, 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: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
233
+ }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", value: o.field.value, onValueChange: (details) => {
234
+ o.field.onChange(details.value);
235
+ }, onValueComplete: () => {
236
+ form2Ref.current?.requestSubmit();
237
+ }, 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: "text-text-placeholder-subtle text-2xl font-medium", 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: step2Form.formState.isSubmitting, 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: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
227
238
  await sendVerificationCodeMutation.mutateAsync({
228
239
  channel: 'SMS',
229
240
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),