@everymatrix/lottery-game-page 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/cjs/index-379e8fc6.js +1239 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/lottery-game-page.cjs.entry.js +319 -0
  5. package/dist/cjs/lottery-game-page.cjs.js +19 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/lottery-game-page/lottery-game-page.css +305 -0
  8. package/dist/collection/components/lottery-game-page/lottery-game-page.js +498 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +50 -0
  11. package/dist/collection/utils/utils.js +12 -0
  12. package/dist/components/index.d.ts +22 -0
  13. package/dist/components/index.js +2 -0
  14. package/dist/components/lottery-game-page.d.ts +11 -0
  15. package/dist/components/lottery-game-page.js +355 -0
  16. package/dist/esm/index-6305dd53.js +1212 -0
  17. package/dist/esm/index.js +1 -0
  18. package/dist/esm/loader.js +17 -0
  19. package/dist/esm/lottery-game-page.entry.js +315 -0
  20. package/dist/esm/lottery-game-page.js +17 -0
  21. package/dist/esm/polyfills/core-js.js +11 -0
  22. package/dist/esm/polyfills/css-shim.js +1 -0
  23. package/dist/esm/polyfills/dom.js +79 -0
  24. package/dist/esm/polyfills/es5-html-element.js +1 -0
  25. package/dist/esm/polyfills/index.js +34 -0
  26. package/dist/esm/polyfills/system.js +6 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/lottery-game-page/index.esm.js +0 -0
  30. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -0
  31. package/dist/lottery-game-page/p-6325d9be.js +2 -0
  32. package/dist/lottery-game-page/p-ea3ef00f.entry.js +1 -0
  33. package/dist/stencil.config.js +22 -0
  34. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +2 -0
  35. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +75 -0
  36. package/dist/types/components.d.ts +93 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  39. package/dist/types/utils/locale.utils.d.ts +1 -0
  40. package/dist/types/utils/utils.d.ts +7 -0
  41. package/loader/cdn.js +3 -0
  42. package/loader/index.cjs.js +3 -0
  43. package/loader/index.d.ts +12 -0
  44. package/loader/index.es2017.js +3 -0
  45. package/loader/index.js +4 -0
  46. package/loader/package.json +10 -0
  47. package/package.json +19 -0
@@ -0,0 +1,498 @@
1
+ import { Component, h, Prop, State, Listen, Element, getAssetPath } from '@stencil/core';
2
+ import { translate } from '../../utils/locale.utils';
3
+ import { isMobile } from "../../utils/utils";
4
+ import '@everymatrix/lottery-ticket-controller';
5
+ import '@everymatrix/helper-modal';
6
+ import '@everymatrix/lottery-game-details';
7
+ import '@everymatrix/lottery-draw-results-history';
8
+ import '@everymatrix/lottery-draw-results';
9
+ export class LotteryGamePage {
10
+ constructor() {
11
+ /**
12
+ * Language of the widget
13
+ */
14
+ this.language = 'en';
15
+ /**
16
+ * Shows the auto-pick button
17
+ */
18
+ this.autoPick = false;
19
+ /**
20
+ * Shows the reset button
21
+ */
22
+ this.resetButton = false;
23
+ this.tickets = [];
24
+ this.tabIndex = 0;
25
+ this.hasErrors = false;
26
+ this.totalAmount = 0;
27
+ this.successVisible = false;
28
+ this.deleteVisible = false;
29
+ this.latestDraw = {};
30
+ this.totalWinningsAmount = 0;
31
+ // @TODO fix any type
32
+ this.userAgent = window.navigator.userAgent;
33
+ this.multiplier = false;
34
+ this.quickPick = false;
35
+ }
36
+ // @TODO fix `any` type later, I'm lazy now
37
+ connectedCallback() {
38
+ this.getGameDetails();
39
+ this.getDraws();
40
+ }
41
+ countdownLogic(date) {
42
+ this.interval = setInterval(() => {
43
+ this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
44
+ this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
45
+ this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
46
+ this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
47
+ }, 1000);
48
+ }
49
+ disconnectedCallback() {
50
+ clearInterval(this.interval);
51
+ }
52
+ getGameDetails() {
53
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
54
+ fetch(url.href)
55
+ .then((res) => {
56
+ if (res.status >= 300) {
57
+ this.hasErrors = true;
58
+ throw new Error('There was an error while fetching the data');
59
+ }
60
+ return res.json();
61
+ })
62
+ .then((data) => {
63
+ this.gameData = data;
64
+ this.basicStake = this.gameData.rules.stakes[0].amount;
65
+ let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
66
+ console.log('draws', draws);
67
+ this.nextDraw = draws[0].id;
68
+ this.createNewTicket();
69
+ })
70
+ .catch((err) => {
71
+ this.hasErrors = true;
72
+ console.log('Error', err);
73
+ });
74
+ }
75
+ calculateTotalAmount() {
76
+ const { currency } = this.gameData.rules.stakes[0];
77
+ this.totalAmount = 0;
78
+ this.tickets.forEach((item) => {
79
+ if (item.completed) {
80
+ this.totalAmount += item.amount * item.stake;
81
+ }
82
+ });
83
+ this.currency = currency;
84
+ }
85
+ // @TODO CustomEvent type
86
+ gridFilledHandler(event) {
87
+ // @TODO item ts
88
+ this.tickets = this.tickets.map((item) => {
89
+ if (item.ticketId == event.detail.id) {
90
+ let arr = item.selectedNumbers || [];
91
+ arr[event.detail.index] = event.detail.selectedNumbers.map((item) => parseInt(item, 10));
92
+ return {
93
+ gameId: item.gameId,
94
+ ticketId: item.ticketId,
95
+ completed: true,
96
+ amount: event.detail.draws,
97
+ stake: item.stake,
98
+ selectedNumbers: arr
99
+ };
100
+ }
101
+ return item;
102
+ });
103
+ this.calculateTotalAmount();
104
+ }
105
+ // @TODO fix any type
106
+ gridDirtyHandler(event) {
107
+ // @TODO item ts
108
+ this.tickets = this.tickets.map((item) => {
109
+ if (item.gameId == event.detail.id) {
110
+ return {
111
+ gameId: item.gameId,
112
+ ticketId: item.ticketId,
113
+ completed: false,
114
+ amount: item.amount,
115
+ stake: item.stake,
116
+ grids: []
117
+ };
118
+ }
119
+ return item;
120
+ });
121
+ }
122
+ // @TODO CustomEvent type
123
+ deleteTicketHandler(event) {
124
+ this.deleteVisible = true;
125
+ this.deleteEventData = event;
126
+ }
127
+ modalCloseEvent() {
128
+ this.deleteVisible = false;
129
+ }
130
+ stakeChangeHandler(event) {
131
+ const { ticketId, stake } = event.detail;
132
+ this.tickets[ticketId - 1].stake = stake;
133
+ this.calculateTotalAmount();
134
+ }
135
+ multiplierChangeHandler(event) {
136
+ this.multiplier = event.detail;
137
+ }
138
+ getDraws() {
139
+ // append from query param with the current date value in order to get the next draw
140
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
141
+ let drawOptions = {
142
+ method: "GET",
143
+ headers: {
144
+ 'Content-Type': "application/json",
145
+ 'Accept': 'application/json',
146
+ },
147
+ };
148
+ fetch(url.href, drawOptions)
149
+ .then((response) => {
150
+ return response.json();
151
+ })
152
+ .then((data) => {
153
+ var _a;
154
+ let upcoming = data.items.filter((item) => {
155
+ if (Date.parse(item.date) > new Date().getTime()) {
156
+ return !item.winningNumbers;
157
+ }
158
+ });
159
+ let past = data.items.filter((item) => item.winningNumbers);
160
+ this.latestDraw = upcoming[0];
161
+ this.nextDate = this.latestDraw.date;
162
+ this.countdownLogic(this.nextDate);
163
+ this.lastDrawId = past[past.length - 1].id;
164
+ // calculate total winnings
165
+ // @TODO fix any type
166
+ (_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.prizes.forEach((element) => {
167
+ this.totalWinningsAmount += JSON.parse(element.amount);
168
+ });
169
+ });
170
+ }
171
+ ;
172
+ // @TODO fix any type
173
+ confirmDeleteTicketHandler(event) {
174
+ // @TODO fix any type
175
+ this.tickets = this.tickets.filter((item) => {
176
+ if (item.ticketId == event.detail.ticketId) {
177
+ return false;
178
+ }
179
+ return true;
180
+ });
181
+ this.calculateTotalAmount();
182
+ this.deleteVisible = false;
183
+ }
184
+ createNewTicket() {
185
+ this.tickets = [
186
+ ...this.tickets,
187
+ { gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
188
+ ];
189
+ }
190
+ submitTickets() {
191
+ let url = new URL(`${this.endpoint}/tickets`);
192
+ // @TODO Body TS type
193
+ let body = {
194
+ gameId: this.gameId,
195
+ tickets: []
196
+ };
197
+ console.log('body', body);
198
+ this.tickets.forEach((item) => {
199
+ body.tickets.push({
200
+ startingDrawId: this.nextDraw,
201
+ amount: item.stake,
202
+ gameId: this.gameId,
203
+ currency: this.currency,
204
+ selection: item.selectedNumbers,
205
+ multiplier: this.multiplier,
206
+ drawCount: item.amount,
207
+ quickPick: this.quickPick,
208
+ });
209
+ });
210
+ // @TODO Options TS type
211
+ let options = {
212
+ method: 'POST',
213
+ headers: {
214
+ 'Content-Type': 'application/json',
215
+ 'Accept': 'application/json',
216
+ 'Authorization': `Bearer ${this.sessionId}`
217
+ },
218
+ body: JSON.stringify(body)
219
+ };
220
+ fetch(url.href, options)
221
+ .then((res) => {
222
+ if (res.status > 300) {
223
+ throw new Error('err');
224
+ }
225
+ return res.json();
226
+ })
227
+ .then((data) => {
228
+ console.log('data', data);
229
+ });
230
+ this.successVisible = true;
231
+ }
232
+ render() {
233
+ const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
234
+ const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
235
+ if (this.hasErrors) {
236
+ return (h("div", { class: "GamePage" },
237
+ h("div", { class: "Title" }, translate('error', this.language))));
238
+ }
239
+ return (
240
+ /* Game details */
241
+ h("div", { class: "GamePage" },
242
+ h("div", { class: "GridBanner", style: { backgroundImage: isMobile(this.userAgent) ? `url(${backgroundSrc})` : `url(${backgroundDesktopSrc})` } },
243
+ h("div", { class: "BannerButtonsWrapper" },
244
+ h("button", { class: "BannerBackButton" },
245
+ h("span", { class: "BannerBackButtonArrow" }, "\u1438 "),
246
+ translate('backButton', this.language)),
247
+ h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))),
248
+ h("div", { class: "Tabs" },
249
+ h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)),
250
+ h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))),
251
+ h("div", { class: "NextDrawWrapper" },
252
+ h("div", { class: "TotalWinnings" },
253
+ translate('winUpTo', this.language),
254
+ ": ",
255
+ h("span", null,
256
+ "$",
257
+ this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))),
258
+ h("div", { class: "NextDraw" },
259
+ h("p", { class: "BannerText" }, translate('nextDraw', this.language)),
260
+ h("div", { class: "BannerCountdown" },
261
+ h("span", { class: "CountdownDays" },
262
+ this.daysRemaining,
263
+ "D"),
264
+ h("span", { class: "CountdownHours" },
265
+ this.hoursRemaining,
266
+ "H"),
267
+ h("span", { class: "CountdownMinutes" },
268
+ this.minutesRemaining,
269
+ "M"),
270
+ h("span", { class: "CountdownSeconds" },
271
+ this.secondsRemaining,
272
+ "S")))),
273
+ this.tabIndex == 0 &&
274
+ h("div", { class: "GamePageContent" },
275
+ h("div", { class: "GameDetails" },
276
+ h("lottery-game-details", null)),
277
+ h("div", { class: "TicketsWrapper" },
278
+ 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 })),
279
+ h("div", { class: "CreateNewTicket" },
280
+ h("button", { onClick: () => this.createNewTicket() }, "+"),
281
+ h("span", null, translate('createTicket', this.language)))),
282
+ h("div", { class: "OrderSummary" },
283
+ h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)),
284
+ h("div", { class: "Ticket" },
285
+ translate('orderSummaryTickets', this.language),
286
+ ": ",
287
+ h("span", null, this.tickets.length)),
288
+ h("div", { class: "Total" },
289
+ translate('orderSummaryTotal', this.language),
290
+ ": ",
291
+ h("span", null,
292
+ this.totalAmount,
293
+ " ",
294
+ this.currency)),
295
+ h("div", { class: "ButtonWrapper" },
296
+ h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language))))),
297
+ this.tabIndex == 1 &&
298
+ h("div", null,
299
+ h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }),
300
+ h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })),
301
+ h("helper-modal", { "title-modal": "Success", visible: this.successVisible },
302
+ h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))),
303
+ h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible },
304
+ h("div", { class: "DeleteTicketModalWrapper" },
305
+ h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)),
306
+ h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)),
307
+ h("div", { class: "DeleteTicketModalButtons" },
308
+ h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)),
309
+ h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
310
+ }
311
+ static get is() { return "lottery-game-page"; }
312
+ static get encapsulation() { return "shadow"; }
313
+ static get originalStyleUrls() { return {
314
+ "$": ["lottery-game-page.scss"]
315
+ }; }
316
+ static get styleUrls() { return {
317
+ "$": ["lottery-game-page.css"]
318
+ }; }
319
+ static get assetsDirs() { return ["static"]; }
320
+ static get properties() { return {
321
+ "endpoint": {
322
+ "type": "string",
323
+ "mutable": false,
324
+ "complexType": {
325
+ "original": "string",
326
+ "resolved": "string",
327
+ "references": {}
328
+ },
329
+ "required": false,
330
+ "optional": false,
331
+ "docs": {
332
+ "tags": [],
333
+ "text": "Endpoint URL for the source of data"
334
+ },
335
+ "attribute": "endpoint",
336
+ "reflect": false
337
+ },
338
+ "gameId": {
339
+ "type": "string",
340
+ "mutable": false,
341
+ "complexType": {
342
+ "original": "string",
343
+ "resolved": "string",
344
+ "references": {}
345
+ },
346
+ "required": false,
347
+ "optional": false,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "GameID of the lottery game"
351
+ },
352
+ "attribute": "game-id",
353
+ "reflect": false
354
+ },
355
+ "playerId": {
356
+ "type": "number",
357
+ "mutable": false,
358
+ "complexType": {
359
+ "original": "number",
360
+ "resolved": "number",
361
+ "references": {}
362
+ },
363
+ "required": false,
364
+ "optional": false,
365
+ "docs": {
366
+ "tags": [],
367
+ "text": "Player ID"
368
+ },
369
+ "attribute": "player-id",
370
+ "reflect": false
371
+ },
372
+ "sessionId": {
373
+ "type": "string",
374
+ "mutable": false,
375
+ "complexType": {
376
+ "original": "string",
377
+ "resolved": "string",
378
+ "references": {}
379
+ },
380
+ "required": false,
381
+ "optional": false,
382
+ "docs": {
383
+ "tags": [],
384
+ "text": "GIC Session"
385
+ },
386
+ "attribute": "session-id",
387
+ "reflect": false
388
+ },
389
+ "language": {
390
+ "type": "string",
391
+ "mutable": false,
392
+ "complexType": {
393
+ "original": "string",
394
+ "resolved": "string",
395
+ "references": {}
396
+ },
397
+ "required": false,
398
+ "optional": false,
399
+ "docs": {
400
+ "tags": [],
401
+ "text": "Language of the widget"
402
+ },
403
+ "attribute": "language",
404
+ "reflect": false,
405
+ "defaultValue": "'en'"
406
+ },
407
+ "autoPick": {
408
+ "type": "boolean",
409
+ "mutable": false,
410
+ "complexType": {
411
+ "original": "boolean",
412
+ "resolved": "boolean",
413
+ "references": {}
414
+ },
415
+ "required": false,
416
+ "optional": false,
417
+ "docs": {
418
+ "tags": [],
419
+ "text": "Shows the auto-pick button"
420
+ },
421
+ "attribute": "auto-pick",
422
+ "reflect": false,
423
+ "defaultValue": "false"
424
+ },
425
+ "resetButton": {
426
+ "type": "boolean",
427
+ "mutable": false,
428
+ "complexType": {
429
+ "original": "boolean",
430
+ "resolved": "boolean",
431
+ "references": {}
432
+ },
433
+ "required": false,
434
+ "optional": false,
435
+ "docs": {
436
+ "tags": [],
437
+ "text": "Shows the reset button"
438
+ },
439
+ "attribute": "reset-button",
440
+ "reflect": false,
441
+ "defaultValue": "false"
442
+ }
443
+ }; }
444
+ static get states() { return {
445
+ "tickets": {},
446
+ "tabIndex": {},
447
+ "hasErrors": {},
448
+ "totalAmount": {},
449
+ "successVisible": {},
450
+ "deleteVisible": {},
451
+ "deleteEventData": {},
452
+ "daysRemaining": {},
453
+ "hoursRemaining": {},
454
+ "minutesRemaining": {},
455
+ "secondsRemaining": {},
456
+ "latestDraw": {},
457
+ "totalWinningsAmount": {},
458
+ "nextDate": {}
459
+ }; }
460
+ static get elementRef() { return "element"; }
461
+ static get listeners() { return [{
462
+ "name": "ticketCompleted",
463
+ "method": "gridFilledHandler",
464
+ "target": undefined,
465
+ "capture": false,
466
+ "passive": false
467
+ }, {
468
+ "name": "gridDirty",
469
+ "method": "gridDirtyHandler",
470
+ "target": undefined,
471
+ "capture": false,
472
+ "passive": false
473
+ }, {
474
+ "name": "deleteTicket",
475
+ "method": "deleteTicketHandler",
476
+ "target": undefined,
477
+ "capture": false,
478
+ "passive": false
479
+ }, {
480
+ "name": "modalCloseEvent",
481
+ "method": "modalCloseEvent",
482
+ "target": undefined,
483
+ "capture": false,
484
+ "passive": false
485
+ }, {
486
+ "name": "stakeChange",
487
+ "method": "stakeChangeHandler",
488
+ "target": undefined,
489
+ "capture": false,
490
+ "passive": false
491
+ }, {
492
+ "name": "multiplierChange",
493
+ "method": "multiplierChangeHandler",
494
+ "target": undefined,
495
+ "capture": false,
496
+ "passive": false
497
+ }]; }
498
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,50 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ error: 'Error',
6
+ title: 'Chrono',
7
+ backButton: 'Back',
8
+ lobbyButton: 'Lobby',
9
+ prize: 'Prize',
10
+ winUpTo: 'Win up to',
11
+ nextDraw: 'Next draw in: ',
12
+ buy: 'Buy tickets',
13
+ viewLatest: 'View latest results',
14
+ createTicket: 'Create Ticket',
15
+ modalSuccess: 'Purchase will be successfull soon!',
16
+ deleteTicketModalTitle: 'Delete Ticket',
17
+ deleteTicketModalText: 'Are you sure you want to delete this ticket?',
18
+ deleteTicketModalCancel: 'Cancel',
19
+ deleteTicketModalConfirm: 'Delete',
20
+ orderSummaryTitle: 'Order Summary',
21
+ orderSummaryTickets: 'Ticket',
22
+ orderSummaryTotal: 'Total',
23
+ orderSummarySubmit: 'Submit'
24
+ },
25
+ ro: {
26
+ error: 'Eroare',
27
+ title: 'Loto 6/49',
28
+ backButton: 'Inapoi',
29
+ lobbyButton: 'Lobby',
30
+ prize: 'MARELE JACKPOT OMG',
31
+ winUpTo: 'Castiga pana la',
32
+ nextDraw: 'In cat timp devii milionar daca cumperi acum!!!',
33
+ buy: 'Cumpara bilet',
34
+ viewLatest: 'Ultimile extrageri',
35
+ createTicket: 'Creeaza bilet',
36
+ modalSuccess: 'Achiziția va avea succes în curând!',
37
+ deleteTicketModalTitle: 'Sterge biletul',
38
+ deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
39
+ deleteTicketModalCancel: 'Anuleaza',
40
+ deleteTicketModalConfirm: 'Sterge',
41
+ orderSummaryTitle: 'Rezumat comanda',
42
+ orderSummaryTickets: 'Bilet',
43
+ orderSummaryTotal: 'Total',
44
+ orderSummarySubmit: 'Trimite'
45
+ },
46
+ };
47
+ export const translate = (key, customLang) => {
48
+ const lang = customLang;
49
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
50
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @name isMobile
3
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
4
+ * @param {String} userAgent window.navigator.userAgent
5
+ * @returns {Boolean} true or false
6
+ */
7
+ export const isMobile = (userAgent) => {
8
+ return !!(userAgent.toLowerCase().match(/android/i) ||
9
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
10
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
11
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
12
+ };
@@ -0,0 +1,22 @@
1
+ /* LotteryGamePage custom elements */
2
+ export { LotteryGamePage as LotteryGamePage } from '../types/components/lottery-game-page/lottery-game-page';
3
+
4
+ /**
5
+ * Used to manually set the base path where assets can be found.
6
+ * If the script is used as "module", it's recommended to use "import.meta.url",
7
+ * such as "setAssetPath(import.meta.url)". Other options include
8
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
9
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
10
+ * But do note that this configuration depends on how your script is bundled, or lack of
11
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
12
+ * will have to ensure the static assets are copied to its build directory.
13
+ */
14
+ export declare const setAssetPath: (path: string) => void;
15
+
16
+ export interface SetPlatformOptions {
17
+ raf?: (c: FrameRequestCallback) => number;
18
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
19
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
+ }
21
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
22
+ export * from '../types';
@@ -0,0 +1,2 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
+ export { LotteryGamePage, defineCustomElement as defineCustomElementLotteryGamePage } from './lottery-game-page.js';
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface LotteryGamePage extends Components.LotteryGamePage, HTMLElement {}
4
+ export const LotteryGamePage: {
5
+ prototype: LotteryGamePage;
6
+ new (): LotteryGamePage;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;