@opexa/portal-components 0.0.17 → 0.0.18

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 (246) hide show
  1. package/dist/client/hooks/index.d.ts +3 -0
  2. package/dist/client/hooks/useGlobalStore.d.ts +11 -1
  3. package/dist/client/hooks/useGlobalStore.js +1 -1
  4. package/dist/client/hooks/useGlobalStore.mjs +81 -35
  5. package/dist/client/hooks/useMarkMessageAsReadMutation.d.ts +6 -0
  6. package/dist/client/hooks/useMarkMessageAsReadMutation.js +1 -0
  7. package/dist/client/hooks/useMarkMessageAsReadMutation.mjs +39 -0
  8. package/dist/client/hooks/useMessagesQuery.d.ts +3 -0
  9. package/dist/client/hooks/useMessagesQuery.js +1 -0
  10. package/dist/client/hooks/useMessagesQuery.mjs +47 -0
  11. package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +3 -0
  12. package/dist/client/hooks/useUnreadMessagesCountQuery.js +1 -0
  13. package/dist/client/hooks/useUnreadMessagesCountQuery.mjs +38 -0
  14. package/dist/client-hooks.js +1 -1
  15. package/dist/client-hooks.mjs +38 -32
  16. package/dist/components/Account/Account.d.ts +3 -1
  17. package/dist/components/Account/Account.js +1 -1
  18. package/dist/components/Account/Account.mjs +163 -96
  19. package/dist/components/Banner/Banner.js +1 -1
  20. package/dist/components/Banner/Banner.mjs +6 -6
  21. package/dist/components/BetRecords/BetRecords.js +1 -1
  22. package/dist/components/BetRecords/BetRecords.mjs +357 -325
  23. package/dist/components/Bonus/Bonus.client.d.ts +2 -0
  24. package/dist/components/Bonus/Bonus.d.ts +10 -0
  25. package/dist/components/Bonus/index.d.ts +1 -0
  26. package/dist/components/Bonuses/Bonuses.d.ts +15 -0
  27. package/dist/components/Bonuses/Bonuses.js +1 -0
  28. package/dist/components/Bonuses/Bonuses.mjs +125 -0
  29. package/dist/components/Bonuses/index.d.ts +1 -0
  30. package/dist/components/DepositWithdrawal/AmountChoices.js +1 -1
  31. package/dist/components/DepositWithdrawal/AmountChoices.mjs +9 -6
  32. package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +1 -1
  33. package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.mjs +11 -8
  34. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +1 -1
  35. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.mjs +5 -2
  36. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +1 -1
  37. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.mjs +5 -2
  38. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +1 -1
  39. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.mjs +16 -13
  40. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
  41. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.mjs +5 -2
  42. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +1 -1
  43. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.mjs +9 -6
  44. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +1 -1
  45. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.mjs +18 -15
  46. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +1 -1
  47. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.mjs +9 -6
  48. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.js +1 -1
  49. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.mjs +9 -6
  50. package/dist/components/DepositWithdrawal/DepositWithdrawal.js +1 -1
  51. package/dist/components/DepositWithdrawal/DepositWithdrawal.mjs +46 -46
  52. package/dist/components/DepositWithdrawal/PaymentMethods.js +1 -1
  53. package/dist/components/DepositWithdrawal/PaymentMethods.mjs +26 -23
  54. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +1 -1
  55. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.mjs +86 -76
  56. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
  57. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.mjs +118 -108
  58. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +1 -1
  59. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.mjs +75 -65
  60. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +1 -1
  61. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.mjs +96 -86
  62. package/dist/components/Disclaimer/Disclaimer.js +1 -1
  63. package/dist/components/Disclaimer/Disclaimer.mjs +11 -8
  64. package/dist/components/Empty/Empty.js +1 -1
  65. package/dist/components/Empty/Empty.mjs +14 -10
  66. package/dist/components/GameLaunch/GameLaunch.js +1 -1
  67. package/dist/components/GameLaunch/GameLaunch.mjs +42 -39
  68. package/dist/components/Games/Games.client.js +1 -1
  69. package/dist/components/Games/Games.client.mjs +47 -44
  70. package/dist/components/Games/Games.d.ts +7 -2
  71. package/dist/components/JackpotCounter/JackpotCounter.d.ts +4 -2
  72. package/dist/components/JackpotCounter/JackpotCounter.js +1 -1
  73. package/dist/components/JackpotCounter/JackpotCounter.mjs +38 -34
  74. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +3 -1
  75. package/dist/components/JackpotCounter/JackpotCounterItem.js +1 -1
  76. package/dist/components/JackpotCounter/JackpotCounterItem.mjs +282 -124
  77. package/dist/components/JackpotCounter/JackpotCounterItem.module.css.js +1 -1
  78. package/dist/components/JackpotCounter/JackpotCounterItem.module.css.mjs +11 -8
  79. package/dist/components/Jackpots/JackpotGameProviders.d.ts +1 -0
  80. package/dist/components/Jackpots/JackpotItem.d.ts +7 -0
  81. package/dist/components/Jackpots/JackpotItemMobile.d.ts +7 -0
  82. package/dist/components/Jackpots/Jackpots.d.ts +8 -0
  83. package/dist/components/Jackpots/index.d.ts +1 -0
  84. package/dist/components/Marquee/Marquee.js +1 -1
  85. package/dist/components/Marquee/Marquee.mjs +7 -7
  86. package/dist/components/Messages/MessageItem.d.ts +4 -0
  87. package/dist/components/Messages/MessageItem.js +1 -0
  88. package/dist/components/Messages/MessageItem.mjs +66 -0
  89. package/dist/components/Messages/MessagePopup.d.ts +1 -0
  90. package/dist/components/Messages/MessagePopup.js +1 -0
  91. package/dist/components/Messages/MessagePopup.mjs +89 -0
  92. package/dist/components/Messages/Messages.d.ts +1 -0
  93. package/dist/components/Messages/Messages.js +1 -0
  94. package/dist/components/Messages/Messages.mjs +147 -0
  95. package/dist/components/Messages/index.d.ts +1 -0
  96. package/dist/components/Messages/utils.d.ts +3 -0
  97. package/dist/components/Messages/utils.js +1 -0
  98. package/dist/components/Messages/utils.mjs +16 -0
  99. package/dist/components/Promos/PromoCarousel.js +1 -1
  100. package/dist/components/Promos/PromoCarousel.mjs +27 -24
  101. package/dist/components/Promos/PromoGrid.js +1 -1
  102. package/dist/components/Promos/PromoGrid.mjs +7 -7
  103. package/dist/components/Promos/PromoItem.js +1 -1
  104. package/dist/components/Promos/PromoItem.mjs +10 -7
  105. package/dist/components/Promos/Promos.d.ts +4 -2
  106. package/dist/components/SignIn/SignIn.d.ts +0 -1
  107. package/dist/components/SignIn/SignIn.js +1 -1
  108. package/dist/components/SignIn/SignIn.mjs +32 -41
  109. package/dist/components/SignIn/SignInForm.js +1 -1
  110. package/dist/components/SignIn/SignInForm.mjs +167 -160
  111. package/dist/components/SignUp/SignUp.d.ts +0 -1
  112. package/dist/components/SignUp/SignUp.js +1 -1
  113. package/dist/components/SignUp/SignUp.mjs +32 -41
  114. package/dist/components/SignUp/SignUpForm.js +1 -1
  115. package/dist/components/SignUp/SignUpForm.mjs +123 -116
  116. package/dist/components/TopWins/TopWins.client.js +1 -1
  117. package/dist/components/TopWins/TopWins.client.mjs +14 -14
  118. package/dist/components/TopWins/TopWins.d.ts +2 -1
  119. package/dist/components/TournamentCounter/TournamentCounter.d.ts +4 -2
  120. package/dist/components/TournamentCounter/TournamentCounter.js +1 -1
  121. package/dist/components/TournamentCounter/TournamentCounter.mjs +27 -24
  122. package/dist/components/TransactionRecords/DepositRecordsTable.js +1 -1
  123. package/dist/components/TransactionRecords/DepositRecordsTable.mjs +113 -99
  124. package/dist/components/TransactionRecords/TableFilters.d.ts +3 -1
  125. package/dist/components/TransactionRecords/TableFilters.js +1 -1
  126. package/dist/components/TransactionRecords/TableFilters.mjs +193 -132
  127. package/dist/components/TransactionRecords/TransactionRecords.js +1 -1
  128. package/dist/components/TransactionRecords/TransactionRecords.mjs +21 -17
  129. package/dist/components/TransactionRecords/TransactionRecordsTable.js +1 -1
  130. package/dist/components/TransactionRecords/TransactionRecordsTable.mjs +89 -77
  131. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
  132. package/dist/components/TransactionRecords/WithdrawalRecordsTable.mjs +105 -96
  133. package/dist/components/index.d.ts +2 -0
  134. package/dist/components.js +1 -1
  135. package/dist/components.mjs +36 -32
  136. package/dist/icons/ArrowNarrowDownIcon.d.ts +2 -0
  137. package/dist/icons/ArrowNarrowUpIcon.d.ts +2 -0
  138. package/dist/icons/Bell01Icon.d.ts +2 -0
  139. package/dist/icons/Bell01Icon.js +1 -0
  140. package/dist/icons/Bell01Icon.mjs +27 -0
  141. package/dist/icons/BellRingIcon.d.ts +2 -0
  142. package/dist/icons/BellRingIcon.js +1 -0
  143. package/dist/icons/BellRingIcon.mjs +27 -0
  144. package/dist/icons/EyeIcon.d.ts +2 -0
  145. package/dist/icons/EyeIcon.js +1 -0
  146. package/dist/icons/EyeIcon.mjs +25 -0
  147. package/dist/icons/EyeOffIcon.d.ts +2 -0
  148. package/dist/icons/EyeOffIcon.js +1 -0
  149. package/dist/icons/EyeOffIcon.mjs +22 -0
  150. package/dist/icons/StarIcon.d.ts +2 -0
  151. package/dist/icons/StarIcon.js +1 -0
  152. package/dist/icons/StarIcon.mjs +19 -0
  153. package/dist/icons/StopWatchIcon.d.ts +2 -0
  154. package/dist/icons/StopWatchIcon.js +1 -0
  155. package/dist/icons/StopWatchIcon.mjs +22 -0
  156. package/dist/icons/Trophy01Icon.d.ts +2 -0
  157. package/dist/icons/Trophy01Icon.js +1 -0
  158. package/dist/icons/Trophy01Icon.mjs +22 -0
  159. package/dist/icons/index.d.ts +6 -0
  160. package/dist/icons.d.ts +2 -0
  161. package/dist/icons.js +1 -0
  162. package/dist/icons.mjs +62 -0
  163. package/dist/images/first-place.png.js +1 -0
  164. package/dist/images/first-place.png.mjs +4 -0
  165. package/dist/images/leaderboard.png.js +1 -0
  166. package/dist/images/leaderboard.png.mjs +4 -0
  167. package/dist/images/placeholder-avatar.png.js +1 -0
  168. package/dist/images/placeholder-avatar.png.mjs +4 -0
  169. package/dist/images/responsible-gaming.png.js +1 -1
  170. package/dist/images/responsible-gaming.png.mjs +2 -2
  171. package/dist/portal-components.css +1 -1
  172. package/dist/server/utils/prefetchUnreadMessagesCountQuery.d.ts +2 -0
  173. package/dist/theme.css +123 -4
  174. package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
  175. package/dist/ui/AlertDialog/alertDialog.recipe.mjs +6 -6
  176. package/dist/ui/Badge/Badge.d.ts +274 -27
  177. package/dist/ui/Badge/Badge.js +1 -1
  178. package/dist/ui/Badge/Badge.mjs +14 -10
  179. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  180. package/dist/ui/Badge/badge.anatomy.js +1 -1
  181. package/dist/ui/Badge/badge.anatomy.mjs +1 -0
  182. package/dist/ui/Badge/badge.recipe.d.ts +57 -9
  183. package/dist/ui/Badge/badge.recipe.js +1 -1
  184. package/dist/ui/Badge/badge.recipe.mjs +57 -21
  185. package/dist/ui/Button/button.recipe.d.ts +2 -2
  186. package/dist/ui/Button/button.recipe.js +1 -1
  187. package/dist/ui/Button/button.recipe.mjs +17 -7
  188. package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
  189. package/dist/ui/Checkbox/checkbox.recipe.mjs +6 -6
  190. package/dist/ui/Collapsible/Collapsible.d.ts +114 -0
  191. package/dist/ui/Collapsible/Collapsible.js +1 -0
  192. package/dist/ui/Collapsible/Collapsible.mjs +13 -0
  193. package/dist/ui/Collapsible/collapsible.recipe.d.ts +28 -0
  194. package/dist/ui/Collapsible/collapsible.recipe.js +1 -0
  195. package/dist/ui/Collapsible/collapsible.recipe.mjs +18 -0
  196. package/dist/ui/Collapsible/index.d.ts +1 -0
  197. package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
  198. package/dist/ui/DatePicker/datePicker.recipe.mjs +37 -6
  199. package/dist/ui/Dialog/dialog.recipe.js +1 -1
  200. package/dist/ui/Dialog/dialog.recipe.mjs +3 -3
  201. package/dist/ui/Drawer/drawer.recipe.js +1 -1
  202. package/dist/ui/Drawer/drawer.recipe.mjs +6 -6
  203. package/dist/ui/Field/field.recipe.js +1 -1
  204. package/dist/ui/Field/field.recipe.mjs +10 -12
  205. package/dist/ui/IconButton/iconButton.recipe.d.ts +2 -2
  206. package/dist/ui/IconButton/iconButton.recipe.js +1 -1
  207. package/dist/ui/IconButton/iconButton.recipe.mjs +6 -6
  208. package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
  209. package/dist/ui/NumberInput/numberInput.recipe.mjs +8 -8
  210. package/dist/ui/PasswordInput/PasswordInput.d.ts +242 -1
  211. package/dist/ui/PasswordInput/PasswordInput.js +1 -0
  212. package/dist/ui/PasswordInput/PasswordInput.mjs +18 -0
  213. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +6 -18
  214. package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -0
  215. package/dist/ui/PasswordInput/passwordInput.recipe.mjs +48 -0
  216. package/dist/ui/PinInput/pinInput.recipe.js +1 -1
  217. package/dist/ui/PinInput/pinInput.recipe.mjs +3 -3
  218. package/dist/ui/Popover/popover.recipe.js +1 -1
  219. package/dist/ui/Popover/popover.recipe.mjs +1 -1
  220. package/dist/ui/Progress/Progress.d.ts +335 -1
  221. package/dist/ui/Progress/Progress.js +1 -1
  222. package/dist/ui/Progress/Progress.mjs +15 -2
  223. package/dist/ui/Progress/progress.recipe.d.ts +37 -1
  224. package/dist/ui/Progress/progress.recipe.js +1 -0
  225. package/dist/ui/Progress/progress.recipe.mjs +41 -0
  226. package/dist/ui/Prose.d.ts +2 -0
  227. package/dist/ui/Prose.js +1 -0
  228. package/dist/ui/Prose.mjs +47 -0
  229. package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
  230. package/dist/ui/SegmentGroup/segmentGroup.recipe.mjs +3 -3
  231. package/dist/ui/Select/select.recipe.js +1 -1
  232. package/dist/ui/Select/select.recipe.mjs +6 -6
  233. package/dist/ui/Table/table.recipe.js +1 -1
  234. package/dist/ui/Table/table.recipe.mjs +4 -4
  235. package/dist/ui/Tabs/tabs.recipe.js +1 -1
  236. package/dist/ui/Tabs/tabs.recipe.mjs +3 -3
  237. package/dist/ui/index.d.ts +3 -0
  238. package/dist/ui.js +1 -1
  239. package/dist/ui.mjs +36 -30
  240. package/dist/utils/queryKeys.d.ts +4 -1
  241. package/dist/utils/queryKeys.js +1 -1
  242. package/dist/utils/queryKeys.mjs +34 -26
  243. package/dist/utils.js +1 -1
  244. package/dist/utils.mjs +35 -32
  245. package/package.json +11 -4
  246. package/dist/components/Promos/PromosContent.d.ts +0 -2
@@ -1,10 +1,10 @@
1
- import { jsxs as r, jsx as e, Fragment as L } from "react/jsx-runtime";
2
- import { createListCollection as T } from "@ark-ui/react";
3
- import { zodResolver as V } from "@hookform/resolvers/zod";
4
- import { useEffect as w, useMemo as W } from "react";
5
- import { useForm as $, Controller as y } from "react-hook-form";
1
+ import { jsxs as t, jsx as o, Fragment as N } from "react/jsx-runtime";
2
+ import { createListCollection as $ } from "@ark-ui/react";
3
+ import { zodResolver as L } from "@hookform/resolvers/zod";
4
+ import { useEffect as I, useMemo as P } from "react";
5
+ import { useForm as T, Controller as w } from "react-hook-form";
6
6
  import { z as s } from "zod";
7
- import { useShallow as D } from "zustand/shallow";
7
+ import { useShallow as V } from "zustand/shallow";
8
8
  import "@opexa/portal-sdk-core";
9
9
  import "@tanstack/react-query";
10
10
  import "tiny-invariant";
@@ -16,16 +16,18 @@ import "../../../../utils/getQueryClient.mjs";
16
16
  import "../../../../utils/isMobile.mjs";
17
17
  import "lodash-es";
18
18
  import "@opexa/portal-sdk-core/object-id";
19
- import { useCreateInstapayWithdrawalMutation as R } from "../../../../client/hooks/useCreateInstapayWithdrawalMutation.mjs";
20
- import { useGlobalStore as B } from "../../../../client/hooks/useGlobalStore.mjs";
19
+ import { useCreateInstapayWithdrawalMutation as W } from "../../../../client/hooks/useCreateInstapayWithdrawalMutation.mjs";
20
+ import { useGlobalStore as R } from "../../../../client/hooks/useGlobalStore.mjs";
21
21
  import "../../../../client/hooks/useInfiniteQueryHelper.mjs";
22
- import { useInstapayBankListQuery as M } from "../../../../client/hooks/useInstapayBankListQuery.mjs";
22
+ import { useInstapayBankListQuery as D } from "../../../../client/hooks/useInstapayBankListQuery.mjs";
23
23
  import "usehooks-ts";
24
- import { usePaymentSettingsQuery as Q } from "../../../../client/hooks/usePaymentSettingsQuery.mjs";
25
- import { toaster as I } from "../../../../client/utils/toaster.mjs";
26
- import { CheckIcon as A } from "../../../../icons/CheckIcon.mjs";
24
+ import { usePaymentSettingsQuery as B } from "../../../../client/hooks/usePaymentSettingsQuery.mjs";
25
+ import { toaster as y } from "../../../../client/utils/toaster.mjs";
26
+ import { CheckIcon as E } from "../../../../icons/CheckIcon.mjs";
27
27
  import { ChevronDownIcon as S } from "../../../../icons/ChevronDownIcon.mjs";
28
- import { ChevronUpIcon as E } from "../../../../icons/ChevronUpIcon.mjs";
28
+ import { ChevronUpIcon as M } from "../../../../icons/ChevronUpIcon.mjs";
29
+ import { EyeIcon as Q } from "../../../../icons/EyeIcon.mjs";
30
+ import { EyeOffIcon as A } from "../../../../icons/EyeOffIcon.mjs";
29
31
  import { SpinnerIcon as F } from "../../../../icons/SpinnerIcon.mjs";
30
32
  import "../../../../ui/AlertDialog/AlertDialog.mjs";
31
33
  import "../../../../ui/Avatar/Avatar.mjs";
@@ -33,47 +35,50 @@ import "../../../../ui/Badge/Badge.mjs";
33
35
  import { Button as j } from "../../../../ui/Button/Button.mjs";
34
36
  import "../../../../ui/Checkbox/Checkbox.mjs";
35
37
  import "../../../../ui/Clipboard/Clipboard.mjs";
38
+ import "../../../../ui/Collapsible/Collapsible.mjs";
36
39
  import "../../../../ui/DatePicker/DatePicker.mjs";
37
40
  import "../../../../ui/Dialog/Dialog.mjs";
38
41
  import "../../../../ui/Drawer/Drawer.mjs";
39
- import { Root as d, ErrorText as p, Label as v, Input as x } from "../../../../ui/Field/Field.mjs";
42
+ import { Root as d, ErrorText as p, Label as G, Input as O } from "../../../../ui/Field/Field.mjs";
40
43
  import "../../../../ui/IconButton/iconButton.recipe.mjs";
41
- import { Root as G, Label as U, Control as q, Input as z, IncrementTrigger as O, DecrementTrigger as Z } from "../../../../ui/NumberInput/NumberInput.mjs";
44
+ import { Root as U, Label as q, Control as z, Input as Z, IncrementTrigger as _, DecrementTrigger as H } from "../../../../ui/NumberInput/NumberInput.mjs";
45
+ import { Root as J, Label as K, Control as X, Input as Y, VisibilityTrigger as oo, Indicator as eo } from "../../../../ui/PasswordInput/PasswordInput.mjs";
42
46
  import "../../../../ui/PinInput/PinInput.mjs";
43
47
  import "../../../../ui/Popover/Popover.mjs";
44
48
  import "tailwind-merge";
49
+ import "../../../../ui/Progress/Progress.mjs";
45
50
  import "../../../../ui/SegmentGroup/SegmentGroup.mjs";
46
- import { Root as _, Label as H, Control as J, Trigger as K, ValueText as X, Indicator as Y, Positioner as ee, Content as oe, ItemGroup as te, Item as re, ItemText as ne, ItemIndicator as ie } from "../../../../ui/Select/Select.mjs";
51
+ import { Root as ro, Label as to, Control as io, Trigger as no, ValueText as ao, Indicator as mo, Positioner as so, Content as lo, ItemGroup as uo, Item as co, ItemText as po, ItemIndicator as ho } from "../../../../ui/Select/Select.mjs";
47
52
  import "../../../../ui/Table/Table.mjs";
48
53
  import "../../../../ui/Tabs/Tabs.mjs";
49
- import { AmountChoices as ae } from "../../AmountChoices.mjs";
50
- function no() {
54
+ import { AmountChoices as fo } from "../../AmountChoices.mjs";
55
+ function Ce() {
51
56
  var g, C;
52
- const k = B(
53
- D((o) => ({
54
- depositWithdrawal: o.depositWithdrawal
57
+ const k = R(
58
+ V((e) => ({
59
+ depositWithdrawal: e.depositWithdrawal
55
60
  }))
56
- ), h = R({
61
+ ), h = W({
57
62
  onSuccess() {
58
- t.reset(), k.depositWithdrawal.setOpen(!1), I.success({
63
+ r.reset(), k.depositWithdrawal.setOpen(!1), y.success({
59
64
  description: "Withdrawal request submitted successfully."
60
65
  });
61
66
  },
62
- onError(o) {
63
- I.error({
64
- description: o.message
67
+ onError(e) {
68
+ y.error({
69
+ description: e.message
65
70
  });
66
71
  }
67
- }), a = M().data, f = Q().data, l = f == null ? void 0 : f.instapayWithdrawalGatewaySettings, m = c(l == null ? void 0 : l.minimumAmount, 0), u = c(l == null ? void 0 : l.maximumAmount, 0), N = s.object({
68
- amount: s.string().superRefine((o, i) => {
69
- const n = c(o, 0);
70
- n < m && i.addIssue({
72
+ }), a = D().data, f = B().data, l = f == null ? void 0 : f.instapayWithdrawalGatewaySettings, m = c(l == null ? void 0 : l.minimumAmount, 0), u = c(l == null ? void 0 : l.maximumAmount, 0), v = s.object({
73
+ amount: s.string().superRefine((e, n) => {
74
+ const i = c(e, 0);
75
+ i < m && n.addIssue({
71
76
  type: "number",
72
77
  code: s.ZodIssueCode.too_small,
73
78
  inclusive: !0,
74
79
  minimum: m,
75
80
  message: `Minimum amount is ${m.toLocaleString()}`
76
- }), n > u && i.addIssue({
81
+ }), i > u && n.addIssue({
77
82
  type: "number",
78
83
  code: s.ZodIssueCode.too_big,
79
84
  inclusive: !0,
@@ -84,9 +89,9 @@ function no() {
84
89
  password: s.string().min(8, "Password must be 8 or more characters").max(64, "Password must be not be more than 64 characters"),
85
90
  accountNumber: s.string().min(1).trim(),
86
91
  bankCode: s.string().min(1, "Bank is required").trim()
87
- }), t = $({
92
+ }), r = T({
88
93
  mode: "all",
89
- resolver: V(N),
94
+ resolver: L(v),
90
95
  defaultValues: {
91
96
  amount: "0",
92
97
  password: "",
@@ -94,107 +99,107 @@ function no() {
94
99
  bankCode: ""
95
100
  }
96
101
  });
97
- w(() => {
98
- m && t.reset({
102
+ I(() => {
103
+ m && r.reset({
99
104
  amount: m.toString(),
100
- bankCode: t.getValues("bankCode"),
105
+ bankCode: r.getValues("bankCode"),
101
106
  password: "",
102
107
  accountNumber: ""
103
108
  });
104
- }, [t, m]), w(() => {
105
- a != null && a.length && t.reset({
106
- amount: t.getValues("amount"),
109
+ }, [r, m]), I(() => {
110
+ a != null && a.length && r.reset({
111
+ amount: r.getValues("amount"),
107
112
  bankCode: a[0].code,
108
113
  password: "",
109
114
  accountNumber: ""
110
115
  });
111
- }, [t, a]);
112
- const P = t.handleSubmit(async (o) => {
116
+ }, [r, a]);
117
+ const x = r.handleSubmit(async (e) => {
113
118
  h.mutate({
114
- amount: o.amount,
115
- transactionPassword: o.password,
116
- accountNumber: o.accountNumber,
117
- bankCode: o.bankCode
119
+ amount: e.amount,
120
+ transactionPassword: e.password,
121
+ accountNumber: e.accountNumber,
122
+ bankCode: e.bankCode
118
123
  });
119
- }), b = W(
120
- () => T({
124
+ }), b = P(
125
+ () => $({
121
126
  items: a ?? [],
122
- itemToValue: (o) => o.code,
123
- itemToString: (o) => o.name
127
+ itemToValue: (e) => e.code,
128
+ itemToString: (e) => e.name
124
129
  }),
125
130
  [a]
126
131
  );
127
- return console.log(b.items), /* @__PURE__ */ r("form", { onSubmit: P, noValidate: !0, autoComplete: "off", children: [
128
- /* @__PURE__ */ e(
129
- y,
132
+ return console.log(b.items), /* @__PURE__ */ t("form", { onSubmit: x, noValidate: !0, autoComplete: "off", children: [
133
+ /* @__PURE__ */ o(
134
+ w,
130
135
  {
131
- control: t.control,
136
+ control: r.control,
132
137
  name: "bankCode",
133
- render: (o) => {
134
- var i;
135
- return /* @__PURE__ */ r(d, { invalid: !!t.formState.errors.bankCode, children: [
136
- /* @__PURE__ */ r(
137
- _,
138
+ render: (e) => {
139
+ var n;
140
+ return /* @__PURE__ */ t(d, { invalid: !!r.formState.errors.bankCode, children: [
141
+ /* @__PURE__ */ t(
142
+ ro,
138
143
  {
139
144
  collection: b,
140
145
  positioning: {
141
146
  sameWidth: !0
142
147
  },
143
- value: o.field.value ? [o.field.value] : [],
144
- onValueChange: (n) => {
145
- o.field.onChange(n.value.at(0) ?? "");
148
+ value: e.field.value ? [e.field.value] : [],
149
+ onValueChange: (i) => {
150
+ e.field.onChange(i.value.at(0) ?? "");
146
151
  },
147
152
  children: [
148
- /* @__PURE__ */ e(H, { children: "Bank" }),
149
- /* @__PURE__ */ e(J, { children: /* @__PURE__ */ r(K, { children: [
150
- /* @__PURE__ */ e(X, {}),
151
- /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(S, {}) })
153
+ /* @__PURE__ */ o(to, { children: "Bank" }),
154
+ /* @__PURE__ */ o(io, { children: /* @__PURE__ */ t(no, { children: [
155
+ /* @__PURE__ */ o(ao, {}),
156
+ /* @__PURE__ */ o(mo, { asChild: !0, children: /* @__PURE__ */ o(S, {}) })
152
157
  ] }) }),
153
- /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(te, { children: b.items.map((n) => /* @__PURE__ */ r(re, { item: n, children: [
154
- /* @__PURE__ */ e(ne, { children: n.name }),
155
- /* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ e(A, {}) })
156
- ] }, n.id)) }) }) })
158
+ /* @__PURE__ */ o(so, { children: /* @__PURE__ */ o(lo, { children: /* @__PURE__ */ o(uo, { children: b.items.map((i) => /* @__PURE__ */ t(co, { item: i, children: [
159
+ /* @__PURE__ */ o(po, { children: i.name }),
160
+ /* @__PURE__ */ o(ho, { asChild: !0, children: /* @__PURE__ */ o(E, {}) })
161
+ ] }, i.id)) }) }) })
157
162
  ]
158
163
  }
159
164
  ),
160
- /* @__PURE__ */ e(p, { children: (i = t.formState.errors.bankCode) == null ? void 0 : i.message })
165
+ /* @__PURE__ */ o(p, { children: (n = r.formState.errors.bankCode) == null ? void 0 : n.message })
161
166
  ] });
162
167
  }
163
168
  }
164
169
  ),
165
- /* @__PURE__ */ r(
170
+ /* @__PURE__ */ t(
166
171
  d,
167
172
  {
168
- invalid: !!t.formState.errors.accountNumber,
173
+ invalid: !!r.formState.errors.accountNumber,
169
174
  className: "mt-3xl",
170
175
  children: [
171
- /* @__PURE__ */ e(v, { children: "Bank account number" }),
172
- /* @__PURE__ */ e(x, { ...t.register("accountNumber") }),
173
- /* @__PURE__ */ e(p, { children: (g = t.formState.errors.accountNumber) == null ? void 0 : g.message })
176
+ /* @__PURE__ */ o(G, { children: "Bank account number" }),
177
+ /* @__PURE__ */ o(O, { ...r.register("accountNumber") }),
178
+ /* @__PURE__ */ o(p, { children: (g = r.formState.errors.accountNumber) == null ? void 0 : g.message })
174
179
  ]
175
180
  }
176
181
  ),
177
- /* @__PURE__ */ e(
178
- y,
182
+ /* @__PURE__ */ o(
183
+ w,
179
184
  {
180
- control: t.control,
185
+ control: r.control,
181
186
  name: "amount",
182
- render: (o) => {
183
- var i;
184
- return /* @__PURE__ */ r(
187
+ render: (e) => {
188
+ var n;
189
+ return /* @__PURE__ */ t(
185
190
  d,
186
191
  {
187
- invalid: !!t.formState.errors.amount,
192
+ invalid: !!r.formState.errors.amount,
188
193
  className: "mt-3xl",
189
194
  children: [
190
- /* @__PURE__ */ r(
191
- G,
195
+ /* @__PURE__ */ t(
196
+ U,
192
197
  {
193
198
  min: 0,
194
199
  step: 1,
195
- value: o.field.value,
196
- onValueChange: (n) => {
197
- o.field.onChange(n.value);
200
+ value: e.field.value,
201
+ onValueChange: (i) => {
202
+ e.field.onChange(i.value);
198
203
  },
199
204
  formatOptions: {
200
205
  maximumFractionDigits: 2,
@@ -202,28 +207,28 @@ function no() {
202
207
  },
203
208
  allowMouseWheel: !0,
204
209
  children: [
205
- /* @__PURE__ */ e(U, { children: "Enter amount you want to withdraw" }),
206
- /* @__PURE__ */ r(q, { children: [
207
- /* @__PURE__ */ e(z, {}),
208
- /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(E, {}) }),
209
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(S, {}) })
210
+ /* @__PURE__ */ o(q, { children: "Enter amount you want to withdraw" }),
211
+ /* @__PURE__ */ t(z, { children: [
212
+ /* @__PURE__ */ o(Z, {}),
213
+ /* @__PURE__ */ o(_, { children: /* @__PURE__ */ o(M, {}) }),
214
+ /* @__PURE__ */ o(H, { children: /* @__PURE__ */ o(S, {}) })
210
215
  ] })
211
216
  ]
212
217
  }
213
218
  ),
214
- /* @__PURE__ */ e(p, { children: (i = t.formState.errors.amount) == null ? void 0 : i.message })
219
+ /* @__PURE__ */ o(p, { children: (n = r.formState.errors.amount) == null ? void 0 : n.message })
215
220
  ]
216
221
  }
217
222
  );
218
223
  }
219
224
  }
220
225
  ),
221
- /* @__PURE__ */ e(
222
- ae,
226
+ /* @__PURE__ */ o(
227
+ fo,
223
228
  {
224
- value: c(t.watch("amount"), 0),
225
- onChange: (o) => {
226
- t.setValue("amount", o.toString(), {
229
+ value: c(r.watch("amount"), 0),
230
+ onChange: (e) => {
231
+ r.setValue("amount", e.toString(), {
227
232
  shouldTouch: !0,
228
233
  shouldDirty: !0,
229
234
  shouldValidate: !0
@@ -234,25 +239,30 @@ function no() {
234
239
  className: "mt-xl"
235
240
  }
236
241
  ),
237
- /* @__PURE__ */ r(d, { className: "mt-3xl", invalid: !!t.formState.errors.password, children: [
238
- /* @__PURE__ */ e(v, { children: "Password" }),
239
- /* @__PURE__ */ e(x, { type: "password", ...t.register("password") }),
240
- /* @__PURE__ */ e(p, { children: (C = t.formState.errors.password) == null ? void 0 : C.message })
242
+ /* @__PURE__ */ t(d, { className: "mt-3xl", invalid: !!r.formState.errors.password, children: [
243
+ /* @__PURE__ */ t(J, { children: [
244
+ /* @__PURE__ */ o(K, { children: "Password" }),
245
+ /* @__PURE__ */ t(X, { children: [
246
+ /* @__PURE__ */ o(Y, { ...r.register("password") }),
247
+ /* @__PURE__ */ o(oo, { children: /* @__PURE__ */ o(eo, { fallback: /* @__PURE__ */ o(A, {}), asChild: !0, children: /* @__PURE__ */ o(Q, {}) }) })
248
+ ] })
249
+ ] }),
250
+ /* @__PURE__ */ o(p, { children: (C = r.formState.errors.password) == null ? void 0 : C.message })
241
251
  ] }),
242
- /* @__PURE__ */ r("p", { className: "mt-4xl text-xs", children: [
252
+ /* @__PURE__ */ t("p", { className: "mt-4xl text-xs", children: [
243
253
  "Upon clicking the deposit button, you agree to the",
244
254
  " ",
245
- /* @__PURE__ */ e("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }),
255
+ /* @__PURE__ */ o("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }),
246
256
  "."
247
257
  ] }),
248
- /* @__PURE__ */ e(
258
+ /* @__PURE__ */ o(
249
259
  j,
250
260
  {
251
261
  type: "submit",
252
262
  className: "mt-4.5",
253
263
  disabled: h.isPending,
254
- children: h.isPending ? /* @__PURE__ */ r(L, { children: [
255
- /* @__PURE__ */ e(F, {}),
264
+ children: h.isPending ? /* @__PURE__ */ t(N, { children: [
265
+ /* @__PURE__ */ o(F, {}),
256
266
  "Processing..."
257
267
  ] }) : "Deposit"
258
268
  }
@@ -260,5 +270,5 @@ function no() {
260
270
  ] });
261
271
  }
262
272
  export {
263
- no as InstapayWithdrawal
273
+ Ce as InstapayWithdrawal
264
274
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("@hookform/resolvers/zod"),f=require("react"),q=require("react-hook-form"),u=require("zod"),b=require("zustand/shallow");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../../../constants/index.js");require("../../../../utils/capitalize.js");const l=require("../../../../utils/parseDecimal.js");require("../../../../utils/getLocaleInfo.js");require("../../../../utils/getQueryClient.js");require("../../../../utils/isMobile.js");require("lodash-es");require("@opexa/portal-sdk-core/object-id");const M=require("../../../../client/hooks/useCreateMayaAppWithdrawalMutation.js"),v=require("../../../../client/hooks/useGlobalStore.js");require("../../../../client/hooks/useInfiniteQueryHelper.js");const I=require("../../../../client/hooks/useIsMayaSessionValidQuery.js");require("usehooks-ts");const C=require("../../../../client/hooks/usePaymentSettingsQuery.js"),x=require("../../../../client/utils/toaster.js"),P=require("../../../../icons/ChevronDownIcon.js"),W=require("../../../../icons/ChevronUpIcon.js"),A=require("../../../../icons/SpinnerIcon.js");require("../../../../ui/AlertDialog/AlertDialog.js");require("../../../../ui/Avatar/Avatar.js");require("../../../../ui/Badge/Badge.js");const D=require("../../../../ui/Button/Button.js");require("../../../../ui/Checkbox/Checkbox.js");require("../../../../ui/Clipboard/Clipboard.js");require("../../../../ui/DatePicker/DatePicker.js");require("../../../../ui/Dialog/Dialog.js");require("../../../../ui/Drawer/Drawer.js");const i=require("../../../../ui/Field/Field.js");require("@ark-ui/react");require("../../../../ui/IconButton/iconButton.recipe.js");const n=require("../../../../ui/NumberInput/NumberInput.js");require("../../../../ui/PinInput/PinInput.js");require("../../../../ui/Popover/Popover.js");require("tailwind-merge");require("../../../../ui/SegmentGroup/SegmentGroup.js");require("../../../../ui/Select/Select.js");require("../../../../ui/Table/Table.js");require("../../../../ui/Tabs/Tabs.js");const V=require("../../AmountChoices.js"),z=require("../../MayaSessionExpired.js");function Q(){var h;const y=v.useGlobalStore(b.useShallow(r=>({depositWithdrawal:r.depositWithdrawal}))),d=M.useCreateMayaAppWithdrawalMutation({onSuccess(){s.reset(),y.depositWithdrawal.setOpen(!1),x.toaster.success({description:"Withdrawal request submitted successfully."})},onError(r){x.toaster.error({description:r.message})}}),g=I.useIsMayaSessionValidQuery().data??!0,p=C.usePaymentSettingsQuery().data,o=p==null?void 0:p.mayaAppWithdrawalGatewaySettings,c=l.parseDecimal(o==null?void 0:o.maximumAmount,0),t=l.parseDecimal(o==null?void 0:o.minimumAmount,0),w=u.z.object({amount:u.z.string().superRefine((r,a)=>{const m=l.parseDecimal(r,0);m<t&&a.addIssue({type:"number",code:u.z.ZodIssueCode.too_small,inclusive:!0,minimum:t,message:`Minimum amount is ${t.toLocaleString()}`}),m>c&&a.addIssue({type:"number",code:u.z.ZodIssueCode.too_big,inclusive:!0,maximum:c,message:`Maximum amount is ${c.toLocaleString()}`})}),password:u.z.string().min(8,"Password must be 8 or more characters").max(64,"Password must be not be more than 64 characters")}),s=q.useForm({mode:"all",resolver:j.zodResolver(w),defaultValues:{amount:"0",password:""}});f.useEffect(()=>{t&&s.reset({amount:t.toString(),password:""})},[s,t]);const S=s.handleSubmit(async r=>{d.mutate({amount:r.amount,transactionPassword:r.password})});return g?e.jsxs("form",{onSubmit:S,noValidate:!0,children:[e.jsx(q.Controller,{control:s.control,name:"amount",render:r=>{var a;return e.jsxs(i.Root,{invalid:!!s.formState.errors.amount,children:[e.jsxs(n.Root,{min:0,step:1,value:r.field.value,onValueChange:m=>{r.field.onChange(m.value)},formatOptions:{maximumFractionDigits:2,minimumFractionDigits:0},allowMouseWheel:!0,children:[e.jsx(n.Label,{children:"Enter amount you want to deposit"}),e.jsxs(n.Control,{children:[e.jsx(n.Input,{}),e.jsx(n.IncrementTrigger,{children:e.jsx(W.ChevronUpIcon,{})}),e.jsx(n.DecrementTrigger,{children:e.jsx(P.ChevronDownIcon,{})})]})]}),e.jsx(i.ErrorText,{children:(a=s.formState.errors.amount)==null?void 0:a.message})]})}}),e.jsx(V.AmountChoices,{value:l.parseDecimal(s.watch("amount"),0),onChange:r=>{s.setValue("amount",r.toString(),{shouldTouch:!0,shouldDirty:!0,shouldValidate:!0})},min:t,max:c,className:"mt-xl"}),e.jsxs(i.Root,{className:"mt-3xl",invalid:!!s.formState.errors.password,children:[e.jsx(i.Label,{children:"Transaction Password"}),e.jsx(i.Input,{type:"password",...s.register("password")}),e.jsx(i.ErrorText,{children:(h=s.formState.errors.password)==null?void 0:h.message})]}),e.jsxs("p",{className:"mt-4xl text-xs",children:["Upon clicking the deposit button, you agree to the"," ",e.jsx("button",{type:"button",className:"underline underline-offset-2",children:"Terms of Use and Privacy Policy"}),"."]}),e.jsx(D.Button,{type:"submit",className:"mt-4.5",disabled:d.isPending,children:d.isPending?e.jsxs(e.Fragment,{children:[e.jsx(A.SpinnerIcon,{}),"Processing..."]}):"Withdraw"})]}):e.jsx(z.MayaSessionExpired,{})}exports.MayaAppWithdrawal=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("@hookform/resolvers/zod"),b=require("react"),x=require("react-hook-form"),u=require("zod"),I=require("zustand/shallow");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../../../constants/index.js");require("../../../../utils/capitalize.js");const m=require("../../../../utils/parseDecimal.js");require("../../../../utils/getLocaleInfo.js");require("../../../../utils/getQueryClient.js");require("../../../../utils/isMobile.js");require("lodash-es");require("@opexa/portal-sdk-core/object-id");const M=require("../../../../client/hooks/useCreateMayaAppWithdrawalMutation.js"),C=require("../../../../client/hooks/useGlobalStore.js");require("../../../../client/hooks/useInfiniteQueryHelper.js");const v=require("../../../../client/hooks/useIsMayaSessionValidQuery.js");require("usehooks-ts");const P=require("../../../../client/hooks/usePaymentSettingsQuery.js"),y=require("../../../../client/utils/toaster.js"),W=require("../../../../icons/ChevronDownIcon.js"),A=require("../../../../icons/ChevronUpIcon.js"),D=require("../../../../icons/EyeIcon.js"),E=require("../../../../icons/EyeOffIcon.js"),V=require("../../../../icons/SpinnerIcon.js");require("../../../../ui/AlertDialog/AlertDialog.js");require("../../../../ui/Avatar/Avatar.js");require("../../../../ui/Badge/Badge.js");const z=require("../../../../ui/Button/Button.js");require("../../../../ui/Checkbox/Checkbox.js");require("../../../../ui/Clipboard/Clipboard.js");require("../../../../ui/Collapsible/Collapsible.js");require("../../../../ui/DatePicker/DatePicker.js");require("../../../../ui/Dialog/Dialog.js");require("../../../../ui/Drawer/Drawer.js");const d=require("../../../../ui/Field/Field.js");require("@ark-ui/react");require("../../../../ui/IconButton/iconButton.recipe.js");const i=require("../../../../ui/NumberInput/NumberInput.js"),n=require("../../../../ui/PasswordInput/PasswordInput.js");require("../../../../ui/PinInput/PinInput.js");require("../../../../ui/Popover/Popover.js");require("tailwind-merge");require("../../../../ui/Progress/Progress.js");require("../../../../ui/SegmentGroup/SegmentGroup.js");require("../../../../ui/Select/Select.js");require("../../../../ui/Table/Table.js");require("../../../../ui/Tabs/Tabs.js");const Q=require("../../AmountChoices.js"),R=require("../../MayaSessionExpired.js");function T(){var p;const j=C.useGlobalStore(I.useShallow(r=>({depositWithdrawal:r.depositWithdrawal}))),h=M.useCreateMayaAppWithdrawalMutation({onSuccess(){s.reset(),j.depositWithdrawal.setOpen(!1),y.toaster.success({description:"Withdrawal request submitted successfully."})},onError(r){y.toaster.error({description:r.message})}}),g=v.useIsMayaSessionValidQuery().data??!0,q=P.usePaymentSettingsQuery().data,o=q==null?void 0:q.mayaAppWithdrawalGatewaySettings,c=m.parseDecimal(o==null?void 0:o.maximumAmount,0),t=m.parseDecimal(o==null?void 0:o.minimumAmount,0),f=u.z.object({amount:u.z.string().superRefine((r,a)=>{const l=m.parseDecimal(r,0);l<t&&a.addIssue({type:"number",code:u.z.ZodIssueCode.too_small,inclusive:!0,minimum:t,message:`Minimum amount is ${t.toLocaleString()}`}),l>c&&a.addIssue({type:"number",code:u.z.ZodIssueCode.too_big,inclusive:!0,maximum:c,message:`Maximum amount is ${c.toLocaleString()}`})}),password:u.z.string().min(8,"Password must be 8 or more characters").max(64,"Password must be not be more than 64 characters")}),s=x.useForm({mode:"all",resolver:S.zodResolver(f),defaultValues:{amount:"0",password:""}});b.useEffect(()=>{t&&s.reset({amount:t.toString(),password:""})},[s,t]);const w=s.handleSubmit(async r=>{h.mutate({amount:r.amount,transactionPassword:r.password})});return g?e.jsxs("form",{onSubmit:w,noValidate:!0,children:[e.jsx(x.Controller,{control:s.control,name:"amount",render:r=>{var a;return e.jsxs(d.Root,{invalid:!!s.formState.errors.amount,children:[e.jsxs(i.Root,{min:0,step:1,value:r.field.value,onValueChange:l=>{r.field.onChange(l.value)},formatOptions:{maximumFractionDigits:2,minimumFractionDigits:0},allowMouseWheel:!0,children:[e.jsx(i.Label,{children:"Enter amount you want to deposit"}),e.jsxs(i.Control,{children:[e.jsx(i.Input,{}),e.jsx(i.IncrementTrigger,{children:e.jsx(A.ChevronUpIcon,{})}),e.jsx(i.DecrementTrigger,{children:e.jsx(W.ChevronDownIcon,{})})]})]}),e.jsx(d.ErrorText,{children:(a=s.formState.errors.amount)==null?void 0:a.message})]})}}),e.jsx(Q.AmountChoices,{value:m.parseDecimal(s.watch("amount"),0),onChange:r=>{s.setValue("amount",r.toString(),{shouldTouch:!0,shouldDirty:!0,shouldValidate:!0})},min:t,max:c,className:"mt-xl"}),e.jsxs(d.Root,{className:"mt-3xl",invalid:!!s.formState.errors.password,children:[e.jsxs(n.Root,{children:[e.jsx(n.Label,{children:"Password"}),e.jsxs(n.Control,{children:[e.jsx(n.Input,{...s.register("password")}),e.jsx(n.VisibilityTrigger,{children:e.jsx(n.Indicator,{fallback:e.jsx(E.EyeOffIcon,{}),asChild:!0,children:e.jsx(D.EyeIcon,{})})})]})]}),e.jsx(d.ErrorText,{children:(p=s.formState.errors.password)==null?void 0:p.message})]}),e.jsxs("p",{className:"mt-4xl text-xs",children:["Upon clicking the deposit button, you agree to the"," ",e.jsx("button",{type:"button",className:"underline underline-offset-2",children:"Terms of Use and Privacy Policy"}),"."]}),e.jsx(z.Button,{type:"submit",className:"mt-4.5",disabled:h.isPending,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V.SpinnerIcon,{}),"Processing..."]}):"Withdraw"})]}):e.jsx(R.MayaSessionExpired,{})}exports.MayaAppWithdrawal=T;