@adiakys/feeling-lucky 0.1.0 → 0.3.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.
- package/README.md +73 -5
- package/dist/config/types.d.ts +11 -0
- package/dist/{de-Cp-ILcpM.js → de-CmzpGbNK.js} +19 -3
- package/dist/developer/panel.d.ts +2 -0
- package/dist/developer/settings.d.ts +2 -0
- package/dist/engine/dealer.d.ts +21 -0
- package/dist/{es-DHZIstf4.js → es-k_kS6Fn2.js} +19 -3
- package/dist/feeling-lucky.iife.js +417 -249
- package/dist/feeling-lucky.js +17 -39
- package/dist/{fr-BPFoerSF.js → fr-GuCZB1l4.js} +19 -3
- package/dist/games/blackjack/blackjack.d.ts +1 -0
- package/dist/games/cards/dealer.d.ts +9 -0
- package/dist/games/cards/table.d.ts +7 -1
- package/dist/games/holdem/holdem.d.ts +2 -0
- package/dist/{i18n-CihzHMU5.js → i18n-Cid8bj2R.js} +23 -7
- package/dist/icons-DTaPp44c.js +863 -0
- package/dist/{it-B95CFDto.js → it-BNztlqHd.js} +19 -3
- package/dist/locales/de/cards.d.ts +7 -0
- package/dist/locales/de/developer.d.ts +7 -0
- package/dist/locales/de/room.d.ts +2 -0
- package/dist/locales/en/cards.d.ts +7 -0
- package/dist/locales/en/developer.d.ts +7 -0
- package/dist/locales/en/room.d.ts +2 -0
- package/dist/locales/es/cards.d.ts +7 -0
- package/dist/locales/es/developer.d.ts +7 -0
- package/dist/locales/es/room.d.ts +2 -0
- package/dist/locales/fr/cards.d.ts +7 -0
- package/dist/locales/fr/developer.d.ts +7 -0
- package/dist/locales/fr/room.d.ts +2 -0
- package/dist/locales/it/cards.d.ts +7 -0
- package/dist/locales/it/developer.d.ts +7 -0
- package/dist/locales/it/room.d.ts +2 -0
- package/dist/mount-CMm0qSYk.js +6257 -0
- package/dist/multiplayer/blackjack.d.ts +35 -0
- package/dist/multiplayer/client.d.ts +55 -0
- package/dist/multiplayer/holdem.d.ts +21 -0
- package/dist/multiplayer/index.d.ts +2 -0
- package/dist/multiplayer/seats.d.ts +16 -0
- package/dist/multiplayer/shared.d.ts +33 -0
- package/dist/multiplayer-CN0t0j_F.js +502 -0
- package/dist/{panel-D1hKmQL7.js → panel-BVgq3Cm5.js} +167 -139
- package/dist/resolve-Dc48n2Jo.js +28 -0
- package/dist/room/boost.d.ts +1 -1
- package/dist/room/lobby.d.ts +1 -0
- package/dist/room/room.d.ts +11 -1
- package/dist/room/stage.d.ts +2 -1
- package/dist/runtime/context.d.ts +3 -1
- package/dist/runtime/sound.d.ts +1 -1
- package/package.json +2 -2
- package/dist/mount-BxDaFww2.js +0 -7034
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as e, A as t, B as n, D as r, G as i, J as a, K as o, P as s, Q as c, T as l, W as u, X as d, Y as f, Z as p, c as ee, k as te, l as m, n as h, q as g, r as _, t as v, tt as y, u as b, w as ne, z as x } from "./icons-DTaPp44c.js";
|
|
2
|
+
import { C as re, D as S, F as C, I as w, L as T, P as E, R as ie, S as D, _ as ae, b as oe, g as se, v as O, x as k, y as A } from "./mount-CMm0qSYk.js";
|
|
2
3
|
// node_modules/lit-html/directives/live.js
|
|
3
|
-
var
|
|
4
|
-
constructor(
|
|
5
|
-
if (super(
|
|
6
|
-
if (!e
|
|
4
|
+
var j = i(class extends o {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
if (super(e), e.type !== g.PROPERTY && e.type !== g.ATTRIBUTE && e.type !== g.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
|
7
|
+
if (!ie(e)) throw Error("`live` bindings can only contain a single expression");
|
|
7
8
|
}
|
|
8
9
|
render(e) {
|
|
9
10
|
return e;
|
|
10
11
|
}
|
|
11
|
-
update(
|
|
12
|
-
if (
|
|
13
|
-
let
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
} else if (
|
|
17
|
-
if (!!
|
|
18
|
-
} else if (
|
|
19
|
-
return
|
|
12
|
+
update(t, [n]) {
|
|
13
|
+
if (n === e || n === c) return n;
|
|
14
|
+
let r = t.element, i = t.name;
|
|
15
|
+
if (t.type === g.PROPERTY) {
|
|
16
|
+
if (n === r[i]) return e;
|
|
17
|
+
} else if (t.type === g.BOOLEAN_ATTRIBUTE) {
|
|
18
|
+
if (!!n === r.hasAttribute(i)) return e;
|
|
19
|
+
} else if (t.type === g.ATTRIBUTE && r.getAttribute(i) === n + "") return e;
|
|
20
|
+
return T(t), n;
|
|
20
21
|
}
|
|
21
|
-
}),
|
|
22
|
+
}), M = [
|
|
22
23
|
["path", { d: "m18 16 4-4-4-4" }],
|
|
23
24
|
["path", { d: "m6 8-4 4 4 4" }],
|
|
24
25
|
["path", { d: "m14.5 4-5 16" }]
|
|
25
|
-
],
|
|
26
|
+
], N = [
|
|
26
27
|
["circle", {
|
|
27
28
|
cx: "9",
|
|
28
29
|
cy: "12",
|
|
@@ -53,19 +54,19 @@ var A = x(class extends c {
|
|
|
53
54
|
cy: "19",
|
|
54
55
|
r: "1"
|
|
55
56
|
}]
|
|
56
|
-
],
|
|
57
|
+
], P = [["rect", {
|
|
57
58
|
width: "18",
|
|
58
59
|
height: "11",
|
|
59
60
|
x: "3",
|
|
60
61
|
y: "11",
|
|
61
62
|
rx: "2",
|
|
62
63
|
ry: "2"
|
|
63
|
-
}], ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1" }]],
|
|
64
|
+
}], ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1" }]], F = [["path", { d: "M5 12h14" }]], I = [
|
|
64
65
|
"automatic",
|
|
65
66
|
"loss",
|
|
66
67
|
"win",
|
|
67
68
|
"jackpot"
|
|
68
|
-
],
|
|
69
|
+
], L = {
|
|
69
70
|
wheel: [
|
|
70
71
|
"segment",
|
|
71
72
|
"booster",
|
|
@@ -77,82 +78,82 @@ var A = x(class extends c {
|
|
|
77
78
|
scratch: ["award", "prize"],
|
|
78
79
|
blackjack: ["prize"],
|
|
79
80
|
holdem: ["prize"]
|
|
80
|
-
},
|
|
81
|
+
}, R = [
|
|
81
82
|
"segment",
|
|
82
83
|
"combination",
|
|
83
84
|
"number",
|
|
84
85
|
"pocket",
|
|
85
86
|
"award"
|
|
86
|
-
],
|
|
87
|
+
], z = {}, B = { prizes: [] }, V = () => ({
|
|
87
88
|
multiplier: void 0,
|
|
88
89
|
variant: void 0,
|
|
89
90
|
result: "automatic",
|
|
90
91
|
advanced: {}
|
|
91
|
-
}),
|
|
92
|
-
slot:
|
|
93
|
-
scratch:
|
|
94
|
-
},
|
|
95
|
-
function
|
|
92
|
+
}), H = {
|
|
93
|
+
slot: ee,
|
|
94
|
+
scratch: m
|
|
95
|
+
}, U = (e) => z[e] ?? V();
|
|
96
|
+
function W(e) {
|
|
96
97
|
let t = e.indexOf(":");
|
|
97
98
|
return {
|
|
98
99
|
tier: e.slice(0, t),
|
|
99
100
|
award: e.slice(t + 1) || null
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
|
-
var
|
|
103
|
+
var G = {
|
|
103
104
|
none: "none",
|
|
104
105
|
pair: "small",
|
|
105
106
|
logos: "big",
|
|
106
107
|
sevens: "big",
|
|
107
108
|
infinities: "jackpot"
|
|
108
109
|
};
|
|
109
|
-
async function
|
|
110
|
+
async function ce(e, t) {
|
|
110
111
|
let n = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
111
112
|
return [...new Uint8Array(n)].map((e) => e.toString(16).padStart(2, "0")).join("") === t.toLowerCase();
|
|
112
113
|
}
|
|
113
114
|
// src/developer/rig.ts
|
|
114
|
-
var
|
|
115
|
+
var K = {
|
|
115
116
|
automatic: void 0,
|
|
116
117
|
loss: "none",
|
|
117
118
|
win: "small",
|
|
118
119
|
jackpot: "jackpot"
|
|
119
|
-
},
|
|
120
|
-
function
|
|
121
|
-
let { result: n, advanced: r } =
|
|
120
|
+
}, le = D.indexOf("jackpot");
|
|
121
|
+
function ue(e, t) {
|
|
122
|
+
let { result: n, advanced: r } = U(e);
|
|
122
123
|
if (e === "wheel" && r.segment) {
|
|
123
124
|
let e = r.segment.split(":")[0];
|
|
124
125
|
return e === "coin" || e === "hunt" || e === "pachinko" ? t() === "big" ? "big" : "small" : e;
|
|
125
126
|
}
|
|
126
|
-
return e === "slot" && r.combination ?
|
|
127
|
+
return e === "slot" && r.combination ? G[r.combination] : e === "pachinko" && r.pocket ? D[Number(r.pocket) - 1] : e === "scratch" && r.award ? W(r.award).tier : K[n] ?? t();
|
|
127
128
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
129
|
+
var q = () => U("pachinko").result === "jackpot" && !U("pachinko").advanced.pocket;
|
|
130
|
+
function J(e, t) {
|
|
130
131
|
let r = Math.min(...e.map((e) => e.x)) + 16, i = Math.max(...e.map((e) => e.x)) - 16, a = (r + i) / 2;
|
|
131
132
|
return [...new Set(e.map((e) => e.y))].sort((e, t) => e - t).slice(1, 1 + t).flatMap((t) => {
|
|
132
133
|
let o = Math.max(r, Math.min(i, a + n(-25, 25))), s = e.filter((e) => e.y === t).sort((e, t) => Math.abs(e.x - o) - Math.abs(t.x - o))[0];
|
|
133
134
|
return s ? (a = s.x, [s]) : [];
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
|
-
var
|
|
137
|
-
boost: ({ game: e }, t) =>
|
|
138
|
-
tier: ({ game: e }, t) =>
|
|
137
|
+
var de = {
|
|
138
|
+
boost: ({ game: e }, t) => U(e).multiplier ?? t(),
|
|
139
|
+
tier: ({ game: e }, t) => ue(e, t),
|
|
139
140
|
prize: ({ game: e, prizeIds: t }, n) => {
|
|
140
|
-
let { prize: r, award: i } =
|
|
141
|
+
let { prize: r, award: i } = U(e).advanced;
|
|
141
142
|
if (r && t.includes(r)) return r;
|
|
142
143
|
if (e !== "scratch" || !i) return n();
|
|
143
|
-
let { tier: a, award: o } =
|
|
144
|
-
return
|
|
144
|
+
let { tier: a, award: o } = W(i), c = s(B.prizes.filter(({ id: e }) => t.includes(e)), a, o);
|
|
145
|
+
return c.length ? x(c).id : n();
|
|
145
146
|
},
|
|
146
147
|
"wheel.segment": ({ segments: e }, t) => {
|
|
147
|
-
let n =
|
|
148
|
-
return r.length ?
|
|
148
|
+
let n = U("wheel").advanced.segment, r = n ? e.flatMap((e, t) => A(e) === n ? [t] : []) : [];
|
|
149
|
+
return r.length ? x(r) : t();
|
|
149
150
|
},
|
|
150
151
|
"wheel.booster": ({ segments: e }, t) => {
|
|
151
|
-
let n =
|
|
152
|
-
return n &&
|
|
152
|
+
let n = U("wheel").advanced.booster;
|
|
153
|
+
return n && O(e).includes(n) ? n : t();
|
|
153
154
|
},
|
|
154
155
|
"slot.line": ({ prizeId: e }, t) => {
|
|
155
|
-
let { combination: n } =
|
|
156
|
+
let { combination: n } = U("slot").advanced, r = n === "logos" ? e : n === "sevens" ? "seven" : void 0;
|
|
156
157
|
return r ? [
|
|
157
158
|
r,
|
|
158
159
|
r,
|
|
@@ -160,56 +161,58 @@ var J = {
|
|
|
160
161
|
] : t();
|
|
161
162
|
},
|
|
162
163
|
"roulette.number": ({ bets: e, storm: t, boost: n }, r) => {
|
|
163
|
-
let { result: i, advanced: a } =
|
|
164
|
+
let { result: i, advanced: a } = U("roulette");
|
|
164
165
|
if (a.number) return Number(a.number);
|
|
165
|
-
let o =
|
|
166
|
+
let o = K[i];
|
|
166
167
|
if (!o && !a.storm) return r();
|
|
167
|
-
let s =
|
|
168
|
-
let r =
|
|
168
|
+
let s = se.filter((n) => {
|
|
169
|
+
let r = ae(e, n)?.tier ?? "none";
|
|
169
170
|
return (!o || (o === "small" ? r !== "none" : r === o)) && (!a.storm || t.includes(n) === (a.storm === "hit"));
|
|
170
171
|
});
|
|
171
|
-
return s.length ?
|
|
172
|
+
return s.length ? x(s.flatMap((e) => Array(t.includes(e) ? n : 1).fill(e))) : r();
|
|
172
173
|
},
|
|
173
174
|
"pachinko.board": ({ pegs: e }, t) => {
|
|
174
175
|
let n = t();
|
|
175
|
-
if (!
|
|
176
|
-
let [r, i] =
|
|
177
|
-
if (
|
|
178
|
-
let t =
|
|
176
|
+
if (!q()) return n;
|
|
177
|
+
let [r, i] = re, a = (e) => e.y >= r && e.y <= i;
|
|
178
|
+
if (U("pachinko").advanced.violet === "hit") {
|
|
179
|
+
let t = J(e, 9), n = x(t.filter(a));
|
|
179
180
|
return {
|
|
180
181
|
violet: n,
|
|
181
182
|
reds: t.filter((e) => e !== n)
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
|
-
let o =
|
|
185
|
+
let o = J(e, 8), s = e.filter((e) => !o.includes(e) && a(e));
|
|
185
186
|
return {
|
|
186
|
-
violet: s.includes(n.violet) ? n.violet :
|
|
187
|
+
violet: s.includes(n.violet) ? n.violet : x(s),
|
|
187
188
|
reds: o
|
|
188
189
|
};
|
|
189
190
|
},
|
|
190
191
|
"pachinko.route": ({ violet: e, reds: t }, n) => {
|
|
191
|
-
let { violet: r } =
|
|
192
|
-
return !
|
|
193
|
-
through: [...
|
|
192
|
+
let { violet: r } = U("pachinko").advanced;
|
|
193
|
+
return !q() && !r ? n() : {
|
|
194
|
+
through: [...q() ? t : [], ...r === "hit" ? [e] : []].sort((e, t) => e.y - t.y),
|
|
194
195
|
avoid: r === "miss" ? [e] : []
|
|
195
196
|
};
|
|
196
197
|
},
|
|
197
198
|
"pachinko.wins": (e, t) => {
|
|
198
|
-
let n =
|
|
199
|
+
let n = K[U("pachinko").result];
|
|
199
200
|
return n ? n !== "none" : t();
|
|
200
201
|
},
|
|
201
202
|
"pachinko.pocket": (e, t) => {
|
|
202
|
-
let { pocket: n } =
|
|
203
|
-
return n ? Number(n) - 1 :
|
|
203
|
+
let { pocket: n } = U("pachinko").advanced;
|
|
204
|
+
return n ? Number(n) - 1 : q() ? le : t();
|
|
204
205
|
},
|
|
205
|
-
"scratch.ticket": (e, t) =>
|
|
206
|
-
locale: (e, t) =>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
"scratch.ticket": (e, t) => U("scratch").variant ?? t(),
|
|
207
|
+
locale: (e, t) => B.locale ?? t(),
|
|
208
|
+
multiplayer: (e, t) => !B.singlePlayer && t(),
|
|
209
|
+
dealer: ({ count: e }, t) => B.dealer === void 0 ? t() : B.dealer === "none" ? null : B.dealer < e ? B.dealer : t(),
|
|
210
|
+
theme: (e, t) => B.theme === void 0 ? t() : B.theme === "none" ? null : B.theme,
|
|
211
|
+
"slot.machine": (e, t) => U("slot").variant ?? t(),
|
|
212
|
+
"breakaway.tackle": (e, t) => K[U("slot").result] && K[U("slot").result] !== "none" ? null : t(),
|
|
210
213
|
"scratch.award": (e, t) => {
|
|
211
|
-
let { award: n } =
|
|
212
|
-
return n ?
|
|
214
|
+
let { award: n } = U("scratch").advanced;
|
|
215
|
+
return n ? W(n).award : t();
|
|
213
216
|
}
|
|
214
217
|
}, Y = "feeling-lucky.developer", X = 8, Z = [
|
|
215
218
|
"small",
|
|
@@ -218,12 +221,12 @@ var J = {
|
|
|
218
221
|
"hunt",
|
|
219
222
|
"pachinko",
|
|
220
223
|
"jackpot"
|
|
221
|
-
], Q = !1, $ = class extends
|
|
224
|
+
], Q = !1, $ = class extends h {
|
|
222
225
|
constructor() {
|
|
223
226
|
super(), this.open = !0, this.unlocked = Q, this.password = "", this.wrong = !1, this.minimized = !1, this.position = {
|
|
224
227
|
x: innerWidth - 416 - 16,
|
|
225
228
|
y: 108
|
|
226
|
-
}, this.selected = "wheel", this.draft =
|
|
229
|
+
}, this.selected = "wheel", this.draft = V(), this.loads = 0, this.advancedOpen = !1, this.drag = null, this.dragged = !1, this.lastFocus = null, this.grab = (e) => {
|
|
227
230
|
if (e.button !== 0 || !this.minimized && e.target.closest("button")) return;
|
|
228
231
|
let t = this.box.getBoundingClientRect();
|
|
229
232
|
this.drag = {
|
|
@@ -241,16 +244,16 @@ var J = {
|
|
|
241
244
|
}, this.unlock = async (e) => {
|
|
242
245
|
e.preventDefault();
|
|
243
246
|
let t = this.password;
|
|
244
|
-
this.password = "", this.wrong = !await
|
|
247
|
+
this.password = "", this.wrong = !await ce(t, this.passwordHash ?? ""), !this.wrong && (this.grant(), this.focusFirst());
|
|
245
248
|
}, this.apply = () => {
|
|
246
249
|
let e = Object.fromEntries(Object.entries(this.draft.advanced).filter(([, e]) => e !== void 0));
|
|
247
|
-
this.draft.multiplier !== void 0 || this.draft.variant !== void 0 || this.draft.result !== "automatic" || Object.keys(e).length ?
|
|
250
|
+
this.draft.multiplier !== void 0 || this.draft.variant !== void 0 || this.draft.result !== "automatic" || Object.keys(e).length ? z[this.selected] = {
|
|
248
251
|
...this.draft,
|
|
249
252
|
advanced: e
|
|
250
|
-
} : delete
|
|
253
|
+
} : delete z[this.selected], l(this.selected);
|
|
251
254
|
}, this.reset = () => {
|
|
252
|
-
for (let e of
|
|
253
|
-
this.load(this.selected),
|
|
255
|
+
for (let e of b) delete z[e];
|
|
256
|
+
this.load(this.selected), l(this.selected);
|
|
254
257
|
}, this.toggle = () => {
|
|
255
258
|
this.open = !this.open, this.open ? (this.lastFocus = this.activeElement, this.focusFirst()) : this.lastFocus instanceof HTMLElement && this.lastFocus.isConnected && this.lastFocus.focus();
|
|
256
259
|
}, this.shortcut = (e) => {
|
|
@@ -270,7 +273,7 @@ var J = {
|
|
|
270
273
|
value: e,
|
|
271
274
|
label: this.t(`wheel.segment.${e}`)
|
|
272
275
|
};
|
|
273
|
-
let { tier: t, award: n } =
|
|
276
|
+
let { tier: t, award: n } = W(e);
|
|
274
277
|
return {
|
|
275
278
|
value: e,
|
|
276
279
|
label: this.awardLabel(t, n)
|
|
@@ -288,13 +291,13 @@ var J = {
|
|
|
288
291
|
this.load(this.selected);
|
|
289
292
|
}
|
|
290
293
|
willUpdate() {
|
|
291
|
-
|
|
294
|
+
B.prizes = this.room.prizes, !this.unlocked && this.passwordHash === void 0 && this.grant();
|
|
292
295
|
}
|
|
293
296
|
get activeElement() {
|
|
294
297
|
return this.getRootNode().activeElement;
|
|
295
298
|
}
|
|
296
299
|
load(e) {
|
|
297
|
-
this.draft = structuredClone(
|
|
300
|
+
this.draft = structuredClone(U(e)), this.loads++;
|
|
298
301
|
}
|
|
299
302
|
save() {
|
|
300
303
|
try {
|
|
@@ -318,13 +321,19 @@ var J = {
|
|
|
318
321
|
this.minimized = e, this.save(), this.focusFirst();
|
|
319
322
|
}
|
|
320
323
|
grant() {
|
|
321
|
-
|
|
324
|
+
ne(de), this.unlocked = Q = !0;
|
|
322
325
|
}
|
|
323
326
|
setLanguage(e) {
|
|
324
|
-
|
|
327
|
+
B.locale = e || void 0, r.value++;
|
|
328
|
+
}
|
|
329
|
+
setDealer(e) {
|
|
330
|
+
B.dealer = e === "" ? void 0 : e === "none" ? "none" : Number(e), r.value++, this.requestUpdate();
|
|
331
|
+
}
|
|
332
|
+
setTables(e) {
|
|
333
|
+
B.singlePlayer = e === "single" || void 0, r.value++, this.requestUpdate();
|
|
325
334
|
}
|
|
326
335
|
setTheme(e) {
|
|
327
|
-
|
|
336
|
+
B.theme = e || void 0, r.value++, this.requestUpdate();
|
|
328
337
|
}
|
|
329
338
|
connectedCallback() {
|
|
330
339
|
super.connectedCallback(), this.lastFocus = this.activeElement, addEventListener("keydown", this.shortcut, !0), addEventListener("resize", this.fit);
|
|
@@ -342,16 +351,16 @@ var J = {
|
|
|
342
351
|
});
|
|
343
352
|
}
|
|
344
353
|
options(e) {
|
|
345
|
-
let
|
|
354
|
+
let n = (e, t) => [{
|
|
346
355
|
value: "hit",
|
|
347
356
|
label: this.t(`developer.option.${e}`)
|
|
348
357
|
}, {
|
|
349
358
|
value: "miss",
|
|
350
359
|
label: this.t(`developer.option.${t}`)
|
|
351
|
-
}],
|
|
360
|
+
}], r = () => O(oe(this.room.board)).sort((e, t) => Z.indexOf(e.split(":")[0]) - Z.indexOf(t.split(":")[0]));
|
|
352
361
|
switch (e) {
|
|
353
|
-
case "segment": return ["none", ...
|
|
354
|
-
case "booster": return
|
|
362
|
+
case "segment": return ["none", ...r()].map(this.segmentOption);
|
|
363
|
+
case "booster": return r().map(this.segmentOption);
|
|
355
364
|
case "prize": return this.room.prizes.map((e) => ({
|
|
356
365
|
value: e.id,
|
|
357
366
|
label: e.name
|
|
@@ -370,15 +379,15 @@ var J = {
|
|
|
370
379
|
value: String(t),
|
|
371
380
|
label: String(t)
|
|
372
381
|
}));
|
|
373
|
-
case "storm": return
|
|
374
|
-
case "violet": return
|
|
375
|
-
case "pocket": return
|
|
382
|
+
case "storm": return n("lands", "misses");
|
|
383
|
+
case "violet": return n("hit", "miss");
|
|
384
|
+
case "pocket": return D.map((e, t) => ({
|
|
376
385
|
value: String(t + 1),
|
|
377
386
|
label: this.t("developer.option.pocket", { n: t + 1 })
|
|
378
387
|
}));
|
|
379
|
-
case "award": return
|
|
380
|
-
value:
|
|
381
|
-
label: this.awardLabel(e,
|
|
388
|
+
case "award": return te.flatMap((e) => this.room.board[e].map((n) => ({
|
|
389
|
+
value: t(e, n),
|
|
390
|
+
label: this.awardLabel(e, n)
|
|
382
391
|
})));
|
|
383
392
|
}
|
|
384
393
|
}
|
|
@@ -397,59 +406,78 @@ var J = {
|
|
|
397
406
|
}
|
|
398
407
|
};
|
|
399
408
|
}
|
|
400
|
-
choices(e,
|
|
401
|
-
return
|
|
402
|
-
${e.map((e) =>
|
|
409
|
+
choices(e, t, n) {
|
|
410
|
+
return y`<option value="" ?selected=${t === void 0}>${n}</option>
|
|
411
|
+
${e.map((e) => y`<option value=${e.value} ?selected=${e.value === t}>${e.label}</option>`)}`;
|
|
403
412
|
}
|
|
404
413
|
renderBody() {
|
|
405
|
-
if (!this.unlocked) return
|
|
414
|
+
if (!this.unlocked) return y`<form class="lk-dev-body" @submit=${this.unlock}>
|
|
406
415
|
<label class="lk-dev-row">${this.t("developer.password")}
|
|
407
416
|
<input
|
|
408
417
|
data-first
|
|
409
418
|
type="password"
|
|
410
419
|
autocomplete="off"
|
|
411
|
-
.value=${
|
|
420
|
+
.value=${j(this.password)}
|
|
412
421
|
aria-invalid=${this.wrong}
|
|
413
|
-
aria-describedby=${this.wrong ? "lk-dev-wrong" :
|
|
422
|
+
aria-describedby=${this.wrong ? "lk-dev-wrong" : c}
|
|
414
423
|
@input=${(e) => {
|
|
415
424
|
this.password = e.target.value, this.wrong = !1;
|
|
416
425
|
}}
|
|
417
426
|
/>
|
|
418
427
|
</label>
|
|
419
|
-
${this.wrong ?
|
|
428
|
+
${this.wrong ? y`<p id="lk-dev-wrong" class="lk-dev-error" role="alert">${this.t("developer.wrongPassword")}</p>` : c}
|
|
420
429
|
<footer>
|
|
421
|
-
<button type="submit" class="is-primary" ?disabled=${!this.password}>${
|
|
430
|
+
<button type="submit" class="is-primary" ?disabled=${!this.password}>${v(P)}${this.t("developer.unlock")}</button>
|
|
422
431
|
</footer>
|
|
423
432
|
</form>`;
|
|
424
|
-
let { selected: e, draft:
|
|
425
|
-
return
|
|
433
|
+
let { selected: e, draft: t } = this, n = L[e].find((e) => R.includes(e) && t.advanced[e] !== void 0), r = H[e], i = (e) => e.target.value;
|
|
434
|
+
return y`<div class="lk-dev-body">
|
|
426
435
|
<p class="lk-dev-hint">${this.t("developer.hint")}</p>
|
|
427
436
|
<label class="lk-dev-row">${this.t("developer.theme")}
|
|
428
|
-
<select data-first @change=${(e) => this.setTheme(
|
|
437
|
+
<select data-first @change=${(e) => this.setTheme(i(e))}>
|
|
429
438
|
${this.choices([{
|
|
430
439
|
value: "none",
|
|
431
440
|
label: this.t("developer.noTheme")
|
|
432
|
-
}, ...
|
|
441
|
+
}, ...k.map((e) => ({
|
|
433
442
|
value: e,
|
|
434
443
|
label: this.t(`themes.${e}.name`)
|
|
435
|
-
}))],
|
|
444
|
+
}))], B.theme, this.t("developer.calendar"))}
|
|
436
445
|
</select>
|
|
437
446
|
</label>
|
|
438
447
|
<label class="lk-dev-row">${this.t("developer.language")}
|
|
439
|
-
<select @change=${(e) => this.setLanguage(
|
|
448
|
+
<select @change=${(e) => this.setLanguage(i(e))}>
|
|
440
449
|
${this.choices(this.room.locales.map((e) => ({
|
|
441
450
|
value: e,
|
|
442
451
|
label: new Intl.DisplayNames([e], { type: "language" }).of(e) ?? e
|
|
443
|
-
})),
|
|
452
|
+
})), B.locale, this.t("developer.autoLanguage"))}
|
|
444
453
|
</select>
|
|
445
454
|
</label>
|
|
455
|
+
${this.room.multiplayer ? y`<label class="lk-dev-row">${this.t("developer.tables")}
|
|
456
|
+
<select @change=${(e) => this.setTables(i(e))}>
|
|
457
|
+
${this.choices([{
|
|
458
|
+
value: "single",
|
|
459
|
+
label: this.t("developer.singlePlayer")
|
|
460
|
+
}], B.singlePlayer ? "single" : void 0, this.t("developer.multiplayer"))}
|
|
461
|
+
</select>
|
|
462
|
+
</label>` : c}
|
|
463
|
+
${this.room.dealers.length ? y`<label class="lk-dev-row">${this.t("developer.dealer")}
|
|
464
|
+
<select @change=${(e) => this.setDealer(i(e))}>
|
|
465
|
+
${this.choices([{
|
|
466
|
+
value: "none",
|
|
467
|
+
label: this.t("developer.dealerAbsent")
|
|
468
|
+
}, ...this.room.dealers.map((e, t) => ({
|
|
469
|
+
value: String(t),
|
|
470
|
+
label: e.name ?? this.t("developer.dealerNumber", { n: t + 1 })
|
|
471
|
+
}))], B.dealer === void 0 ? void 0 : String(B.dealer), this.t("developer.dealerShifts"))}
|
|
472
|
+
</select>
|
|
473
|
+
</label>` : c}
|
|
446
474
|
<label class="lk-dev-row">${this.t("developer.game")}
|
|
447
475
|
<select @change=${this.selectGame}>
|
|
448
|
-
${
|
|
476
|
+
${b.map((t) => y`<option value=${t} ?selected=${t === e}>${this.t(`games.${t}.name`)}</option>`)}
|
|
449
477
|
</select>
|
|
450
478
|
</label>
|
|
451
|
-
${
|
|
452
|
-
<select @change=${(e) => this.change("multiplier", Number(
|
|
479
|
+
${w(this.loads, y`<label class="lk-dev-row">${this.t("developer.multiplier")}
|
|
480
|
+
<select @change=${(e) => this.change("multiplier", Number(i(e)) || void 0)}>
|
|
453
481
|
${this.choices([
|
|
454
482
|
1,
|
|
455
483
|
2,
|
|
@@ -459,49 +487,49 @@ var J = {
|
|
|
459
487
|
].map((e) => ({
|
|
460
488
|
value: String(e),
|
|
461
489
|
label: `×${e}`
|
|
462
|
-
})),
|
|
490
|
+
})), t.multiplier?.toString(), this.t("developer.daily"))}
|
|
463
491
|
</select>
|
|
464
492
|
</label>
|
|
465
|
-
${
|
|
466
|
-
<select @change=${(e) => this.change("variant",
|
|
467
|
-
${this.choices(
|
|
493
|
+
${r ? y`<label class="lk-dev-row">${this.t(`developer.variant.${e}`)}
|
|
494
|
+
<select @change=${(e) => this.change("variant", i(e) || void 0)}>
|
|
495
|
+
${this.choices(r.map((t) => ({
|
|
468
496
|
value: t,
|
|
469
497
|
label: this.t(`${e}.names.${t}`)
|
|
470
|
-
})),
|
|
498
|
+
})), t.variant, this.t("developer.daily"))}
|
|
471
499
|
</select>
|
|
472
|
-
</label>` :
|
|
500
|
+
</label>` : c}
|
|
473
501
|
<label class="lk-dev-row">${this.t("developer.result")}
|
|
474
|
-
<select ?disabled=${!!
|
|
475
|
-
${
|
|
502
|
+
<select ?disabled=${!!n} @change=${(e) => this.change("result", i(e))}>
|
|
503
|
+
${I.map((e) => y`<option value=${e} ?selected=${e === t.result}>${this.t(`developer.${e}`)}</option>`)}
|
|
476
504
|
</select>
|
|
477
505
|
</label>
|
|
478
|
-
${
|
|
506
|
+
${n ? y`<p class="lk-dev-note">${this.t("developer.decidedBy", { field: this.t(`developer.field.${n}`) })}</p>` : c}
|
|
479
507
|
|
|
480
508
|
<details
|
|
481
509
|
class="lk-dev-advanced"
|
|
482
|
-
?open=${this.advancedOpen ||
|
|
510
|
+
?open=${this.advancedOpen || L[e].some((e) => t.advanced[e] !== void 0)}
|
|
483
511
|
@toggle=${(e) => this.advancedOpen = e.target.open}
|
|
484
512
|
>
|
|
485
|
-
<summary>${
|
|
486
|
-
${
|
|
487
|
-
<select @change=${(t) => this.changeAdvanced(e,
|
|
488
|
-
${this.choices(this.options(e),
|
|
513
|
+
<summary>${v(E)}${this.t("developer.advanced")}</summary>
|
|
514
|
+
${L[e].map((e) => y`<label class="lk-dev-row">${this.t(`developer.field.${e}`)}
|
|
515
|
+
<select @change=${(t) => this.changeAdvanced(e, i(t))}>
|
|
516
|
+
${this.choices(this.options(e), t.advanced[e], this.t("developer.automatic"))}
|
|
489
517
|
</select>
|
|
490
518
|
</label>`)}
|
|
491
519
|
<p class="lk-dev-note">${this.t(`developer.about.${e}`)}</p>
|
|
492
520
|
</details>`)}
|
|
493
521
|
|
|
494
522
|
<footer>
|
|
495
|
-
<button type="button" @click=${this.reset}>${
|
|
496
|
-
<button type="button" class="is-primary" @click=${this.apply}>${
|
|
523
|
+
<button type="button" @click=${this.reset}>${v(S)}${this.t("developer.reset")}</button>
|
|
524
|
+
<button type="button" class="is-primary" @click=${this.apply}>${v(C)}${this.t("developer.apply")}</button>
|
|
497
525
|
</footer>
|
|
498
526
|
</div>`;
|
|
499
527
|
}
|
|
500
528
|
render() {
|
|
501
|
-
if (!this.open) return
|
|
529
|
+
if (!this.open) return c;
|
|
502
530
|
let e = this.unlocked && this.minimized;
|
|
503
|
-
return
|
|
504
|
-
${e ?
|
|
531
|
+
return y`<div class="lk-dev ${e ? "is-icon" : ""}" style="left: ${this.position.x}px; top: ${this.position.y}px" @keydown=${this.keydown}>
|
|
532
|
+
${e ? y`<button
|
|
505
533
|
type="button"
|
|
506
534
|
class="lk-dev-icon"
|
|
507
535
|
aria-label=${this.t("developer.restore")}
|
|
@@ -512,19 +540,19 @@ var J = {
|
|
|
512
540
|
@pointercancel=${this.release}
|
|
513
541
|
@click=${this.restore}
|
|
514
542
|
>
|
|
515
|
-
${
|
|
516
|
-
</button>` :
|
|
543
|
+
${v(M)}
|
|
544
|
+
</button>` : y`<section class="lk-dev-panel" aria-label=${this.t("developer.title")}>
|
|
517
545
|
<header @pointerdown=${this.grab} @pointermove=${this.move} @pointerup=${this.release} @pointercancel=${this.release}>
|
|
518
|
-
${
|
|
519
|
-
<strong>${
|
|
520
|
-
${this.unlocked ?
|
|
521
|
-
${
|
|
522
|
-
</button>` :
|
|
523
|
-
<button type="button" aria-label=${this.t("developer.close")} title=${this.t("developer.close")} @click=${this.toggle}>${
|
|
546
|
+
${v(N, "lk-dev-grip")}
|
|
547
|
+
<strong>${v(M)}${this.t("developer.title")}</strong>
|
|
548
|
+
${this.unlocked ? y`<button type="button" aria-label=${this.t("developer.minimize")} title=${this.t("developer.minimize")} @click=${() => this.minimize(!0)}>
|
|
549
|
+
${v(F)}
|
|
550
|
+
</button>` : c}
|
|
551
|
+
<button type="button" aria-label=${this.t("developer.close")} title=${this.t("developer.close")} @click=${this.toggle}>${v(u)}</button>
|
|
524
552
|
</header>
|
|
525
553
|
${this.renderBody()}
|
|
526
554
|
</section>`}
|
|
527
555
|
</div>`;
|
|
528
556
|
}
|
|
529
557
|
};
|
|
530
|
-
|
|
558
|
+
_([d({ attribute: !1 })], $.prototype, "passwordHash", void 0), _([f()], $.prototype, "open", void 0), _([f()], $.prototype, "unlocked", void 0), _([f()], $.prototype, "password", void 0), _([f()], $.prototype, "wrong", void 0), _([f()], $.prototype, "minimized", void 0), _([f()], $.prototype, "position", void 0), _([f()], $.prototype, "selected", void 0), _([f()], $.prototype, "draft", void 0), _([f()], $.prototype, "loads", void 0), _([f()], $.prototype, "advancedOpen", void 0), _([a(".lk-dev")], $.prototype, "box", void 0), _([a(".lk-dev [data-first]")], $.prototype, "first", void 0), _([a(".lk-dev-icon")], $.prototype, "iconButton", void 0), $ = _([p("fl-developer")], $);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/config/resolve.ts
|
|
2
|
+
var e = async (e) => typeof e == "function" ? e() : e;
|
|
3
|
+
async function t(t) {
|
|
4
|
+
let [n, r, i, a, o, s, c, l] = await Promise.all([
|
|
5
|
+
e(t.prizes),
|
|
6
|
+
t.locale === void 0 ? void 0 : e(t.locale),
|
|
7
|
+
t.messages === void 0 ? {} : e(t.messages),
|
|
8
|
+
t.player === void 0 ? null : e(t.player),
|
|
9
|
+
t.developer !== void 0 && e(t.developer),
|
|
10
|
+
t.logo === void 0 ? void 0 : e(t.logo),
|
|
11
|
+
t.dealers === void 0 ? void 0 : e(t.dealers),
|
|
12
|
+
t.multiplayer === void 0 ? void 0 : e(t.multiplayer)
|
|
13
|
+
]);
|
|
14
|
+
if (!n.length) throw Error("feeling-lucky: at least one prize is needed");
|
|
15
|
+
return {
|
|
16
|
+
prizes: n,
|
|
17
|
+
locale: r,
|
|
18
|
+
messages: i,
|
|
19
|
+
player: a,
|
|
20
|
+
logo: s,
|
|
21
|
+
dealers: c,
|
|
22
|
+
developer: o === !1 ? null : { passwordHash: o === !0 ? void 0 : o.passwordHash },
|
|
23
|
+
multiplayer: typeof l == "string" ? { url: l } : l,
|
|
24
|
+
onWin: t.onWin,
|
|
25
|
+
onClaim: t.onClaim
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export { t as n, e as t };
|
package/dist/room/boost.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Translate } from '../runtime/i18n';
|
|
2
|
-
export declare const boost: (t: Translate, multiplier: number) => import("lit-html").TemplateResult<1>;
|
|
2
|
+
export declare const boost: (t: Translate, multiplier: number, dealer?: boolean) => import("lit-html").TemplateResult<1>;
|