@everymatrix/lottery-game-page 0.0.7 → 0.0.10
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/helper-accordion_13.cjs.entry.js +23492 -0
- package/dist/cjs/helper-pagination.cjs.entry.js +188 -0
- package/dist/cjs/{index-af6d701d.js → index-81cb3b3b.js} +70 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-game-page.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +75 -1
- package/dist/components/helper-accordion.js +6 -0
- package/dist/components/helper-accordion2.js +110 -0
- package/dist/components/helper-filters.js +6 -0
- package/dist/components/helper-filters2.js +22347 -0
- package/dist/components/helper-modal.js +6 -0
- package/dist/components/helper-modal2.js +58 -0
- package/dist/components/helper-pagination.js +215 -0
- package/dist/components/helper-tab.js +6 -0
- package/dist/components/helper-tab2.js +47 -0
- package/dist/components/helper-tabs.js +6 -0
- package/dist/components/helper-tabs2.js +62 -0
- package/dist/components/index.js +13 -0
- package/dist/components/lottery-bullet.js +6 -0
- package/dist/components/lottery-bullet2.js +56 -0
- package/dist/components/lottery-draw-results-history.js +6 -0
- package/dist/components/lottery-draw-results-history2.js +174 -0
- package/dist/components/lottery-draw-results.js +6 -0
- package/dist/components/lottery-draw-results2.js +217 -0
- package/dist/components/lottery-game-details.js +6 -0
- package/dist/components/lottery-game-details2.js +48 -0
- package/dist/components/lottery-game-page.js +73 -6
- package/dist/components/lottery-grid.js +6 -0
- package/dist/components/lottery-grid2.js +196 -0
- package/dist/components/lottery-ticket-controller.js +6 -0
- package/dist/components/lottery-ticket-controller2.js +117 -0
- package/dist/components/lottery-ticket.js +6 -0
- package/dist/components/lottery-ticket2.js +183 -0
- package/dist/esm/helper-accordion_13.entry.js +23476 -0
- package/dist/esm/helper-pagination.entry.js +184 -0
- package/dist/esm/{index-8c700c5e.js → index-be84da79.js} +70 -3
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-game-page.js +2 -2
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-08581ede.entry.js +1 -0
- package/dist/lottery-game-page/p-49bd2864.entry.js +2849 -0
- package/dist/lottery-game-page/p-91420518.js +2 -0
- package/dist/stencil.config.js +6 -0
- package/package.json +1 -1
- package/dist/cjs/lottery-game-page.cjs.entry.js +0 -304
- package/dist/esm/lottery-game-page.entry.js +0 -300
- package/dist/lottery-game-page/p-453db7fa.entry.js +0 -1
- package/dist/lottery-game-page/p-b5969eab.js +0 -2
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-8c700c5e.js';
|
|
2
|
-
import '@everymatrix/lottery-ticket-controller';
|
|
3
|
-
import '@everymatrix/helper-modal';
|
|
4
|
-
import '@everymatrix/lottery-game-details';
|
|
5
|
-
import '@everymatrix/lottery-draw-results-history';
|
|
6
|
-
import '@everymatrix/lottery-draw-results';
|
|
7
|
-
|
|
8
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
9
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
10
|
-
const TRANSLATIONS = {
|
|
11
|
-
en: {
|
|
12
|
-
error: 'Error',
|
|
13
|
-
title: 'Chrono',
|
|
14
|
-
backButton: 'Back',
|
|
15
|
-
lobbyButton: 'Lobby',
|
|
16
|
-
prize: 'Prize',
|
|
17
|
-
winUpTo: 'Win up to',
|
|
18
|
-
nextDraw: 'Next draw in: ',
|
|
19
|
-
buy: 'Buy tickets',
|
|
20
|
-
viewLatest: 'View latest results',
|
|
21
|
-
createTicket: 'Create Ticket',
|
|
22
|
-
modalSuccess: 'Purchase will be successfull soon!',
|
|
23
|
-
deleteTicketModalTitle: 'Delete Ticket',
|
|
24
|
-
deleteTicketModalText: 'Are you sure you want to delete this ticket?',
|
|
25
|
-
deleteTicketModalCancel: 'Cancel',
|
|
26
|
-
deleteTicketModalConfirm: 'Delete',
|
|
27
|
-
orderSummaryTitle: 'Order Summary',
|
|
28
|
-
orderSummaryTickets: 'Ticket',
|
|
29
|
-
orderSummaryTotal: 'Total',
|
|
30
|
-
orderSummarySubmit: 'Submit'
|
|
31
|
-
},
|
|
32
|
-
ro: {
|
|
33
|
-
error: 'Eroare',
|
|
34
|
-
title: 'Loto 6/49',
|
|
35
|
-
backButton: 'Inapoi',
|
|
36
|
-
lobbyButton: 'Lobby',
|
|
37
|
-
prize: 'MARELE JACKPOT OMG',
|
|
38
|
-
winUpTo: 'Castiga pana la',
|
|
39
|
-
nextDraw: 'In cat timp devii milionar daca cumperi acum!!!',
|
|
40
|
-
buy: 'Cumpara bilet',
|
|
41
|
-
viewLatest: 'Ultimile extrageri',
|
|
42
|
-
createTicket: 'Creeaza bilet',
|
|
43
|
-
modalSuccess: 'Achiziția va avea succes în curând!',
|
|
44
|
-
deleteTicketModalTitle: 'Sterge biletul',
|
|
45
|
-
deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
|
|
46
|
-
deleteTicketModalCancel: 'Anuleaza',
|
|
47
|
-
deleteTicketModalConfirm: 'Sterge',
|
|
48
|
-
orderSummaryTitle: 'Rezumat comanda',
|
|
49
|
-
orderSummaryTickets: 'Bilet',
|
|
50
|
-
orderSummaryTotal: 'Total',
|
|
51
|
-
orderSummarySubmit: 'Trimite'
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
const translate = (key, customLang) => {
|
|
55
|
-
const lang = customLang;
|
|
56
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#00958f;font-size:18px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px}.GamePage .TotalWinnings span{font-size:22px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:capitalize;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#F1F1F1;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{background:#00958f;color:#FFF}.NextDrawWrapper{padding:10px 15px;background:#fff}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:10px 15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px;border-bottom:1px solid #e9e9e9}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}";
|
|
60
|
-
|
|
61
|
-
const LotteryGamePage = class {
|
|
62
|
-
constructor(hostRef) {
|
|
63
|
-
registerInstance(this, hostRef);
|
|
64
|
-
/**
|
|
65
|
-
* Language of the widget
|
|
66
|
-
*/
|
|
67
|
-
this.language = 'en';
|
|
68
|
-
/**
|
|
69
|
-
* Shows the auto-pick button
|
|
70
|
-
*/
|
|
71
|
-
this.autoPick = false;
|
|
72
|
-
/**
|
|
73
|
-
* Shows the reset button
|
|
74
|
-
*/
|
|
75
|
-
this.resetButton = false;
|
|
76
|
-
this.tickets = [];
|
|
77
|
-
this.tabIndex = 0;
|
|
78
|
-
this.hasErrors = false;
|
|
79
|
-
this.totalAmount = 0;
|
|
80
|
-
this.successVisible = false;
|
|
81
|
-
this.deleteVisible = false;
|
|
82
|
-
this.latestDraw = {};
|
|
83
|
-
this.totalWinningsAmount = 0;
|
|
84
|
-
this.multiplier = false;
|
|
85
|
-
this.quickPick = false;
|
|
86
|
-
}
|
|
87
|
-
// @TODO fix `any` type later, I'm lazy now
|
|
88
|
-
connectedCallback() {
|
|
89
|
-
this.getGameDetails();
|
|
90
|
-
this.getDraws();
|
|
91
|
-
}
|
|
92
|
-
countdownLogic(date) {
|
|
93
|
-
this.interval = setInterval(() => {
|
|
94
|
-
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
95
|
-
this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
|
|
96
|
-
this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
|
|
97
|
-
this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
|
|
98
|
-
}, 1000);
|
|
99
|
-
}
|
|
100
|
-
disconnectedCallback() {
|
|
101
|
-
clearInterval(this.interval);
|
|
102
|
-
}
|
|
103
|
-
getGameDetails() {
|
|
104
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
105
|
-
fetch(url.href)
|
|
106
|
-
.then((res) => {
|
|
107
|
-
if (res.status >= 300) {
|
|
108
|
-
this.hasErrors = true;
|
|
109
|
-
throw new Error('There was an error while fetching the data');
|
|
110
|
-
}
|
|
111
|
-
return res.json();
|
|
112
|
-
})
|
|
113
|
-
.then((data) => {
|
|
114
|
-
this.gameData = data;
|
|
115
|
-
this.basicStake = this.gameData.rules.stakes[0].amount;
|
|
116
|
-
let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
|
|
117
|
-
console.log('draws', draws);
|
|
118
|
-
this.nextDraw = draws[0].id;
|
|
119
|
-
this.createNewTicket();
|
|
120
|
-
})
|
|
121
|
-
.catch((err) => {
|
|
122
|
-
this.hasErrors = true;
|
|
123
|
-
console.log('Error', err);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
calculateTotalAmount() {
|
|
127
|
-
const { currency } = this.gameData.rules.stakes[0];
|
|
128
|
-
this.totalAmount = 0;
|
|
129
|
-
this.tickets.forEach((item) => {
|
|
130
|
-
if (item.completed) {
|
|
131
|
-
this.totalAmount += item.amount * item.stake;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
this.currency = currency;
|
|
135
|
-
}
|
|
136
|
-
// @TODO CustomEvent type
|
|
137
|
-
gridFilledHandler(event) {
|
|
138
|
-
// @TODO item ts
|
|
139
|
-
this.tickets = this.tickets.map((item) => {
|
|
140
|
-
if (item.ticketId == event.detail.id) {
|
|
141
|
-
let arr = item.selectedNumbers || [];
|
|
142
|
-
arr[event.detail.index] = event.detail.selectedNumbers.map((item) => parseInt(item, 10));
|
|
143
|
-
return {
|
|
144
|
-
gameId: item.gameId,
|
|
145
|
-
ticketId: item.ticketId,
|
|
146
|
-
completed: true,
|
|
147
|
-
amount: event.detail.draws,
|
|
148
|
-
stake: item.stake,
|
|
149
|
-
selectedNumbers: arr
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
return item;
|
|
153
|
-
});
|
|
154
|
-
this.calculateTotalAmount();
|
|
155
|
-
}
|
|
156
|
-
// @TODO fix any type
|
|
157
|
-
gridDirtyHandler(event) {
|
|
158
|
-
// @TODO item ts
|
|
159
|
-
this.tickets = this.tickets.map((item) => {
|
|
160
|
-
if (item.gameId == event.detail.id) {
|
|
161
|
-
return {
|
|
162
|
-
gameId: item.gameId,
|
|
163
|
-
ticketId: item.ticketId,
|
|
164
|
-
completed: false,
|
|
165
|
-
amount: item.amount,
|
|
166
|
-
stake: item.stake,
|
|
167
|
-
grids: []
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
return item;
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
// @TODO CustomEvent type
|
|
174
|
-
deleteTicketHandler(event) {
|
|
175
|
-
this.deleteVisible = true;
|
|
176
|
-
this.deleteEventData = event;
|
|
177
|
-
}
|
|
178
|
-
modalCloseEvent() {
|
|
179
|
-
this.deleteVisible = false;
|
|
180
|
-
}
|
|
181
|
-
stakeChangeHandler(event) {
|
|
182
|
-
const { ticketId, stake } = event.detail;
|
|
183
|
-
this.tickets[ticketId - 1].stake = stake;
|
|
184
|
-
this.calculateTotalAmount();
|
|
185
|
-
}
|
|
186
|
-
multiplierChangeHandler(event) {
|
|
187
|
-
this.multiplier = event.detail;
|
|
188
|
-
}
|
|
189
|
-
getDraws() {
|
|
190
|
-
// append from query param with the current date value in order to get the next draw
|
|
191
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
|
|
192
|
-
let drawOptions = {
|
|
193
|
-
method: "GET",
|
|
194
|
-
headers: {
|
|
195
|
-
'Content-Type': "application/json",
|
|
196
|
-
'Accept': 'application/json',
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
fetch(url.href, drawOptions)
|
|
200
|
-
.then((response) => {
|
|
201
|
-
return response.json();
|
|
202
|
-
})
|
|
203
|
-
.then((data) => {
|
|
204
|
-
var _a;
|
|
205
|
-
let upcoming = data.items.filter((item) => {
|
|
206
|
-
if (Date.parse(item.date) > new Date().getTime()) {
|
|
207
|
-
return !item.winningNumbers;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
let past = data.items.filter((item) => item.winningNumbers);
|
|
211
|
-
this.latestDraw = upcoming[0];
|
|
212
|
-
this.nextDate = this.latestDraw.date;
|
|
213
|
-
this.countdownLogic(this.nextDate);
|
|
214
|
-
this.lastDrawId = past[past.length - 1].id;
|
|
215
|
-
// calculate total winnings
|
|
216
|
-
// @TODO fix any type
|
|
217
|
-
(_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.prizes.forEach((element) => {
|
|
218
|
-
this.totalWinningsAmount += JSON.parse(element.amount);
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
;
|
|
223
|
-
// @TODO fix any type
|
|
224
|
-
confirmDeleteTicketHandler(event) {
|
|
225
|
-
// @TODO fix any type
|
|
226
|
-
this.tickets = this.tickets.filter((item) => {
|
|
227
|
-
if (item.ticketId == event.detail.ticketId) {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
return true;
|
|
231
|
-
});
|
|
232
|
-
this.calculateTotalAmount();
|
|
233
|
-
this.deleteVisible = false;
|
|
234
|
-
}
|
|
235
|
-
createNewTicket() {
|
|
236
|
-
this.tickets = [
|
|
237
|
-
...this.tickets,
|
|
238
|
-
{ gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
|
|
239
|
-
];
|
|
240
|
-
}
|
|
241
|
-
submitTickets() {
|
|
242
|
-
let url = new URL(`${this.endpoint}/tickets`);
|
|
243
|
-
// @TODO Body TS type
|
|
244
|
-
let body = {
|
|
245
|
-
gameId: this.gameId,
|
|
246
|
-
tickets: []
|
|
247
|
-
};
|
|
248
|
-
console.log('body', body);
|
|
249
|
-
this.tickets.forEach((item) => {
|
|
250
|
-
body.tickets.push({
|
|
251
|
-
startingDrawId: this.nextDraw,
|
|
252
|
-
amount: item.stake,
|
|
253
|
-
gameId: this.gameId,
|
|
254
|
-
currency: this.currency,
|
|
255
|
-
selection: item.selectedNumbers,
|
|
256
|
-
multiplier: this.multiplier,
|
|
257
|
-
drawCount: item.amount,
|
|
258
|
-
quickPick: this.quickPick,
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
// @TODO Options TS type
|
|
262
|
-
let options = {
|
|
263
|
-
method: 'POST',
|
|
264
|
-
headers: {
|
|
265
|
-
'Content-Type': 'application/json',
|
|
266
|
-
'Accept': 'application/json',
|
|
267
|
-
'Authorization': `Bearer ${this.sessionId}`
|
|
268
|
-
},
|
|
269
|
-
body: JSON.stringify(body)
|
|
270
|
-
};
|
|
271
|
-
fetch(url.href, options)
|
|
272
|
-
.then((res) => {
|
|
273
|
-
if (res.status > 300) {
|
|
274
|
-
throw new Error('err');
|
|
275
|
-
}
|
|
276
|
-
return res.json();
|
|
277
|
-
})
|
|
278
|
-
.then((data) => {
|
|
279
|
-
console.log('data', data);
|
|
280
|
-
});
|
|
281
|
-
this.successVisible = true;
|
|
282
|
-
}
|
|
283
|
-
render() {
|
|
284
|
-
// const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
|
|
285
|
-
// const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
|
|
286
|
-
if (this.hasErrors) {
|
|
287
|
-
return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate('error', this.language))));
|
|
288
|
-
}
|
|
289
|
-
return (
|
|
290
|
-
/* Game details */
|
|
291
|
-
h("div", { class: "GamePage" }, h("div", { class: "GridBanner" }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
292
|
-
h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", null)), h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language))))), this.tabIndex == 1 &&
|
|
293
|
-
h("div", null, h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
|
|
294
|
-
}
|
|
295
|
-
static get assetsDirs() { return ["static"]; }
|
|
296
|
-
get element() { return getElement(this); }
|
|
297
|
-
};
|
|
298
|
-
LotteryGamePage.style = lotteryGamePageCss;
|
|
299
|
-
|
|
300
|
-
export { LotteryGamePage as lottery_game_page };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,g as i}from"./p-b5969eab.js";import"@everymatrix/lottery-ticket-controller";import"@everymatrix/helper-modal";import"@everymatrix/lottery-game-details";import"@everymatrix/lottery-draw-results-history";import"@everymatrix/lottery-draw-results";const a=["ro","en"],r={en:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase will be successfull soon!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit"},ro:{error:"Eroare",title:"Loto 6/49",backButton:"Inapoi",lobbyButton:"Lobby",prize:"MARELE JACKPOT OMG",winUpTo:"Castiga pana la",nextDraw:"In cat timp devii milionar daca cumperi acum!!!",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",createTicket:"Creeaza bilet",modalSuccess:"Achiziția va avea succes în curând!",deleteTicketModalTitle:"Sterge biletul",deleteTicketModalText:"Esti sigur ca vrei sa stergi acest bilet?",deleteTicketModalCancel:"Anuleaza",deleteTicketModalConfirm:"Sterge",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite"}},s=(e,t)=>{const i=t;return r[void 0!==i&&a.includes(i)?i:"en"][e]},n=class{constructor(t){e(this,t),this.language="en",this.autoPick=!1,this.resetButton=!1,this.tickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.deleteVisible=!1,this.latestDraw={},this.totalWinningsAmount=0,this.multiplier=!1,this.quickPick=!1}connectedCallback(){this.getGameDetails(),this.getDraws()}countdownLogic(e){this.interval=setInterval((()=>{this.daysRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/864e5),this.hoursRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/36e5-24*this.daysRemaining),this.minutesRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/6e4-24*this.daysRemaining*60-60*this.hoursRemaining),this.secondsRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/1e3-24*this.daysRemaining*60*60-60*this.hoursRemaining*60-60*this.minutesRemaining)}),1e3)}disconnectedCallback(){clearInterval(this.interval)}getGameDetails(){let e=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(e.href).then((e=>{if(e.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return e.json()})).then((e=>{this.gameData=e,this.basicStake=this.gameData.rules.stakes[0].amount;let t=this.gameData.draws.filter((e=>!e.winningNumbers));console.log("draws",t),this.nextDraw=t[0].id,this.createNewTicket()})).catch((e=>{this.hasErrors=!0,console.log("Error",e)}))}calculateTotalAmount(){const{currency:e}=this.gameData.rules.stakes[0];this.totalAmount=0,this.tickets.forEach((e=>{e.completed&&(this.totalAmount+=e.amount*e.stake)})),this.currency=e}gridFilledHandler(e){this.tickets=this.tickets.map((t=>{if(t.ticketId==e.detail.id){let i=t.selectedNumbers||[];return i[e.detail.index]=e.detail.selectedNumbers.map((e=>parseInt(e,10))),{gameId:t.gameId,ticketId:t.ticketId,completed:!0,amount:e.detail.draws,stake:t.stake,selectedNumbers:i}}return t})),this.calculateTotalAmount()}gridDirtyHandler(e){this.tickets=this.tickets.map((t=>t.gameId==e.detail.id?{gameId:t.gameId,ticketId:t.ticketId,completed:!1,amount:t.amount,stake:t.stake,grids:[]}:t))}deleteTicketHandler(e){this.deleteVisible=!0,this.deleteEventData=e}modalCloseEvent(){this.deleteVisible=!1}stakeChangeHandler(e){const{ticketId:t,stake:i}=e.detail;this.tickets[t-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(e){this.multiplier=e.detail}getDraws(){let e=new URL(`${this.endpoint}/games/${this.gameId}/draws`);fetch(e.href,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>e.json())).then((e=>{var t;let i=e.items.filter((e=>{if(Date.parse(e.date)>(new Date).getTime())return!e.winningNumbers})),a=e.items.filter((e=>e.winningNumbers));this.latestDraw=i[0],this.nextDate=this.latestDraw.date,this.countdownLogic(this.nextDate),this.lastDrawId=a[a.length-1].id,null===(t=this.latestDraw)||void 0===t||t.prizes.forEach((e=>{this.totalWinningsAmount+=JSON.parse(e.amount)}))}))}confirmDeleteTicketHandler(e){this.tickets=this.tickets.filter((t=>t.ticketId!=e.detail.ticketId)),this.calculateTotalAmount(),this.deleteVisible=!1}createNewTicket(){this.tickets=[...this.tickets,{gameId:this.gameId,ticketId:this.tickets.length+1,completed:!1,amount:1,stake:this.basicStake,grids:[]}]}submitTickets(){let e=new URL(`${this.endpoint}/tickets`),t={gameId:this.gameId,tickets:[]};console.log("body",t),this.tickets.forEach((e=>{t.tickets.push({startingDrawId:this.nextDraw,amount:e.stake,gameId:this.gameId,currency:this.currency,selection:e.selectedNumbers,multiplier:this.multiplier,drawCount:e.amount,quickPick:this.quickPick})}));let i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`},body:JSON.stringify(t)};fetch(e.href,i).then((e=>{if(e.status>300)throw new Error("err");return e.json()})).then((e=>{console.log("data",e)})),this.successVisible=!0}render(){return this.hasErrors?t("div",{class:"GamePage"},t("div",{class:"Title"},s("error",this.language))):t("div",{class:"GamePage"},t("div",{class:"GridBanner"},t("div",{class:"BannerButtonsWrapper"},t("button",{class:"BannerBackButton"},t("span",{class:"BannerBackButtonArrow"},"ᐸ "),s("backButton",this.language)),t("button",{class:"BannerLobbyButton"},s("lobbyButton",this.language))),t("div",{class:"Tabs"},t("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},s("buy",this.language)),t("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},s("viewLatest",this.language)))),t("div",{class:"NextDrawWrapper"},t("div",{class:"TotalWinnings"},s("winUpTo",this.language),": ",t("span",null,"$",this.totalWinningsAmount.toLocaleString("en-US",{maximumFractionDigits:2}))),t("div",{class:"NextDraw"},t("p",{class:"BannerText"},s("nextDraw",this.language)),t("div",{class:"BannerCountdown"},t("span",{class:"CountdownDays"},this.daysRemaining,"D"),t("span",{class:"CountdownHours"},this.hoursRemaining,"H"),t("span",{class:"CountdownMinutes"},this.minutesRemaining,"M"),t("span",{class:"CountdownSeconds"},this.secondsRemaining,"S")))),0==this.tabIndex&&t("div",{class:"GamePageContent"},t("div",{class:"GameDetails"},t("lottery-game-details",null)),t("div",{class:"TicketsWrapper"},this.tickets.map((e=>t("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":e.ticketId,"game-id":e.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":this.autoPick,"reset-button":this.resetButton}))),t("div",{class:"CreateNewTicket"},t("button",{onClick:()=>this.createNewTicket()},"+"),t("span",null,s("createTicket",this.language)))),t("div",{class:"OrderSummary"},t("h3",{class:"OrderSummaryTitle"},s("orderSummaryTitle",this.language)),t("div",{class:"Ticket"},s("orderSummaryTickets",this.language),": ",t("span",null,this.tickets.length)),t("div",{class:"Total"},s("orderSummaryTotal",this.language),": ",t("span",null,this.totalAmount," ",this.currency)),t("div",{class:"ButtonWrapper"},t("span",{class:"Button",onClick:()=>this.submitTickets()},s("orderSummarySubmit",this.language))))),1==this.tabIndex&&t("div",null,t("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"draw-id":this.lastDrawId,"draw-mode":!0}),t("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language})),t("helper-modal",{"title-modal":"Success",visible:this.successVisible},t("p",{class:"SubmitModalSuccess"},s("modalSuccess",this.language))),t("helper-modal",{"title-modal":"Delete Ticket",visible:this.deleteVisible},t("div",{class:"DeleteTicketModalWrapper"},t("h3",{class:"DeleteTicketModalTitle"},s("deleteTicketModalTitle",this.language)),t("p",{class:"DeleteTicketModalText"},s("deleteTicketModalText",this.language)),t("div",{class:"DeleteTicketModalButtons"},t("button",{class:"DeleteTicketModalCancel",onClick:()=>this.modalCloseEvent()},s("deleteTicketModalCancel",this.language)),t("button",{class:"DeleteTicketModalConfirm",onClick:()=>this.confirmDeleteTicketHandler(this.deleteEventData)},s("deleteTicketModalConfirm",this.language))))))}static get assetsDirs(){return["static"]}get element(){return i(this)}};n.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#00958f;font-size:18px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px}.GamePage .TotalWinnings span{font-size:22px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:capitalize;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#F1F1F1;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{background:#00958f;color:#FFF}.NextDrawWrapper{padding:10px 15px;background:#fff}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:10px 15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px;border-bottom:1px solid #e9e9e9}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}';export{n as lottery_game_page}
|
|
@@ -1,2 +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=e,r=a(t,s),i=u(n);o.ael(c,l,r,i),(t.o=t.o||[]).push((()=>o.rel(c,l,r,i)))}))},a=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){G(e)}},u=e=>0!=(2&e),f=new WeakMap,h=e=>"sc-"+e.h,$={},d=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1;const c=[],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.p=t,c.length>0&&(i.m=c),i},p=(e,t)=>({t:0,g:e,$:t,S:null,m:null,p:null}),m={},b=(e,t,n,s,c,r)=>{if(n!==s){let i=D(e,t),a=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{const 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):D(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},w=/\s/,g=e=>e?e.split(w):[],S=(e,t,n,l)=>{const s=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.p||$,c=t.p||$;for(l in o)l in c||b(s,l,o[l],void 0,n,t.t);for(l in c)b(s,l,o[l],c[l],n,t.t)},j=(t,n,l)=>{const o=n.m[l];let c,r,i=0;if(null!==o.$)c=o.S=s.createTextNode(o.$);else if(c=o.S=s.createElement(o.g),S(null,o,!1),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),o.m)for(i=0;i<o.m.length;++i)r=j(t,o,i),r&&c.appendChild(r);return c},v=(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=j(null,l,o),r&&(s[o].S=r,i.insertBefore(r,n)))},k=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.S.remove()},C=(e,t)=>e.g===t.g,M=(e,t)=>{const n=t.S=e.S,l=e.m,s=t.m,o=t.$;null===o?(S(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],a=t[r],u=l.length-1,f=l[0],h=l[u];for(;o<=r&&c<=u;)null==i?i=t[++o]:null==a?a=t[--r]:null==f?f=l[++c]:null==h?h=l[--u]:C(i,f)?(M(i,f),i=t[++o],f=l[++c]):C(a,h)?(M(a,h),a=t[--r],h=l[--u]):C(i,h)?(M(i,h),e.insertBefore(i.S,a.S.nextSibling),i=t[++o],h=l[--u]):C(a,f)?(M(a,f),e.insertBefore(a.S,i.S),a=t[--r],f=l[++c]):(s=j(t&&t[c],n,c),f=l[++c],s&&i.S.parentNode.insertBefore(s,i.S));o>r?v(e,null==l[u+1]?null:l[u+1].S,n,l,c,u):c>u&&k(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&k(l,0,l.length-1)):e.$!==o&&(n.data=o)},O=e=>_(e).j,P=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},x=(e,t)=>{if(e.t|=16,!(4&e.t))return P(e,e.k),ne((()=>E(e,t)));e.t|=512},E=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>L(n,e,t))),e.u=null)),R(void 0,(()=>N(e,n,t)))},N=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.C,n=e.j,l=t.t,o=((e,t)=>{let n=h(t);const l=K.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=f.get(e=e.head||e);o||f.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);T(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>A(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},T=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.M||p(null,null),c=(e=>e&&e.g===m)(l)?l:y(null,null,l);t=s.tagName,c.g=null,c.t|=4,n.M=c,c.S=o.S=s.shadowRoot||s,e=s["s-sc"],M(o,c)})(n,l)}catch(e){G(e,n.j)}return null},A=e=>{const t=e.j,n=e.k;64&e.t||(e.t|=64,U(t),e.O(t),n||F()),e.v&&(e.v(),e.v=void 0),512&e.t&&te((()=>x(e,!1))),e.t&=-517},F=()=>{U(s.documentElement),te((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"lottery-game-page"}});return e.dispatchEvent(t),t})(l)))},L=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){G(e)}},R=(e,t)=>e&&e.then?e.then(t):t(),U=e=>e.classList.add("hydrated"),W=(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)=>_(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=_(e),o=s.N.get(t),c=s.t,r=s.i;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&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.N.set(t,n),r&&2==(18&c)&&x(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},q=e=>{L(e,"connectedCallback")},H=(e,t={})=>{const n=[],c=t.exclude||[],a=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),$=s.createElement("style"),d=[];let y,p=!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,u=class extends HTMLElement{constructor(e){super(e),B(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),p?d.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=_(e),n=t.C,l=()=>{};if(1&t.t)i(e,t,n.T),q(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){P(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=J(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(W(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){G(e)}t.t&=-9,e(),q(t.i)}if(s.style){let e=s.style;const t=h(n);if(!K.has(t)){const l=()=>{};((e,t,n)=>{let l=K.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,K.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,c=()=>x(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=_(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),L(t,"disconnectedCallback")}})()))}componentOnReady(){return _(this).A}};l.F=e[0],c.includes(s)||a.get(s)||(n.push(s),a.define(s,W(u,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),u.insertBefore($,f?f.nextSibling:u.firstChild),p=!1,d.length?d.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(F,30)))},V=new WeakMap,_=e=>V.get(e),z=(e,t)=>V.set(t.i=e,t),B=(e,t)=>{const n={t:0,j:e,C:t,N:new Map};return n.A=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.T),V.set(e,n)},D=(e,t)=>t in e,G=(e,t)=>(0,console.error)(e,t),I=new Map,J=e=>{const t=e.h.replace(/-/g,"_"),n=e.F,l=I.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(I.set(n,e),e[t])),G)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},K=new Map,Q=[],X=[],Y=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?te(ee):o.raf(ee))},Z=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){G(e)}e.length=0},ee=()=>{Z(Q),Z(X),(n=Q.length>0)&&o.raf(ee)},te=e=>c().then(e),ne=Y(X,!0);export{H as b,O as g,y as h,c as p,z as r}
|