react-native-monflowts 0.5.1 → 0.5.2

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 (245) hide show
  1. package/README.md +37 -3
  2. package/android/build.gradle +1 -0
  3. package/android/src/main/java/com/monflowts/MonflowtsNavigationModule.kt +43 -0
  4. package/android/src/main/java/com/monflowts/MonflowtsPackage.kt +10 -1
  5. package/android/src/main/java/com/monflowts/MonflowtsStackView.kt +443 -0
  6. package/android/src/main/java/com/monflowts/MonflowtsStackViewManager.kt +70 -0
  7. package/ios/MonflowtsNavigationBridge.m +10 -0
  8. package/ios/MonflowtsNavigationModule.swift +28 -0
  9. package/ios/MonflowtsStackBridge.m +17 -0
  10. package/ios/MonflowtsStackUIView.swift +409 -0
  11. package/ios/MonflowtsStackViewManager.swift +14 -0
  12. package/lib/module/HubContent.js +259 -219
  13. package/lib/module/HubContent.js.map +1 -1
  14. package/lib/module/MonflowtsHub.js +42 -3
  15. package/lib/module/MonflowtsHub.js.map +1 -1
  16. package/lib/module/api/mutations.js +4 -0
  17. package/lib/module/api/mutations.js.map +1 -1
  18. package/lib/module/api/queries.js +9 -3
  19. package/lib/module/api/queries.js.map +1 -1
  20. package/lib/module/components/AbandonPolicyNotice.js +3 -2
  21. package/lib/module/components/AbandonPolicyNotice.js.map +1 -1
  22. package/lib/module/components/CoinFlyOverlay.js +27 -20
  23. package/lib/module/components/CoinFlyOverlay.js.map +1 -1
  24. package/lib/module/components/GameRulesModal.js +8 -6
  25. package/lib/module/components/GameRulesModal.js.map +1 -1
  26. package/lib/module/components/HypeCallout.js +5 -5
  27. package/lib/module/components/HypeCallout.js.map +1 -1
  28. package/lib/module/components/InsufficientFundsOverlay.js +2 -1
  29. package/lib/module/components/InsufficientFundsOverlay.js.map +1 -1
  30. package/lib/module/components/JackpotNearMiss.js +3 -2
  31. package/lib/module/components/JackpotNearMiss.js.map +1 -1
  32. package/lib/module/components/JackpotTeaser.js +2 -1
  33. package/lib/module/components/JackpotTeaser.js.map +1 -1
  34. package/lib/module/components/QuitConfirmModal.js +3 -2
  35. package/lib/module/components/QuitConfirmModal.js.map +1 -1
  36. package/lib/module/components/SessionTimer.js +3 -2
  37. package/lib/module/components/SessionTimer.js.map +1 -1
  38. package/lib/module/components/ShopArtView.js +105 -0
  39. package/lib/module/components/ShopArtView.js.map +1 -0
  40. package/lib/module/components/SideDemoTab.js +20 -2
  41. package/lib/module/components/SideDemoTab.js.map +1 -1
  42. package/lib/module/components/StakeInput.js +3 -2
  43. package/lib/module/components/StakeInput.js.map +1 -1
  44. package/lib/module/content.js.map +1 -1
  45. package/lib/module/hooks/useAvailableGames.js +7 -2
  46. package/lib/module/hooks/useAvailableGames.js.map +1 -1
  47. package/lib/module/hooks/useLeaderboard.js.map +1 -1
  48. package/lib/module/hooks/usePlayGame.js +11 -5
  49. package/lib/module/hooks/usePlayGame.js.map +1 -1
  50. package/lib/module/hooks/useRaffleDrawState.js +4 -1
  51. package/lib/module/hooks/useRaffleDrawState.js.map +1 -1
  52. package/lib/module/index.js +15 -0
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/navigation/NativeStackView.js +5 -0
  55. package/lib/module/navigation/NativeStackView.js.map +1 -0
  56. package/lib/module/navigation/Navigator.js +250 -0
  57. package/lib/module/navigation/Navigator.js.map +1 -0
  58. package/lib/module/navigation/engine.js +466 -0
  59. package/lib/module/navigation/engine.js.map +1 -0
  60. package/lib/module/navigation/hooks.js +29 -0
  61. package/lib/module/navigation/hooks.js.map +1 -0
  62. package/lib/module/navigation/index.js +7 -0
  63. package/lib/module/navigation/index.js.map +1 -0
  64. package/lib/module/navigation/routes.js +111 -0
  65. package/lib/module/navigation/routes.js.map +1 -0
  66. package/lib/module/theme.js +2 -2
  67. package/lib/module/theme.js.map +1 -1
  68. package/lib/module/utils/scale.js +35 -0
  69. package/lib/module/utils/scale.js.map +1 -0
  70. package/lib/module/views/DepositSelect.js +3 -2
  71. package/lib/module/views/DepositSelect.js.map +1 -1
  72. package/lib/module/views/DiceBattle.js +207 -125
  73. package/lib/module/views/DiceBattle.js.map +1 -1
  74. package/lib/module/views/DiceLobby.js +97 -30
  75. package/lib/module/views/DiceLobby.js.map +1 -1
  76. package/lib/module/views/FortuneWheel.js +417 -271
  77. package/lib/module/views/FortuneWheel.js.map +1 -1
  78. package/lib/module/views/Freefall.js +147 -88
  79. package/lib/module/views/Freefall.js.map +1 -1
  80. package/lib/module/views/History.js +3 -2
  81. package/lib/module/views/History.js.map +1 -1
  82. package/lib/module/views/Home.js +1026 -401
  83. package/lib/module/views/Home.js.map +1 -1
  84. package/lib/module/views/Jetstream.js +43 -19
  85. package/lib/module/views/Jetstream.js.map +1 -1
  86. package/lib/module/views/Leaderboard.js +98 -89
  87. package/lib/module/views/Leaderboard.js.map +1 -1
  88. package/lib/module/views/MillionaireHunter.js +743 -569
  89. package/lib/module/views/MillionaireHunter.js.map +1 -1
  90. package/lib/module/views/Minefield.js +40 -18
  91. package/lib/module/views/Minefield.js.map +1 -1
  92. package/lib/module/views/PaymentWebView.js +4 -3
  93. package/lib/module/views/PaymentWebView.js.map +1 -1
  94. package/lib/module/views/PlayerCard.js +3 -2
  95. package/lib/module/views/PlayerCard.js.map +1 -1
  96. package/lib/module/views/Profile.js +3 -2
  97. package/lib/module/views/Profile.js.map +1 -1
  98. package/lib/module/views/RaffleDraw.js +16 -6
  99. package/lib/module/views/RaffleDraw.js.map +1 -1
  100. package/lib/module/views/RevealWin.js +152 -25
  101. package/lib/module/views/RevealWin.js.map +1 -1
  102. package/lib/module/views/Splash.js +3 -2
  103. package/lib/module/views/Splash.js.map +1 -1
  104. package/lib/module/views/Success.js +5 -2
  105. package/lib/module/views/Success.js.map +1 -1
  106. package/lib/module/views/TicketShop.js +1067 -236
  107. package/lib/module/views/TicketShop.js.map +1 -1
  108. package/lib/module/views/TriviaLobby.js +43 -6
  109. package/lib/module/views/TriviaLobby.js.map +1 -1
  110. package/lib/module/views/TriviaMaster.js +23 -18
  111. package/lib/module/views/TriviaMaster.js.map +1 -1
  112. package/lib/module/views/Wallet.js +2 -1
  113. package/lib/module/views/Wallet.js.map +1 -1
  114. package/lib/module/views/WithdrawFlow.js +3 -2
  115. package/lib/module/views/WithdrawFlow.js.map +1 -1
  116. package/lib/module/views/diceDuel.js +44 -0
  117. package/lib/module/views/diceDuel.js.map +1 -0
  118. package/lib/module/views/freefallDrop.js +66 -0
  119. package/lib/module/views/freefallDrop.js.map +1 -0
  120. package/lib/module/views/homeLayout.js +47 -0
  121. package/lib/module/views/homeLayout.js.map +1 -0
  122. package/lib/module/views/launchFeatured.js +43 -0
  123. package/lib/module/views/launchFeatured.js.map +1 -0
  124. package/lib/module/views/leaderboardPhase.js +52 -0
  125. package/lib/module/views/leaderboardPhase.js.map +1 -0
  126. package/lib/module/views/lobbyKit.js +224 -0
  127. package/lib/module/views/lobbyKit.js.map +1 -0
  128. package/lib/module/views/raffleContent.js +11 -0
  129. package/lib/module/views/raffleContent.js.map +1 -0
  130. package/lib/module/views/rafflePhase.js +15 -0
  131. package/lib/module/views/rafflePhase.js.map +1 -0
  132. package/lib/module/views/revealWinHelpers.js +19 -0
  133. package/lib/module/views/revealWinHelpers.js.map +1 -1
  134. package/lib/module/views/shopArtMotion.js +25 -0
  135. package/lib/module/views/shopArtMotion.js.map +1 -0
  136. package/lib/module/views/ticketBundlePresets.js +15 -12
  137. package/lib/module/views/ticketBundlePresets.js.map +1 -1
  138. package/lib/module/views/ticketShopArt.js +391 -0
  139. package/lib/module/views/ticketShopArt.js.map +1 -0
  140. package/lib/module/views/treasureHunt.js +81 -0
  141. package/lib/module/views/treasureHunt.js.map +1 -0
  142. package/lib/module/views/wheelLayout.js +47 -0
  143. package/lib/module/views/wheelLayout.js.map +1 -0
  144. package/lib/typescript/src/HubContent.d.ts.map +1 -1
  145. package/lib/typescript/src/MonflowtsHub.d.ts.map +1 -1
  146. package/lib/typescript/src/api/gameTypes.d.ts +18 -2
  147. package/lib/typescript/src/api/gameTypes.d.ts.map +1 -1
  148. package/lib/typescript/src/api/mutations.d.ts.map +1 -1
  149. package/lib/typescript/src/api/queries.d.ts.map +1 -1
  150. package/lib/typescript/src/api/sdkTypes.d.ts +3 -0
  151. package/lib/typescript/src/api/sdkTypes.d.ts.map +1 -1
  152. package/lib/typescript/src/components/AbandonPolicyNotice.d.ts.map +1 -1
  153. package/lib/typescript/src/components/CoinFlyOverlay.d.ts.map +1 -1
  154. package/lib/typescript/src/components/GameRulesModal.d.ts +1 -0
  155. package/lib/typescript/src/components/GameRulesModal.d.ts.map +1 -1
  156. package/lib/typescript/src/components/HypeCallout.d.ts.map +1 -1
  157. package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts.map +1 -1
  158. package/lib/typescript/src/components/JackpotNearMiss.d.ts.map +1 -1
  159. package/lib/typescript/src/components/JackpotTeaser.d.ts.map +1 -1
  160. package/lib/typescript/src/components/QuitConfirmModal.d.ts.map +1 -1
  161. package/lib/typescript/src/components/SessionTimer.d.ts.map +1 -1
  162. package/lib/typescript/src/components/ShopArtView.d.ts +11 -0
  163. package/lib/typescript/src/components/ShopArtView.d.ts.map +1 -0
  164. package/lib/typescript/src/components/SideDemoTab.d.ts +1 -0
  165. package/lib/typescript/src/components/SideDemoTab.d.ts.map +1 -1
  166. package/lib/typescript/src/components/StakeInput.d.ts.map +1 -1
  167. package/lib/typescript/src/content.d.ts +1 -0
  168. package/lib/typescript/src/content.d.ts.map +1 -1
  169. package/lib/typescript/src/hooks/useAvailableGames.d.ts +3 -0
  170. package/lib/typescript/src/hooks/useAvailableGames.d.ts.map +1 -1
  171. package/lib/typescript/src/hooks/useLeaderboard.d.ts +4 -0
  172. package/lib/typescript/src/hooks/useLeaderboard.d.ts.map +1 -1
  173. package/lib/typescript/src/hooks/usePlayGame.d.ts +1 -1
  174. package/lib/typescript/src/hooks/usePlayGame.d.ts.map +1 -1
  175. package/lib/typescript/src/hooks/useRaffleDrawState.d.ts.map +1 -1
  176. package/lib/typescript/src/index.d.ts +16 -0
  177. package/lib/typescript/src/index.d.ts.map +1 -1
  178. package/lib/typescript/src/navigation/NativeStackView.d.ts +41 -0
  179. package/lib/typescript/src/navigation/NativeStackView.d.ts.map +1 -0
  180. package/lib/typescript/src/navigation/Navigator.d.ts +13 -0
  181. package/lib/typescript/src/navigation/Navigator.d.ts.map +1 -0
  182. package/lib/typescript/src/navigation/engine.d.ts +69 -0
  183. package/lib/typescript/src/navigation/engine.d.ts.map +1 -0
  184. package/lib/typescript/src/navigation/hooks.d.ts +6 -0
  185. package/lib/typescript/src/navigation/hooks.d.ts.map +1 -0
  186. package/lib/typescript/src/navigation/index.d.ts +7 -0
  187. package/lib/typescript/src/navigation/index.d.ts.map +1 -0
  188. package/lib/typescript/src/navigation/routes.d.ts +80 -0
  189. package/lib/typescript/src/navigation/routes.d.ts.map +1 -0
  190. package/lib/typescript/src/types.d.ts +0 -9
  191. package/lib/typescript/src/types.d.ts.map +1 -1
  192. package/lib/typescript/src/utils/scale.d.ts +12 -0
  193. package/lib/typescript/src/utils/scale.d.ts.map +1 -0
  194. package/lib/typescript/src/views/DiceBattle.d.ts.map +1 -1
  195. package/lib/typescript/src/views/DiceLobby.d.ts.map +1 -1
  196. package/lib/typescript/src/views/FortuneWheel.d.ts.map +1 -1
  197. package/lib/typescript/src/views/Freefall.d.ts.map +1 -1
  198. package/lib/typescript/src/views/History.d.ts.map +1 -1
  199. package/lib/typescript/src/views/Home.d.ts +2 -2
  200. package/lib/typescript/src/views/Home.d.ts.map +1 -1
  201. package/lib/typescript/src/views/Jetstream.d.ts.map +1 -1
  202. package/lib/typescript/src/views/Leaderboard.d.ts.map +1 -1
  203. package/lib/typescript/src/views/MillionaireHunter.d.ts.map +1 -1
  204. package/lib/typescript/src/views/Minefield.d.ts.map +1 -1
  205. package/lib/typescript/src/views/PlayerCard.d.ts.map +1 -1
  206. package/lib/typescript/src/views/Profile.d.ts.map +1 -1
  207. package/lib/typescript/src/views/RaffleDraw.d.ts +2 -1
  208. package/lib/typescript/src/views/RaffleDraw.d.ts.map +1 -1
  209. package/lib/typescript/src/views/RevealWin.d.ts.map +1 -1
  210. package/lib/typescript/src/views/Splash.d.ts.map +1 -1
  211. package/lib/typescript/src/views/Success.d.ts.map +1 -1
  212. package/lib/typescript/src/views/TicketShop.d.ts +1 -0
  213. package/lib/typescript/src/views/TicketShop.d.ts.map +1 -1
  214. package/lib/typescript/src/views/TriviaLobby.d.ts.map +1 -1
  215. package/lib/typescript/src/views/TriviaMaster.d.ts.map +1 -1
  216. package/lib/typescript/src/views/Wallet.d.ts.map +1 -1
  217. package/lib/typescript/src/views/diceDuel.d.ts +22 -0
  218. package/lib/typescript/src/views/diceDuel.d.ts.map +1 -0
  219. package/lib/typescript/src/views/freefallDrop.d.ts +19 -0
  220. package/lib/typescript/src/views/freefallDrop.d.ts.map +1 -0
  221. package/lib/typescript/src/views/homeLayout.d.ts +15 -0
  222. package/lib/typescript/src/views/homeLayout.d.ts.map +1 -0
  223. package/lib/typescript/src/views/launchFeatured.d.ts +2 -0
  224. package/lib/typescript/src/views/launchFeatured.d.ts.map +1 -0
  225. package/lib/typescript/src/views/leaderboardPhase.d.ts +6 -0
  226. package/lib/typescript/src/views/leaderboardPhase.d.ts.map +1 -0
  227. package/lib/typescript/src/views/lobbyKit.d.ts +45 -0
  228. package/lib/typescript/src/views/lobbyKit.d.ts.map +1 -0
  229. package/lib/typescript/src/views/raffleContent.d.ts +3 -0
  230. package/lib/typescript/src/views/raffleContent.d.ts.map +1 -0
  231. package/lib/typescript/src/views/rafflePhase.d.ts +9 -0
  232. package/lib/typescript/src/views/rafflePhase.d.ts.map +1 -0
  233. package/lib/typescript/src/views/revealWinHelpers.d.ts +9 -0
  234. package/lib/typescript/src/views/revealWinHelpers.d.ts.map +1 -1
  235. package/lib/typescript/src/views/shopArtMotion.d.ts +13 -0
  236. package/lib/typescript/src/views/shopArtMotion.d.ts.map +1 -0
  237. package/lib/typescript/src/views/ticketBundlePresets.d.ts +3 -17
  238. package/lib/typescript/src/views/ticketBundlePresets.d.ts.map +1 -1
  239. package/lib/typescript/src/views/ticketShopArt.d.ts +27 -0
  240. package/lib/typescript/src/views/ticketShopArt.d.ts.map +1 -0
  241. package/lib/typescript/src/views/treasureHunt.d.ts +29 -0
  242. package/lib/typescript/src/views/treasureHunt.d.ts.map +1 -0
  243. package/lib/typescript/src/views/wheelLayout.d.ts +30 -0
  244. package/lib/typescript/src/views/wheelLayout.d.ts.map +1 -0
  245. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
4
- import { View, Text, StyleSheet, Alert, Animated, KeyboardAvoidingView, Platform, ScrollView, BackHandler } from 'react-native';
4
+ import { View, Text, StyleSheet, Alert, Animated, Easing, KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
5
+ import { scaledStyles } from "../utils/scale.js";
5
6
  import CoinFlyOverlay from "../components/CoinFlyOverlay.js";
6
7
  import MonflowtsPressable from "../components/MonflowtsPressable.js";
7
8
  import MonflowtsWheelView from "../NativeWheelView.js";
@@ -10,6 +11,7 @@ import QuitConfirmModal from "../components/QuitConfirmModal.js";
10
11
  import SideDemoTab from "../components/SideDemoTab.js";
11
12
  import SvgIcon from "../Icons.js";
12
13
  import { sounds } from "../SoundManager.js";
14
+ import { useBackGuard } from "../navigation/hooks.js";
13
15
  import HypeCallout from "../components/HypeCallout.js";
14
16
  import { HYPE_PHRASES, pickPhrase } from "../effects/hypePhrases.js";
15
17
  import MonflowtsButton from "../components/MonflowtsButton.js";
@@ -19,7 +21,7 @@ import AbandonPolicyNotice from "../components/AbandonPolicyNotice.js";
19
21
  import InsufficientFundsOverlay from "../components/InsufficientFundsOverlay.js";
20
22
  import StakeInput from "../components/StakeInput.js";
21
23
  import GameRulesModal from "../components/GameRulesModal.js";
22
- import JackpotNearMiss from "../components/JackpotNearMiss.js";
24
+ import { nativeWheelSegments, wheelLayout, wheelOddsRows, wheelReturnToPlayer } from "./wheelLayout.js";
23
25
  import { usePlayGame, useInitPlay } from "../hooks/usePlayGame.js";
24
26
  import { useCurrency } from "../hooks/useCurrency.js";
25
27
  import { useResponsive } from "../hooks/useResponsive.js";
@@ -27,7 +29,6 @@ import { useGameStore } from "../stores/gameStore.js";
27
29
  import { gameContent, gameRules, randomMessageKey } from "../content.js";
28
30
  import { t, formatNumber, errorText } from "../i18n.js";
29
31
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
30
- const WHEEL_MAX_SIZE = 460;
31
32
  const FortuneWheel = ({
32
33
  onBack,
33
34
  balance,
@@ -39,19 +40,35 @@ const FortuneWheel = ({
39
40
  // ── Derive segments from server game config ──
40
41
  const currency = useCurrency();
41
42
  const {
42
- columnWidth
43
+ columnWidth,
44
+ height: windowHeight
43
45
  } = useResponsive();
46
+ const [box, setBox] = useState({
47
+ width: columnWidth,
48
+ height: windowHeight
49
+ });
50
+ const layout = useMemo(() => wheelLayout(box.width, box.height), [box.width, box.height]);
51
+ const onContainerLayout = useCallback(e => {
52
+ const {
53
+ width,
54
+ height
55
+ } = e.nativeEvent.layout;
56
+ setBox(prev => prev.width === width && prev.height === height ? prev : {
57
+ width,
58
+ height
59
+ });
60
+ }, []);
44
61
  const demoMode = useGameStore(s => s.demoMode);
62
+ const creditDemoBalance = useGameStore(s => s.creditDemoBalance);
45
63
  const toggleDemoMode = useGameStore(s => s.toggleDemoMode);
46
64
  const segments = useMemo(() => {
47
65
  const content = gameContent('SPIN_WHEEL');
48
66
  const source = game?.gameplayRules?.segments?.length ? game.gameplayRules.segments : content.rules?.segments ?? [];
49
- const palette = content.segmentColors ?? [];
50
- return source.map((seg, i) => ({
51
- label: seg.label,
52
- value: seg.payoutKobo != null ? seg.payoutKobo / 100 : seg.value ?? 0,
53
- color: seg.color ?? palette[i % palette.length] ?? '#4f46e5'
54
- }));
67
+ return nativeWheelSegments(source, content.segmentColors ?? []);
68
+ }, [game]);
69
+ const multipliers = useMemo(() => {
70
+ const source = game?.gameplayRules?.segments ?? [];
71
+ return source.length && source.every(seg => typeof seg.multiplier === 'number') ? source.map(seg => seg.multiplier) : null;
55
72
  }, [game]);
56
73
 
57
74
  // Derive actual play cost from game config (kobo → VG)
@@ -65,8 +82,10 @@ const FortuneWheel = ({
65
82
  }, [game?.playCost]);
66
83
  const hasStakeOptions = !!game?.gameplayRules?.stakeOptions?.length;
67
84
  const stakeOptions = (hasStakeOptions ? game.gameplayRules.stakeOptions : gameRules('SPIN_WHEEL').stakeOptions ?? []).map(s => Math.round(s / 100));
68
- const [activeStake, setActiveStake] = useState(hasStakeOptions ? stakeOptions[Math.floor(stakeOptions.length / 2)] ?? 250 : actualCostVG || (stakeOptions[Math.floor(stakeOptions.length / 2)] ?? 250));
85
+ const [activeStake, setActiveStake] = useState(hasStakeOptions ? stakeOptions[0] ?? 100 : actualCostVG || (stakeOptions[0] ?? 100));
69
86
  const effectiveCostVG = hasStakeOptions ? activeStake : actualCostVG || activeStake;
87
+ const oddsRows = useMemo(() => multipliers ? wheelOddsRows(multipliers, effectiveCostVG) : [], [multipliers, effectiveCostVG]);
88
+ const rtpPercent = multipliers ? (wheelReturnToPlayer(multipliers) * 100).toFixed(1) : null;
70
89
 
71
90
  // Multi-play session support
72
91
  const stakeCountOptions = game?.gameplayRules?.stakeCountOptions ?? [];
@@ -75,6 +94,8 @@ const FortuneWheel = ({
75
94
  const isMultiRound = selectedStakeCount > 1;
76
95
  const totalCostVG = effectiveCostVG * selectedStakeCount;
77
96
  const [roundNum, setRoundNum] = useState(0);
97
+ const roundRef = useRef(0);
98
+ const [lastSpin, setLastSpin] = useState(null);
78
99
  const [sessionWins, setSessionWins] = useState(0);
79
100
  const [sessionTotalWon, setSessionTotalWon] = useState(0);
80
101
  const [sessionComplete, setSessionComplete] = useState(false);
@@ -90,19 +111,17 @@ const FortuneWheel = ({
90
111
  }
91
112
  setQuitVisible(true);
92
113
  }, [wheelLive, onBack]);
93
- useEffect(() => {
94
- const sub = BackHandler.addEventListener('hardwareBackPress', () => {
95
- handleBack();
96
- return true;
97
- });
98
- return () => sub.remove();
99
- }, [handleBack]);
114
+ useBackGuard(wheelLive, handleBack);
100
115
  const [lastAmountWon, setLastAmountWon] = useState(0);
101
116
  const [rulesVisible, setRulesVisible] = useState(false);
102
- const [rotation, setRotation] = useState(0);
117
+ const spinAngle = useRef(new Animated.Value(0)).current;
118
+ const spinRotate = useMemo(() => spinAngle.interpolate({
119
+ inputRange: [0, 360],
120
+ outputRange: ['0deg', '360deg'],
121
+ extrapolate: 'extend'
122
+ }), [spinAngle]);
103
123
  const rotationRef = useRef(0);
104
124
  const lastTickSegment = useRef(0);
105
- const animFrameRef = useRef(null);
106
125
  const {
107
126
  play
108
127
  } = usePlayGame();
@@ -139,6 +158,7 @@ const FortuneWheel = ({
139
158
  sounds.resume();
140
159
  setIsSpinning(true);
141
160
  setRoundNum(r => r + 1);
161
+ roundRef.current += 1;
142
162
 
143
163
  // ── Call server to determine outcome ──
144
164
  const gameInputPayload = isMultiRound ? {
@@ -160,6 +180,8 @@ const FortuneWheel = ({
160
180
  } else {
161
181
  Alert.alert(t('wheel.playError'), errorText(e, 'wheel.somethingWentWrong'));
162
182
  }
183
+ roundRef.current -= 1;
184
+ setRoundNum(r => Math.max(0, r - 1));
163
185
  setIsSpinning(false);
164
186
  return;
165
187
  }
@@ -207,92 +229,92 @@ const FortuneWheel = ({
207
229
 
208
230
  // Honor the admin-configured spin duration; fall back to 6s if unset.
209
231
  const duration = game?.gameplayRules?.spinDurationMs ?? gameRules('SPIN_WHEEL').spinDurationMs ?? 0;
210
- const startTime = Date.now();
211
- const startRotation = rotationRef.current;
212
- const animate = () => {
213
- const elapsed = Date.now() - startTime;
214
- const progress = Math.min(elapsed / duration, 1);
215
-
216
- // Quartic ease out
217
- const easedProgress = 1 - Math.pow(1 - progress, 4);
218
- const currentRot = startRotation + (totalNewRotation - startRotation) * easedProgress;
219
- setRotation(currentRot);
220
- rotationRef.current = currentRot;
221
-
222
- // Segment-crossing tick sound
223
- const segSize = 360 / segments.length;
224
- const currentSegment = Math.floor((currentRot + segSize / 2) % 360 / segSize);
232
+ const segSize = 360 / segments.length;
233
+ const tickListener = spinAngle.addListener(({
234
+ value
235
+ }) => {
236
+ const currentSegment = Math.floor((value + segSize / 2) % 360 / segSize);
225
237
  if (currentSegment !== lastTickSegment.current) {
226
238
  sounds.playRollTick();
227
239
  lastTickSegment.current = currentSegment;
228
240
  }
229
- if (progress < 1) {
230
- animFrameRef.current = requestAnimationFrame(animate);
231
- } else {
232
- // Finish spin
233
- rotationRef.current = totalNewRotation;
234
- setRotation(totalNewRotation);
235
- setIsSpinning(false);
236
- const amountWon = (serverResult?.amountWonKobo ?? 0) / 100;
237
- const session = gameResult?.session;
238
- const isLastRound = session?.isLastRound ?? true;
239
- if (isMultiRound) {
240
- if (amountWon > 0) {
241
- setSessionWins(w => w + 1);
242
- setSessionTotalWon(t => t + amountWon);
243
- sounds.playWinChime();
244
- hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.wheel.bigWin : HYPE_PHRASES.wheel.win), amountWon >= 5000 ? 'boost' : 'win');
245
- if (!demoMode) {
246
- coinFlyRef.current?.measureTarget();
247
- wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
248
- coinFlyRef.current?.fly(x + w / 2, y + h / 2);
249
- });
250
- }
251
- } else {
252
- sounds.playDrawSound();
253
- hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
254
- }
255
- if (isLastRound) {
256
- setSessionComplete(true);
257
- const totalWon = sessionTotalWon + amountWon;
258
- setLastAmountWon(totalWon);
259
- setShowResultOverlay(true);
241
+ });
242
+ Animated.timing(spinAngle, {
243
+ toValue: totalNewRotation,
244
+ duration,
245
+ easing: Easing.out(Easing.poly(4)),
246
+ useNativeDriver: true
247
+ }).start(() => {
248
+ spinAngle.removeListener(tickListener);
249
+ rotationRef.current = totalNewRotation;
250
+ setIsSpinning(false);
251
+ const amountWon = (serverResult?.amountWonKobo ?? 0) / 100;
252
+ const session = gameResult?.session;
253
+ const isLastRound = session?.isLastRound ?? roundRef.current >= selectedStakeCount;
254
+ setLastSpin({
255
+ label: segments[serverSegmentIndex]?.label ?? '',
256
+ multiplier: typeof gameResult?.multiplier === 'number' ? gameResult.multiplier : null,
257
+ nonce: typeof gameResult?.nonce === 'number' ? gameResult.nonce : null,
258
+ hash: typeof gameResult?.serverSeedHash === 'string' && gameResult.serverSeedHash !== 'demo' ? gameResult.serverSeedHash : null
259
+ });
260
+ if (isMultiRound) {
261
+ if (amountWon > 0) {
262
+ setSessionWins(w => w + 1);
263
+ setSessionTotalWon(t => t + amountWon);
264
+ sounds.playWinChime();
265
+ hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.wheel.bigWin : HYPE_PHRASES.wheel.win), amountWon >= 5000 ? 'boost' : 'win');
266
+ if (!demoMode) {
267
+ coinFlyRef.current?.measureTarget();
268
+ wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
269
+ coinFlyRef.current?.fly(x + w / 2, y + h / 2);
270
+ });
260
271
  }
261
272
  } else {
262
- // Single round: show result overlay
263
- setLastAmountWon(amountWon);
264
- if (amountWon > 0) {
265
- sounds.playWinChime();
266
- hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.wheel.bigWin : HYPE_PHRASES.wheel.win), amountWon >= 5000 ? 'boost' : 'win');
267
- if (!demoMode) {
268
- coinFlyRef.current?.measureTarget();
269
- wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
270
- coinFlyRef.current?.fly(x + w / 2, y + h / 2);
271
- });
272
- }
273
- } else {
274
- sounds.playDrawSound();
275
- hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
276
- }
273
+ sounds.playDrawSound();
274
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
275
+ }
276
+ if (isLastRound) {
277
+ setSessionComplete(true);
278
+ const totalWon = sessionTotalWon + amountWon;
279
+ setLastAmountWon(totalWon);
277
280
  setShowResultOverlay(true);
278
281
  }
282
+ } else {
283
+ // Single round: show result overlay
284
+ setLastAmountWon(amountWon);
285
+ if (amountWon > 0) {
286
+ sounds.playWinChime();
287
+ hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.wheel.bigWin : HYPE_PHRASES.wheel.win), amountWon >= 5000 ? 'boost' : 'win');
288
+ if (!demoMode) {
289
+ coinFlyRef.current?.measureTarget();
290
+ wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
291
+ coinFlyRef.current?.fly(x + w / 2, y + h / 2);
292
+ });
293
+ }
294
+ } else {
295
+ sounds.playDrawSound();
296
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
297
+ }
298
+ setShowResultOverlay(true);
279
299
  }
280
- };
281
- animFrameRef.current = requestAnimationFrame(animate);
300
+ });
282
301
  }, [isSpinning, balance, effectiveCostVG, game, segments, play, onWin, onLose, initPlay, isMultiRound, selectedStakeCount, sessionTotalWon, sessionComplete]);
283
- const wheelSize = Math.min(columnWidth - 80, WHEEL_MAX_SIZE);
284
- const rotateDeg = `${rotation}deg`;
302
+ const {
303
+ wheelSize
304
+ } = layout;
285
305
  const resultMsgKey = useMemo(() => randomMessageKey(lastAmountWon > 0 ? 'wheel.win' : 'wheel.loss'), [showResultOverlay] // eslint-disable-line react-hooks/exhaustive-deps
286
306
  );
287
307
  const handleResultPlayAgain = useCallback(() => {
308
+ if (demoMode && lastAmountWon > 0) creditDemoBalance(lastAmountWon);
288
309
  setShowResultOverlay(false);
289
310
  setSessionComplete(false);
290
311
  setRoundNum(0);
312
+ roundRef.current = 0;
291
313
  setSessionWins(0);
292
314
  setSessionTotalWon(0);
293
315
  setLastAmountWon(0);
294
316
  if (initPlay.enabled) initPlay.reset();
295
- }, [initPlay]);
317
+ }, [initPlay, demoMode, lastAmountWon, creditDemoBalance]);
296
318
  const handleResultExit = useCallback(() => {
297
319
  if (lastAmountWon > 0) {
298
320
  onWin(lastAmountWon);
@@ -300,40 +322,50 @@ const FortuneWheel = ({
300
322
  onLose?.();
301
323
  }
302
324
  }, [lastAmountWon, onWin, onLose]);
303
- return /*#__PURE__*/_jsxs(KeyboardAvoidingView, {
325
+ const paytablePanel = oddsRows.length > 0 && /*#__PURE__*/_jsxs(View, {
326
+ style: styles.paytable,
327
+ children: [/*#__PURE__*/_jsx(Text, {
328
+ style: styles.stakeLabel,
329
+ children: t('hunter.paytable')
330
+ }), oddsRows.map(row => /*#__PURE__*/_jsxs(View, {
331
+ style: styles.paytableRow,
332
+ children: [/*#__PURE__*/_jsxs(Text, {
333
+ style: [styles.paytableCell, styles.paytableMultiplier],
334
+ children: [row.multiplier, "x"]
335
+ }), /*#__PURE__*/_jsx(Text, {
336
+ style: [styles.paytableCell, styles.paytableValue],
337
+ children: formatNumber(row.payout)
338
+ }), /*#__PURE__*/_jsx(Text, {
339
+ style: [styles.paytableCell, styles.paytableOdds],
340
+ children: t('hunter.oneIn', {
341
+ odds: 1 / row.probability < 10 ? (1 / row.probability).toFixed(1) : Math.round(1 / row.probability).toLocaleString('en-US')
342
+ })
343
+ })]
344
+ }, row.multiplier)), rtpPercent && /*#__PURE__*/_jsx(Text, {
345
+ style: styles.paytableNote,
346
+ children: t('hunter.rtp', {
347
+ percent: rtpPercent
348
+ })
349
+ })]
350
+ });
351
+ return /*#__PURE__*/_jsx(KeyboardAvoidingView, {
304
352
  style: {
305
353
  flex: 1
306
354
  },
307
355
  behavior: Platform.OS === 'ios' ? 'padding' : undefined,
308
- children: [/*#__PURE__*/_jsx(HypeCallout, {
309
- ref: hypeRef,
310
- style: {
311
- top: 240
312
- }
313
- }), /*#__PURE__*/_jsx(SideDemoTab, {
314
- enabled: !!game?.demoConfig?.enabled
315
- }), /*#__PURE__*/_jsxs(ScrollView, {
356
+ children: /*#__PURE__*/_jsxs(View, {
316
357
  style: styles.container,
317
- contentContainerStyle: {
318
- flexGrow: 1
319
- },
320
- keyboardShouldPersistTaps: "handled",
321
- bounces: false,
322
- children: [initPlay.enabled && initPlay.session && /*#__PURE__*/_jsx(SessionTimer, {
358
+ onLayout: onContainerLayout,
359
+ children: [/*#__PURE__*/_jsx(HypeCallout, {
360
+ ref: hypeRef,
361
+ style: {
362
+ top: layout.landscape ? 80 : 240
363
+ }
364
+ }), /*#__PURE__*/_jsx(SideDemoTab, {
365
+ enabled: !!game?.demoConfig?.enabled
366
+ }), initPlay.enabled && initPlay.session && /*#__PURE__*/_jsx(SessionTimer, {
323
367
  secondsLeft: initPlay.secondsLeft,
324
368
  isExpired: initPlay.isExpired
325
- }), initPlay.enabled && initPlay.isExpired && /*#__PURE__*/_jsxs(View, {
326
- style: styles.expiredOverlay,
327
- children: [/*#__PURE__*/_jsx(Text, {
328
- style: styles.expiredTitle,
329
- children: t('wheel.timesUp')
330
- }), /*#__PURE__*/_jsx(Text, {
331
- style: styles.expiredText,
332
- children: t('wheel.stakeForfeited')
333
- }), /*#__PURE__*/_jsx(MonflowtsButton, {
334
- title: t('wheel.goBack'),
335
- onPress: onBack
336
- })]
337
369
  }), /*#__PURE__*/_jsxs(View, {
338
370
  style: styles.header,
339
371
  children: [/*#__PURE__*/_jsx(QuitConfirmModal, {
@@ -407,162 +439,193 @@ const FortuneWheel = ({
407
439
  })
408
440
  })]
409
441
  })]
410
- }), /*#__PURE__*/_jsx(AbandonPolicyNotice, {
411
- abandonPolicy: abandonPolicy
412
- }), initPlay.enabled && initPlay.error && !initPlay.session && /*#__PURE__*/_jsxs(View, {
413
- style: {
414
- padding: 12,
415
- backgroundColor: '#fef2f2',
416
- borderRadius: 8,
417
- margin: 8,
418
- alignItems: 'center'
419
- },
420
- children: [/*#__PURE__*/_jsx(Text, {
421
- style: {
422
- color: '#b91c1c',
423
- fontSize: 13,
424
- marginBottom: 8,
425
- textAlign: 'center'
426
- },
427
- children: initPlay.error
428
- }), /*#__PURE__*/_jsx(MonflowtsButton, {
429
- title: t('wheel.retry'),
430
- onPress: () => initPlay.reset()
431
- })]
432
- }), /*#__PURE__*/_jsx(View, {
433
- ref: wheelAreaRef,
434
- style: styles.wheelArea,
435
- children: /*#__PURE__*/_jsxs(View, {
436
- style: [styles.wheelContainer, {
437
- width: wheelSize,
438
- height: wheelSize
439
- }],
440
- children: [/*#__PURE__*/_jsx(View, {
441
- style: styles.pointer,
442
- children: /*#__PURE__*/_jsx(Text, {
443
- style: styles.pointerText,
444
- children: "\u25BC"
442
+ }), /*#__PURE__*/_jsxs(View, {
443
+ style: [styles.body, layout.landscape && styles.bodyLandscape],
444
+ children: [/*#__PURE__*/_jsx(View, {
445
+ style: layout.landscape ? [styles.wheelPaneLandscape, {
446
+ width: layout.wheelPaneWidth
447
+ }] : styles.wheelPanePortrait,
448
+ children: /*#__PURE__*/_jsx(View, {
449
+ ref: wheelAreaRef,
450
+ style: styles.wheelArea,
451
+ children: /*#__PURE__*/_jsxs(View, {
452
+ style: [styles.wheelContainer, {
453
+ width: wheelSize,
454
+ height: wheelSize
455
+ }],
456
+ children: [/*#__PURE__*/_jsx(View, {
457
+ style: styles.pointer,
458
+ children: /*#__PURE__*/_jsx(Text, {
459
+ style: styles.pointerText,
460
+ children: "\u25BC"
461
+ })
462
+ }), /*#__PURE__*/_jsx(Animated.View, {
463
+ renderToHardwareTextureAndroid: isSpinning,
464
+ style: [{
465
+ width: wheelSize,
466
+ height: wheelSize
467
+ }, {
468
+ transform: [{
469
+ rotate: spinRotate
470
+ }]
471
+ }],
472
+ children: /*#__PURE__*/_jsx(MonflowtsWheelView, {
473
+ segments: segments,
474
+ style: {
475
+ width: wheelSize,
476
+ height: wheelSize
477
+ }
478
+ })
479
+ })]
445
480
  })
481
+ })
482
+ }), /*#__PURE__*/_jsxs(View, {
483
+ style: styles.sidePane,
484
+ children: [/*#__PURE__*/_jsxs(ScrollView, {
485
+ contentContainerStyle: layout.landscape ? styles.sideScroll : undefined,
486
+ keyboardShouldPersistTaps: "handled",
487
+ bounces: false,
488
+ children: [/*#__PURE__*/_jsx(AbandonPolicyNotice, {
489
+ abandonPolicy: abandonPolicy
490
+ }), initPlay.enabled && initPlay.error && !initPlay.session && /*#__PURE__*/_jsxs(View, {
491
+ style: {
492
+ padding: 12,
493
+ backgroundColor: '#fef2f2',
494
+ borderRadius: 8,
495
+ margin: 8,
496
+ alignItems: 'center'
497
+ },
498
+ children: [/*#__PURE__*/_jsx(Text, {
499
+ style: {
500
+ color: '#b91c1c',
501
+ fontSize: 13,
502
+ marginBottom: 8,
503
+ textAlign: 'center'
504
+ },
505
+ children: initPlay.error
506
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
507
+ title: t('wheel.retry'),
508
+ onPress: () => initPlay.reset()
509
+ })]
510
+ }), paytablePanel, (hasStakeOptions || !actualCostVG) && /*#__PURE__*/_jsxs(View, {
511
+ style: styles.stakeSection,
512
+ children: [/*#__PURE__*/_jsx(Text, {
513
+ style: styles.stakeLabel,
514
+ children: t('wheel.selectBet')
515
+ }), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
516
+ options: stakeOptions,
517
+ selectedValue: activeStake,
518
+ onSelect: stake => {
519
+ sounds.playSelect();
520
+ setActiveStake(stake);
521
+ },
522
+ containerStyle: styles.stakeRow
523
+ }), !hasStakeOptions && /*#__PURE__*/_jsx(StakeInput, {
524
+ value: activeStake,
525
+ min: stakeOptions[0] ?? 100,
526
+ onConfirm: stake => setActiveStake(stake),
527
+ disabled: isSpinning
528
+ })]
529
+ }), hasStakeCount && /*#__PURE__*/_jsxs(View, {
530
+ style: styles.stakeSection,
531
+ children: [/*#__PURE__*/_jsx(Text, {
532
+ style: styles.stakeLabel,
533
+ children: t('wheel.spinsPerSession')
534
+ }), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
535
+ options: stakeCountOptions,
536
+ selectedValue: selectedStakeCount,
537
+ onSelect: count => {
538
+ sounds.playSelect();
539
+ setSelectedStakeCount(count);
540
+ },
541
+ containerStyle: styles.stakeRow,
542
+ getLabel: v => t('wheel.roundsOption', {
543
+ count: v
544
+ })
545
+ }), isMultiRound && /*#__PURE__*/_jsx(Text, {
546
+ style: {
547
+ color: COLORS.slateLight,
548
+ fontSize: 11,
549
+ textAlign: 'center',
550
+ marginTop: 6
551
+ },
552
+ children: t('wheel.total', {
553
+ amount: formatNumber(totalCostVG)
554
+ })
555
+ })]
556
+ }), isMultiRound && roundNum > 0 && /*#__PURE__*/_jsxs(View, {
557
+ style: styles.sessionBar,
558
+ children: [/*#__PURE__*/_jsx(Text, {
559
+ style: styles.sessionBarText,
560
+ children: t('wheel.wonAmount', {
561
+ amount: sessionTotalWon
562
+ })
563
+ }), /*#__PURE__*/_jsx(Text, {
564
+ style: styles.sessionBarText,
565
+ children: t('wheel.spinsWon', {
566
+ won: sessionWins,
567
+ total: roundNum
568
+ })
569
+ })]
570
+ })]
446
571
  }), /*#__PURE__*/_jsx(View, {
447
- style: [{
448
- width: wheelSize,
449
- height: wheelSize
450
- }, {
451
- transform: [{
452
- rotate: rotateDeg
453
- }]
454
- }],
455
- children: /*#__PURE__*/_jsx(MonflowtsWheelView, {
456
- segments: segments,
572
+ style: styles.actionBar,
573
+ children: sessionComplete ? /*#__PURE__*/_jsxs(View, {
457
574
  style: {
458
- width: wheelSize,
459
- height: wheelSize
460
- }
575
+ alignItems: 'center',
576
+ marginBottom: 36,
577
+ paddingHorizontal: 20
578
+ },
579
+ children: [/*#__PURE__*/_jsx(Text, {
580
+ style: {
581
+ color: COLORS.gold,
582
+ fontSize: 16,
583
+ fontWeight: '700',
584
+ marginBottom: 8
585
+ },
586
+ children: t('wheel.sessionComplete')
587
+ }), /*#__PURE__*/_jsx(Text, {
588
+ style: {
589
+ color: COLORS.slateLight,
590
+ fontSize: 13
591
+ },
592
+ children: t('wheel.sessionSummary', {
593
+ won: sessionWins,
594
+ total: selectedStakeCount,
595
+ result: sessionTotalWon > 0 ? t('wheel.winningsAmount', {
596
+ amount: sessionTotalWon
597
+ }) : t('wheel.noWinnings')
598
+ })
599
+ })]
600
+ }) : /*#__PURE__*/_jsx(MonflowtsButton, {
601
+ title: isMultiRound && roundNum > 0 ? t('wheel.spinProgress', {
602
+ round: roundNum,
603
+ total: selectedStakeCount
604
+ }) : t('wheel.spinTheWheel'),
605
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
606
+ name: "slotMachine",
607
+ size: 18,
608
+ color: "#ffffff"
609
+ }),
610
+ loading: isSpinning,
611
+ loadingText: t('wheel.spinning'),
612
+ onPress: spin,
613
+ textStyle: styles.spinBtnText
461
614
  })
462
615
  })]
463
- })
464
- }), (hasStakeOptions || !actualCostVG) && /*#__PURE__*/_jsxs(View, {
465
- style: styles.stakeSection,
466
- children: [/*#__PURE__*/_jsx(Text, {
467
- style: styles.stakeLabel,
468
- children: t('wheel.selectBet')
469
- }), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
470
- options: stakeOptions,
471
- selectedValue: activeStake,
472
- onSelect: stake => {
473
- sounds.playSelect();
474
- setActiveStake(stake);
475
- },
476
- containerStyle: styles.stakeRow
477
- }), /*#__PURE__*/_jsx(StakeInput, {
478
- value: activeStake,
479
- min: stakeOptions[0] ?? 100,
480
- onConfirm: stake => setActiveStake(stake),
481
- disabled: isSpinning
482
- })]
483
- }), hasStakeCount && /*#__PURE__*/_jsxs(View, {
484
- style: styles.stakeSection,
485
- children: [/*#__PURE__*/_jsx(Text, {
486
- style: styles.stakeLabel,
487
- children: t('wheel.spinsPerSession')
488
- }), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
489
- options: stakeCountOptions,
490
- selectedValue: selectedStakeCount,
491
- onSelect: count => {
492
- sounds.playSelect();
493
- setSelectedStakeCount(count);
494
- },
495
- containerStyle: styles.stakeRow,
496
- getLabel: v => t('wheel.roundsOption', {
497
- count: v
498
- })
499
- }), isMultiRound && /*#__PURE__*/_jsx(Text, {
500
- style: {
501
- color: COLORS.slateLight,
502
- fontSize: 11,
503
- textAlign: 'center',
504
- marginTop: 6
505
- },
506
- children: t('wheel.total', {
507
- amount: formatNumber(totalCostVG)
508
- })
509
- })]
510
- }), isMultiRound && roundNum > 0 && /*#__PURE__*/_jsxs(View, {
511
- style: styles.sessionBar,
512
- children: [/*#__PURE__*/_jsx(Text, {
513
- style: styles.sessionBarText,
514
- children: t('wheel.wonAmount', {
515
- amount: sessionTotalWon
516
- })
517
- }), /*#__PURE__*/_jsx(Text, {
518
- style: styles.sessionBarText,
519
- children: t('wheel.spinsWon', {
520
- won: sessionWins,
521
- total: roundNum
522
- })
523
616
  })]
524
- }), sessionComplete ? /*#__PURE__*/_jsxs(View, {
525
- style: {
526
- alignItems: 'center',
527
- marginBottom: 36,
528
- paddingHorizontal: 20
529
- },
617
+ }), initPlay.enabled && initPlay.isExpired && /*#__PURE__*/_jsxs(View, {
618
+ style: styles.expiredOverlay,
530
619
  children: [/*#__PURE__*/_jsx(Text, {
531
- style: {
532
- color: COLORS.gold,
533
- fontSize: 16,
534
- fontWeight: '700',
535
- marginBottom: 8
536
- },
537
- children: t('wheel.sessionComplete')
620
+ style: styles.expiredTitle,
621
+ children: t('wheel.timesUp')
538
622
  }), /*#__PURE__*/_jsx(Text, {
539
- style: {
540
- color: COLORS.slateLight,
541
- fontSize: 13
542
- },
543
- children: t('wheel.sessionSummary', {
544
- won: sessionWins,
545
- total: selectedStakeCount,
546
- result: sessionTotalWon > 0 ? t('wheel.winningsAmount', {
547
- amount: sessionTotalWon
548
- }) : t('wheel.noWinnings')
549
- })
623
+ style: styles.expiredText,
624
+ children: t('wheel.stakeForfeited')
625
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
626
+ title: t('wheel.goBack'),
627
+ onPress: onBack
550
628
  })]
551
- }) : /*#__PURE__*/_jsx(MonflowtsButton, {
552
- title: isMultiRound && roundNum > 0 ? t('wheel.spinProgress', {
553
- round: roundNum,
554
- total: selectedStakeCount
555
- }) : t('wheel.spinTheWheel'),
556
- icon: /*#__PURE__*/_jsx(SvgIcon, {
557
- name: "slotMachine",
558
- size: 18,
559
- color: "#ffffff"
560
- }),
561
- loading: isSpinning,
562
- loadingText: t('wheel.spinning'),
563
- onPress: spin,
564
- style: styles.spinBtnWrap,
565
- textStyle: styles.spinBtnText
566
629
  }), /*#__PURE__*/_jsx(InsufficientFundsOverlay, {
567
630
  visible: showFundsOverlay,
568
631
  balance: balance,
@@ -619,10 +682,18 @@ const FortuneWheel = ({
619
682
  }), /*#__PURE__*/_jsx(Text, {
620
683
  style: styles.resultSubtitle,
621
684
  children: t(`${resultMsgKey}.sub`)
622
- }), /*#__PURE__*/_jsx(JackpotNearMiss, {
623
- jackpotAmountKobo: game?.gameplayRules?.jackpotAmountKobo ?? 0,
624
- currency: currency
625
- }), demoMode ? /*#__PURE__*/_jsxs(_Fragment, {
685
+ }), !isMultiRound && lastSpin?.label ? /*#__PURE__*/_jsx(Text, {
686
+ style: styles.resultDetail,
687
+ children: t('wheel.landed', {
688
+ label: lastSpin.label
689
+ })
690
+ }) : null, lastSpin?.hash && lastSpin.nonce !== null ? /*#__PURE__*/_jsx(Text, {
691
+ style: styles.fairnessText,
692
+ children: t('wheel.fairness', {
693
+ nonce: lastSpin.nonce,
694
+ hash: lastSpin.hash.slice(0, 12)
695
+ })
696
+ }) : null, demoMode ? /*#__PURE__*/_jsxs(_Fragment, {
626
697
  children: [/*#__PURE__*/_jsx(Text, {
627
698
  style: styles.demoHookText,
628
699
  children: lastAmountWon > 0 ? t('wheel.demoHookWin') : t('wheel.demoHookLoss')
@@ -672,15 +743,93 @@ const FortuneWheel = ({
672
743
  })
673
744
  })
674
745
  })]
675
- })]
746
+ })
676
747
  });
677
748
  };
678
- const styles = StyleSheet.create({
749
+ const styles = scaledStyles({
679
750
  container: {
680
751
  flex: 1,
681
752
  backgroundColor: COLORS.backgroundDark,
682
753
  paddingTop: 50
683
754
  },
755
+ body: {
756
+ flex: 1
757
+ },
758
+ bodyLandscape: {
759
+ flexDirection: 'row'
760
+ },
761
+ wheelPanePortrait: {
762
+ alignItems: 'center'
763
+ },
764
+ wheelPaneLandscape: {
765
+ justifyContent: 'center',
766
+ alignItems: 'center'
767
+ },
768
+ sidePane: {
769
+ flex: 1
770
+ },
771
+ sideScroll: {
772
+ flexGrow: 1,
773
+ justifyContent: 'center',
774
+ paddingRight: 28
775
+ },
776
+ actionBar: {
777
+ paddingHorizontal: 20,
778
+ paddingTop: 10,
779
+ paddingBottom: 28,
780
+ borderTopWidth: 1,
781
+ borderTopColor: COLORS.white10,
782
+ backgroundColor: COLORS.backgroundDark
783
+ },
784
+ paytable: {
785
+ marginHorizontal: 20,
786
+ marginBottom: 16,
787
+ padding: 12,
788
+ borderRadius: 14,
789
+ backgroundColor: 'rgba(30, 41, 59, 0.5)',
790
+ borderWidth: 1,
791
+ borderColor: COLORS.white10,
792
+ alignItems: 'center'
793
+ },
794
+ paytableRow: {
795
+ flexDirection: 'row',
796
+ alignSelf: 'stretch',
797
+ paddingVertical: 4
798
+ },
799
+ paytableCell: {
800
+ flex: 1,
801
+ fontSize: 12,
802
+ fontWeight: '700',
803
+ color: COLORS.slateLight
804
+ },
805
+ paytableMultiplier: {
806
+ color: COLORS.gold
807
+ },
808
+ paytableValue: {
809
+ color: '#fff',
810
+ textAlign: 'center'
811
+ },
812
+ paytableOdds: {
813
+ textAlign: 'right'
814
+ },
815
+ paytableNote: {
816
+ fontSize: 10,
817
+ color: COLORS.slateDark,
818
+ marginTop: 6,
819
+ textAlign: 'center'
820
+ },
821
+ resultDetail: {
822
+ color: COLORS.slateLight,
823
+ fontSize: 13,
824
+ marginBottom: 6,
825
+ textAlign: 'center'
826
+ },
827
+ fairnessText: {
828
+ color: COLORS.slateDark,
829
+ fontSize: 10,
830
+ marginBottom: 16,
831
+ textAlign: 'center'
832
+ },
684
833
  header: {
685
834
  flexDirection: 'row',
686
835
  alignItems: 'center',
@@ -730,9 +879,9 @@ const styles = StyleSheet.create({
730
879
  fontWeight: '700'
731
880
  },
732
881
  wheelArea: {
733
- flex: 1,
734
882
  alignItems: 'center',
735
- justifyContent: 'center'
883
+ justifyContent: 'center',
884
+ paddingVertical: 28
736
885
  },
737
886
  wheelContainer: {
738
887
  alignItems: 'center',
@@ -773,9 +922,6 @@ const styles = StyleSheet.create({
773
922
  justifyContent: 'center',
774
923
  gap: 8
775
924
  },
776
- spinBtnWrap: {
777
- marginBottom: 36
778
- },
779
925
  spinBtnText: {
780
926
  fontSize: 18,
781
927
  fontWeight: '800',