@everymatrix/lottery-ticket 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-1a18a097.js → index-3626c135.js} +0 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +11 -34
- package/dist/cjs/lottery-ticket.cjs.js +2 -2
- package/dist/collection/components/lottery-ticket/lottery-ticket.css +7 -121
- package/dist/collection/components/lottery-ticket/lottery-ticket.js +17 -58
- package/dist/components/lottery-bullet2.js +1 -1
- package/dist/components/lottery-grid2.js +1 -1
- package/dist/components/lottery-ticket.js +10 -35
- package/dist/esm/{index-c436caae.js → index-dbc4aa67.js} +0 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-bullet_3.entry.js +11 -34
- package/dist/esm/lottery-ticket.js +2 -2
- package/dist/lottery-ticket/lottery-ticket.esm.js +1 -1
- package/dist/lottery-ticket/p-6d0df066.js +1 -0
- package/dist/lottery-ticket/p-ed151006.entry.js +1 -0
- package/dist/types/components/lottery-ticket/lottery-ticket.d.ts +1 -9
- package/package.json +1 -1
- package/dist/lottery-ticket/p-91b1278e.js +0 -1
- package/dist/lottery-ticket/p-ec3208f7.entry.js +0 -1
|
@@ -77,8 +77,6 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
77
77
|
const getHostListenerTarget = (elm, flags) => {
|
|
78
78
|
if (flags & 4 /* TargetDocument */)
|
|
79
79
|
return doc;
|
|
80
|
-
if (flags & 8 /* TargetWindow */)
|
|
81
|
-
return win;
|
|
82
80
|
return elm;
|
|
83
81
|
};
|
|
84
82
|
// prettier-ignore
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3626c135.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]
|
|
17
|
+
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]},[[0,"gridFilled","gridFilledHandler"]]],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3626c135.js');
|
|
6
6
|
|
|
7
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}
|
|
7
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;background:#FFF;border:solid 2px #00958f;height:20px;width:20px;border-radius:50%;margin:0;display:flex;align-items:center;justify-content:center;user-select:none;font-size:12px;font-weight:600;position:relative}.Circle:hover{background:#aee4e2}.Circle.Selected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{color:#707070;background:#D4D4D4;border:solid 2px #707070;cursor:default}.Circle.DisabledSelected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #707070;cursor:default}";
|
|
8
8
|
|
|
9
9
|
const LotteryBullet = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -38,7 +38,7 @@ const LotteryBullet = class {
|
|
|
38
38
|
};
|
|
39
39
|
LotteryBullet.style = lotteryBulletCss;
|
|
40
40
|
|
|
41
|
-
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:
|
|
41
|
+
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:350px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px}";
|
|
42
42
|
|
|
43
43
|
const LotteryGrid = class {
|
|
44
44
|
constructor(hostRef) {
|
|
@@ -227,7 +227,7 @@ const translate = (key, customLang) => {
|
|
|
227
227
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
-
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.
|
|
230
|
+
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;background-color:transparent;border:none;align-items:center;justify-content:center;height:20px;margin:0;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);width:30px;align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}";
|
|
231
231
|
|
|
232
232
|
const LotteryTicket = class {
|
|
233
233
|
constructor(hostRef) {
|
|
@@ -262,16 +262,6 @@ const LotteryTicket = class {
|
|
|
262
262
|
this.isLoading = true;
|
|
263
263
|
this.hasErrors = false;
|
|
264
264
|
this.ticketDone = false;
|
|
265
|
-
this.isCustomSelect = false;
|
|
266
|
-
this.amountInfo = {};
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
270
|
-
*/
|
|
271
|
-
checkForClickOutside(ev) {
|
|
272
|
-
if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
|
|
273
|
-
this.isCustomSelect = false;
|
|
274
|
-
}
|
|
275
265
|
}
|
|
276
266
|
connectedCallback() {
|
|
277
267
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -289,7 +279,6 @@ const LotteryTicket = class {
|
|
|
289
279
|
this.isLoading = false;
|
|
290
280
|
this.gameData = data;
|
|
291
281
|
this.grids = [...Array(data.rules.boards.length).keys()];
|
|
292
|
-
this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
|
|
293
282
|
})
|
|
294
283
|
.catch((err) => {
|
|
295
284
|
this.isLoading = false;
|
|
@@ -318,23 +307,12 @@ const LotteryTicket = class {
|
|
|
318
307
|
this.ticketDone = false;
|
|
319
308
|
this.resetSelection.emit(this.ticketId);
|
|
320
309
|
}
|
|
321
|
-
changeStake(
|
|
310
|
+
changeStake(event) {
|
|
322
311
|
this.stakeChange.emit({
|
|
323
|
-
ticketId:
|
|
324
|
-
stake:
|
|
312
|
+
ticketId: this.ticketId,
|
|
313
|
+
stake: event.target.value
|
|
325
314
|
});
|
|
326
315
|
}
|
|
327
|
-
toggleClass() {
|
|
328
|
-
this.isCustomSelect = !this.isCustomSelect;
|
|
329
|
-
}
|
|
330
|
-
setDropdownItem(item) {
|
|
331
|
-
this.amountInfo = {
|
|
332
|
-
amount: item.amount,
|
|
333
|
-
currency: item.currency
|
|
334
|
-
};
|
|
335
|
-
this.isCustomSelect = false;
|
|
336
|
-
this.changeStake(this.ticketId, item.amount);
|
|
337
|
-
}
|
|
338
316
|
render() {
|
|
339
317
|
if (this.isLoading) {
|
|
340
318
|
return (index.h("div", null, index.h("p", null, translate('loading', this.language))));
|
|
@@ -345,12 +323,11 @@ const LotteryTicket = class {
|
|
|
345
323
|
}
|
|
346
324
|
else {
|
|
347
325
|
const { rules } = this.gameData;
|
|
348
|
-
return (index.h("div", { class: "TicketContainer" }, index.h("p",
|
|
349
|
-
index.h("
|
|
350
|
-
index.h("
|
|
326
|
+
return (index.h("div", { class: "TicketContainer" }, index.h("p", null, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
327
|
+
index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language)), this.autoPick && !this.ticketDone &&
|
|
328
|
+
index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language)), this.grids.map((item, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": rules.boards[index$1].maximumAllowed, "minimum-allowed": rules.boards[index$1].minimumAllowed, "total-numbers": rules.boards[index$1].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
351
329
|
index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
352
|
-
index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("
|
|
353
|
-
(index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
330
|
+
index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, rules.stakes.length > 1 ? index.h("div", null, index.h("select", { class: "InputDefault", onChange: (event) => this.changeStake(event) }, rules.stakes.map((item) => index.h("option", { value: item.amount }, item.amount, " ", item.currency)))) : index.h("div", null, index.h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))));
|
|
354
331
|
}
|
|
355
332
|
}
|
|
356
333
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-3626c135.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]
|
|
18
|
+
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]},[[0,"gridFilled","gridFilledHandler"]]],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
19
19
|
});
|
|
@@ -4,16 +4,6 @@
|
|
|
4
4
|
font-family: "Roboto", sans-serif;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.TicketTitle {
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
font-weight: bold;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.ButtonContainer {
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: flex-end;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
7
|
.Toggle {
|
|
18
8
|
cursor: pointer;
|
|
19
9
|
margin-top: 20px;
|
|
@@ -100,10 +90,12 @@ input[type=number]::-webkit-outer-spin-button {
|
|
|
100
90
|
cursor: pointer;
|
|
101
91
|
outline: none;
|
|
102
92
|
-webkit-appearance: none;
|
|
93
|
+
background-color: transparent;
|
|
103
94
|
border: none;
|
|
104
95
|
align-items: center;
|
|
105
96
|
justify-content: center;
|
|
106
97
|
height: 20px;
|
|
98
|
+
margin: 0;
|
|
107
99
|
position: relative;
|
|
108
100
|
}
|
|
109
101
|
|
|
@@ -111,6 +103,7 @@ input[type=number]::-webkit-outer-spin-button {
|
|
|
111
103
|
display: inline-block;
|
|
112
104
|
position: absolute;
|
|
113
105
|
transform: translate(-50%, -50%) rotate(180deg);
|
|
106
|
+
width: 30px;
|
|
114
107
|
align-items: center;
|
|
115
108
|
text-align: center;
|
|
116
109
|
}
|
|
@@ -148,9 +141,9 @@ input[type=number]::-webkit-outer-spin-button {
|
|
|
148
141
|
|
|
149
142
|
.AutoButton {
|
|
150
143
|
cursor: pointer;
|
|
151
|
-
display:
|
|
144
|
+
display: block;
|
|
152
145
|
border-radius: 4px;
|
|
153
|
-
padding: 8px
|
|
146
|
+
padding: 8px 25px;
|
|
154
147
|
width: max-content;
|
|
155
148
|
margin: 5px 0;
|
|
156
149
|
border: 1px solid #00958f;
|
|
@@ -169,9 +162,9 @@ input[type=number]::-webkit-outer-spin-button {
|
|
|
169
162
|
|
|
170
163
|
.ResetButton {
|
|
171
164
|
cursor: pointer;
|
|
172
|
-
display:
|
|
165
|
+
display: block;
|
|
173
166
|
border-radius: 4px;
|
|
174
|
-
padding: 8px
|
|
167
|
+
padding: 8px 25px;
|
|
175
168
|
width: max-content;
|
|
176
169
|
margin: 5px 0;
|
|
177
170
|
color: #000;
|
|
@@ -197,111 +190,4 @@ input[type=number]::-webkit-outer-spin-button {
|
|
|
197
190
|
}
|
|
198
191
|
.TicketGridBullets .TicketGridTitle {
|
|
199
192
|
margin-top: 0px;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.Minus {
|
|
203
|
-
border-radius: 4px;
|
|
204
|
-
width: 30px;
|
|
205
|
-
height: 24px !important;
|
|
206
|
-
margin-right: 10px;
|
|
207
|
-
color: #FFF;
|
|
208
|
-
background: #009993;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.Plus {
|
|
212
|
-
border-radius: 4px;
|
|
213
|
-
width: 30px;
|
|
214
|
-
height: 24px !important;
|
|
215
|
-
margin-left: 10px;
|
|
216
|
-
color: #FFF;
|
|
217
|
-
background: #009993;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.SelectWrapper {
|
|
221
|
-
width: auto;
|
|
222
|
-
padding: 5px;
|
|
223
|
-
margin: 0 auto;
|
|
224
|
-
border: 1px solid #ccc;
|
|
225
|
-
border-radius: 5px;
|
|
226
|
-
position: relative;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.SelectButton, .SelectOptions li {
|
|
230
|
-
display: flex;
|
|
231
|
-
align-items: center;
|
|
232
|
-
cursor: pointer;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.SelectButton {
|
|
236
|
-
display: flex;
|
|
237
|
-
padding: 0 5px;
|
|
238
|
-
border-radius: 7px;
|
|
239
|
-
align-items: center;
|
|
240
|
-
justify-content: space-between;
|
|
241
|
-
font-size: 14px;
|
|
242
|
-
}
|
|
243
|
-
.SelectButton span:first-child {
|
|
244
|
-
padding-right: 10px;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.SelectExpand {
|
|
248
|
-
transition: transform 0.3s linear;
|
|
249
|
-
font-size: 12px;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.SelectActive .SelectExpand {
|
|
253
|
-
transform: rotate(180deg);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.SelectContent {
|
|
257
|
-
display: none;
|
|
258
|
-
padding: 5px;
|
|
259
|
-
border-radius: 7px;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.SelectWrapper.SelectActive .SelectContent {
|
|
263
|
-
width: 100%;
|
|
264
|
-
display: block;
|
|
265
|
-
position: absolute;
|
|
266
|
-
left: 0;
|
|
267
|
-
top: 32px;
|
|
268
|
-
padding: 0;
|
|
269
|
-
border: 1px solid #ccc;
|
|
270
|
-
overflow: hidden;
|
|
271
|
-
background: #fff;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.SelectContent .SelectOptions {
|
|
275
|
-
max-height: 100px;
|
|
276
|
-
margin: 0;
|
|
277
|
-
overflow-y: auto;
|
|
278
|
-
padding: 0;
|
|
279
|
-
}
|
|
280
|
-
.SelectContent .SelectOptions .SelectedValue {
|
|
281
|
-
background-color: #009993;
|
|
282
|
-
color: #fff;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.SelectOptions::-webkit-scrollbar {
|
|
286
|
-
width: 7px;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.SelectOptions::-webkit-scrollbar-track {
|
|
290
|
-
background: #f1f1f1;
|
|
291
|
-
border-radius: 25px;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.SelectOptions::-webkit-scrollbar-thumb {
|
|
295
|
-
background: #ccc;
|
|
296
|
-
border-radius: 25px;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.SelectOptions li {
|
|
300
|
-
height: 20px;
|
|
301
|
-
padding: 0 13px;
|
|
302
|
-
font-size: 14px;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.SelectOptions li:hover {
|
|
306
|
-
background: #f2f2f2;
|
|
307
193
|
}
|
|
@@ -28,16 +28,6 @@ export class LotteryTicket {
|
|
|
28
28
|
this.isLoading = true;
|
|
29
29
|
this.hasErrors = false;
|
|
30
30
|
this.ticketDone = false;
|
|
31
|
-
this.isCustomSelect = false;
|
|
32
|
-
this.amountInfo = {};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
36
|
-
*/
|
|
37
|
-
checkForClickOutside(ev) {
|
|
38
|
-
if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
|
|
39
|
-
this.isCustomSelect = false;
|
|
40
|
-
}
|
|
41
31
|
}
|
|
42
32
|
connectedCallback() {
|
|
43
33
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -55,7 +45,6 @@ export class LotteryTicket {
|
|
|
55
45
|
this.isLoading = false;
|
|
56
46
|
this.gameData = data;
|
|
57
47
|
this.grids = [...Array(data.rules.boards.length).keys()];
|
|
58
|
-
this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
|
|
59
48
|
})
|
|
60
49
|
.catch((err) => {
|
|
61
50
|
this.isLoading = false;
|
|
@@ -84,23 +73,12 @@ export class LotteryTicket {
|
|
|
84
73
|
this.ticketDone = false;
|
|
85
74
|
this.resetSelection.emit(this.ticketId);
|
|
86
75
|
}
|
|
87
|
-
changeStake(
|
|
76
|
+
changeStake(event) {
|
|
88
77
|
this.stakeChange.emit({
|
|
89
|
-
ticketId:
|
|
90
|
-
stake:
|
|
78
|
+
ticketId: this.ticketId,
|
|
79
|
+
stake: event.target.value
|
|
91
80
|
});
|
|
92
81
|
}
|
|
93
|
-
toggleClass() {
|
|
94
|
-
this.isCustomSelect = !this.isCustomSelect;
|
|
95
|
-
}
|
|
96
|
-
setDropdownItem(item) {
|
|
97
|
-
this.amountInfo = {
|
|
98
|
-
amount: item.amount,
|
|
99
|
-
currency: item.currency
|
|
100
|
-
};
|
|
101
|
-
this.isCustomSelect = false;
|
|
102
|
-
this.changeStake(this.ticketId, item.amount);
|
|
103
|
-
}
|
|
104
82
|
render() {
|
|
105
83
|
if (this.isLoading) {
|
|
106
84
|
return (h("div", null,
|
|
@@ -114,13 +92,11 @@ export class LotteryTicket {
|
|
|
114
92
|
else {
|
|
115
93
|
const { rules } = this.gameData;
|
|
116
94
|
return (h("div", { class: "TicketContainer" },
|
|
117
|
-
h("p",
|
|
95
|
+
h("p", null, this.gameData.name),
|
|
118
96
|
this.resetButton && this.ticketDone &&
|
|
119
|
-
h("
|
|
120
|
-
h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))),
|
|
97
|
+
h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language)),
|
|
121
98
|
this.autoPick && !this.ticketDone &&
|
|
122
|
-
h("
|
|
123
|
-
h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))),
|
|
99
|
+
h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language)),
|
|
124
100
|
this.grids.map((item, index) => h("div", { class: "TicketGridBullets" },
|
|
125
101
|
h("p", { class: "TicketGridTitle" },
|
|
126
102
|
translate('grid', this.language),
|
|
@@ -144,25 +120,16 @@ export class LotteryTicket {
|
|
|
144
120
|
h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"),
|
|
145
121
|
h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }),
|
|
146
122
|
h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))),
|
|
147
|
-
h("
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
h("
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.amountInfo.currency),
|
|
158
|
-
h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")),
|
|
159
|
-
h("div", { "data-cluster": "SelectComponent", class: "SelectContent" },
|
|
160
|
-
h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) },
|
|
161
|
-
item.amount,
|
|
162
|
-
" ",
|
|
163
|
-
item.currency)))))) : (h("div", null,
|
|
164
|
-
h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }),
|
|
165
|
-
h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
123
|
+
h("label", { class: "Label" },
|
|
124
|
+
translate('wagerPerDraw', this.language),
|
|
125
|
+
": "),
|
|
126
|
+
h("div", { class: "WagerInput" }, rules.stakes.length > 1 ? h("div", null,
|
|
127
|
+
h("select", { class: "InputDefault", onChange: (event) => this.changeStake(event) }, rules.stakes.map((item) => h("option", { value: item.amount },
|
|
128
|
+
item.amount,
|
|
129
|
+
" ",
|
|
130
|
+
item.currency)))) : h("div", null,
|
|
131
|
+
h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }),
|
|
132
|
+
h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))));
|
|
166
133
|
}
|
|
167
134
|
}
|
|
168
135
|
}
|
|
@@ -322,9 +289,7 @@ export class LotteryTicket {
|
|
|
322
289
|
"numberOfDraws": {},
|
|
323
290
|
"isLoading": {},
|
|
324
291
|
"hasErrors": {},
|
|
325
|
-
"ticketDone": {}
|
|
326
|
-
"isCustomSelect": {},
|
|
327
|
-
"amountInfo": {}
|
|
292
|
+
"ticketDone": {}
|
|
328
293
|
}; }
|
|
329
294
|
static get events() { return [{
|
|
330
295
|
"method": "ticketCompleted",
|
|
@@ -410,12 +375,6 @@ export class LotteryTicket {
|
|
|
410
375
|
"methodName": "drawsChangeHandler"
|
|
411
376
|
}]; }
|
|
412
377
|
static get listeners() { return [{
|
|
413
|
-
"name": "click",
|
|
414
|
-
"method": "checkForClickOutside",
|
|
415
|
-
"target": "window",
|
|
416
|
-
"capture": false,
|
|
417
|
-
"passive": false
|
|
418
|
-
}, {
|
|
419
378
|
"name": "gridFilled",
|
|
420
379
|
"method": "gridFilledHandler",
|
|
421
380
|
"target": undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}
|
|
3
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;background:#FFF;border:solid 2px #00958f;height:20px;width:20px;border-radius:50%;margin:0;display:flex;align-items:center;justify-content:center;user-select:none;font-size:12px;font-weight:600;position:relative}.Circle:hover{background:#aee4e2}.Circle.Selected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{color:#707070;background:#D4D4D4;border:solid 2px #707070;cursor:default}.Circle.DisabledSelected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #707070;cursor:default}";
|
|
4
4
|
|
|
5
5
|
const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './lottery-bullet2.js';
|
|
3
3
|
|
|
4
|
-
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:
|
|
4
|
+
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:350px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px}";
|
|
5
5
|
|
|
6
6
|
const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -31,7 +31,7 @@ const translate = (key, customLang) => {
|
|
|
31
31
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.
|
|
34
|
+
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;background-color:transparent;border:none;align-items:center;justify-content:center;height:20px;margin:0;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);width:30px;align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}";
|
|
35
35
|
|
|
36
36
|
const LotteryTicket$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
37
37
|
constructor() {
|
|
@@ -68,16 +68,6 @@ const LotteryTicket$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
68
68
|
this.isLoading = true;
|
|
69
69
|
this.hasErrors = false;
|
|
70
70
|
this.ticketDone = false;
|
|
71
|
-
this.isCustomSelect = false;
|
|
72
|
-
this.amountInfo = {};
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
76
|
-
*/
|
|
77
|
-
checkForClickOutside(ev) {
|
|
78
|
-
if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
|
|
79
|
-
this.isCustomSelect = false;
|
|
80
|
-
}
|
|
81
71
|
}
|
|
82
72
|
connectedCallback() {
|
|
83
73
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -95,7 +85,6 @@ const LotteryTicket$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
95
85
|
this.isLoading = false;
|
|
96
86
|
this.gameData = data;
|
|
97
87
|
this.grids = [...Array(data.rules.boards.length).keys()];
|
|
98
|
-
this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
|
|
99
88
|
})
|
|
100
89
|
.catch((err) => {
|
|
101
90
|
this.isLoading = false;
|
|
@@ -124,23 +113,12 @@ const LotteryTicket$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
124
113
|
this.ticketDone = false;
|
|
125
114
|
this.resetSelection.emit(this.ticketId);
|
|
126
115
|
}
|
|
127
|
-
changeStake(
|
|
116
|
+
changeStake(event) {
|
|
128
117
|
this.stakeChange.emit({
|
|
129
|
-
ticketId:
|
|
130
|
-
stake:
|
|
118
|
+
ticketId: this.ticketId,
|
|
119
|
+
stake: event.target.value
|
|
131
120
|
});
|
|
132
121
|
}
|
|
133
|
-
toggleClass() {
|
|
134
|
-
this.isCustomSelect = !this.isCustomSelect;
|
|
135
|
-
}
|
|
136
|
-
setDropdownItem(item) {
|
|
137
|
-
this.amountInfo = {
|
|
138
|
-
amount: item.amount,
|
|
139
|
-
currency: item.currency
|
|
140
|
-
};
|
|
141
|
-
this.isCustomSelect = false;
|
|
142
|
-
this.changeStake(this.ticketId, item.amount);
|
|
143
|
-
}
|
|
144
122
|
render() {
|
|
145
123
|
if (this.isLoading) {
|
|
146
124
|
return (h("div", null, h("p", null, translate('loading', this.language))));
|
|
@@ -151,12 +129,11 @@ const LotteryTicket$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
151
129
|
}
|
|
152
130
|
else {
|
|
153
131
|
const { rules } = this.gameData;
|
|
154
|
-
return (h("div", { class: "TicketContainer" }, h("p",
|
|
155
|
-
h("
|
|
156
|
-
h("
|
|
132
|
+
return (h("div", { class: "TicketContainer" }, h("p", null, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
133
|
+
h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language)), this.autoPick && !this.ticketDone &&
|
|
134
|
+
h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language)), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
157
135
|
h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
158
|
-
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("
|
|
159
|
-
(h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
136
|
+
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ? h("div", null, h("select", { class: "InputDefault", onChange: (event) => this.changeStake(event) }, rules.stakes.map((item) => h("option", { value: item.amount }, item.amount, " ", item.currency)))) : h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))));
|
|
160
137
|
}
|
|
161
138
|
}
|
|
162
139
|
}
|
|
@@ -177,10 +154,8 @@ const LotteryTicket$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
177
154
|
"numberOfDraws": [32],
|
|
178
155
|
"isLoading": [32],
|
|
179
156
|
"hasErrors": [32],
|
|
180
|
-
"ticketDone": [32]
|
|
181
|
-
|
|
182
|
-
"amountInfo": [32]
|
|
183
|
-
}, [[8, "click", "checkForClickOutside"], [0, "gridFilled", "gridFilledHandler"]]]);
|
|
157
|
+
"ticketDone": [32]
|
|
158
|
+
}, [[0, "gridFilled", "gridFilledHandler"]]]);
|
|
184
159
|
function defineCustomElement$1() {
|
|
185
160
|
if (typeof customElements === "undefined") {
|
|
186
161
|
return;
|
|
@@ -55,8 +55,6 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
55
55
|
const getHostListenerTarget = (elm, flags) => {
|
|
56
56
|
if (flags & 4 /* TargetDocument */)
|
|
57
57
|
return doc;
|
|
58
|
-
if (flags & 8 /* TargetWindow */)
|
|
59
|
-
return win;
|
|
60
58
|
return elm;
|
|
61
59
|
};
|
|
62
60
|
// prettier-ignore
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-dbc4aa67.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["lottery-bullet_3",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]
|
|
13
|
+
return bootstrapLazy([["lottery-bullet_3",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]},[[0,"gridFilled","gridFilledHandler"]]],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-dbc4aa67.js';
|
|
2
2
|
|
|
3
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}
|
|
3
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;background:#FFF;border:solid 2px #00958f;height:20px;width:20px;border-radius:50%;margin:0;display:flex;align-items:center;justify-content:center;user-select:none;font-size:12px;font-weight:600;position:relative}.Circle:hover{background:#aee4e2}.Circle.Selected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{color:#707070;background:#D4D4D4;border:solid 2px #707070;cursor:default}.Circle.DisabledSelected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #707070;cursor:default}";
|
|
4
4
|
|
|
5
5
|
const LotteryBullet = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -34,7 +34,7 @@ const LotteryBullet = class {
|
|
|
34
34
|
};
|
|
35
35
|
LotteryBullet.style = lotteryBulletCss;
|
|
36
36
|
|
|
37
|
-
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:
|
|
37
|
+
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:350px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px}";
|
|
38
38
|
|
|
39
39
|
const LotteryGrid = class {
|
|
40
40
|
constructor(hostRef) {
|
|
@@ -223,7 +223,7 @@ const translate = (key, customLang) => {
|
|
|
223
223
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.
|
|
226
|
+
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;background-color:transparent;border:none;align-items:center;justify-content:center;height:20px;margin:0;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);width:30px;align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}";
|
|
227
227
|
|
|
228
228
|
const LotteryTicket = class {
|
|
229
229
|
constructor(hostRef) {
|
|
@@ -258,16 +258,6 @@ const LotteryTicket = class {
|
|
|
258
258
|
this.isLoading = true;
|
|
259
259
|
this.hasErrors = false;
|
|
260
260
|
this.ticketDone = false;
|
|
261
|
-
this.isCustomSelect = false;
|
|
262
|
-
this.amountInfo = {};
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
266
|
-
*/
|
|
267
|
-
checkForClickOutside(ev) {
|
|
268
|
-
if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
|
|
269
|
-
this.isCustomSelect = false;
|
|
270
|
-
}
|
|
271
261
|
}
|
|
272
262
|
connectedCallback() {
|
|
273
263
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -285,7 +275,6 @@ const LotteryTicket = class {
|
|
|
285
275
|
this.isLoading = false;
|
|
286
276
|
this.gameData = data;
|
|
287
277
|
this.grids = [...Array(data.rules.boards.length).keys()];
|
|
288
|
-
this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
|
|
289
278
|
})
|
|
290
279
|
.catch((err) => {
|
|
291
280
|
this.isLoading = false;
|
|
@@ -314,23 +303,12 @@ const LotteryTicket = class {
|
|
|
314
303
|
this.ticketDone = false;
|
|
315
304
|
this.resetSelection.emit(this.ticketId);
|
|
316
305
|
}
|
|
317
|
-
changeStake(
|
|
306
|
+
changeStake(event) {
|
|
318
307
|
this.stakeChange.emit({
|
|
319
|
-
ticketId:
|
|
320
|
-
stake:
|
|
308
|
+
ticketId: this.ticketId,
|
|
309
|
+
stake: event.target.value
|
|
321
310
|
});
|
|
322
311
|
}
|
|
323
|
-
toggleClass() {
|
|
324
|
-
this.isCustomSelect = !this.isCustomSelect;
|
|
325
|
-
}
|
|
326
|
-
setDropdownItem(item) {
|
|
327
|
-
this.amountInfo = {
|
|
328
|
-
amount: item.amount,
|
|
329
|
-
currency: item.currency
|
|
330
|
-
};
|
|
331
|
-
this.isCustomSelect = false;
|
|
332
|
-
this.changeStake(this.ticketId, item.amount);
|
|
333
|
-
}
|
|
334
312
|
render() {
|
|
335
313
|
if (this.isLoading) {
|
|
336
314
|
return (h("div", null, h("p", null, translate('loading', this.language))));
|
|
@@ -341,12 +319,11 @@ const LotteryTicket = class {
|
|
|
341
319
|
}
|
|
342
320
|
else {
|
|
343
321
|
const { rules } = this.gameData;
|
|
344
|
-
return (h("div", { class: "TicketContainer" }, h("p",
|
|
345
|
-
h("
|
|
346
|
-
h("
|
|
322
|
+
return (h("div", { class: "TicketContainer" }, h("p", null, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
323
|
+
h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language)), this.autoPick && !this.ticketDone &&
|
|
324
|
+
h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language)), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
347
325
|
h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
348
|
-
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("
|
|
349
|
-
(h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
326
|
+
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ? h("div", null, h("select", { class: "InputDefault", onChange: (event) => this.changeStake(event) }, rules.stakes.map((item) => h("option", { value: item.amount }, item.amount, " ", item.currency)))) : h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))));
|
|
350
327
|
}
|
|
351
328
|
}
|
|
352
329
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-dbc4aa67.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["lottery-bullet_3",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]
|
|
16
|
+
return bootstrapLazy([["lottery-bullet_3",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32]},[[0,"gridFilled","gridFilledHandler"]]],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-
|
|
1
|
+
import{p as e,b as t}from"./p-6d0df066.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((e=>t([["p-ed151006",[[1,"lottery-ticket",{endpoint:[1],gameId:[1,"game-id"],numberOfGrids:[2,"number-of-grids"],multipleDraws:[4,"multiple-draws"],ticketId:[2,"ticket-id"],resetButton:[4,"reset-button"],autoPick:[4,"auto-pick"],language:[1],multiplier:[32],numberOfDraws:[32],isLoading:[32],hasErrors:[32],ticketDone:[32]},[[0,"gridFilled","gridFilledHandler"]]],[1,"lottery-grid",{ticketId:[2,"ticket-id"],totalNumbers:[2,"total-numbers"],gameId:[1,"game-id"],maximumAllowed:[2,"maximum-allowed"],minimumAllowed:[2,"minimum-allowed"],selectable:[4],selectedNumbers:[1,"selected-numbers"],displaySelected:[4,"display-selected"],language:[1],gridIndex:[2,"grid-index"],numbers:[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{value:[1],selectable:[4],isSelected:[4,"is-selected"]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const c=a(e,n),r=u(t,s),i=f(n);o.ael(c,l,r,i),(t.o=t.o||[]).push((()=>o.rel(c,l,r,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},a=(e,t)=>4&t?s:e,f=e=>0!=(2&e),h=new WeakMap,y=e=>"sc-"+e.h,$={},d=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!d(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?p(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=p(e,null);return i.m=t,c.length>0&&(i.p=c),i},p=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),b={},w=(e,t,n,s,c,r)=>{if(n!==s){let i=I(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=g(n),o=g(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=d(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},S=/\s/,g=e=>e?e.split(S):[],j=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||$,c=t.m||$;for(l in o)l in c||w(s,l,o[l],void 0,n,t.t);for(l in c)w(s,l,o[l],c[l],n,t.t)},v=(t,n,l)=>{let o,c,r=n.p[l],i=0;if(null!==r.$)o=r.g=s.createTextNode(r.$);else if(o=r.g=s.createElement(r.S),j(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.p)for(i=0;i<r.p.length;++i)c=v(t,r,i),c&&o.appendChild(c);return o},k=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=v(null,l,o),r&&(s[o].g=r,i.insertBefore(r,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},C=(e,t)=>e.S===t.S,O=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?(j(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:C(i,f)?(O(i,f),i=t[++o],f=l[++c]):C(u,h)?(O(u,h),u=t[--r],h=l[--a]):C(i,h)?(O(i,h),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],h=l[--a]):C(u,f)?(O(u,f),e.insertBefore(u.g,i.g),u=t[--r],f=l[++c]):(s=v(t&&t[c],n,c),f=l[++c],s&&i.g.parentNode.insertBefore(s,i.g));o>r?k(e,null==l[a+1]?null:l[a+1].g,n,l,c,a):c>a&&M(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),k(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=(e,t,n)=>{const l=(e=>B(e).j)(e);return{emit:e=>x(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},x=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},E=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return E(e,e.k),se((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null)),W(void 0,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,o=((e,t)=>{let n=y(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=h.get(e=e.head||e);o||h.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);F(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},F=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C||p(null,null),c=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,c.S=null,c.t|=4,n.C=c,c.g=o.g=s.shadowRoot||s,e=s["s-sc"],O(o,c)})(n,l)}catch(e){J(e,n.j)}return null},L=e=>{const t=e.j,n=e.k;64&e.t||(e.t|=64,q(t),e.O(t),n||R()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>N(e,!1))),e.t&=-517},R=()=>{q(s.documentElement),le((()=>x(l,"appload",{detail:{namespace:"lottery-ticket"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.P){e.watchers&&(t.N=e.watchers);const l=Object.entries(t.P),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>B(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=B(e),o=s.j,c=s.T.get(t),r=s.t,i=s.i;if(n=((e,t)=>null==e||d(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.P[t][0]),(!(8&r)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.T.set(t,n),i)){if(l.N&&128&r){const e=l.N[t];e&&e.map((e=>{try{i[e](n,c,t)}catch(e){J(e,o)}}))}2==(18&r)&&N(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},V=e=>{U(e,"connectedCallback")},_=(e,t={})=>{const n=[],c=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),h=s.createElement("style"),$=[];let d,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],P:t[2],A:t[3]};l.P=t[2],l.A=t[3],l.N={};const s=l.h,a=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=B(e),n=t.M,l=()=>{};if(1&t.t)i(e,t,n.A),V(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.k=n);break}}n.P&&Object.entries(n.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.N=s.watchers,H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,t.t|=128,e(),V(t.i)}if(s.style){let e=s.style;const t=y(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,c=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=B(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return B(this).F}};l.L=e[0],c.includes(s)||u.get(s)||(n.push(s),u.define(s,H(a,l,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),a.insertBefore(h,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>d=setTimeout(R,30)))},z=new WeakMap,B=e=>z.get(e),D=(e,t)=>z.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,M:t,T:new Map};return n.F=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.A),z.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>c().then(e),se=ee(Z,!0);export{_ as b,P as c,m as h,c as p,D as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i}from"./p-6d0df066.js";const s=class{constructor(i){t(this,i),this.bulletEvent=e(this,"lotteryBulletSelection",7),this.value="0",this.selectable=!0,this.isSelected=!1,this.select=()=>{this.selectable&&(this.isSelected=!this.isSelected,this.bulletEvent.emit({value:this.value,selected:this.isSelected}))}}render(){return i("div",{class:"Circle "+(this.selectable?"":"Disabled")+(this.isSelected?"Selected":""),onClick:()=>this.select()},this.value)}};s.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;background:#FFF;border:solid 2px #00958f;height:20px;width:20px;border-radius:50%;margin:0;display:flex;align-items:center;justify-content:center;user-select:none;font-size:12px;font-weight:600;position:relative}.Circle:hover{background:#aee4e2}.Circle.Selected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{color:#707070;background:#D4D4D4;border:solid 2px #707070;cursor:default}.Circle.DisabledSelected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #707070;cursor:default}';const r=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.totalNumbers=0,this.maximumAllowed=0,this.minimumAllowed=1,this.selectable=!0,this.selectedNumbers="",this.displaySelected=!1,this.language="en",this.numbers=[],this.selectedCounter=0}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):[...Array(this.totalNumbers).keys()].map((t=>(t+1).toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>e.number==t.detail.value?{number:e.number,selected:t.detail.selected,selectable:e.selectable}:{number:e.number,selected:e.selected,selectable:e.selectable})),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter==this.maximumAllowed&&(this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!!t.selected}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter==this.maximumAllowed&&(this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))})),this.selectedCounter-=1)}async resetSelectionHandler(t){t.detail&&t.detail==this.ticketId&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async autoSelectionHandler(t){if(t.detail&&t.detail==this.ticketId){this.resetSelectionHandler(t);let e=[...Array(this.totalNumbers).keys()].map((t=>t+1)).sort((()=>.5-Math.random()));e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.maximumAllowed}}render(){return i("div",{class:"GridContainer"},i("div",{class:"Grid"},this.numbers.map((t=>i("div",null,i("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected}))))))}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:350px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px}';const l=["ro","en"],o={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",grid:"Grid",multiplier:"Multiplier",numberOfDraws:"Number of draws",wagerPerDraw:"Wager per draw",resetButton:"Reset",autoButton:"I feel lucky"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",grid:"Grid",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"Ma simt norocos"}},a=(t,e)=>{const i=e;return o[void 0!==i&&l.includes(i)?i:"en"][t]},n=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.numberOfGrids=1,this.multipleDraws=!0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.multiplier=!1,this.numberOfDraws=1,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=!1}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{this.isLoading=!1,this.gameData=t,this.grids=[...Array(t.rules.boards.length).keys()]})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}multiplierChangeHandler(t){this.multiplier=!!t.target&&t.target.checked,this.multiplierChange.emit(this.multiplier)}drawsChangeHandler(t){this.ticket=Object.assign(Object.assign({},this.ticket),{draws:t}),this.ticketCompleted.emit(this.ticket)}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{draws:this.numberOfDraws}),this.ticketDone=!0,this.ticketCompleted.emit(this.ticket)}toggleAutoSelection(){this.ticketDone=!0,this.autoSelection.emit(this.ticketId)}toggleResetSelection(){this.ticketDone=!1,this.resetSelection.emit(this.ticketId)}changeStake(t){this.stakeChange.emit({ticketId:this.ticketId,stake:t.target.value})}render(){if(this.isLoading)return i("div",null,i("p",null,a("loading",this.language)));if(this.hasErrors)return i("div",null,i("p",null,a("error",this.language)));{const{rules:t}=this.gameData;return i("div",{class:"TicketContainer"},i("p",null,this.gameData.name),this.resetButton&&this.ticketDone&&i("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection()},a("resetButton",this.language)),this.autoPick&&!this.ticketDone&&i("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection()},a("autoButton",this.language)),this.grids.map(((e,s)=>i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},a("grid",this.language)," ",e),i("lottery-grid",{"grid-index":s,"maximum-allowed":t.boards[s].maximumAllowed,"minimum-allowed":t.boards[s].minimumAllowed,"total-numbers":t.boards[s].totalNumbers,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,language:this.language})))),t.multiplier&&i("div",null,i("label",{class:"Toggle"},i("label",{class:"Label"},a("multiplier",this.language),": "),i("input",{class:"ToggleCheckbox",type:"checkbox",onInput:t=>this.multiplierChangeHandler(t)}),i("div",{class:"ToggleSwitch"}))),this.multipleDraws&&i("div",{class:"TicketDraws"},i("label",{class:"Label"},a("numberOfDraws",this.language),": "),i("div",{class:"NumberInput"},i("button",{onClick:()=>this.numberOfDraws>1?this.numberOfDraws--:this.numberOfDraws=1,class:"Minus"},"-"),i("input",{class:"InputDefault",min:"1",value:this.numberOfDraws,type:"number"}),i("button",{onClick:()=>this.numberOfDraws++,class:"Plus"},"+"))),i("label",{class:"Label"},a("wagerPerDraw",this.language),": "),i("div",{class:"WagerInput"},t.stakes.length>1?i("div",null,i("select",{class:"InputDefault",onChange:t=>this.changeStake(t)},t.stakes.map((t=>i("option",{value:t.amount},t.amount," ",t.currency))))):i("div",null,i("input",{min:"1",value:t.stakes[0].amount,type:"number",disabled:!0}),i("p",{class:"WagerInputTitle"},t.stakes[0].currency))))}}static get watchers(){return{numberOfDraws:["drawsChangeHandler"]}}};n.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:""}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;background-color:transparent;border:none;align-items:center;justify-content:center;height:20px;margin:0;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);width:30px;align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}';export{s as lottery_bullet,r as lottery_grid,n as lottery_ticket}
|
|
@@ -42,12 +42,6 @@ export declare class LotteryTicket {
|
|
|
42
42
|
private isLoading;
|
|
43
43
|
private hasErrors;
|
|
44
44
|
private ticketDone;
|
|
45
|
-
private isCustomSelect;
|
|
46
|
-
private amountInfo;
|
|
47
|
-
/**
|
|
48
|
-
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
49
|
-
*/
|
|
50
|
-
checkForClickOutside(ev: any): void;
|
|
51
45
|
/**
|
|
52
46
|
* @TODO including ts type
|
|
53
47
|
*/
|
|
@@ -62,8 +56,6 @@ export declare class LotteryTicket {
|
|
|
62
56
|
gridFilledHandler(event: CustomEvent<GridEvent>): void;
|
|
63
57
|
toggleAutoSelection(): void;
|
|
64
58
|
toggleResetSelection(): void;
|
|
65
|
-
changeStake(
|
|
66
|
-
toggleClass(): void;
|
|
67
|
-
setDropdownItem(item: any): void;
|
|
59
|
+
changeStake(event: any): void;
|
|
68
60
|
render(): any;
|
|
69
61
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const c=a(e,n),r=u(t,s),i=f(n);o.ael(c,l,r,i),(t.o=t.o||[]).push((()=>o.rel(c,l,r,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},a=(e,t)=>4&t?s:8&t?l:e,f=e=>0!=(2&e),h=new WeakMap,y=e=>"sc-"+e.h,$={},d=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!d(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?p(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=p(e,null);return i.m=t,c.length>0&&(i.p=c),i},p=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),b={},w=(e,t,n,s,c,r)=>{if(n!==s){let i=I(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=g(n),o=g(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=d(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},S=/\s/,g=e=>e?e.split(S):[],j=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||$,c=t.m||$;for(l in o)l in c||w(s,l,o[l],void 0,n,t.t);for(l in c)w(s,l,o[l],c[l],n,t.t)},v=(t,n,l)=>{let o,c,r=n.p[l],i=0;if(null!==r.$)o=r.g=s.createTextNode(r.$);else if(o=r.g=s.createElement(r.S),j(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.p)for(i=0;i<r.p.length;++i)c=v(t,r,i),c&&o.appendChild(c);return o},k=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=v(null,l,o),r&&(s[o].g=r,i.insertBefore(r,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},C=(e,t)=>e.S===t.S,O=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?(j(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:C(i,f)?(O(i,f),i=t[++o],f=l[++c]):C(u,h)?(O(u,h),u=t[--r],h=l[--a]):C(i,h)?(O(i,h),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],h=l[--a]):C(u,f)?(O(u,f),e.insertBefore(u.g,i.g),u=t[--r],f=l[++c]):(s=v(t&&t[c],n,c),f=l[++c],s&&i.g.parentNode.insertBefore(s,i.g));o>r?k(e,null==l[a+1]?null:l[a+1].g,n,l,c,a):c>a&&M(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),k(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=(e,t,n)=>{const l=(e=>B(e).j)(e);return{emit:e=>x(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},x=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},E=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return E(e,e.k),se((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null)),W(void 0,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,o=((e,t)=>{let n=y(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=h.get(e=e.head||e);o||h.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);F(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},F=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C||p(null,null),c=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,c.S=null,c.t|=4,n.C=c,c.g=o.g=s.shadowRoot||s,e=s["s-sc"],O(o,c)})(n,l)}catch(e){J(e,n.j)}return null},L=e=>{const t=e.j,n=e.k;64&e.t||(e.t|=64,q(t),e.O(t),n||R()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>N(e,!1))),e.t&=-517},R=()=>{q(s.documentElement),le((()=>x(l,"appload",{detail:{namespace:"lottery-ticket"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.P){e.watchers&&(t.N=e.watchers);const l=Object.entries(t.P),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>B(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=B(e),o=s.j,c=s.T.get(t),r=s.t,i=s.i;if(n=((e,t)=>null==e||d(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.P[t][0]),(!(8&r)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.T.set(t,n),i)){if(l.N&&128&r){const e=l.N[t];e&&e.map((e=>{try{i[e](n,c,t)}catch(e){J(e,o)}}))}2==(18&r)&&N(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},V=e=>{U(e,"connectedCallback")},_=(e,t={})=>{const n=[],c=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),h=s.createElement("style"),$=[];let d,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],P:t[2],A:t[3]};l.P=t[2],l.A=t[3],l.N={};const s=l.h,a=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=B(e),n=t.M,l=()=>{};if(1&t.t)i(e,t,n.A),V(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.k=n);break}}n.P&&Object.entries(n.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.N=s.watchers,H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,t.t|=128,e(),V(t.i)}if(s.style){let e=s.style;const t=y(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,c=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=B(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return B(this).F}};l.L=e[0],c.includes(s)||u.get(s)||(n.push(s),u.define(s,H(a,l,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),a.insertBefore(h,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>d=setTimeout(R,30)))},z=new WeakMap,B=e=>z.get(e),D=(e,t)=>z.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,M:t,T:new Map};return n.F=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.A),z.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>c().then(e),se=ee(Z,!0);export{_ as b,P as c,m as h,c as p,D as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-91b1278e.js";const s=class{constructor(i){t(this,i),this.bulletEvent=e(this,"lotteryBulletSelection",7),this.value="0",this.selectable=!0,this.isSelected=!1,this.select=()=>{this.selectable&&(this.isSelected=!this.isSelected,this.bulletEvent.emit({value:this.value,selected:this.isSelected}))}}render(){return i("div",{class:"Circle "+(this.selectable?"":"Disabled")+(this.isSelected?"Selected":""),onClick:()=>this.select()},this.value)}};s.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}';const r=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.totalNumbers=0,this.maximumAllowed=0,this.minimumAllowed=1,this.selectable=!0,this.selectedNumbers="",this.displaySelected=!1,this.language="en",this.numbers=[],this.selectedCounter=0}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):[...Array(this.totalNumbers).keys()].map((t=>(t+1).toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>e.number==t.detail.value?{number:e.number,selected:t.detail.selected,selectable:e.selectable}:{number:e.number,selected:e.selected,selectable:e.selectable})),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter==this.maximumAllowed&&(this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!!t.selected}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter==this.maximumAllowed&&(this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))})),this.selectedCounter-=1)}async resetSelectionHandler(t){t.detail&&t.detail==this.ticketId&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async autoSelectionHandler(t){if(t.detail&&t.detail==this.ticketId){this.resetSelectionHandler(t);let e=[...Array(this.totalNumbers).keys()].map((t=>t+1)).sort((()=>.5-Math.random()));e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.maximumAllowed}}render(){return i("div",{class:"GridContainer"},i("div",{class:"Grid"},this.numbers.map((t=>i("div",null,i("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected}))))))}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:25px}';const a=["ro","en"],o={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",grid:"Grid",multiplier:"Multiplier",numberOfDraws:"Number of draws",wagerPerDraw:"Wager per draw",resetButton:"Reset",autoButton:"I feel lucky"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",grid:"Grid",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"Ma simt norocos"}},l=(t,e)=>{const i=e;return o[void 0!==i&&a.includes(i)?i:"en"][t]},n=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.numberOfGrids=1,this.multipleDraws=!0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.multiplier=!1,this.numberOfDraws=1,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=!1,this.isCustomSelect=!1,this.amountInfo={}}checkForClickOutside(t){"SelectComponent"!==t.composedPath()[0].getAttribute("data-cluster")&&(this.isCustomSelect=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{this.isLoading=!1,this.gameData=t,this.grids=[...Array(t.rules.boards.length).keys()],this.amountInfo=this.gameData.rules.stakes[0]})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}multiplierChangeHandler(t){this.multiplier=!!t.target&&t.target.checked,this.multiplierChange.emit(this.multiplier)}drawsChangeHandler(t){this.ticket=Object.assign(Object.assign({},this.ticket),{draws:t}),this.ticketCompleted.emit(this.ticket)}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{draws:this.numberOfDraws}),this.ticketDone=!0,this.ticketCompleted.emit(this.ticket)}toggleAutoSelection(){this.ticketDone=!0,this.autoSelection.emit(this.ticketId)}toggleResetSelection(){this.ticketDone=!1,this.resetSelection.emit(this.ticketId)}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}setDropdownItem(t){this.amountInfo={amount:t.amount,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.amount)}render(){if(this.isLoading)return i("div",null,i("p",null,l("loading",this.language)));if(this.hasErrors)return i("div",null,i("p",null,l("error",this.language)));{const{rules:t}=this.gameData;return i("div",{class:"TicketContainer"},i("p",{class:"TicketTitle"},this.gameData.name),this.resetButton&&this.ticketDone&&i("div",{class:"ButtonContainer"},i("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection()},l("resetButton",this.language))),this.autoPick&&!this.ticketDone&&i("div",{class:"ButtonContainer"},i("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection()},l("autoButton",this.language))),this.grids.map(((e,s)=>i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},l("grid",this.language)," ",e),i("lottery-grid",{"grid-index":s,"maximum-allowed":t.boards[s].maximumAllowed,"minimum-allowed":t.boards[s].minimumAllowed,"total-numbers":t.boards[s].totalNumbers,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,language:this.language})))),t.multiplier&&i("div",null,i("label",{class:"Toggle"},i("label",{class:"Label"},l("multiplier",this.language),": "),i("input",{class:"ToggleCheckbox",type:"checkbox",onInput:t=>this.multiplierChangeHandler(t)}),i("div",{class:"ToggleSwitch"}))),this.multipleDraws&&i("div",{class:"TicketDraws"},i("label",{class:"Label"},l("numberOfDraws",this.language),": "),i("div",{class:"NumberInput"},i("button",{onClick:()=>this.numberOfDraws>1?this.numberOfDraws--:this.numberOfDraws=1,class:"Minus"},"-"),i("input",{class:"InputDefault",min:"1",value:this.numberOfDraws,type:"number"}),i("button",{onClick:()=>this.numberOfDraws++,class:"Plus"},"+"))),i("div",null,i("label",{class:"Label"},l("wagerPerDraw",this.language),": "),i("div",{class:"WagerInput"},t.stakes.length>1?i("div",{"data-cluster":"SelectComponent",class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{"data-cluster":"SelectComponent",class:"SelectButton",onClick:()=>this.toggleClass()},i("span",{"data-cluster":"SelectComponent"},this.amountInfo.amount," ",this.amountInfo.currency),i("span",{"data-cluster":"SelectComponent",class:"SelectExpand"},"▼")),i("div",{"data-cluster":"SelectComponent",class:"SelectContent"},i("ul",{"data-cluster":"SelectComponent",class:"SelectOptions"},t.stakes.map((t=>i("li",{"data-cluster":"SelectComponent",class:this.amountInfo.amount==t.amount?"SelectedValue":"",value:t.amount,onClick:()=>this.setDropdownItem(t)},t.amount," ",t.currency)))))):i("div",null,i("input",{min:"1",value:t.stakes[0].amount,type:"number",disabled:!0}),i("p",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{numberOfDraws:["drawsChangeHandler"]}}};n.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.ButtonContainer{display:flex;justify-content:flex-end}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:""}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:#FFF;background:#009993}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:#FFF;background:#009993}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid #ccc;border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid #ccc;overflow:hidden;background:#fff}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:#009993;color:#fff}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:#f2f2f2}';export{s as lottery_bullet,r as lottery_grid,n as lottery_ticket}
|