@enigma-lake/dice-play-controller-sdk 1.0.0

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 (39) hide show
  1. package/README.md +180 -0
  2. package/dist/components/ManualPlayStateProvider/ManualPlayProvider.d.ts +9 -0
  3. package/dist/components/ManualPlayStateProvider/ManualPlayStateContext.d.ts +13 -0
  4. package/dist/components/ManualPlayStateProvider/index.d.ts +1 -0
  5. package/dist/components/Widgets/WidgetContainer.d.ts +13 -0
  6. package/dist/components/base/Button/Button.d.ts +21 -0
  7. package/dist/components/base/Button/index.d.ts +1 -0
  8. package/dist/components/base/ChevronIcon/ChevronIcon.d.ts +5 -0
  9. package/dist/components/base/ChevronIcon/index.d.ts +1 -0
  10. package/dist/components/base/GroupRow/GroupRow.d.ts +6 -0
  11. package/dist/components/base/GroupRow/index.d.ts +1 -0
  12. package/dist/components/base/Input/Input.d.ts +3 -0
  13. package/dist/components/base/Input/cleanInputNumber.d.ts +2 -0
  14. package/dist/components/base/Input/index.d.ts +1 -0
  15. package/dist/components/base/ManualPlayController/ManualPlayController.d.ts +2 -0
  16. package/dist/components/base/ManualPlayController/index.d.ts +1 -0
  17. package/dist/components/base/PlayController/PlayController.d.ts +5 -0
  18. package/dist/components/base/PlayValueInput/PlayValueInput.d.ts +8 -0
  19. package/dist/components/base/PlayValueInput/index.d.ts +1 -0
  20. package/dist/components/base/PlayValueList/PlayValueList.d.ts +2 -0
  21. package/dist/components/base/PlayValueList/index.d.ts +1 -0
  22. package/dist/components/base/SelectMenu/GoldIcon.d.ts +1 -0
  23. package/dist/components/base/SelectMenu/SelectMenu.d.ts +5 -0
  24. package/dist/components/base/SelectMenu/SweepsIcon.d.ts +1 -0
  25. package/dist/components/base/SelectMenu/config.d.ts +3 -0
  26. package/dist/components/base/SelectMenu/index.d.ts +1 -0
  27. package/dist/components/base/index.d.ts +7 -0
  28. package/dist/components/hooks/usePlayController.d.ts +22 -0
  29. package/dist/components/index.d.ts +4 -0
  30. package/dist/components/utils.d.ts +6 -0
  31. package/dist/index.d.ts +69 -0
  32. package/dist/index.mjs +477 -0
  33. package/dist/index.mjs.map +1 -0
  34. package/dist/style.css +1 -0
  35. package/dist/types/gameMode.d.ts +3 -0
  36. package/dist/types/index.d.ts +4 -0
  37. package/dist/types/playController.d.ts +33 -0
  38. package/dist/types/widgets.d.ts +11 -0
  39. package/package.json +84 -0
package/README.md ADDED
@@ -0,0 +1,180 @@
1
+ # DicePlayController
2
+
3
+ The `DicePlayController` component is a key part of the gameplay interface, allowing users to initiate a play or cash out based on their current game state. It supports manual play, dynamic currency handling, and play amount adjustments.
4
+
5
+ ---
6
+
7
+ ## Component Overview
8
+
9
+ The `DicePlayController` allows the user to:
10
+
11
+ - Select a currency.
12
+ - Adjust the play amount.
13
+ - Start a play
14
+
15
+ ---
16
+
17
+ ## Setup
18
+
19
+ ### 1. Install the package using npm:
20
+
21
+ ```bash
22
+ npm install @enigma-lake/dice-play-controller-sdk
23
+ ```
24
+
25
+ ### 2. Import the component and styles in your project:
26
+
27
+ ```tsx
28
+ import {
29
+ AUTO_PLAY_STATE,
30
+ GAME_MODE,
31
+ ManualPlayProvider,
32
+ } from "@enigma-lake/dice-play-controller-sdk";
33
+
34
+ import "@enigma-lake/dice-play-controller-sdk/dist/style.css";
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Context & Provider
40
+
41
+ ### `ManualPlayProvider`
42
+
43
+ The `ManualPlayProvider` wraps the DicePlayController, managing both manual play and autoplay. It uses React Context to provide game state and actions throughout the component tree.
44
+
45
+ 🔹 **Features of `ManualPlayProvider`**:
46
+
47
+ - **Provides Context:** Exposes state and functions for controlling play behavior.
48
+
49
+ ## Props
50
+
51
+ ### 1. `StylingProps`
52
+
53
+ Handles the styling-related properties for the component.
54
+
55
+ - **`panel` (optional)**: Custom styling for the play controller.
56
+
57
+ - **`bgColorHex`**: Hex color for the panel background.
58
+ - **`bgColorOpacity` (optional)**: Opacity for the panel background.
59
+ - **`bottom`**: Position of the panel relative to the window.
60
+
61
+ - **`dropdown` (optional)**: Custom styling for the dropdown.
62
+ - **`bgColorHex`**: Hex color for the panel background.
63
+
64
+ ### 2. `CurrencyProps`
65
+
66
+ Handles currency-related logic and settings.
67
+
68
+ - **`currencyOptions`**: An object containing the following properties:
69
+ - **`current`**: The currently selected currency
70
+ - **`available`**: Array of available currencies that the user can choose from.
71
+
72
+ ### 3. `ActionsProps`
73
+
74
+ Defines functions for the user actions.
75
+
76
+ - **`onPlay`**: A callback function to trigger when the user starts a play.
77
+
78
+ ### 4. `PlaySettingsProps`
79
+
80
+ Handles game-specific settings and states.
81
+
82
+ - **`playOptions`**: An object containing the following properties:
83
+
84
+ - **`disabledController`**: Boolean flag to disable all interactive elements in the component, preventing user interactions (e.g., when the game is in progress).
85
+ - **`displayController`**: Boolean flag to determine if the play controller should be visible.
86
+ - **`playHook`**: A hook providing the current play amount, play limits, and a function to set the play amount.
87
+ - **`playLimits`**: Play limits for the game.
88
+ - **`playAmount`**: The current play amount.
89
+ - **`setPlayAmount`**: A function to set the play amount.
90
+ - **`disabledMenu`**: Disable menu flag
91
+ - **`totalBalance`**: The available balance for the current currency
92
+
93
+ ### 3. `Widgets`
94
+
95
+ Defines functions for the user actions.
96
+
97
+ - **`leftWidgets`**: A list of widgets that will be displayed on the left side
98
+ - **`centerWidgets`**: A list of widgets that will be displayed on the center
99
+ - **`rightWidgets`**: A list of widgets that will be displayed on the right side
100
+
101
+ ---
102
+
103
+ ## Example Usage
104
+
105
+ ```tsx
106
+ import "@enigma-lake/dice-play-controller-sdk/dist/style.css";
107
+ import { ManualPlayProvider } from "@enigma-lake/dice-play-controller-sdk";
108
+ import { Currency } from "@enigma-lake/zoot-platform-sdk";
109
+
110
+ const GameExample = () => {
111
+ const config = {
112
+ currencyOptions: {
113
+ currentCurrency: Currency.SWEEPS,
114
+ currencies: [Currency.SWEEPS, Currency.GOLD],
115
+ winText: "0.00 SC",
116
+ },
117
+ onPlay: () => console.log("Play button clicked"),
118
+ playOptions: {
119
+ displayController: true,
120
+ disabledController: false,
121
+ disabledMenu: false,
122
+ playHook: () => {
123
+ return {
124
+ playLimits: { min: 1, max: 100 },
125
+ playAmount: 10,
126
+ setPlayAmount: (value) => console.log("New play amount:", value),
127
+ };
128
+ },
129
+ },
130
+ panel: {
131
+ bottom: window.innerWidth < 450 ? "55px" : "70px",
132
+ bgColorHex: "#08643F"
133
+ bgColorOpacity: 0.8,
134
+ },
135
+ dropdown: {
136
+ bgColorHex: "#10243F",
137
+ }
138
+ };
139
+
140
+ return (
141
+ <ManualPlayProvider config={config}>
142
+ {() => (
143
+ // children content
144
+ )}
145
+ </ManualPlayProvider>
146
+ );
147
+ };
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Key Features
153
+
154
+ 1. **Dynamic Currency Handling**:
155
+
156
+ - Supports multiple currencies (e.g., SWEEPS, GOLD).
157
+ - Allows users to switch currencies easily.
158
+
159
+ 2. **Play Amount Adjustment**:
160
+
161
+ - Includes buttons to halve or double the play amount.
162
+ - Validates play amounts against user balance and play limits.
163
+
164
+ 3. **Custom Styling**:
165
+
166
+ - Supports customizable input and button colors.
167
+
168
+ 4. **Play & Cashout Actions**:
169
+ - Allows users to initiate gameplay or cash out winnings seamlessly.
170
+
171
+ ---
172
+
173
+ ## Development Notes
174
+
175
+ 1. **Play Amount Validation**:
176
+
177
+ - The play amount is validated to ensure it falls within the minimum and maximum limits, as well as the user's available balance.
178
+
179
+ 2. **Responsive Design**:
180
+ - The component is styled to be responsive and integrate seamlessly into various layouts.
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from "react";
2
+ import { PlayControllerProps } from "../../types/playController";
3
+ import { ManualPlayStateContextType } from "./ManualPlayStateContext";
4
+ interface ManualPlayStateProviderProps {
5
+ children: React.ReactNode | ((state: ManualPlayStateContextType) => ReactElement);
6
+ config: PlayControllerProps;
7
+ }
8
+ declare const ManualPlayProvider: React.FC<ManualPlayStateProviderProps>;
9
+ export default ManualPlayProvider;
@@ -0,0 +1,13 @@
1
+ import { GAME_MODE } from "../../types/gameMode";
2
+ import { PlayControllerProps } from "../../types/playController";
3
+ export interface ManualPlayStateContextType {
4
+ mode: GAME_MODE;
5
+ config: PlayControllerProps;
6
+ playValues: {
7
+ displayPlayAmountView: boolean;
8
+ setDisplayPlayAmountView: (v: boolean) => void;
9
+ togglePlayAmountView: () => void;
10
+ };
11
+ }
12
+ export declare const ManualPlayStateContext: import("react").Context<ManualPlayStateContextType | undefined>;
13
+ export declare const useManualPlayState: () => ManualPlayStateContextType;
@@ -0,0 +1 @@
1
+ export { default } from "./ManualPlayProvider";
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Widget } from "../../types";
3
+ type WidgetsByZone = {
4
+ left: Widget[];
5
+ center: Widget[];
6
+ right: Widget[];
7
+ };
8
+ interface WidgetContainerProps {
9
+ widgets: WidgetsByZone;
10
+ displayPlayAmountView: boolean;
11
+ }
12
+ export declare const WidgetContainer: React.FC<WidgetContainerProps>;
13
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { GAME_MODE } from "../../../types";
3
+ declare const themes: {
4
+ primary: string;
5
+ success: string;
6
+ ghost: string;
7
+ };
8
+ type Props = React.ComponentProps<"button"> & {
9
+ theme?: (typeof themes)[keyof typeof themes];
10
+ roleType?: GAME_MODE;
11
+ className?: string;
12
+ };
13
+ declare const Button: {
14
+ ({ disabled, roleType, className, theme, ...props }: Props): import("react/jsx-runtime").JSX.Element;
15
+ themes: {
16
+ primary: string;
17
+ success: string;
18
+ ghost: string;
19
+ };
20
+ };
21
+ export default Button;
@@ -0,0 +1 @@
1
+ export { default } from "./Button";
@@ -0,0 +1,5 @@
1
+ declare const ChevronIcon: ({ open, disabled, }: {
2
+ open: boolean;
3
+ disabled: boolean;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default ChevronIcon;
@@ -0,0 +1 @@
1
+ export { default } from "./ChevronIcon";
@@ -0,0 +1,6 @@
1
+ import { ComponentProps } from "react";
2
+ export type Props = ComponentProps<"div"> & {
3
+ label?: string;
4
+ };
5
+ declare const GroupRow: ({ children, label, className, ...restProps }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default GroupRow;
@@ -0,0 +1 @@
1
+ export { default } from "./GroupRow";
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Input: ({ onChange, disabled, className, ...restProps }: React.ComponentProps<"input">) => import("react/jsx-runtime").JSX.Element;
3
+ export default Input;
@@ -0,0 +1,2 @@
1
+ export declare function findFirstSeparatorIndex(value: string): number | undefined;
2
+ export declare function cleanInputNumber(value: string): string;
@@ -0,0 +1 @@
1
+ export { default } from "./Input";
@@ -0,0 +1,2 @@
1
+ declare const ManualPlayController: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ManualPlayController;
@@ -0,0 +1 @@
1
+ export { default } from "./ManualPlayController";
@@ -0,0 +1,5 @@
1
+ interface PlayAmountControlProps {
2
+ isDisabled: () => boolean;
3
+ }
4
+ declare const PlayAmountControl: ({ isDisabled }: PlayAmountControlProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default PlayAmountControl;
@@ -0,0 +1,8 @@
1
+ import { ComponentProps, PropsWithChildren } from "react";
2
+ export type Props = PropsWithChildren<ComponentProps<"div">> & {
3
+ disabled: boolean;
4
+ onClick: () => void;
5
+ value: string;
6
+ };
7
+ declare const PlayValueInput: ({ disabled, children, className, value, onClick, }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default PlayValueInput;
@@ -0,0 +1 @@
1
+ export { default } from "./PlayValueInput";
@@ -0,0 +1,2 @@
1
+ declare const PlayValueList: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default PlayValueList;
@@ -0,0 +1 @@
1
+ export { default } from "./PlayValueList";
@@ -0,0 +1 @@
1
+ export declare const GoldIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface ISelectMenuProps {
2
+ disabled?: boolean;
3
+ }
4
+ declare const SelectMenu: ({ disabled }: ISelectMenuProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default SelectMenu;
@@ -0,0 +1 @@
1
+ export declare const SweepsIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { CurrencyMeta, CurrencyIcon } from "@enigma-lake/zoot-platform-sdk";
2
+ export declare const capitalize: (str: string) => string;
3
+ export declare const getIcon: (option: CurrencyMeta) => CurrencyIcon | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./SelectMenu";
@@ -0,0 +1,7 @@
1
+ import Button from "./Button";
2
+ import GroupRow from "./GroupRow";
3
+ import Input from "./Input";
4
+ import PlayValueInput from "./PlayValueInput";
5
+ import PlayValueList from "./PlayValueList";
6
+ import SelectMenu from "./SelectMenu";
7
+ export { Button, GroupRow, Input, SelectMenu, PlayValueInput, PlayValueList };
@@ -0,0 +1,22 @@
1
+ export declare const usePlayController: () => {
2
+ playAmount: number;
3
+ minPlayAmount: number;
4
+ maxPlayAmount: number;
5
+ setPlayAmount: (value: number) => void;
6
+ adjustPlayAmount: ({ direction }: {
7
+ direction: -1 | 1;
8
+ }) => void;
9
+ onChangeAmount: (playValue: number) => void;
10
+ playOptions: import("../../types/playController").PlaySettingsProps;
11
+ isValidPlayAmount: boolean;
12
+ totalBalance: number;
13
+ manualPlay: {
14
+ isDisabled: () => boolean;
15
+ onPlay: () => void;
16
+ };
17
+ playValues: {
18
+ displayPlayAmountView: boolean;
19
+ setDisplayPlayAmountView: (v: boolean) => void;
20
+ togglePlayAmountView: () => void;
21
+ };
22
+ };
@@ -0,0 +1,4 @@
1
+ import ManualPlayProvider from "./ManualPlayStateProvider";
2
+ import { GAME_MODE } from "../types/gameMode";
3
+ import { format } from "./utils";
4
+ export { ManualPlayProvider, GAME_MODE, format };
@@ -0,0 +1,6 @@
1
+ import { GAME_MODE } from "../types";
2
+ export declare const hexToRgb: (hex: string) => string | null;
3
+ export declare const selectButton: (gameMode: GAME_MODE) => HTMLButtonElement;
4
+ export declare const addPressedClass: (gameMode: GAME_MODE, activeClassName: string) => void;
5
+ export declare const removePressedClass: (gameMode: GAME_MODE, activeClassName: string) => void;
6
+ export declare const format: (balance: number, decimals: number) => string;
@@ -0,0 +1,69 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ import { CurrencyProps, PlayLimitsV2 } from '@enigma-lake/zoot-platform-sdk';
3
+
4
+ declare enum GAME_MODE {
5
+ MANUAL = "manual"
6
+ }
7
+
8
+ declare enum WIDGET {
9
+ CENTER = "center",
10
+ SIDE = "side"
11
+ }
12
+ type Widget = {
13
+ type: WIDGET;
14
+ renderElement: ({ displayPlayAmountView, }: {
15
+ displayPlayAmountView: boolean;
16
+ }) => ReactNode;
17
+ };
18
+
19
+ declare const format: (balance: number, decimals: number) => string;
20
+
21
+ type StylingProps = {
22
+ panel: {
23
+ bottom?: string;
24
+ bgColorHex: string;
25
+ bgColorOpacity?: number;
26
+ };
27
+ dropdown: {
28
+ bgColorHex: string;
29
+ };
30
+ };
31
+ type ActionsProps = {
32
+ onPlay: () => void;
33
+ };
34
+ type PlaySettingsProps = {
35
+ disabledController: boolean;
36
+ disabledMenu: boolean;
37
+ displayController: boolean;
38
+ playHook: () => {
39
+ playLimits?: PlayLimitsV2;
40
+ playAmount: number;
41
+ setPlayAmount: (value: number) => void;
42
+ };
43
+ totalBalance: number;
44
+ };
45
+ type PlayControllerProps = StylingProps & ActionsProps & {
46
+ currencyOptions: CurrencyProps;
47
+ playOptions: PlaySettingsProps;
48
+ leftWidgets: Widget[];
49
+ rightWidgets: Widget[];
50
+ centerWidgets: Widget[];
51
+ };
52
+
53
+ interface ManualPlayStateContextType {
54
+ mode: GAME_MODE;
55
+ config: PlayControllerProps;
56
+ playValues: {
57
+ displayPlayAmountView: boolean;
58
+ setDisplayPlayAmountView: (v: boolean) => void;
59
+ togglePlayAmountView: () => void;
60
+ };
61
+ }
62
+
63
+ interface ManualPlayStateProviderProps {
64
+ children: React.ReactNode | ((state: ManualPlayStateContextType) => ReactElement);
65
+ config: PlayControllerProps;
66
+ }
67
+ declare const ManualPlayProvider: React.FC<ManualPlayStateProviderProps>;
68
+
69
+ export { GAME_MODE, ManualPlayProvider, WIDGET, type Widget, format };
package/dist/index.mjs ADDED
@@ -0,0 +1,477 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { createContext, useContext, useMemo, useCallback, useEffect, useState } from 'react';
3
+ import cx$1 from 'classnames';
4
+ import { Currency, sendSetUserCurrencyEvent, sendSetUserCurrencyEventV2, setToggleGameWidgetsVisibility, setToggleGameWidgetsExpansion, sendOpenStoreEvent } from '@enigma-lake/zoot-platform-sdk';
5
+ import { Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/react';
6
+
7
+ const hexToRgb = (hex) => {
8
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
9
+ hex = hex.replace(shorthandRegex, (_, r, g, b) => r + r + g + g + b + b);
10
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
11
+ return result
12
+ ? `${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}`
13
+ : null;
14
+ };
15
+ const selectButton = (gameMode) => {
16
+ const role = `role-${gameMode}-button`;
17
+ const buttons = document.querySelectorAll(`[data-role="${role}"]`);
18
+ return buttons[0];
19
+ };
20
+ const addPressedClass = (gameMode, activeClassName) => {
21
+ const button = selectButton(gameMode);
22
+ if (!button) {
23
+ return;
24
+ }
25
+ if (!button.classList.contains(activeClassName)) {
26
+ button.classList.add(activeClassName);
27
+ }
28
+ };
29
+ const removePressedClass = (gameMode, activeClassName) => {
30
+ const button = selectButton(gameMode);
31
+ if (!button) {
32
+ return;
33
+ }
34
+ if (button.classList.contains(activeClassName)) {
35
+ button.classList.remove(activeClassName);
36
+ }
37
+ };
38
+ const format = (balance, decimals) => balance?.toFixed(decimals) ?? 0;
39
+
40
+ var GAME_MODE;
41
+ (function (GAME_MODE) {
42
+ GAME_MODE["MANUAL"] = "manual";
43
+ })(GAME_MODE || (GAME_MODE = {}));
44
+
45
+ var WIDGET;
46
+ (function (WIDGET) {
47
+ WIDGET["CENTER"] = "center";
48
+ WIDGET["SIDE"] = "side";
49
+ })(WIDGET || (WIDGET = {}));
50
+
51
+ const ManualPlayStateContext = createContext(undefined);
52
+ const useManualPlayState = () => {
53
+ const context = useContext(ManualPlayStateContext);
54
+ if (!context) {
55
+ throw new Error("useManualPlayStateState must be used within a ManualPlayStateProvider");
56
+ }
57
+ return context;
58
+ };
59
+
60
+ const usePlayController = () => {
61
+ const { config, playValues: { displayPlayAmountView, setDisplayPlayAmountView, togglePlayAmountView, }, } = useManualPlayState();
62
+ const { current } = config.currencyOptions;
63
+ const { disabledController, playHook } = config.playOptions;
64
+ const { playAmount, playLimits, setPlayAmount } = playHook?.() ?? {};
65
+ const minPlayAmount = playLimits?.[current.code]?.limits.min ?? 0;
66
+ const maxPlayAmount = playLimits?.[current.code]?.limits.max ?? 0;
67
+ const isDisabled = () => disabledController;
68
+ const adjustPlayAmount = ({ direction }) => {
69
+ if (isDisabled()) {
70
+ return;
71
+ }
72
+ const opts = playLimits?.[current.code]?.defaultBetOptions ?? [];
73
+ if (!opts.length) {
74
+ return;
75
+ }
76
+ // Ensure options sorted ascending
77
+ const sorted = [...opts].sort((a, b) => a - b);
78
+ const currentIndex = sorted.findIndex((o) => o === playAmount);
79
+ let newAmount;
80
+ if (currentIndex === -1) {
81
+ // if current isn't exactly in list, insert it logically
82
+ sorted.push(playAmount);
83
+ sorted.sort((a, b) => a - b);
84
+ const idx = sorted.indexOf(playAmount);
85
+ newAmount = sorted[idx + direction] ?? playAmount;
86
+ }
87
+ else {
88
+ const targetIdx = currentIndex + direction;
89
+ if (targetIdx >= 0 && targetIdx < sorted.length) {
90
+ newAmount = sorted[targetIdx];
91
+ }
92
+ else {
93
+ // clamp if out of bounds
94
+ newAmount = sorted[currentIndex];
95
+ }
96
+ }
97
+ setPlayAmount(newAmount);
98
+ };
99
+ const onChangeAmount = (playValue) => {
100
+ if (isDisabled()) {
101
+ return;
102
+ }
103
+ setPlayAmount(playValue);
104
+ };
105
+ const isValidPlayAmount = playAmount >= minPlayAmount && playAmount <= maxPlayAmount;
106
+ return {
107
+ playAmount,
108
+ minPlayAmount,
109
+ maxPlayAmount,
110
+ setPlayAmount,
111
+ adjustPlayAmount,
112
+ onChangeAmount,
113
+ playOptions: config.playOptions,
114
+ isValidPlayAmount,
115
+ totalBalance: config.playOptions.totalBalance,
116
+ manualPlay: {
117
+ isDisabled,
118
+ onPlay: config.onPlay,
119
+ },
120
+ playValues: {
121
+ displayPlayAmountView,
122
+ setDisplayPlayAmountView,
123
+ togglePlayAmountView,
124
+ },
125
+ };
126
+ };
127
+
128
+ var styles_button = {"base":"Button-module__base___muNxk","base__theme-ghost":"Button-module__base__theme-ghost___I5-LJ","base__theme-primary":"Button-module__base__theme-primary___Zuswb","base__state-disabled":"Button-module__base__state-disabled___EU5tH","buttonPlayAmount":"Button-module__buttonPlayAmount___GMy3F","buttonCashout":"Button-module__buttonCashout___LG-Yr","buttonPlayAmount__active":"Button-module__buttonPlayAmount__active___e0nGe","buttonCashout__active":"Button-module__buttonCashout__active___qnE3h","buttonSweeps":"Button-module__buttonSweeps___0snDQ","buttonSweeps__active":"Button-module__buttonSweeps__active___PXIFH","buttonGold":"Button-module__buttonGold___DAj-d","buttonGold__active":"Button-module__buttonGold__active___vsi7m","buttonDefault":"Button-module__buttonDefault___QENXy","buttonDefault__active":"Button-module__buttonDefault__active___oS6gd"};
129
+
130
+ const themes = {
131
+ primary: "primary",
132
+ success: "success",
133
+ ghost: "ghost",
134
+ };
135
+ const Button = ({ disabled, roleType, className = "", theme = "primary", ...props }) => {
136
+ return (jsx("button", { ...props, className: cx$1(styles_button.base, styles_button[`base__theme-${theme}`], className, {
137
+ [styles_button["base__state-disabled"]]: disabled,
138
+ }), disabled: disabled, "data-role": `role-${roleType}-button` }));
139
+ };
140
+ Button.themes = themes;
141
+
142
+ var styles_group = {"base":"GroupRow-module__base___b241-","label":"GroupRow-module__label___Du57P","group":"GroupRow-module__group___V7xa6","groupItem":"GroupRow-module__groupItem___yNSX8","x2":"GroupRow-module__x2___9bLae","last":"GroupRow-module__last___ArsSn","gap-2":"GroupRow-module__gap-2___1eib1"};
143
+
144
+ const GroupRow = ({ children, label, className, ...restProps }) => {
145
+ return (jsxs("div", { ...restProps, className: cx$1(styles_group.base, className), children: [label && jsx("div", { className: styles_group.label, children: label }), jsx("div", { className: styles_group.group, children: children })] }));
146
+ };
147
+
148
+ var style_select = {"button":"SelectMenu-module__button___N-HeB","menu":"SelectMenu-module__menu___c5jvZ","menuItems":"SelectMenu-module__menuItems___BX1YQ","menuItem":"SelectMenu-module__menuItem___eXbi3","selected":"SelectMenu-module__selected___XyADw","disabledSVG":"SelectMenu-module__disabledSVG___OdVFW","disabled":"SelectMenu-module__disabled___jiTPl"};
149
+
150
+ var style_chevron = {"chevron":"ChevronIcon-module__chevron___lif8s","open":"ChevronIcon-module__open___niD1n","disable":"ChevronIcon-module__disable___8n-xg"};
151
+
152
+ const ChevronIcon = ({ open, disabled, }) => {
153
+ return (jsx("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", children: jsx("path", { className: cx$1(style_chevron.chevron, {
154
+ [style_chevron.open]: open,
155
+ [style_chevron.disabled]: disabled,
156
+ }), d: "M6 9L12 15L18 9", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
157
+ };
158
+
159
+ const GoldIcon = () => (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: [jsx("path", { opacity: "0.39", d: "M7.41645 14.1044C11.0357 14.1044 13.9697 11.136 13.9697 7.47417C13.9697 3.81236 11.0357 0.843872 7.41645 0.843872C3.79725 0.843872 0.863281 3.81236 0.863281 7.47417C0.863281 11.136 3.79725 14.1044 7.41645 14.1044Z", fill: "#F2BF0B" }), jsx("path", { d: "M7.49933 13.5066C5.90609 13.5066 4.37818 12.8736 3.25163 11.7471C2.12508 10.6205 1.49219 9.09258 1.49219 7.49944C1.49219 5.90626 2.12508 4.37833 3.25163 3.25178C4.37818 2.12523 5.90609 1.49234 7.49933 1.49234C8.32641 1.48979 9.14495 1.6605 9.90213 1.99347C9.92954 2.00654 9.9541 2.02489 9.97447 2.04746C9.99484 2.07003 10.0105 2.0964 10.0207 2.12503C10.0308 2.15367 10.0352 2.18402 10.0336 2.21437C10.032 2.2447 10.0244 2.27444 10.0113 2.30186C9.98737 2.3563 9.94287 2.39903 9.88746 2.42071C9.83205 2.44238 9.77036 2.44123 9.71579 2.4175C9.01511 2.11018 8.25801 1.95261 7.49287 1.95492C6.19268 1.95633 4.93427 2.41409 3.93705 3.24836C2.93984 4.08263 2.26711 5.24047 2.03619 6.51997C1.80527 7.79947 2.03081 9.11941 2.67348 10.2497C3.31615 11.3799 4.33517 12.2487 5.55286 12.7045C6.77048 13.1603 8.10948 13.1743 9.3364 12.7439C10.5632 12.3135 11.6001 11.466 12.2661 10.3494C12.9322 9.23282 13.1852 7.91786 12.9809 6.63384C12.7767 5.34981 12.1281 4.17822 11.1485 3.32338C11.1125 3.28223 11.0928 3.22938 11.0929 3.17472C11.0931 3.12006 11.1132 3.06732 11.1494 3.02638C11.1856 2.98544 11.2355 2.9591 11.2897 2.95227C11.344 2.94544 11.3988 2.9586 11.4441 2.98929C12.3644 3.79366 13.0174 4.85964 13.316 6.04489C13.6146 7.23014 13.5444 8.47827 13.1151 9.62268C12.6857 10.767 11.9174 11.7531 10.9128 12.4495C9.90824 13.1457 8.71519 13.519 7.49287 13.5194L7.49933 13.5066Z", fill: "#F2BF0B" }), jsx("path", { d: "M7.50001 14.6249C6.09085 14.6249 4.71327 14.207 3.54156 13.4241C2.36986 12.6412 1.45664 11.5284 0.91736 10.2265C0.378089 8.92454 0.236989 7.49197 0.511905 6.10986C0.78683 4.72775 1.46542 3.45819 2.46187 2.46175C3.45832 1.4653 4.72787 0.786705 6.10996 0.511786C7.49213 0.236866 8.92467 0.377965 10.2266 0.91724C11.5286 1.45651 12.6413 2.36974 13.4242 3.54145C14.2071 4.71314 14.625 6.09069 14.625 7.49988C14.6233 9.38901 13.8721 11.2003 12.5363 12.5362C11.2004 13.872 9.38914 14.6232 7.50001 14.6249ZM7.50001 1.01735C6.21784 1.01735 4.96455 1.39754 3.8985 2.10986C2.83246 2.82216 2.00158 3.83459 1.51093 5.01912C1.02028 6.20365 0.891903 7.50707 1.14203 8.76452C1.39216 10.022 2.00956 11.1771 2.91617 12.0837C3.82276 12.9903 4.97784 13.6077 6.23536 13.8578C7.4928 14.1079 8.79625 13.9796 9.98076 13.489C11.1653 12.9983 12.1777 12.1674 12.89 11.1014C13.6024 10.0354 13.9825 8.78204 13.9825 7.49988C13.9791 5.78165 13.2951 4.13477 12.0801 2.91979C10.8651 1.70481 9.21822 1.02075 7.50001 1.01735Z", fill: "#F2BF0B" }), jsx("path", { d: "M10.1591 10.5131C9.43158 10.7452 8.6739 10.8686 7.91043 10.8794C6.91972 10.9596 5.93706 10.6482 5.17347 10.012C4.86218 9.70525 4.61761 9.33743 4.45509 8.93173C4.29258 8.52596 4.21562 8.09104 4.22904 7.65417C4.22904 5.37982 5.94443 4.22981 8.08386 4.22981C8.72897 4.20483 9.37215 4.31423 9.97274 4.55104L9.61934 5.95163C9.13325 5.7425 8.60617 5.64587 8.07741 5.66894C7.8189 5.63999 7.55711 5.6683 7.31067 5.75187C7.06423 5.83544 6.83925 5.9722 6.65165 6.15248C6.46397 6.33274 6.31837 6.5521 6.22499 6.79497C6.13161 7.03784 6.09288 7.29828 6.11149 7.5578C6.0892 7.80993 6.12113 8.0639 6.20512 8.30265C6.2892 8.5414 6.42332 8.75939 6.59859 8.94195C6.77387 9.12461 6.98628 9.26753 7.2214 9.36124C7.45653 9.45496 7.709 9.4972 7.96181 9.48522C8.14782 9.49377 8.33407 9.47423 8.51429 9.42738V8.29664H7.60841V6.94745H10.1783L10.1591 10.5131Z", fill: "#F2BF0B" })] }));
160
+
161
+ const SweepsIcon = () => (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: [jsx("path", { opacity: "0.39", d: "M7.41174 14.4521C11.2215 14.4521 14.3099 11.3275 14.3099 7.47291C14.3099 3.61837 11.2215 0.493652 7.41174 0.493652C3.60206 0.493652 0.513672 3.61837 0.513672 7.47291C0.513672 11.3275 3.60206 14.4521 7.41174 14.4521Z", fill: "#0DE83D" }), jsx("path", { d: "M8.35827 6.34123C8.33727 6.1169 8.25066 5.94313 8.09843 5.81991C7.94619 5.6951 7.75459 5.6327 7.52362 5.6327C7.35827 5.6327 7.21522 5.6643 7.09449 5.72749C6.97375 5.7891 6.87992 5.87441 6.81299 5.98341C6.74738 6.09084 6.71457 6.21327 6.71457 6.35071C6.71457 6.46603 6.73688 6.56556 6.7815 6.64929C6.82743 6.73302 6.88714 6.80332 6.96063 6.86019C7.03543 6.91548 7.11549 6.96209 7.20079 7C7.28609 7.03633 7.36811 7.06635 7.44685 7.09005L7.84055 7.21327C7.96916 7.25118 8.10105 7.30253 8.23622 7.3673C8.37139 7.43207 8.49672 7.51738 8.6122 7.62322C8.72769 7.72907 8.82087 7.86019 8.89173 8.01659C8.96391 8.17299 9 8.36019 9 8.5782C9 8.85308 8.94094 9.09716 8.82283 9.31043C8.70604 9.5237 8.53609 9.69194 8.31299 9.81517C8.09121 9.93839 7.82283 10 7.50787 10C7.20604 10 6.94488 9.94234 6.72441 9.82701C6.50394 9.71169 6.33136 9.54818 6.20669 9.33649C6.08202 9.12322 6.01312 8.87046 6 8.5782H6.61024C6.62205 8.75355 6.66929 8.89968 6.75197 9.01659C6.83596 9.13191 6.94291 9.21801 7.07283 9.27488C7.20407 9.33017 7.34777 9.35782 7.50394 9.35782C7.67585 9.35782 7.82874 9.32543 7.9626 9.26066C8.09777 9.19431 8.20407 9.10269 8.2815 8.98578C8.35892 8.8673 8.39764 8.72907 8.39764 8.57109C8.39764 8.42733 8.36352 8.30964 8.29528 8.21801C8.22835 8.12638 8.13714 8.05055 8.02165 7.99052C7.90748 7.93049 7.77822 7.87757 7.63386 7.83175L7.15748 7.67536C6.83465 7.56951 6.57874 7.4139 6.38976 7.20853C6.2021 7.00316 6.10827 6.73144 6.10827 6.39336C6.10827 6.11374 6.17126 5.86967 6.29724 5.66114C6.42323 5.45261 6.59383 5.29068 6.80906 5.17536C7.02428 5.05845 7.26706 5 7.5374 5C7.81037 5 8.05118 5.05766 8.25984 5.17299C8.46982 5.28831 8.63517 5.44708 8.75591 5.64929C8.87664 5.84992 8.93963 6.08057 8.94488 6.34123H8.35827Z", fill: "#0DE83D" }), jsx("path", { d: "M7.50006 13.8228C5.82297 13.8228 4.21465 13.1566 3.0288 11.9708C1.84296 10.7849 1.17676 9.17656 1.17676 7.49957C1.17676 5.82253 1.84296 4.21419 3.0288 3.02834C4.21465 1.8425 5.82297 1.1763 7.50006 1.1763C8.37068 1.17362 9.2323 1.35331 10.0293 1.7038C10.0582 1.71756 10.084 1.73688 10.1055 1.76064C10.1269 1.7844 10.1434 1.81215 10.1541 1.84229C10.1648 1.87244 10.1694 1.90439 10.1677 1.93633C10.166 1.96826 10.1581 1.99956 10.1443 2.02842C10.1191 2.08573 10.0722 2.13071 10.0139 2.15353C9.95556 2.17634 9.89062 2.17513 9.83318 2.15015C9.09562 1.82665 8.29868 1.6608 7.49327 1.66323C6.12465 1.66471 4.8 2.14656 3.7503 3.02474C2.7006 3.90292 1.99247 5.1217 1.74939 6.46855C1.50632 7.81539 1.74373 9.20479 2.42022 10.3946C3.09672 11.5842 4.16937 12.4988 5.45115 12.9786C6.73285 13.4583 8.14233 13.4731 9.43383 13.02C10.7252 12.567 11.8167 11.6749 12.5177 10.4996C13.2189 9.32417 13.4851 7.94001 13.2701 6.5884C13.0552 5.2368 12.3725 4.00354 11.3413 3.10371C11.3034 3.0604 11.2826 3.00476 11.2828 2.94723C11.283 2.88969 11.3041 2.83418 11.3423 2.79108C11.3804 2.74799 11.4329 2.72026 11.49 2.71307C11.5471 2.70588 11.6048 2.71974 11.6524 2.75204C12.6211 3.59875 13.3086 4.72083 13.6229 5.96845C13.9372 7.21609 13.8633 8.52992 13.4114 9.73456C12.9594 10.9391 12.1507 11.9771 11.0932 12.7101C10.0358 13.443 8.77991 13.8359 7.49327 13.8363L7.50006 13.8228Z", fill: "#0DE83D" }), jsx("path", { d: "M7.50001 15C6.01668 15 4.5666 14.5601 3.33323 13.736C2.09986 12.9119 1.13857 11.7406 0.570905 10.3701C0.00325189 8.99965 -0.145274 7.49168 0.144111 6.03682C0.433505 4.58197 1.14781 3.24559 2.1967 2.19671C3.2456 1.14781 4.58197 0.433502 6.0368 0.144114C7.49171 -0.145275 8.99965 0.00324947 10.3701 0.570907C11.7406 1.13856 12.9119 2.09986 13.736 3.33323C14.5602 4.56659 15 6.01664 15 7.5C14.9982 9.48856 14.2075 11.3951 12.8014 12.8014C11.3952 14.2075 9.48857 14.9982 7.50001 15ZM7.50001 0.676288C6.15036 0.676288 4.83111 1.07649 3.70895 1.82629C2.5868 2.57609 1.71218 3.64181 1.19572 4.88868C0.679241 6.13555 0.544108 7.50757 0.807402 8.83121C1.0707 10.1549 1.72059 11.3708 2.67491 12.3251C3.62922 13.2794 4.84509 13.9293 6.1688 14.1926C7.49242 14.4559 8.86448 14.3208 10.1113 13.8043C11.3582 13.2878 12.4239 12.4132 13.1737 11.291C13.9235 10.1689 14.3237 8.84965 14.3237 7.5C14.3202 5.69134 13.6001 3.95778 12.3212 2.67886C11.0422 1.39993 9.30865 0.679862 7.50001 0.676288Z", fill: "#0DE83D" })] }));
162
+
163
+ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
164
+ const getIcon = (option) => {
165
+ if (option.code === Currency.GOLD) {
166
+ return GoldIcon;
167
+ }
168
+ if (option.code === Currency.SWEEPS) {
169
+ return SweepsIcon;
170
+ }
171
+ return option.icon;
172
+ };
173
+
174
+ const SelectMenu = ({ disabled = false }) => {
175
+ const { config } = useManualPlayState();
176
+ const { current, available } = config.currencyOptions;
177
+ const handleClick = (e) => {
178
+ if (disabled) {
179
+ return;
180
+ }
181
+ const target = e.target;
182
+ const value = target.dataset.value;
183
+ if (!value) {
184
+ return;
185
+ }
186
+ const newCurrency = available.find((d) => d.code === value);
187
+ if (newCurrency) {
188
+ sendSetUserCurrencyEvent({ currency: newCurrency.code });
189
+ sendSetUserCurrencyEventV2({ current: newCurrency, available });
190
+ }
191
+ };
192
+ const ButtonIcon = getIcon(current);
193
+ if (available.length === 1) {
194
+ return (jsx("div", { className: cx$1(style_select.button), children: ButtonIcon && jsx(ButtonIcon, {}) }));
195
+ }
196
+ return (jsx(Menu, { as: "div", className: cx$1(style_select.menu), children: ({ open }) => (jsxs(Fragment, { children: [jsxs(MenuButton, { className: cx$1(style_select.button, {
197
+ [style_select.disabled]: disabled,
198
+ }), disabled: disabled, as: "div", children: [ButtonIcon && jsx(ButtonIcon, {}), jsx(ChevronIcon, { open: open, disabled: disabled })] }), jsx(MenuItems, { anchor: { to: "top start" }, className: cx$1(style_select.menuItems), children: available.map((option) => {
199
+ const Icon = getIcon(option);
200
+ return (jsxs(MenuItem, { as: "div", "data-value": option.code, onClick: handleClick, className: cx$1(style_select.menuItem, {
201
+ [style_select.selected]: String(current.code) === String(option.code),
202
+ }), children: [Icon && jsx(Icon, {}), capitalize(String(option.label))] }, `element-${option.code}`));
203
+ }) })] })) }));
204
+ };
205
+
206
+ var styles$1 = {"base":"PlayValueInput-module__base___sTNW2","icon":"PlayValueInput-module__icon___jZj7O","playValueInput":"PlayValueInput-module__playValueInput___7pJtn","playValueInputWithLabel":"PlayValueInput-module__playValueInputWithLabel___S55Cr","label":"PlayValueInput-module__label___1ZSAV","inputContainer":"PlayValueInput-module__inputContainer___RKr1l","playValueWithLabel":"PlayValueInput-module__playValueWithLabel___K4-pr"};
207
+
208
+ const PlayValueInput = ({ disabled, children, className, value, onClick, }) => {
209
+ const handleOnClick = () => {
210
+ if (disabled) {
211
+ return;
212
+ }
213
+ onClick();
214
+ };
215
+ return (jsxs("div", { className: cx$1(styles$1.base, className, {
216
+ [styles$1.disabled]: disabled,
217
+ }), children: [jsxs("div", { className: cx$1(styles$1.inputContainer), onClick: (e) => {
218
+ e.preventDefault();
219
+ handleOnClick();
220
+ }, children: [jsx("span", { className: styles$1.label, children: "Play amount" }), jsx("div", { className: cx$1(styles$1.playValueInput, {
221
+ [styles$1.playValueInputWithLabel]: true,
222
+ }), children: value })] }), children && jsx("div", { className: cx$1(styles$1.icon), children: children })] }));
223
+ };
224
+
225
+ const PlayAmountControl = ({ isDisabled }) => {
226
+ const { config } = useManualPlayState();
227
+ const { playAmount, adjustPlayAmount, playValues: { togglePlayAmountView }, } = usePlayController();
228
+ const handleTogglePlayAmount = () => {
229
+ setToggleGameWidgetsVisibility();
230
+ togglePlayAmountView();
231
+ setToggleGameWidgetsExpansion();
232
+ };
233
+ return (jsxs(GroupRow, { children: [jsx(PlayValueInput, { className: styles_group.groupItem, value: `${playAmount} ${config.currencyOptions.current.abbr}`, disabled: isDisabled() || config.playOptions.disabledController, onClick: handleTogglePlayAmount, children: jsx(SelectMenu, { disabled: isDisabled() }) }), jsx(Button, { className: styles_group.groupItem, onClick: () => adjustPlayAmount({ direction: -1 }), theme: "ghost", disabled: isDisabled(), children: jsx("span", { className: styles_group.x2, children: "-" }) }), jsx(Button, { className: styles_group.groupItem, onClick: () => adjustPlayAmount({ direction: 1 }), theme: "ghost", disabled: isDisabled(), children: jsx("span", { className: cx$1(styles_group.x2, styles_group.last), children: "+" }) })] }));
234
+ };
235
+
236
+ const ManualPlayController = () => {
237
+ const { config } = useManualPlayState();
238
+ const { isValidPlayAmount, playValues: { displayPlayAmountView, togglePlayAmountView }, manualPlay: { isDisabled, onPlay }, } = usePlayController();
239
+ const { current } = config.currencyOptions;
240
+ const roleButton = GAME_MODE.MANUAL;
241
+ const activeClassName = useMemo(() => {
242
+ if (current.code === Currency.GOLD) {
243
+ return styles_button.buttonGold__active;
244
+ }
245
+ if (current.code === Currency.SWEEPS) {
246
+ return styles_button.buttonSweeps__active;
247
+ }
248
+ return styles_button.buttonDefault__active;
249
+ }, [current.code]);
250
+ const defaultClassName = useMemo(() => {
251
+ if (current.code === Currency.GOLD) {
252
+ return styles_button.buttonGold;
253
+ }
254
+ if (current.code === Currency.SWEEPS) {
255
+ return styles_button.buttonSweeps;
256
+ }
257
+ return styles_button.buttonDefault;
258
+ }, [current.code]);
259
+ const handleKeyPress = useCallback((event) => {
260
+ if (event.code !== "Space") {
261
+ return;
262
+ }
263
+ const button = selectButton(roleButton);
264
+ if (!button || isDisabled()) {
265
+ return;
266
+ }
267
+ event.preventDefault();
268
+ event.stopPropagation();
269
+ addPressedClass(roleButton, activeClassName);
270
+ button.click();
271
+ }, [roleButton, isDisabled, activeClassName]);
272
+ const handleKeyUp = useCallback((event) => {
273
+ if (event.code !== "Space") {
274
+ return;
275
+ }
276
+ const button = selectButton(roleButton);
277
+ if (!button) {
278
+ return;
279
+ }
280
+ event.preventDefault();
281
+ event.stopPropagation();
282
+ removePressedClass(roleButton, activeClassName);
283
+ }, [roleButton, activeClassName]);
284
+ useEffect(() => {
285
+ window.addEventListener("keydown", handleKeyPress, true);
286
+ window.addEventListener("keyup", handleKeyUp, true);
287
+ return () => {
288
+ window.removeEventListener("keydown", handleKeyPress, true);
289
+ window.removeEventListener("keyup", handleKeyUp, true);
290
+ };
291
+ }, [handleKeyPress, handleKeyUp]);
292
+ const isButtonDisabled = isDisabled() || !isValidPlayAmount;
293
+ const renderButton = useMemo(() => {
294
+ if (displayPlayAmountView) {
295
+ return (jsx(Button, { className: styles_button.buttonPlayAmount, onClick: togglePlayAmountView, roleType: roleButton, children: "SELECT PLAY AMOUNT" }));
296
+ }
297
+ return (jsx(Button, { disabled: isButtonDisabled, className: defaultClassName, onClick: onPlay, roleType: roleButton, children: "PLAY NOW" }));
298
+ }, [
299
+ defaultClassName,
300
+ displayPlayAmountView,
301
+ isButtonDisabled,
302
+ onPlay,
303
+ roleButton,
304
+ togglePlayAmountView,
305
+ ]);
306
+ return (jsxs(Fragment, { children: [jsx(PlayAmountControl, { isDisabled: isDisabled || displayPlayAmountView }), renderButton] }));
307
+ };
308
+
309
+ var styles_ui = {"base":"UI-module__base___6q08N","container":"UI-module__container___S3Gpa","betForm":"UI-module__betForm___pu-7D","disabled":"UI-module__disabled___E2zhE","controllerWidgets":"UI-module__controllerWidgets___rFquu","sideWidget":"UI-module__sideWidget___mTaGO","centerWidget":"UI-module__centerWidget___zWhMN","left":"UI-module__left___VsEJc","center":"UI-module__center___hZwDn","right":"UI-module__right___JJ0-R"};
310
+
311
+ function getDefaultExportFromCjs (x) {
312
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
313
+ }
314
+
315
+ var bind = {exports: {}};
316
+
317
+ /*!
318
+ Copyright (c) 2018 Jed Watson.
319
+ Licensed under the MIT License (MIT), see
320
+ http://jedwatson.github.io/classnames
321
+ */
322
+
323
+ var hasRequiredBind;
324
+
325
+ function requireBind () {
326
+ if (hasRequiredBind) return bind.exports;
327
+ hasRequiredBind = 1;
328
+ (function (module) {
329
+ /* global define */
330
+
331
+ (function () {
332
+
333
+ var hasOwn = {}.hasOwnProperty;
334
+
335
+ function classNames () {
336
+ var classes = '';
337
+
338
+ for (var i = 0; i < arguments.length; i++) {
339
+ var arg = arguments[i];
340
+ if (arg) {
341
+ classes = appendClass(classes, parseValue.call(this, arg));
342
+ }
343
+ }
344
+
345
+ return classes;
346
+ }
347
+
348
+ function parseValue (arg) {
349
+ if (typeof arg === 'string' || typeof arg === 'number') {
350
+ return this && this[arg] || arg;
351
+ }
352
+
353
+ if (typeof arg !== 'object') {
354
+ return '';
355
+ }
356
+
357
+ if (Array.isArray(arg)) {
358
+ return classNames.apply(this, arg);
359
+ }
360
+
361
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
362
+ return arg.toString();
363
+ }
364
+
365
+ var classes = '';
366
+
367
+ for (var key in arg) {
368
+ if (hasOwn.call(arg, key) && arg[key]) {
369
+ classes = appendClass(classes, this && this[key] || key);
370
+ }
371
+ }
372
+
373
+ return classes;
374
+ }
375
+
376
+ function appendClass (value, newClass) {
377
+ if (!newClass) {
378
+ return value;
379
+ }
380
+
381
+ if (value) {
382
+ return value + ' ' + newClass;
383
+ }
384
+
385
+ return value + newClass;
386
+ }
387
+
388
+ if (module.exports) {
389
+ classNames.default = classNames;
390
+ module.exports = classNames;
391
+ } else {
392
+ window.classNames = classNames;
393
+ }
394
+ }());
395
+ } (bind));
396
+ return bind.exports;
397
+ }
398
+
399
+ var bindExports = requireBind();
400
+ var cn = /*@__PURE__*/getDefaultExportFromCjs(bindExports);
401
+
402
+ const cx = cn.bind(styles_ui);
403
+ const WidgetContainer = ({ widgets, displayPlayAmountView, }) => {
404
+ const { left = [], center = [], right = [] } = widgets ?? {};
405
+ const renderZone = (items, zone) => {
406
+ const containerClass = zone === "center" ? cx("centerWidget") : cx("sideWidget");
407
+ return (jsx("div", { className: cx(containerClass, zone), children: items.map((widget) => widget.renderElement({ displayPlayAmountView })) }));
408
+ };
409
+ return (jsxs("div", { className: cx("controllerWidgets"), children: [renderZone(left, "left"), renderZone(center, "center"), renderZone(right, "right")] }));
410
+ };
411
+
412
+ var styles = {"base":"PlayValueList-module__base___5duc6","playValuesWrapper":"PlayValueList-module__playValuesWrapper___-zfj2","playValue":"PlayValueList-module__playValue___TJQhI","selectedPlayValue":"PlayValueList-module__selectedPlayValue___3DhDC","disabledPlayValue":"PlayValueList-module__disabledPlayValue___U9Bkj"};
413
+
414
+ const PlayValueList = () => {
415
+ const { config } = useManualPlayState();
416
+ const { onChangeAmount, playAmount, totalBalance, playValues: { displayPlayAmountView, togglePlayAmountView }, } = usePlayController();
417
+ const { playLimits } = config.playOptions.playHook();
418
+ if (!displayPlayAmountView) {
419
+ return null;
420
+ }
421
+ const applyValue = (value) => {
422
+ if (totalBalance < value) {
423
+ sendOpenStoreEvent();
424
+ }
425
+ else {
426
+ onChangeAmount(value);
427
+ }
428
+ togglePlayAmountView();
429
+ };
430
+ const handleClick = (e) => {
431
+ const el = e.target?.closest("[data-value]");
432
+ if (!el) {
433
+ return;
434
+ }
435
+ const raw = el.dataset.value;
436
+ if (!raw) {
437
+ return;
438
+ }
439
+ const value = Number(raw);
440
+ if (!Number.isNaN(value)) {
441
+ applyValue(value);
442
+ }
443
+ };
444
+ return (jsx("div", { className: cx$1(styles.base), children: jsx("div", { className: cx$1(styles.playValuesWrapper), onClick: handleClick, role: "listbox", "aria-label": "Select play amount", "data-testid": "play-value-list", children: playLimits?.[config.currencyOptions.current.code].defaultBetOptions.map((playValue) => (jsx("div", { className: cx$1(styles.playValue, {
445
+ [styles.selectedPlayValue]: playValue === playAmount,
446
+ [styles.disabledPlayValue]: playValue > totalBalance,
447
+ }), "data-value": playValue, role: "option", tabIndex: 0, "aria-selected": false, children: format(playValue, config.currencyOptions.current.decimals) }, `${config.currencyOptions.current.code}-${playValue}`))) }) }));
448
+ };
449
+
450
+ const ManualPlayProvider = ({ children, config, }) => {
451
+ const [displayPlayAmountView, setDisplayPlayAmountView] = useState(false);
452
+ const togglePlayAmountView = useCallback(() => {
453
+ setDisplayPlayAmountView((v) => !v);
454
+ }, []);
455
+ const contextValue = useMemo(() => ({
456
+ mode: GAME_MODE.MANUAL,
457
+ config,
458
+ playValues: {
459
+ displayPlayAmountView,
460
+ setDisplayPlayAmountView,
461
+ togglePlayAmountView,
462
+ },
463
+ }), [config, displayPlayAmountView, togglePlayAmountView]);
464
+ return (jsxs(ManualPlayStateContext.Provider, { value: contextValue, children: [typeof children === "function" ? children(contextValue) : children, config.playOptions.displayController && (jsx("div", { className: cx$1(styles_ui.base, styles_ui.betForm), style: {
465
+ "--play-bottom": config.panel.bottom ?? 0,
466
+ "--play-panel-bg": hexToRgb(config.panel.bgColorHex ?? "#01243A"),
467
+ "--play-dropdown-bg": hexToRgb(config.dropdown.bgColorHex ?? "#01243A"),
468
+ "--play-panel-bg-opacity": config.panel.bgColorOpacity ?? 0.5,
469
+ }, children: jsxs("div", { className: cx$1(styles_ui.container), children: [jsx(PlayValueList, {}), jsx(ManualPlayController, {}), jsx(WidgetContainer, { widgets: {
470
+ left: config.leftWidgets,
471
+ center: config.centerWidgets,
472
+ right: config.rightWidgets,
473
+ }, displayPlayAmountView: displayPlayAmountView })] }) }))] }));
474
+ };
475
+
476
+ export { GAME_MODE, ManualPlayProvider, WIDGET, format };
477
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/components/utils.ts","../src/types/gameMode.ts","../src/types/widgets.ts","../src/components/ManualPlayStateProvider/ManualPlayStateContext.tsx","../src/components/hooks/usePlayController.ts","../src/components/base/Button/Button.tsx","../src/components/base/GroupRow/GroupRow.tsx","../src/components/base/ChevronIcon/ChevronIcon.tsx","../src/components/base/SelectMenu/GoldIcon.tsx","../src/components/base/SelectMenu/SweepsIcon.tsx","../src/components/base/SelectMenu/config.tsx","../src/components/base/SelectMenu/SelectMenu.tsx","../src/components/base/PlayValueInput/PlayValueInput.tsx","../src/components/base/PlayController/PlayController.tsx","../src/components/base/ManualPlayController/ManualPlayController.tsx","../node_modules/classnames/bind.js","../src/components/Widgets/WidgetContainer.tsx","../src/components/base/PlayValueList/PlayValueList.tsx","../src/components/ManualPlayStateProvider/ManualPlayProvider.tsx"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n",null,null,null],"names":["_jsx","cx","styles","_jsxs","PlayValue","_Fragment"],"mappings":";;;;;;AAEO,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAI;IACtC,MAAM,cAAc,GAAG,kCAAkC;AACzD,IAAA,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,2CAA2C,CAAC,IAAI,CAA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,EAG1B,QAAA,EAAAE,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEF,IAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EACrC,QAAA,EAAA,CAAAD,GAAA,CAAC,aAAa,EAAG,EAAA,CAAA,EACjBA,IAAC,oBAAoB,EAAA,EAAA,CAAG,EACxBA,GAAC,CAAA,eAAe,EACd,EAAA,OAAO,EAAE;gCACP,IAAI,EAAE,MAAM,CAAC,WAAW;gCACxB,MAAM,EAAE,MAAM,CAAC,aAAa;gCAC5B,KAAK,EAAE,MAAM,CAAC,YAAY;6BAC3B,EACD,qBAAqB,EAAE,qBAAqB,EAAA,CAC5C,IACE,EACF,CAAA,CACP,CAC+B,EAAA,CAAA;AAEtC;;;;","x_google_ignoreList":[15]}
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .Button-module__base___muNxk{background:transparent;border:0;cursor:pointer;font-weight:700;margin:0;outline:none;text-transform:uppercase;user-select:none}.Button-module__base__theme-ghost___I5-LJ{align-items:center;backdrop-filter:blur(10px);border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;height:100%;width:100%}.Button-module__base__theme-ghost___I5-LJ:active,.Button-module__base__theme-ghost___I5-LJ:focus,.Button-module__base__theme-ghost___I5-LJ:hover{background:rgba(var(--bg-color-rgb),.05)}.Button-module__base__theme-primary___Zuswb{align-items:center;border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;height:39px;justify-content:center;letter-spacing:.8px;line-height:125%;margin-top:7px;width:100%}.Button-module__base__state-disabled___EU5tH{color:rgba(var(--text-color-hex),.5)!important;pointer-events:none}.Button-module__buttonCashout___LG-Yr,.Button-module__buttonPlayAmount___GMy3F{background:linear-gradient(357deg,#7f44c3 22.01%,#9f5eeb 97.97%)}.Button-module__buttonCashout___LG-Yr:active,.Button-module__buttonCashout__active___qnE3h,.Button-module__buttonPlayAmount___GMy3F:active,.Button-module__buttonPlayAmount__active___e0nGe{background:#592f9d}.Button-module__buttonSweeps___0snDQ{background:linear-gradient(357deg,#10be68 23.9%,#29cf7d 97.97%)}.Button-module__buttonSweeps___0snDQ:active,.Button-module__buttonSweeps__active___PXIFH{background:#008c47}.Button-module__buttonGold___DAj-d{background:linear-gradient(357deg,#bf9e21 22.01%,#f0c72c 97.97%)}.Button-module__buttonGold___DAj-d:active,.Button-module__buttonGold__active___vsi7m{background:#9a7c04}.Button-module__buttonDefault___QENXy{background:linear-gradient(357deg,#10be68 23.9%,#29cf7d 97.97%)}.Button-module__buttonDefault___QENXy:active,.Button-module__buttonDefault__active___oS6gd{background:#008c47}.GroupRow-module__base___b241-{display:flex;width:100%}.GroupRow-module__label___Du57P{color:hsla(0,6%,41%,.6);font-size:12px;font-style:Inter;font-weight:700;letter-spacing:.02em;line-height:18px;margin-bottom:6px}.GroupRow-module__group___V7xa6{display:flex;margin-top:5px;width:100%}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8{border-radius:0;box-sizing:border-box}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8:last-child{border-bottom-right-radius:10px;border-top-right-radius:10px}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8:first-child{border-bottom-left-radius:10px;border-top-left-radius:10px}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8+.GroupRow-module__groupItem___yNSX8{margin-left:2px}.GroupRow-module__x2___9bLae{align-items:center;background:hsla(0,0%,100%,.15);cursor:pointer;display:block;display:flex;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;height:35px;justify-content:center;width:45px}.GroupRow-module__x2___9bLae.GroupRow-module__last___ArsSn{border-bottom-right-radius:10px;border-top-right-radius:10px}.GroupRow-module__gap-2___1eib1{gap:9px}.SelectMenu-module__button___N-HeB{align-items:center;display:flex;gap:3px;height:35px;justify-content:space-between;transition:all .7s;width:35px}.SelectMenu-module__menu___c5jvZ{cursor:pointer;width:auto}.SelectMenu-module__menuItems___BX1YQ{background-color:rgba(var(--play-dropdown-bg),1);border-radius:6px;cursor:pointer;overflow-y:auto;padding:4px 0;width:100%;width:110px}.SelectMenu-module__menuItem___eXbi3{align-items:center;background-color:rgba(var(--play-dropdown-bg),1);color:rgba(var(--text-color-hex),1);display:flex;font-size:12px;font-weight:600;gap:6px;padding:2px 12px}.SelectMenu-module__menuItem___eXbi3:hover{background:rgba(var(--bg-color-rgb),.16);color:rgba(var(--text-color-hex),1)}.SelectMenu-module__selected___XyADw{position:relative}.SelectMenu-module__selected___XyADw:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' d='M20.53 6.47a.75.75 0 0 1 0 1.06l-10 10a.75.75 0 0 1-1.06 0l-5-5a.75.75 0 1 1 1.06-1.06L10 15.94l9.47-9.47a.75.75 0 0 1 1.06 0Z' clip-rule='evenodd' fill='%23FFF'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain;content:"";height:16px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px}.SelectMenu-module__disabledSVG___OdVFW,.SelectMenu-module__disabled___jiTPl{cursor:not-allowed}.SelectMenu-module__disabled___jiTPl svg{opacity:.1}.ChevronIcon-module__chevron___lif8s{stroke:rgba(var(--text-color-hex),1);height:14px;transform-origin:center;transition:transform .3s ease;width:14px}.ChevronIcon-module__open___niD1n{transform:rotate(-180deg)}.ChevronIcon-module__disable___8n-xg{stroke:rgba(var(--text-color-hex),.1)}.PlayValueInput-module__base___sTNW2{background:hsla(0,0%,100%,.15);border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;height:35px;padding:5px 0 4px;position:relative;width:100%;z-index:1}.PlayValueInput-module__icon___jZj7O{display:block;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;left:11px;position:absolute;top:50%;transform:translateY(-50%)}.PlayValueInput-module__label___1ZSAV,.PlayValueInput-module__playValueInputWithLabel___S55Cr,.PlayValueInput-module__playValueInput___7pJtn{background:transparent;color:rgba(var(--text-color-hex),1);cursor:pointer;font-family:Inter;font-size:12px;letter-spacing:.6px;margin-left:50px;padding:0;text-align:left;width:197px}.PlayValueInput-module__inputContainer___RKr1l{cursor:pointer;display:flex;flex-direction:column;justify-content:space-between}.PlayValueInput-module__label___1ZSAV{font-size:10px;letter-spacing:.5px;line-height:125%}.PlayValueInput-module__playValueWithLabel___K4-pr{padding-top:15px;user-select:none;z-index:1}.UI-module__base___6q08N{align-items:center;border-radius:15px;display:flex;flex-direction:column;justify-content:center;position:relative}.UI-module__container___S3Gpa{width:342px}.UI-module__betForm___pu-7D{background-color:rgba(var(--play-panel-bg),var(--play-panel-bg-opacity));border-radius:0;bottom:var(--play-bottom);display:flex;flex-direction:column;height:auto;left:50%;padding:16px;position:absolute;transform:translateX(-50%);width:100%}@media (min-width:700px){.UI-module__betForm___pu-7D{border-radius:15px;width:374px}}.UI-module__disabled___E2zhE{opacity:.1}.UI-module__controllerWidgets___rFquu{align-items:center;display:flex;height:38px;justify-content:space-between;margin-top:5px;width:100%}.UI-module__controllerWidgets___rFquu .UI-module__centerWidget___zWhMN,.UI-module__controllerWidgets___rFquu .UI-module__sideWidget___mTaGO{color:#fff;display:flex;font-family:Inter,sans-serif;font-size:10px!important;font-style:normal;font-weight:700;gap:8px;line-height:125%;text-align:center;width:20%}.UI-module__controllerWidgets___rFquu .UI-module__centerWidget___zWhMN{width:60%}.UI-module__controllerWidgets___rFquu .UI-module__left___VsEJc{justify-content:flex-start}.UI-module__controllerWidgets___rFquu .UI-module__center___hZwDn{justify-content:center}.UI-module__controllerWidgets___rFquu .UI-module__right___JJ0-R{justify-content:flex-end}*,html{--bet-bottom:0px;--bet-panel-bg:8,30,100;--play-dropdown-bg:16,36,63;--bg-color-rgb:255,255,255;--text-color-hex:255,255,255;cursor:default;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.Input-module__base___IifiA{border:none;color:rgba(var(--text-color-hex),1);outline:none;padding:10px 12px;user-select:none!important;width:100%}.Input-module__disabled___WqyKa{color:rgba(var(--text-color-hex),.1)!important;cursor:pointer;pointer-events:none}.PlayValueList-module__base___5duc6{align-items:center;backdrop-filter:blur(10px);background:hsla(0,0%,100%,.15);border-radius:10px;display:flex;flex-shrink:0;height:385px;justify-content:center;margin-bottom:5px;width:342px}.PlayValueList-module__playValuesWrapper___-zfj2{align-content:flex-start;align-items:flex-start;display:flex;flex-shrink:0;flex-wrap:wrap;gap:7px;height:351px;transition:all .2s;width:326px}.PlayValueList-module__playValue___TJQhI{align-items:center;backdrop-filter:blur(10px);background:hsla(0,0%,100%,.15);border-radius:50px;color:#fff;cursor:pointer;display:flex;flex-shrink:0;font-family:Inter;font-size:16px;font-style:normal;gap:10px;height:45px;justify-content:center;letter-spacing:.8px;line-height:125%;padding:12px 21px;text-align:center;text-transform:uppercase;width:104px}.PlayValueList-module__selectedPlayValue___3DhDC{background:#07172d;transition:all .2s}.PlayValueList-module__disabledPlayValue___U9Bkj{background:#07172d;opacity:.25;transition:all .2s}
@@ -0,0 +1,3 @@
1
+ export declare enum GAME_MODE {
2
+ MANUAL = "manual"
3
+ }
@@ -0,0 +1,4 @@
1
+ import { GAME_MODE } from "./gameMode";
2
+ import { Widget, WIDGET } from "./widgets";
3
+ export { GAME_MODE, WIDGET };
4
+ export type { Widget };
@@ -0,0 +1,33 @@
1
+ import { CurrencyProps, PlayLimitsV2 as PlayLimits } from "@enigma-lake/zoot-platform-sdk";
2
+ import { Widget } from "./widgets";
3
+ export type StylingProps = {
4
+ panel: {
5
+ bottom?: string;
6
+ bgColorHex: string;
7
+ bgColorOpacity?: number;
8
+ };
9
+ dropdown: {
10
+ bgColorHex: string;
11
+ };
12
+ };
13
+ export type ActionsProps = {
14
+ onPlay: () => void;
15
+ };
16
+ export type PlaySettingsProps = {
17
+ disabledController: boolean;
18
+ disabledMenu: boolean;
19
+ displayController: boolean;
20
+ playHook: () => {
21
+ playLimits?: PlayLimits;
22
+ playAmount: number;
23
+ setPlayAmount: (value: number) => void;
24
+ };
25
+ totalBalance: number;
26
+ };
27
+ export type PlayControllerProps = StylingProps & ActionsProps & {
28
+ currencyOptions: CurrencyProps;
29
+ playOptions: PlaySettingsProps;
30
+ leftWidgets: Widget[];
31
+ rightWidgets: Widget[];
32
+ centerWidgets: Widget[];
33
+ };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ export declare enum WIDGET {
3
+ CENTER = "center",
4
+ SIDE = "side"
5
+ }
6
+ export type Widget = {
7
+ type: WIDGET;
8
+ renderElement: ({ displayPlayAmountView, }: {
9
+ displayPlayAmountView: boolean;
10
+ }) => ReactNode;
11
+ };
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@enigma-lake/dice-play-controller-sdk",
3
+ "version": "1.0.0",
4
+ "description": "A React component library for building gameplay interfaces",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "typings": "dist/index.d.ts",
8
+ "type": "module",
9
+ "style": "dist/style.css",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc && rollup -c --bundleConfigAsCjs",
15
+ "start": "webpack serve --mode development --open",
16
+ "eslint": "eslint --cache --fix .",
17
+ "eslint:check": "eslint .",
18
+ "prettier": "prettier --write .",
19
+ "prettier:check": "prettier --check ."
20
+ },
21
+ "keywords": [],
22
+ "author": "",
23
+ "license": "ISC",
24
+ "files": [
25
+ "dist",
26
+ "dist/style.css",
27
+ "dist/index.js",
28
+ "dist/index.d.ts"
29
+ ],
30
+ "peerDependencies": {
31
+ "@enigma-lake/zoot-platform-sdk": "1.1.6",
32
+ "@headlessui/react": "^2.2.0",
33
+ "@types/react": "^19.0.7",
34
+ "@types/react-dom": "^19.0.3",
35
+ "react": "18.2.0",
36
+ "react-dom": "18.2.0",
37
+ "use-debounce": "^10.0.4"
38
+ },
39
+ "resolutions": {
40
+ "react": "18.2.0",
41
+ "react-dom": "18.2.0"
42
+ },
43
+ "devDependencies": {
44
+ "@babel/core": "^7.26.0",
45
+ "@babel/preset-env": "^7.26.0",
46
+ "@babel/preset-react": "^7.26.3",
47
+ "@rollup/plugin-babel": "^6.0.4",
48
+ "@rollup/plugin-commonjs": "^28.0.2",
49
+ "@rollup/plugin-inject": "^5.0.5",
50
+ "@rollup/plugin-node-resolve": "^16.0.0",
51
+ "@rollup/plugin-typescript": "^12.1.2",
52
+ "@types/node": "^22.10.6",
53
+ "@typescript-eslint/eslint-plugin": "^8.20.0",
54
+ "@typescript-eslint/parser": "^8.20.0",
55
+ "babel-loader": "^9.2.1",
56
+ "classnames": "^2.5.1",
57
+ "css-loader": "^7.1.2",
58
+ "eslint": "^9.18.0",
59
+ "eslint-config-prettier": "^10.0.1",
60
+ "eslint-plugin-import": "^2.31.0",
61
+ "eslint-plugin-prettier": "^5.2.2",
62
+ "eslint-plugin-promise": "^7.2.1",
63
+ "eslint-plugin-react": "^7.37.4",
64
+ "eslint-plugin-react-hooks": "^5.1.0",
65
+ "eslint-plugin-storybook": "^0.11.2",
66
+ "mini-css-extract-plugin": "^2.9.2",
67
+ "prettier": "^3.4.2",
68
+ "react-switch": "^7.1.0",
69
+ "rollup": "^4.30.1",
70
+ "rollup-plugin-delete": "^2.1.0",
71
+ "rollup-plugin-dts": "^6.1.1",
72
+ "rollup-plugin-peer-deps-external": "^2.2.4",
73
+ "rollup-plugin-postcss": "^4.0.2",
74
+ "rollup-plugin-sass": "^1.15.0",
75
+ "sass": "^1.83.4",
76
+ "sass-loader": "^16.0.4",
77
+ "style-loader": "^4.0.0",
78
+ "ts-loader": "^9.5.2",
79
+ "typescript": "^5.7.3",
80
+ "webpack": "^5.97.1",
81
+ "webpack-cli": "^6.0.1",
82
+ "webpack-dev-server": "^5.2.0"
83
+ }
84
+ }