@everymatrix/lottery-draw-results 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-33a98fae.js → index-62f030ff.js} +73 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +374 -0
- package/dist/cjs/lottery-draw-results.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +14 -1
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.css +7 -18
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +56 -169
- package/dist/collection/utils/locale.utils.js +2 -14
- package/dist/components/lottery-bullet.js +6 -0
- package/dist/components/lottery-bullet2.js +56 -0
- package/dist/components/lottery-draw-results.js +59 -62
- package/dist/components/lottery-grid.js +6 -0
- package/dist/components/lottery-grid2.js +196 -0
- package/dist/esm/{index-c6e6b7f8.js → index-98326ddd.js} +73 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-bullet_3.entry.js +368 -0
- package/dist/esm/lottery-draw-results.js +2 -2
- package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
- package/dist/lottery-draw-results/p-2b8529f6.entry.js +1 -0
- package/dist/lottery-draw-results/p-bb429486.js +1 -0
- package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +3 -28
- package/dist/types/components.d.ts +2 -56
- package/package.json +1 -1
- package/dist/cjs/lottery-draw-results.cjs.entry.js +0 -188
- package/dist/esm/lottery-draw-results.entry.js +0 -184
- package/dist/lottery-draw-results/p-31e0953f.js +0 -1
- package/dist/lottery-draw-results/p-d7361a7b.entry.js +0 -1
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-98326ddd.js';
|
|
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}.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
|
+
|
|
5
|
+
const LotteryBullet = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
|
|
9
|
+
/**
|
|
10
|
+
* Value of the bullet
|
|
11
|
+
*/
|
|
12
|
+
this.value = '0';
|
|
13
|
+
/**
|
|
14
|
+
* Marks if the bullet should be selectable
|
|
15
|
+
*/
|
|
16
|
+
this.selectable = true;
|
|
17
|
+
/**
|
|
18
|
+
* Marks if the bullet should be selected
|
|
19
|
+
*/
|
|
20
|
+
this.isSelected = false;
|
|
21
|
+
this.select = () => {
|
|
22
|
+
if (this.selectable) {
|
|
23
|
+
this.isSelected = !this.isSelected;
|
|
24
|
+
this.bulletEvent.emit({
|
|
25
|
+
value: this.value,
|
|
26
|
+
selected: this.isSelected
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
LotteryBullet.style = lotteryBulletCss;
|
|
36
|
+
|
|
37
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
38
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
39
|
+
const TRANSLATIONS = {
|
|
40
|
+
en: {
|
|
41
|
+
drawResultsHeader: 'Last draw results',
|
|
42
|
+
drawId: 'Draw ID',
|
|
43
|
+
drawName: 'Game name',
|
|
44
|
+
drawDate: 'Draw Date',
|
|
45
|
+
drawNumbersGridDraw: 'Draw numbers Grid A',
|
|
46
|
+
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
47
|
+
ticketResult: 'Ticket result',
|
|
48
|
+
amountWon: 'Amount won',
|
|
49
|
+
numberOfDraws: 'Number of draws'
|
|
50
|
+
},
|
|
51
|
+
ro: {
|
|
52
|
+
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
53
|
+
drawId: 'Id extragere',
|
|
54
|
+
drawName: 'Numele jocului',
|
|
55
|
+
drawDate: 'Data extragerii',
|
|
56
|
+
drawNumbersGridDraw: 'Numerele extrase Grid A',
|
|
57
|
+
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
58
|
+
ticketResult: 'Rezultatul biletului',
|
|
59
|
+
amountWon: 'Suma castigata',
|
|
60
|
+
numberOfDraws: 'Numarul de extrageri'
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const translate = (key, customLang) => {
|
|
64
|
+
const lang = customLang;
|
|
65
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsSection{max-width:500px;margin:0 auto;margin:0px auto 10px;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0 20px}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;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%, #eee 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:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{width:100%;height:100%;max-height:100px;float:left;margin:0 0 20px 0;border:1px solid #009993;border-radius:4px;padding:10px;box-sizing:border-box;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
69
|
+
|
|
70
|
+
const DEFAULT_VALUES = {
|
|
71
|
+
gamename: 'Chrono',
|
|
72
|
+
gamedate: '24/09/2022',
|
|
73
|
+
state: 'Processing',
|
|
74
|
+
amount: 304444,
|
|
75
|
+
ticketid: '6963444',
|
|
76
|
+
selection: '[5, 6, 7, 8, 9]',
|
|
77
|
+
multiplier: 4.5,
|
|
78
|
+
resultstatus: 'Processing',
|
|
79
|
+
drawstatus: 'Won',
|
|
80
|
+
drawamount: 1022,
|
|
81
|
+
drawid: '54545555',
|
|
82
|
+
drawdate: '24/09/2032'
|
|
83
|
+
};
|
|
84
|
+
const LotteryDrawResults = class {
|
|
85
|
+
constructor(hostRef) {
|
|
86
|
+
registerInstance(this, hostRef);
|
|
87
|
+
/**
|
|
88
|
+
* Language of the widget
|
|
89
|
+
*/
|
|
90
|
+
this.language = 'en';
|
|
91
|
+
/**
|
|
92
|
+
* Shows only the last draw
|
|
93
|
+
*/
|
|
94
|
+
this.drawMode = false;
|
|
95
|
+
this.gameName = '';
|
|
96
|
+
this.multiplier = 5.434;
|
|
97
|
+
this.ticketData = {};
|
|
98
|
+
this.isLoading = true;
|
|
99
|
+
this.drawResults = [];
|
|
100
|
+
this.rules = {};
|
|
101
|
+
this.toggleDrawer = [false];
|
|
102
|
+
this.hasErrors = false;
|
|
103
|
+
this.errorText = '';
|
|
104
|
+
this.changeBox = (index) => {
|
|
105
|
+
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
106
|
+
if (itemIndex == index) {
|
|
107
|
+
return !item;
|
|
108
|
+
}
|
|
109
|
+
return item;
|
|
110
|
+
});
|
|
111
|
+
if (index >= this.toggleDrawer.length) {
|
|
112
|
+
this.toggleDrawer.push(true);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
connectedCallback() {
|
|
117
|
+
let promises = [];
|
|
118
|
+
promises.push(this.getGameData());
|
|
119
|
+
if (this.playerId) {
|
|
120
|
+
promises.push(this.getTicketData());
|
|
121
|
+
}
|
|
122
|
+
if (this.drawId) {
|
|
123
|
+
promises.push(this.getDrawData());
|
|
124
|
+
}
|
|
125
|
+
Promise.all(promises)
|
|
126
|
+
.then(() => {
|
|
127
|
+
this.isLoading = false;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
getDrawData() {
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
|
|
133
|
+
fetch(url.href)
|
|
134
|
+
.then((response) => {
|
|
135
|
+
// @TODO EXCEPTIONS
|
|
136
|
+
return response.json();
|
|
137
|
+
})
|
|
138
|
+
.then((data) => {
|
|
139
|
+
this.drawData = data;
|
|
140
|
+
resolve(true);
|
|
141
|
+
})
|
|
142
|
+
.catch((err) => {
|
|
143
|
+
reject(err);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
getGameData() {
|
|
148
|
+
return new Promise((resolve, reject) => {
|
|
149
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
150
|
+
fetch(url.href)
|
|
151
|
+
.then((response) => {
|
|
152
|
+
return response.json();
|
|
153
|
+
})
|
|
154
|
+
.then((data) => {
|
|
155
|
+
this.rules = {
|
|
156
|
+
maximumAllowed: data.rules.boards[0].maximumAllowed,
|
|
157
|
+
totalNumbers: data.rules.boards[0].totalNumbers
|
|
158
|
+
};
|
|
159
|
+
resolve(true);
|
|
160
|
+
})
|
|
161
|
+
.catch((err) => {
|
|
162
|
+
this.isLoading = false;
|
|
163
|
+
this.hasErrors = true;
|
|
164
|
+
this.errorText = err;
|
|
165
|
+
reject(err);
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
getTicketData() {
|
|
170
|
+
return new Promise((resolve, reject) => {
|
|
171
|
+
let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
|
|
172
|
+
fetch(url.href)
|
|
173
|
+
.then((response) => {
|
|
174
|
+
return response.json();
|
|
175
|
+
})
|
|
176
|
+
.then((data) => {
|
|
177
|
+
this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
|
|
178
|
+
this.drawResults = this.ticketData.drawResults.map((item) => item);
|
|
179
|
+
this.selection = this.ticketData.selection[0].join(',');
|
|
180
|
+
resolve(true);
|
|
181
|
+
})
|
|
182
|
+
.catch((err) => {
|
|
183
|
+
reject(err);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
render() {
|
|
188
|
+
var _a, _b, _c, _d, _e, _f;
|
|
189
|
+
if (this.isLoading) {
|
|
190
|
+
return (h("p", null, "Loading, please wait ..."));
|
|
191
|
+
}
|
|
192
|
+
else if (this.hasErrors) {
|
|
193
|
+
h("p", null, this.errorText);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
return (h("section", { class: "DrawResultsSection" }, !this.drawMode ?
|
|
197
|
+
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" }, "Ticket Purchase Date: ", h("span", null, (_a = this.ticketData) === null || _a === void 0 ? void 0 : _a.createdAt.slice(0, 10))), h("div", { class: "TicketStatus" }, "Status: ", h("span", null, (_b = this.ticketData) === null || _b === void 0 ? void 0 : _b.state))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, "Ticket id: ", h("span", null, (_c = this.ticketData) === null || _c === void 0 ? void 0 : _c.id))), h("div", { class: "TicketAmountContainer" }, h("p", null, "Ticket amount: ", h("span", null, (_d = this.ticketData) === null || _d === void 0 ? void 0 : _d.amount))), h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridTicket', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", h("span", null, JSON.stringify((_e = this.ticketData) === null || _e === void 0 ? void 0 : _e.multiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", (_f = this.ticketData) === null || _f === void 0 ? void 0 :
|
|
198
|
+
_f.drawCount), h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" }, h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", item.status)), item.state == 'won' &&
|
|
199
|
+
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", item.multiplier)))))))))
|
|
200
|
+
:
|
|
201
|
+
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
202
|
+
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", this.multiplier))))))));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
LotteryDrawResults.style = lotteryDrawResultsCss;
|
|
207
|
+
|
|
208
|
+
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}";
|
|
209
|
+
|
|
210
|
+
const LotteryGrid = class {
|
|
211
|
+
constructor(hostRef) {
|
|
212
|
+
registerInstance(this, hostRef);
|
|
213
|
+
this.gridFilledEvent = createEvent(this, "gridFilled", 7);
|
|
214
|
+
this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
|
|
215
|
+
/**
|
|
216
|
+
* Number of bullets of grid
|
|
217
|
+
*/
|
|
218
|
+
this.totalNumbers = 0;
|
|
219
|
+
/**
|
|
220
|
+
* Number of maximum bullets that can be selected
|
|
221
|
+
*/
|
|
222
|
+
this.maximumAllowed = 0;
|
|
223
|
+
/**
|
|
224
|
+
* Minimum allowed of bullets
|
|
225
|
+
*/
|
|
226
|
+
this.minimumAllowed = 1;
|
|
227
|
+
/**
|
|
228
|
+
* Allows the user to select numbers on the grid
|
|
229
|
+
*/
|
|
230
|
+
this.selectable = true;
|
|
231
|
+
/**
|
|
232
|
+
* Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
|
|
233
|
+
*/
|
|
234
|
+
this.selectedNumbers = '';
|
|
235
|
+
/**
|
|
236
|
+
* Show only selected numbers
|
|
237
|
+
*/
|
|
238
|
+
this.displaySelected = false;
|
|
239
|
+
/**
|
|
240
|
+
* Language
|
|
241
|
+
*/
|
|
242
|
+
this.language = 'en';
|
|
243
|
+
this.numbers = [];
|
|
244
|
+
this.selectedCounter = 0;
|
|
245
|
+
}
|
|
246
|
+
connectedCallback() {
|
|
247
|
+
let selected = [];
|
|
248
|
+
if (this.selectedNumbers.length > 0) {
|
|
249
|
+
selected = this.selectedNumbers.split(',');
|
|
250
|
+
this.selectedCounter = selected.length;
|
|
251
|
+
}
|
|
252
|
+
if (this.displaySelected) {
|
|
253
|
+
selected.forEach((item) => {
|
|
254
|
+
this.numbers.push({
|
|
255
|
+
number: item,
|
|
256
|
+
selected: true,
|
|
257
|
+
selectable: this.selectable
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
[...Array(this.totalNumbers).keys()]
|
|
263
|
+
.map(number => (number + 1).toString())
|
|
264
|
+
.forEach((number) => {
|
|
265
|
+
this.numbers.push({
|
|
266
|
+
number,
|
|
267
|
+
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
268
|
+
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
lotteryBulletSelectionHandler(event) {
|
|
274
|
+
this.numbers = this.numbers.map((item) => {
|
|
275
|
+
if (item.number == event.detail.value) {
|
|
276
|
+
return {
|
|
277
|
+
number: item.number,
|
|
278
|
+
selected: event.detail.selected,
|
|
279
|
+
selectable: item.selectable
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
number: item.number,
|
|
284
|
+
selected: item.selected,
|
|
285
|
+
selectable: item.selectable
|
|
286
|
+
};
|
|
287
|
+
});
|
|
288
|
+
if (event.detail.selected) {
|
|
289
|
+
this.selectedCounter += 1;
|
|
290
|
+
if (this.selectedCounter == this.maximumAllowed) {
|
|
291
|
+
this.numbers = this.numbers.map((item) => {
|
|
292
|
+
return {
|
|
293
|
+
number: item.number,
|
|
294
|
+
selected: item.selected,
|
|
295
|
+
selectable: item.selected ? true : false
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
this.gridFilledEvent.emit({
|
|
299
|
+
id: this.ticketId,
|
|
300
|
+
index: this.gridIndex,
|
|
301
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
if (this.selectedCounter == this.maximumAllowed) {
|
|
307
|
+
this.numbers = this.numbers.map((item) => {
|
|
308
|
+
return {
|
|
309
|
+
number: item.number,
|
|
310
|
+
selected: item.selected,
|
|
311
|
+
selectable: true
|
|
312
|
+
};
|
|
313
|
+
});
|
|
314
|
+
this.gridDirtyEvent.emit({
|
|
315
|
+
id: this.ticketId,
|
|
316
|
+
index: this.gridIndex,
|
|
317
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
this.selectedCounter -= 1;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
async resetSelectionHandler(event) {
|
|
324
|
+
if (event.detail && event.detail == this.ticketId) {
|
|
325
|
+
this.selectedCounter = 0;
|
|
326
|
+
this.numbers = this.numbers.map((item) => {
|
|
327
|
+
return {
|
|
328
|
+
number: item.number,
|
|
329
|
+
selected: false,
|
|
330
|
+
selectable: this.selectable
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
this.gridDirtyEvent.emit({
|
|
334
|
+
id: this.ticketId,
|
|
335
|
+
index: this.gridIndex,
|
|
336
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
async autoSelectionHandler(event) {
|
|
341
|
+
if (event.detail && event.detail == this.ticketId) {
|
|
342
|
+
this.resetSelectionHandler(event);
|
|
343
|
+
let array = [...Array(this.totalNumbers).keys()]
|
|
344
|
+
.map(number => number + 1)
|
|
345
|
+
.sort(() => 0.5 - Math.random());
|
|
346
|
+
array = array.slice(0, this.minimumAllowed);
|
|
347
|
+
this.numbers = this.numbers.map((item) => {
|
|
348
|
+
return {
|
|
349
|
+
number: item.number,
|
|
350
|
+
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
351
|
+
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
352
|
+
};
|
|
353
|
+
});
|
|
354
|
+
this.gridFilledEvent.emit({
|
|
355
|
+
id: this.ticketId,
|
|
356
|
+
index: this.gridIndex,
|
|
357
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
358
|
+
});
|
|
359
|
+
this.selectedCounter = this.maximumAllowed;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
render() {
|
|
363
|
+
return (h("div", { class: "GridContainer" }, h("div", { class: "Grid" }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected }))))));
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
LotteryGrid.style = lotteryGridCss;
|
|
367
|
+
|
|
368
|
+
export { LotteryBullet as lottery_bullet, LotteryDrawResults as lottery_draw_results, LotteryGrid as lottery_grid };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-98326ddd.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-
|
|
16
|
+
return bootstrapLazy([["lottery-bullet_3",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"multiplier":[32],"ticketData":[32],"isLoading":[32],"drawResults":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[32]}],[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
|
|
1
|
+
import{p as e,b as l}from"./p-bb429486.js";(()=>{const l=import.meta.url,t={};return""!==l&&(t.resourcesUrl=new URL(".",l).href),e(t)})().then((e=>l([["p-2b8529f6",[[1,"lottery-draw-results",{endpoint:[1],gameId:[1,"game-id"],language:[1],playerId:[1,"player-id"],drawMode:[4,"draw-mode"],drawId:[1,"draw-id"],gameName:[1,"game-name"],multiplier:[32],ticketData:[32],isLoading:[32],drawResults:[32],rules:[32],toggleDrawer:[32],hasErrors:[32],errorText:[32]}],[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
|
+
import{r as t,c as e,h as i}from"./p-bb429486.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 a=["ro","en"],l={en:{drawResultsHeader:"Last draw results",drawId:"Draw ID",drawName:"Game name",drawDate:"Draw Date",drawNumbersGridDraw:"Draw numbers Grid A",drawNumbersGridTicket:"Draw numbers Grid B",ticketResult:"Ticket result",amountWon:"Amount won",numberOfDraws:"Number of draws"},ro:{drawResultsHeader:"Ultimele rezultate extragere",drawId:"Id extragere",drawName:"Numele jocului",drawDate:"Data extragerii",drawNumbersGridDraw:"Numerele extrase Grid A",drawNumbersGridTicket:"Numerele extrase Grid B",ticketResult:"Rezultatul biletului",amountWon:"Suma castigata",numberOfDraws:"Numarul de extrageri"}},r=(t,e)=>{const i=e;return l[void 0!==i&&a.includes(i)?i:"en"][t]},o={gamename:"Chrono",gamedate:"24/09/2022",state:"Processing",amount:304444,ticketid:"6963444",selection:"[5, 6, 7, 8, 9]",multiplier:4.5,resultstatus:"Processing",drawstatus:"Won",drawamount:1022,drawid:"54545555",drawdate:"24/09/2032"},d=class{constructor(e){t(this,e),this.language="en",this.drawMode=!1,this.gameName="",this.multiplier=5.434,this.ticketData={},this.isLoading=!0,this.drawResults=[],this.rules={},this.toggleDrawer=[!1],this.hasErrors=!1,this.errorText="",this.changeBox=t=>{this.toggleDrawer=this.toggleDrawer.map(((e,i)=>i==t?!e:e)),t>=this.toggleDrawer.length&&this.toggleDrawer.push(!0)}}connectedCallback(){let t=[];t.push(this.getGameData()),this.playerId&&t.push(this.getTicketData()),this.drawId&&t.push(this.getDrawData()),Promise.all(t).then((()=>{this.isLoading=!1}))}getDrawData(){return new Promise(((t,e)=>{let i=new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);fetch(i.href).then((t=>t.json())).then((e=>{this.drawData=e,t(!0)})).catch((t=>{e(t)}))}))}getGameData(){return new Promise(((t,e)=>{let i=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(i.href).then((t=>t.json())).then((e=>{this.rules={maximumAllowed:e.rules.boards[0].maximumAllowed,totalNumbers:e.rules.boards[0].totalNumbers},t(!0)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,this.errorText=t,e(t)}))}))}getTicketData(){return new Promise(((t,e)=>{let i=new URL(`${this.endpoint}/tickets/player/${this.playerId}`);fetch(i.href).then((t=>t.json())).then((e=>{this.ticketData=0===e.length?o:e[1],this.drawResults=this.ticketData.drawResults.map((t=>t)),this.selection=this.ticketData.selection[0].join(","),t(!0)})).catch((t=>{e(t)}))}))}render(){var t,e,s,a,l,o;return this.isLoading?i("p",null,"Loading, please wait ..."):this.hasErrors?void i("p",null,this.errorText):i("section",{class:"DrawResultsSection"},this.drawMode?i("div",{class:"DrawResultsArea"},this.drawData&&i("div",null,i("div",{class:"DrawResultsHeader"},i("span",null,r("drawId",this.language),": ",this.drawData.id),i("span",null,r("drawDate",this.language),": ",this.drawData.date.slice(0,10))),i("div",{class:"DrawResultsBody"},i("div",{class:"DrawNumbersGrid"},i("p",null,r("drawNumbersGridDraw",this.language),":"),i("div",{class:"BulletContainer"},i("lottery-grid",{"maximum-allowed":this.rules.maximumAllowed,"total-numbers":this.rules.totalNumbers,selectedNumbers:this.drawData.winningNumbers.join(","),"display-selected":!0,selectable:!1,language:this.language})),i("div",{class:"DrawMultipler"},i("label",{class:"Label"},"Multiplier: ",this.multiplier)))))):i("div",{class:"DrawResultsArea"},i("div",{class:"TicketInfo"},i("div",{class:"TicketGameName"},r("drawName",this.language),": ",i("span",null,this.gameName)),i("div",{class:"TicketDate"},"Ticket Purchase Date: ",i("span",null,null===(t=this.ticketData)||void 0===t?void 0:t.createdAt.slice(0,10))),i("div",{class:"TicketStatus"},"Status: ",i("span",null,null===(e=this.ticketData)||void 0===e?void 0:e.state))),i("div",{class:"DrawResultsBody"},i("div",{class:"TicketIdContainer"},i("p",null,"Ticket id: ",i("span",null,null===(s=this.ticketData)||void 0===s?void 0:s.id))),i("div",{class:"TicketAmountContainer"},i("p",null,"Ticket amount: ",i("span",null,null===(a=this.ticketData)||void 0===a?void 0:a.amount))),i("div",{class:"DrawNumbersGrid"},i("p",null,r("drawNumbersGridTicket",this.language),":"),i("div",{class:"BulletContainer"},i("lottery-grid",{"maximum-allowed":this.rules.maximumAllowed,"total-numbers":this.rules.totalNumbers,"selected-numbers":this.selection,selectable:!1,"display-selected":!0,language:this.language}))),i("div",{class:"DrawMultipler"},i("label",{class:"Label"},"Multiplier: ",i("span",null,JSON.stringify(null===(l=this.ticketData)||void 0===l?void 0:l.multiplier)))),i("div",{class:"NumberOfDrawsContainer"},i("p",null,r("numberOfDraws",this.language),": ",null===(o=this.ticketData)||void 0===o?void 0:o.drawCount),i("div",{class:"DrawTicketsContainer"},this.drawResults.map(((t,e)=>i("div",{class:"ExpandableBoxes"},i("div",{class:this.toggleDrawer[e]?"ExpandableBox ShowBox":"ExpandableBox",onClick:()=>this.changeBox(e)},i("div",{class:"TicketResultContainer"},i("p",null,r("ticketResult",this.language),": ",t.status)),"won"==t.state&&i("div",{class:"AmountWonContainer"},i("p",null,r("amountWon",this.language),": ",Number(t.amount).toLocaleString("en")," ",t.currency)),i("div",{class:"DrawIdContainer"},i("p",null,r("drawId",this.language),": ",t.drawId)),i("div",{class:"DrawDateContainer"},i("p",null,r("drawDate",this.language),": ",t.updatedAt.slice(0,10)," | ",t.updatedAt.slice(11,19))),i("div",{class:"DrawNumbersGrid"}),i("div",{class:"DrawMultipler"},i("label",{class:"Label"},"Multiplier: ",t.multiplier)))))))))))}};d.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsSection{max-width:500px;margin:0 auto;margin:0px auto 10px;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0 20px}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;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%, #eee 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:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{width:100%;height:100%;max-height:100px;float:left;margin:0 0 20px 0;border:1px solid #009993;border-radius:4px;padding:10px;box-sizing:border-box;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}';const n=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}))))))}};n.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}';export{s as lottery_bullet,d as lottery_draw_results,n as lottery_grid}
|
|
@@ -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)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const r=a(e,n),c=u(t,s),i=f(n);o.ael(r,l,c,i),(t.o=t.o||[]).push((()=>o.rel(r,l,c,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),d=new WeakMap,h=e=>"sc-"+e.h,$={},y=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!y(l))&&(l+=""),s&&o?r[r.length-1].$+=l:r.push(s?p(null,l):l),o=s)};if(c(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,r.length>0&&(i.p=r),i},p=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),b={},w=(e,t,n,s,r,c)=>{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=y(s);if((i||l&&null!==s)&&!r)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&c||r)&&!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||$,r=t.m||$;for(l in o)l in r||w(s,l,o[l],void 0,n,t.t);for(l in r)w(s,l,o[l],r[l],n,t.t)},v=(t,n,l)=>{let o,r,c=n.p[l],i=0;if(null!==c.$)o=c.g=s.createTextNode(c.$);else if(o=c.g=s.createElement(c.S),j(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(i=0;i<c.p.length;++i)r=v(t,c,i),r&&o.appendChild(r);return o},M=(e,n,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=v(null,l,o),c&&(s[o].g=c,i.insertBefore(c,n)))},k=(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,r=0,c=t.length-1,i=t[0],u=t[c],a=l.length-1,f=l[0],d=l[a];for(;o<=c&&r<=a;)null==i?i=t[++o]:null==u?u=t[--c]:null==f?f=l[++r]:null==d?d=l[--a]:C(i,f)?(O(i,f),i=t[++o],f=l[++r]):C(u,d)?(O(u,d),u=t[--c],d=l[--a]):C(i,d)?(O(i,d),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],d=l[--a]):C(u,f)?(O(u,f),e.insertBefore(u.g,i.g),u=t[--c],f=l[++r]):(s=v(t&&t[r],n,r),f=l[++r],s&&i.g.parentNode.insertBefore(s,i.g));o>c?M(e,null==l[a+1]?null:l[a+1].g,n,l,r,a):r>a&&k(t,o,c)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),M(n,null,t,s,0,s.length-1)):null!==l&&k(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.M),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.k,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=d.get(e=e.head||e);o||d.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),r=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,r.S=null,r.t|=4,n.C=r,r.g=o.g=s.shadowRoot||s,e=s["s-sc"],O(o,r)})(n,l)}catch(e){J(e,n.j)}return null},L=e=>{const t=e.j,n=e.M;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-draw-results"}})))},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){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).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=B(e),o=s.N.get(t),r=s.t,c=s.i;n=((e,t)=>null==e||y(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!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.N.set(t,n),c&&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=[],r=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let y,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],T:t[3]};l.P=t[2],l.T=t[3];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=B(e),n=t.k,l=()=>{};if(1&t.t)i(e,t,n.T),V(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.M=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||(H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,e(),V(t.i)}if(s.style){let e=s.style;const t=h(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,r=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(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).A}};l.F=e[0],r.includes(s)||u.get(s)||(n.push(s),u.define(s,H(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>y=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,k:t,N:new Map};return n.A=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.T),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.F,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=>r().then(e),se=ee(Z,!0);export{_ as b,P as c,m as h,r as p,D as r}
|
|
@@ -21,38 +21,12 @@ export declare class LotteryDrawResults {
|
|
|
21
21
|
*/
|
|
22
22
|
drawMode: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Shows results for a specific drawID (option)
|
|
25
25
|
*/
|
|
26
26
|
drawId: string;
|
|
27
|
-
/**
|
|
28
|
-
* The game name
|
|
29
|
-
*/
|
|
30
27
|
gameName: string;
|
|
31
|
-
/**
|
|
32
|
-
* The ticket submission date
|
|
33
|
-
*/
|
|
34
|
-
ticketDate: string;
|
|
35
|
-
/**
|
|
36
|
-
* The ticket status
|
|
37
|
-
*/
|
|
38
|
-
ticketStatus: string;
|
|
39
|
-
/**
|
|
40
|
-
* The ticket id
|
|
41
|
-
*/
|
|
42
|
-
ticketId: string;
|
|
43
|
-
/**
|
|
44
|
-
* The ticket amount
|
|
45
|
-
*/
|
|
46
|
-
ticketAmount: string;
|
|
47
|
-
/**
|
|
48
|
-
* The ticket multiplier
|
|
49
|
-
*/
|
|
50
|
-
ticketMultiplier: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* The ticket draw count
|
|
53
|
-
*/
|
|
54
|
-
ticketDrawCount: number;
|
|
55
28
|
multiplier: number;
|
|
29
|
+
ticketData: any;
|
|
56
30
|
isLoading: boolean;
|
|
57
31
|
drawResults: any;
|
|
58
32
|
private rules;
|
|
@@ -65,5 +39,6 @@ export declare class LotteryDrawResults {
|
|
|
65
39
|
getDrawData(): Promise<boolean>;
|
|
66
40
|
getGameData(): Promise<boolean>;
|
|
67
41
|
changeBox: (index: number) => void;
|
|
42
|
+
getTicketData(): Promise<boolean>;
|
|
68
43
|
render(): any;
|
|
69
44
|
}
|
|
@@ -8,7 +8,7 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface LotteryDrawResults {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Shows results for a specific drawID (option)
|
|
12
12
|
*/
|
|
13
13
|
"drawId": string;
|
|
14
14
|
/**
|
|
@@ -23,9 +23,6 @@ export namespace Components {
|
|
|
23
23
|
* GameID of the lottery game
|
|
24
24
|
*/
|
|
25
25
|
"gameId": string;
|
|
26
|
-
/**
|
|
27
|
-
* The game name
|
|
28
|
-
*/
|
|
29
26
|
"gameName": string;
|
|
30
27
|
/**
|
|
31
28
|
* Language of the widget
|
|
@@ -35,30 +32,6 @@ export namespace Components {
|
|
|
35
32
|
* Player ID
|
|
36
33
|
*/
|
|
37
34
|
"playerId": string;
|
|
38
|
-
/**
|
|
39
|
-
* The ticket amount
|
|
40
|
-
*/
|
|
41
|
-
"ticketAmount": string;
|
|
42
|
-
/**
|
|
43
|
-
* The ticket submission date
|
|
44
|
-
*/
|
|
45
|
-
"ticketDate": string;
|
|
46
|
-
/**
|
|
47
|
-
* The ticket draw count
|
|
48
|
-
*/
|
|
49
|
-
"ticketDrawCount": number;
|
|
50
|
-
/**
|
|
51
|
-
* The ticket id
|
|
52
|
-
*/
|
|
53
|
-
"ticketId": string;
|
|
54
|
-
/**
|
|
55
|
-
* The ticket multiplier
|
|
56
|
-
*/
|
|
57
|
-
"ticketMultiplier": boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The ticket status
|
|
60
|
-
*/
|
|
61
|
-
"ticketStatus": string;
|
|
62
35
|
}
|
|
63
36
|
}
|
|
64
37
|
declare global {
|
|
@@ -75,7 +48,7 @@ declare global {
|
|
|
75
48
|
declare namespace LocalJSX {
|
|
76
49
|
interface LotteryDrawResults {
|
|
77
50
|
/**
|
|
78
|
-
*
|
|
51
|
+
* Shows results for a specific drawID (option)
|
|
79
52
|
*/
|
|
80
53
|
"drawId"?: string;
|
|
81
54
|
/**
|
|
@@ -90,9 +63,6 @@ declare namespace LocalJSX {
|
|
|
90
63
|
* GameID of the lottery game
|
|
91
64
|
*/
|
|
92
65
|
"gameId"?: string;
|
|
93
|
-
/**
|
|
94
|
-
* The game name
|
|
95
|
-
*/
|
|
96
66
|
"gameName"?: string;
|
|
97
67
|
/**
|
|
98
68
|
* Language of the widget
|
|
@@ -102,30 +72,6 @@ declare namespace LocalJSX {
|
|
|
102
72
|
* Player ID
|
|
103
73
|
*/
|
|
104
74
|
"playerId"?: string;
|
|
105
|
-
/**
|
|
106
|
-
* The ticket amount
|
|
107
|
-
*/
|
|
108
|
-
"ticketAmount"?: string;
|
|
109
|
-
/**
|
|
110
|
-
* The ticket submission date
|
|
111
|
-
*/
|
|
112
|
-
"ticketDate"?: string;
|
|
113
|
-
/**
|
|
114
|
-
* The ticket draw count
|
|
115
|
-
*/
|
|
116
|
-
"ticketDrawCount"?: number;
|
|
117
|
-
/**
|
|
118
|
-
* The ticket id
|
|
119
|
-
*/
|
|
120
|
-
"ticketId"?: string;
|
|
121
|
-
/**
|
|
122
|
-
* The ticket multiplier
|
|
123
|
-
*/
|
|
124
|
-
"ticketMultiplier"?: boolean;
|
|
125
|
-
/**
|
|
126
|
-
* The ticket status
|
|
127
|
-
*/
|
|
128
|
-
"ticketStatus"?: string;
|
|
129
75
|
}
|
|
130
76
|
interface IntrinsicElements {
|
|
131
77
|
"lottery-draw-results": LotteryDrawResults;
|