@open-slot-ui/core 0.0.1 → 0.1.1
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.
- package/dist/index.cjs +12 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -26
- package/dist/index.d.ts +5 -26
- package/dist/index.js +13 -27
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1069,8 +1069,10 @@ declare const RGS_ERROR_KEYS: Readonly<Record<string, {
|
|
|
1069
1069
|
}>>;
|
|
1070
1070
|
/** The default dismiss action used when a notice supplies none. */
|
|
1071
1071
|
declare const DEFAULT_NOTICE_ACTION: NoticeAction;
|
|
1072
|
-
/** Build the title + message blocks for an error/notice (used by `showError`).
|
|
1073
|
-
|
|
1072
|
+
/** Build the title + message blocks for an error/notice (used by `showError`).
|
|
1073
|
+
* The Figma "default" modal is plain: a heading + body text (no tinted callout).
|
|
1074
|
+
* `tone` is kept for API compatibility but no longer changes the rendering. */
|
|
1075
|
+
declare function errorBlocks(message: string, title: string, _tone: NonNullable<NoticeOptions['tone']>): BlockSpec[];
|
|
1074
1076
|
|
|
1075
1077
|
/**
|
|
1076
1078
|
* i18n port (Charter B5/B8): the core depends on this tiny interface, NOT on i18next.
|
|
@@ -1580,9 +1582,6 @@ interface UISpec {
|
|
|
1580
1582
|
jurisdiction?: JurisdictionConfig;
|
|
1581
1583
|
/** Initial RTP percentage for the RTP readout (e.g. 96 → "96.0%"). */
|
|
1582
1584
|
rtp?: number;
|
|
1583
|
-
/** Put the compliance readouts (net · RTP · session) in a thin status bar pinned
|
|
1584
|
-
* to the `'top'` or `'bottom'` edge instead of at screen corners. */
|
|
1585
|
-
statusBar?: 'top' | 'bottom';
|
|
1586
1585
|
/** Game name + version — shown in the menu footer (support / certification). */
|
|
1587
1586
|
game?: {
|
|
1588
1587
|
name?: string;
|
|
@@ -1790,24 +1789,4 @@ declare function buildBetLadder(cfg: RgsBetConfig, divisor?: number): {
|
|
|
1790
1789
|
/** Clamp a stake (major units) to the RGS min/max and snap to `stepBet`. Pure. */
|
|
1791
1790
|
declare function clampBet(amount: number, cfg: RgsBetConfig, divisor?: number): number;
|
|
1792
1791
|
|
|
1793
|
-
|
|
1794
|
-
* Win-celebration classifier — the RTS 14F guardrail. open-ui doesn't render the win
|
|
1795
|
-
* (the game does), but this helper lets a game decide HOW LOUD to celebrate without
|
|
1796
|
-
* ever celebrating a return ≤ the stake (the most-fined responsible-gambling rule).
|
|
1797
|
-
*/
|
|
1798
|
-
interface WinTier {
|
|
1799
|
-
name: string;
|
|
1800
|
-
/** Minimum win/stake multiplier for this tier. */
|
|
1801
|
-
minMultiplier: number;
|
|
1802
|
-
}
|
|
1803
|
-
/** Default escalation tiers (multipliers of stake). */
|
|
1804
|
-
declare const DEFAULT_WIN_TIERS: readonly WinTier[];
|
|
1805
|
-
/**
|
|
1806
|
-
* Classify a win for celebration. Returns `'none'` when the win is ≤ the stake (so a
|
|
1807
|
-
* "win" that returns less than was staked is NEVER celebrated — UKGC RTS 14F), else
|
|
1808
|
-
* `'win'` for a positive win below the first tier, or the highest tier whose
|
|
1809
|
-
* multiplier threshold is met. Pure + total.
|
|
1810
|
-
*/
|
|
1811
|
-
declare function winTier(win: number, stake: number, tiers?: readonly WinTier[]): string;
|
|
1812
|
-
|
|
1813
|
-
export { API_AMOUNT_DIVISOR, type Anchor, AutoplayControl, type AutoplayLimits, type AutoplayMode, type AutoplayOptions, BLOCK_KINDS, type BlockFactory, type BlockSpec, type Breakpoint, type BuiltPanel, ButtonControl, type ButtonOptions, CURRENCY_TABLE, CardControl, type CardOptions, type ComposeMenuOptions, Control, type ControlOptions, type ControlOverride, ControlRegistry, type ControlSnapshot, type CurrencyInfo, type CurrencySpec, DEFAULT_MENU_TITLES, DEFAULT_NOTICE_ACTION, DEFAULT_WIN_TIERS, type DeepPartial, DictionaryTranslator, type Dispose, EventBus, EventLog, type EventLogOptions, type EventMap, Fade, type HostHooks, type JurisdictionConfig, type KnownControlId, LOCALE_LABELS, type LayoutConfig, type LayoutSpec, type LoggedEvent, type MenuSpec, type NoticeAction, type NoticeOptions, OpenUI, type OpenUIEvents, type OpenUIOptions, type Orientation, PanelControl, type PanelOptions, type PanelSpec, type PanelVariant, Parallel, type Placement, Pulse, RGS_ERROR_KEYS, ReadoutControl, type ReadoutKind, type ReadoutOptions, type RealityCheckOptions, type Rect, type ResponsiveKey, type ResponsiveOverride, type RgsBetConfig, type RgsErrorCode, type RgsErrorOptions, type ScreenState, SelectControl, type SelectControlOptions, type SelectOption, Sequence, Signal, SliderControl, type SliderOptions, type SpecIssue, SpinControl, type SpinPress, type SpinSpec, Squish, type StateDef, type StateMap, StepperControl, type StepperOptions, type Subscribable, type Theme, type ThemeChoice, type ThemeIssue, type ThemeOverrides, type ThemePreset, ToggleControl, type ToggleOptions, type Transition, type Translator, TurboControl, type TurboOptions, type TurboSpec, Turn, type UISpec, ValueDisplay, type ValueDisplayOptions, type ViewInspect, type WinTier, applyJurisdiction, breakpointFor, buildBetLadder, buildBlocks, buildPanel, buttonBlocks, clampBet, clampDecimals, clampDigits, clampMinDigits, composeMenu, computeScreen, createUI, defaultHudSpec, defaultLayoutConfig, defaultTheme, defineUI, dictionary, displayDigits, effect, errorBlocks, extendTheme, formatAmount, installResponsive, integerDigits, isSafeColor, isSocialCurrency, openuiDefaults, resolveCurrency, resolvePlacement, resolveTheme, resolveTurboModes, safeAmount, sanitizeThemeOverrides, themePresets, validateSpec, valueFitMaxWidth, winTier };
|
|
1792
|
+
export { API_AMOUNT_DIVISOR, type Anchor, AutoplayControl, type AutoplayLimits, type AutoplayMode, type AutoplayOptions, BLOCK_KINDS, type BlockFactory, type BlockSpec, type Breakpoint, type BuiltPanel, ButtonControl, type ButtonOptions, CURRENCY_TABLE, CardControl, type CardOptions, type ComposeMenuOptions, Control, type ControlOptions, type ControlOverride, ControlRegistry, type ControlSnapshot, type CurrencyInfo, type CurrencySpec, DEFAULT_MENU_TITLES, DEFAULT_NOTICE_ACTION, type DeepPartial, DictionaryTranslator, type Dispose, EventBus, EventLog, type EventLogOptions, type EventMap, Fade, type HostHooks, type JurisdictionConfig, type KnownControlId, LOCALE_LABELS, type LayoutConfig, type LayoutSpec, type LoggedEvent, type MenuSpec, type NoticeAction, type NoticeOptions, OpenUI, type OpenUIEvents, type OpenUIOptions, type Orientation, PanelControl, type PanelOptions, type PanelSpec, type PanelVariant, Parallel, type Placement, Pulse, RGS_ERROR_KEYS, ReadoutControl, type ReadoutKind, type ReadoutOptions, type RealityCheckOptions, type Rect, type ResponsiveKey, type ResponsiveOverride, type RgsBetConfig, type RgsErrorCode, type RgsErrorOptions, type ScreenState, SelectControl, type SelectControlOptions, type SelectOption, Sequence, Signal, SliderControl, type SliderOptions, type SpecIssue, SpinControl, type SpinPress, type SpinSpec, Squish, type StateDef, type StateMap, StepperControl, type StepperOptions, type Subscribable, type Theme, type ThemeChoice, type ThemeIssue, type ThemeOverrides, type ThemePreset, ToggleControl, type ToggleOptions, type Transition, type Translator, TurboControl, type TurboOptions, type TurboSpec, Turn, type UISpec, ValueDisplay, type ValueDisplayOptions, type ViewInspect, applyJurisdiction, breakpointFor, buildBetLadder, buildBlocks, buildPanel, buttonBlocks, clampBet, clampDecimals, clampDigits, clampMinDigits, composeMenu, computeScreen, createUI, defaultHudSpec, defaultLayoutConfig, defaultTheme, defineUI, dictionary, displayDigits, effect, errorBlocks, extendTheme, formatAmount, installResponsive, integerDigits, isSafeColor, isSocialCurrency, openuiDefaults, resolveCurrency, resolvePlacement, resolveTheme, resolveTurboModes, safeAmount, sanitizeThemeOverrides, themePresets, validateSpec, valueFitMaxWidth };
|
package/dist/index.d.ts
CHANGED
|
@@ -1069,8 +1069,10 @@ declare const RGS_ERROR_KEYS: Readonly<Record<string, {
|
|
|
1069
1069
|
}>>;
|
|
1070
1070
|
/** The default dismiss action used when a notice supplies none. */
|
|
1071
1071
|
declare const DEFAULT_NOTICE_ACTION: NoticeAction;
|
|
1072
|
-
/** Build the title + message blocks for an error/notice (used by `showError`).
|
|
1073
|
-
|
|
1072
|
+
/** Build the title + message blocks for an error/notice (used by `showError`).
|
|
1073
|
+
* The Figma "default" modal is plain: a heading + body text (no tinted callout).
|
|
1074
|
+
* `tone` is kept for API compatibility but no longer changes the rendering. */
|
|
1075
|
+
declare function errorBlocks(message: string, title: string, _tone: NonNullable<NoticeOptions['tone']>): BlockSpec[];
|
|
1074
1076
|
|
|
1075
1077
|
/**
|
|
1076
1078
|
* i18n port (Charter B5/B8): the core depends on this tiny interface, NOT on i18next.
|
|
@@ -1580,9 +1582,6 @@ interface UISpec {
|
|
|
1580
1582
|
jurisdiction?: JurisdictionConfig;
|
|
1581
1583
|
/** Initial RTP percentage for the RTP readout (e.g. 96 → "96.0%"). */
|
|
1582
1584
|
rtp?: number;
|
|
1583
|
-
/** Put the compliance readouts (net · RTP · session) in a thin status bar pinned
|
|
1584
|
-
* to the `'top'` or `'bottom'` edge instead of at screen corners. */
|
|
1585
|
-
statusBar?: 'top' | 'bottom';
|
|
1586
1585
|
/** Game name + version — shown in the menu footer (support / certification). */
|
|
1587
1586
|
game?: {
|
|
1588
1587
|
name?: string;
|
|
@@ -1790,24 +1789,4 @@ declare function buildBetLadder(cfg: RgsBetConfig, divisor?: number): {
|
|
|
1790
1789
|
/** Clamp a stake (major units) to the RGS min/max and snap to `stepBet`. Pure. */
|
|
1791
1790
|
declare function clampBet(amount: number, cfg: RgsBetConfig, divisor?: number): number;
|
|
1792
1791
|
|
|
1793
|
-
|
|
1794
|
-
* Win-celebration classifier — the RTS 14F guardrail. open-ui doesn't render the win
|
|
1795
|
-
* (the game does), but this helper lets a game decide HOW LOUD to celebrate without
|
|
1796
|
-
* ever celebrating a return ≤ the stake (the most-fined responsible-gambling rule).
|
|
1797
|
-
*/
|
|
1798
|
-
interface WinTier {
|
|
1799
|
-
name: string;
|
|
1800
|
-
/** Minimum win/stake multiplier for this tier. */
|
|
1801
|
-
minMultiplier: number;
|
|
1802
|
-
}
|
|
1803
|
-
/** Default escalation tiers (multipliers of stake). */
|
|
1804
|
-
declare const DEFAULT_WIN_TIERS: readonly WinTier[];
|
|
1805
|
-
/**
|
|
1806
|
-
* Classify a win for celebration. Returns `'none'` when the win is ≤ the stake (so a
|
|
1807
|
-
* "win" that returns less than was staked is NEVER celebrated — UKGC RTS 14F), else
|
|
1808
|
-
* `'win'` for a positive win below the first tier, or the highest tier whose
|
|
1809
|
-
* multiplier threshold is met. Pure + total.
|
|
1810
|
-
*/
|
|
1811
|
-
declare function winTier(win: number, stake: number, tiers?: readonly WinTier[]): string;
|
|
1812
|
-
|
|
1813
|
-
export { API_AMOUNT_DIVISOR, type Anchor, AutoplayControl, type AutoplayLimits, type AutoplayMode, type AutoplayOptions, BLOCK_KINDS, type BlockFactory, type BlockSpec, type Breakpoint, type BuiltPanel, ButtonControl, type ButtonOptions, CURRENCY_TABLE, CardControl, type CardOptions, type ComposeMenuOptions, Control, type ControlOptions, type ControlOverride, ControlRegistry, type ControlSnapshot, type CurrencyInfo, type CurrencySpec, DEFAULT_MENU_TITLES, DEFAULT_NOTICE_ACTION, DEFAULT_WIN_TIERS, type DeepPartial, DictionaryTranslator, type Dispose, EventBus, EventLog, type EventLogOptions, type EventMap, Fade, type HostHooks, type JurisdictionConfig, type KnownControlId, LOCALE_LABELS, type LayoutConfig, type LayoutSpec, type LoggedEvent, type MenuSpec, type NoticeAction, type NoticeOptions, OpenUI, type OpenUIEvents, type OpenUIOptions, type Orientation, PanelControl, type PanelOptions, type PanelSpec, type PanelVariant, Parallel, type Placement, Pulse, RGS_ERROR_KEYS, ReadoutControl, type ReadoutKind, type ReadoutOptions, type RealityCheckOptions, type Rect, type ResponsiveKey, type ResponsiveOverride, type RgsBetConfig, type RgsErrorCode, type RgsErrorOptions, type ScreenState, SelectControl, type SelectControlOptions, type SelectOption, Sequence, Signal, SliderControl, type SliderOptions, type SpecIssue, SpinControl, type SpinPress, type SpinSpec, Squish, type StateDef, type StateMap, StepperControl, type StepperOptions, type Subscribable, type Theme, type ThemeChoice, type ThemeIssue, type ThemeOverrides, type ThemePreset, ToggleControl, type ToggleOptions, type Transition, type Translator, TurboControl, type TurboOptions, type TurboSpec, Turn, type UISpec, ValueDisplay, type ValueDisplayOptions, type ViewInspect, type WinTier, applyJurisdiction, breakpointFor, buildBetLadder, buildBlocks, buildPanel, buttonBlocks, clampBet, clampDecimals, clampDigits, clampMinDigits, composeMenu, computeScreen, createUI, defaultHudSpec, defaultLayoutConfig, defaultTheme, defineUI, dictionary, displayDigits, effect, errorBlocks, extendTheme, formatAmount, installResponsive, integerDigits, isSafeColor, isSocialCurrency, openuiDefaults, resolveCurrency, resolvePlacement, resolveTheme, resolveTurboModes, safeAmount, sanitizeThemeOverrides, themePresets, validateSpec, valueFitMaxWidth, winTier };
|
|
1792
|
+
export { API_AMOUNT_DIVISOR, type Anchor, AutoplayControl, type AutoplayLimits, type AutoplayMode, type AutoplayOptions, BLOCK_KINDS, type BlockFactory, type BlockSpec, type Breakpoint, type BuiltPanel, ButtonControl, type ButtonOptions, CURRENCY_TABLE, CardControl, type CardOptions, type ComposeMenuOptions, Control, type ControlOptions, type ControlOverride, ControlRegistry, type ControlSnapshot, type CurrencyInfo, type CurrencySpec, DEFAULT_MENU_TITLES, DEFAULT_NOTICE_ACTION, type DeepPartial, DictionaryTranslator, type Dispose, EventBus, EventLog, type EventLogOptions, type EventMap, Fade, type HostHooks, type JurisdictionConfig, type KnownControlId, LOCALE_LABELS, type LayoutConfig, type LayoutSpec, type LoggedEvent, type MenuSpec, type NoticeAction, type NoticeOptions, OpenUI, type OpenUIEvents, type OpenUIOptions, type Orientation, PanelControl, type PanelOptions, type PanelSpec, type PanelVariant, Parallel, type Placement, Pulse, RGS_ERROR_KEYS, ReadoutControl, type ReadoutKind, type ReadoutOptions, type RealityCheckOptions, type Rect, type ResponsiveKey, type ResponsiveOverride, type RgsBetConfig, type RgsErrorCode, type RgsErrorOptions, type ScreenState, SelectControl, type SelectControlOptions, type SelectOption, Sequence, Signal, SliderControl, type SliderOptions, type SpecIssue, SpinControl, type SpinPress, type SpinSpec, Squish, type StateDef, type StateMap, StepperControl, type StepperOptions, type Subscribable, type Theme, type ThemeChoice, type ThemeIssue, type ThemeOverrides, type ThemePreset, ToggleControl, type ToggleOptions, type Transition, type Translator, TurboControl, type TurboOptions, type TurboSpec, Turn, type UISpec, ValueDisplay, type ValueDisplayOptions, type ViewInspect, applyJurisdiction, breakpointFor, buildBetLadder, buildBlocks, buildPanel, buttonBlocks, clampBet, clampDecimals, clampDigits, clampMinDigits, composeMenu, computeScreen, createUI, defaultHudSpec, defaultLayoutConfig, defaultTheme, defineUI, dictionary, displayDigits, effect, errorBlocks, extendTheme, formatAmount, installResponsive, integerDigits, isSafeColor, isSocialCurrency, openuiDefaults, resolveCurrency, resolvePlacement, resolveTheme, resolveTurboModes, safeAmount, sanitizeThemeOverrides, themePresets, validateSpec, valueFitMaxWidth };
|
package/dist/index.js
CHANGED
|
@@ -93,8 +93,11 @@ function extendTheme(base, patch) {
|
|
|
93
93
|
|
|
94
94
|
// src/layout/screen.ts
|
|
95
95
|
var defaultLayoutConfig = {
|
|
96
|
+
// Reference design frames, matching the Figma "DEF" frames 1:1 so offsets map
|
|
97
|
+
// directly: desktop 1920×1080, mobile 360×779 (×3 = 1080×2337). The portrait
|
|
98
|
+
// aspect matches real phones (~0.46), so scaling no longer squashes vertically.
|
|
96
99
|
refLandscape: [1920, 1080],
|
|
97
|
-
refPortrait: [1080,
|
|
100
|
+
refPortrait: [1080, 2337],
|
|
98
101
|
portraitBelowAspect: 0.85,
|
|
99
102
|
breakpoints: { mobile: 480, tablet: 840 }
|
|
100
103
|
};
|
|
@@ -1167,9 +1170,6 @@ function validateSpec(spec) {
|
|
|
1167
1170
|
if (spec.rtp != null && !(typeof spec.rtp === "number" && Number.isFinite(spec.rtp))) {
|
|
1168
1171
|
add("error", "rtp", "bad-rtp", `rtp must be a number, got ${String(spec.rtp)}`);
|
|
1169
1172
|
}
|
|
1170
|
-
if (spec.statusBar != null && spec.statusBar !== "top" && spec.statusBar !== "bottom") {
|
|
1171
|
-
add("error", "statusBar", "bad-statusbar", `statusBar must be 'top' or 'bottom', got "${String(spec.statusBar)}"`);
|
|
1172
|
-
}
|
|
1173
1173
|
if (spec.realityCheck != null && !(typeof spec.realityCheck.everyMinutes === "number" && spec.realityCheck.everyMinutes > 0)) {
|
|
1174
1174
|
add("error", "realityCheck.everyMinutes", "bad-interval", "realityCheck.everyMinutes must be a number > 0");
|
|
1175
1175
|
}
|
|
@@ -1344,10 +1344,10 @@ var RGS_ERROR_KEYS = Object.freeze({
|
|
|
1344
1344
|
ERR_TIMEOUT: { title: "openui.err.connection.title", message: "openui.err.connection.message" }
|
|
1345
1345
|
});
|
|
1346
1346
|
var DEFAULT_NOTICE_ACTION = { label: "openui.ok", variant: "primary" };
|
|
1347
|
-
function errorBlocks(message, title,
|
|
1347
|
+
function errorBlocks(message, title, _tone) {
|
|
1348
1348
|
return [
|
|
1349
1349
|
{ kind: "heading", id: "notice-title", text: title },
|
|
1350
|
-
{ kind: "
|
|
1350
|
+
{ kind: "text", id: "notice-body", text: message }
|
|
1351
1351
|
];
|
|
1352
1352
|
}
|
|
1353
1353
|
|
|
@@ -1618,11 +1618,11 @@ var OpenUI = class {
|
|
|
1618
1618
|
this.betMinus = new ButtonControl({ id: "bet-minus", layout: { anchor: "bottom-center", offset: [-150, -270] } }, this.bus);
|
|
1619
1619
|
this.betPlus = new ButtonControl({ id: "bet-plus", layout: { anchor: "bottom-center", offset: [150, -270] } }, this.bus);
|
|
1620
1620
|
this.betStepper = new StepperControl({ id: "bet-stepper", layout: { anchor: "center" }, levels: [0.5, 1, 2, 5, 10, 20], index: 1 }, this.bus);
|
|
1621
|
-
this.muteButton = new ButtonControl({ id: "mute", layout: { anchor: "top-right", offset: [-
|
|
1622
|
-
this.fullscreenButton = new ButtonControl({ id: "fullscreen", layout: { anchor: "top-right", offset: [-
|
|
1623
|
-
this.rtp = new ReadoutControl({ id: "rtp", kind: "percent", label: "RTP", layout: { anchor: "top-left", offset: [
|
|
1624
|
-
this.
|
|
1625
|
-
this.
|
|
1621
|
+
this.muteButton = new ButtonControl({ id: "mute", layout: { anchor: "top-right", offset: [-122, 46] } }, this.bus);
|
|
1622
|
+
this.fullscreenButton = new ButtonControl({ id: "fullscreen", layout: { anchor: "top-right", offset: [-46, 46] } }, this.bus);
|
|
1623
|
+
this.rtp = new ReadoutControl({ id: "rtp", kind: "percent", label: "RTP", layout: { anchor: "top-left", offset: [18, 18] } });
|
|
1624
|
+
this.sessionTimer = new ReadoutControl({ id: "session-timer", kind: "duration", label: "Session Time", layout: { anchor: "top-left", offset: [18, 36] } });
|
|
1625
|
+
this.netPosition = new ReadoutControl({ id: "net-position", kind: "currency", label: "Net", currency: { code: "USD", symbol: "$", display: "symbol", position: "prefix", decimals: 2 }, layout: { anchor: "top-left", offset: [18, 60] } });
|
|
1626
1626
|
this.noticePanel = new PanelControl({ id: "notice-panel", variant: "modal", layout: { anchor: "center" } }, this.bus);
|
|
1627
1627
|
for (const c of [
|
|
1628
1628
|
this.spin,
|
|
@@ -1959,7 +1959,7 @@ var OpenUI = class {
|
|
|
1959
1959
|
|
|
1960
1960
|
// src/spec/responsive.ts
|
|
1961
1961
|
function cloneLayout(l) {
|
|
1962
|
-
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale };
|
|
1962
|
+
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation };
|
|
1963
1963
|
}
|
|
1964
1964
|
function activeKeys(screen) {
|
|
1965
1965
|
return [screen.orientation, screen.breakpoint];
|
|
@@ -2252,20 +2252,6 @@ function clampBet(amount, cfg, divisor = API_AMOUNT_DIVISOR) {
|
|
|
2252
2252
|
return Math.min(max, Math.max(min, v));
|
|
2253
2253
|
}
|
|
2254
2254
|
|
|
2255
|
-
|
|
2256
|
-
var DEFAULT_WIN_TIERS = Object.freeze([
|
|
2257
|
-
{ name: "big", minMultiplier: 10 },
|
|
2258
|
-
{ name: "mega", minMultiplier: 50 },
|
|
2259
|
-
{ name: "epic", minMultiplier: 100 }
|
|
2260
|
-
]);
|
|
2261
|
-
function winTier(win, stake, tiers = DEFAULT_WIN_TIERS) {
|
|
2262
|
-
if (!Number.isFinite(win) || !Number.isFinite(stake) || stake <= 0 || win <= stake) return "none";
|
|
2263
|
-
const mult = win / stake;
|
|
2264
|
-
let name = "win";
|
|
2265
|
-
for (const t of tiers) if (mult >= t.minMultiplier) name = t.name;
|
|
2266
|
-
return name;
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
export { API_AMOUNT_DIVISOR, AutoplayControl, BLOCK_KINDS, ButtonControl, CURRENCY_TABLE, CardControl, Control, ControlRegistry, DEFAULT_MENU_TITLES, DEFAULT_NOTICE_ACTION, DEFAULT_WIN_TIERS, DictionaryTranslator, EventBus, EventLog, Fade, LOCALE_LABELS, OpenUI, PanelControl, Parallel, Pulse, RGS_ERROR_KEYS, ReadoutControl, SelectControl, Sequence, Signal, SliderControl, SpinControl, Squish, StepperControl, ToggleControl, TurboControl, Turn, ValueDisplay, applyJurisdiction, breakpointFor, buildBetLadder, buildBlocks, buildPanel, buttonBlocks, clampBet, clampDecimals, clampDigits, clampMinDigits, composeMenu, computeScreen, createUI, defaultHudSpec, defaultLayoutConfig, defaultTheme, defineUI, dictionary, displayDigits, effect, errorBlocks, extendTheme, formatAmount, installResponsive, integerDigits, isSafeColor, isSocialCurrency, openuiDefaults, resolveCurrency, resolvePlacement, resolveTheme, resolveTurboModes, safeAmount, sanitizeThemeOverrides, themePresets, validateSpec, valueFitMaxWidth, winTier };
|
|
2255
|
+
export { API_AMOUNT_DIVISOR, AutoplayControl, BLOCK_KINDS, ButtonControl, CURRENCY_TABLE, CardControl, Control, ControlRegistry, DEFAULT_MENU_TITLES, DEFAULT_NOTICE_ACTION, DictionaryTranslator, EventBus, EventLog, Fade, LOCALE_LABELS, OpenUI, PanelControl, Parallel, Pulse, RGS_ERROR_KEYS, ReadoutControl, SelectControl, Sequence, Signal, SliderControl, SpinControl, Squish, StepperControl, ToggleControl, TurboControl, Turn, ValueDisplay, applyJurisdiction, breakpointFor, buildBetLadder, buildBlocks, buildPanel, buttonBlocks, clampBet, clampDecimals, clampDigits, clampMinDigits, composeMenu, computeScreen, createUI, defaultHudSpec, defaultLayoutConfig, defaultTheme, defineUI, dictionary, displayDigits, effect, errorBlocks, extendTheme, formatAmount, installResponsive, integerDigits, isSafeColor, isSocialCurrency, openuiDefaults, resolveCurrency, resolvePlacement, resolveTheme, resolveTurboModes, safeAmount, sanitizeThemeOverrides, themePresets, validateSpec, valueFitMaxWidth };
|
|
2270
2256
|
//# sourceMappingURL=index.js.map
|
|
2271
2257
|
//# sourceMappingURL=index.js.map
|