@everymatrix/lottery-game-page 1.77.25 → 1.77.26

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 (26) hide show
  1. package/dist/cjs/general-multi-select_16.cjs.entry.js +289 -243
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/lottery-game-page.cjs.js +1 -1
  4. package/dist/collection/components/lottery-game-page/lottery-game-page.css +89 -97
  5. package/dist/collection/components/lottery-game-page/lottery-game-page.js +87 -51
  6. package/dist/collection/utils/utils.js +11 -4
  7. package/dist/esm/general-multi-select_16.entry.js +289 -243
  8. package/dist/esm/loader.js +1 -1
  9. package/dist/esm/lottery-game-page.js +1 -1
  10. package/dist/lottery-game-page/general-multi-select_16.entry.js +242 -243
  11. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  12. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +2 -0
  13. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +2 -0
  14. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -3
  15. package/dist/types/utils/utils.d.ts +4 -0
  16. package/package.json +1 -1
  17. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +0 -2
  18. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +0 -2
  19. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  20. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/storybook/main.d.ts +0 -0
  21. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/storybook/preview.d.ts +0 -0
  22. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/tools/plugins/index.d.ts +0 -0
  23. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +0 -0
  24. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  25. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  26. /package/dist/types/{builds/emfe-widgets → Users/maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { h, getAssetPath } from "@stencil/core";
2
2
  import { translate, getTranslations } from "../../utils/locale.utils";
3
- import { isMobile, generateUUID, fetchRequest } from "../../utils/utils";
3
+ import { isMobile, generateUUID, fetchRequest, showNotification } from "../../utils/utils";
4
4
  import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
5
5
  import "../../../../../lottery-ticket-controller/dist/types/index";
6
6
  import "../../../../../helper-modal/dist/types/index";
@@ -26,9 +26,9 @@ export class LotteryGamePage {
26
26
  return '';
27
27
  }
28
28
  value = value.toString();
29
- const parts = value.split(".");
30
- parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
31
- return parts.join(".");
29
+ const parts = value.split('.');
30
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
31
+ return parts.join('.');
32
32
  };
33
33
  this.endpoint = undefined;
34
34
  this.endpointTicket = undefined;
@@ -89,17 +89,26 @@ export class LotteryGamePage {
89
89
  this.isLoading = false;
90
90
  });
91
91
  }
92
+ watchGameInfoChange(newValue, oldValue) {
93
+ if (newValue && newValue != oldValue) {
94
+ this.getGameDetails();
95
+ }
96
+ }
92
97
  async componentWillLoad() {
93
- this.getGameDetails();
98
+ if (this.gameId && this.endpoint) {
99
+ this.getGameDetails();
100
+ }
94
101
  if (this.sessionId) {
95
102
  this.isLoggedIn = true;
96
103
  }
97
104
  // Translation url logic
98
105
  const promises = [];
99
106
  if (this.translationUrl) {
100
- const translationPromise = getTranslations(this.translationUrl).then((data) => {
107
+ const translationPromise = getTranslations(this.translationUrl)
108
+ .then((data) => {
101
109
  this.translationData = JSON.stringify(data);
102
- }).catch(err => {
110
+ })
111
+ .catch((err) => {
103
112
  console.log(err);
104
113
  });
105
114
  promises.push(translationPromise);
@@ -120,8 +129,13 @@ export class LotteryGamePage {
120
129
  const setTime = () => {
121
130
  this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
122
131
  this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
123
- this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
124
- this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
132
+ this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) -
133
+ this.daysRemaining * 24 * 60 -
134
+ this.hoursRemaining * 60);
135
+ this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 -
136
+ this.daysRemaining * 24 * 60 * 60 -
137
+ this.hoursRemaining * 60 * 60 -
138
+ this.minutesRemaining * 60);
125
139
  };
126
140
  setTime();
127
141
  this.interval = setInterval(setTime, 1000);
@@ -147,9 +161,9 @@ export class LotteryGamePage {
147
161
  this.basicBetType = this.gameData.rules.betTypes[0];
148
162
  this.nextDate = (_b = this.gameData.currentDraw) === null || _b === void 0 ? void 0 : _b.date;
149
163
  this.nextDate && this.countdownLogic(this.nextDate);
150
- this.secondarySelectionAllowed = this.gameData.rules.secondarySelectionAllowed === "INPUT" ? true : false;
164
+ this.secondarySelectionAllowed = this.gameData.rules.secondarySelectionAllowed === 'INPUT' ? true : false;
151
165
  this.quickPick = this.gameData.rules.quickPickAvailable;
152
- this.isSubscription = this.gameData.rules.wagerTypes && this.gameData.rules.wagerTypes.includes("Subscription");
166
+ this.isSubscription = this.gameData.rules.wagerTypes && this.gameData.rules.wagerTypes.includes('Subscription');
153
167
  let draws = this.gameData.draws ? this.gameData.draws.filter((item) => !item.winningNumbers) : [];
154
168
  draws.length > 0 && (this.nextDraw = draws[0].id);
155
169
  this.createNewTicket();
@@ -165,7 +179,12 @@ export class LotteryGamePage {
165
179
  this.mainTickets.forEach((item) => {
166
180
  var _a;
167
181
  if (item.completed.every((v) => v)) {
168
- this.totalAmount += (item.drawCount) * (item.stake || this.basicStake) * (item.multiplierNum) * (item.lineNum) * ((_a = item.betType) === null || _a === void 0 ? void 0 : _a.combinations);
182
+ this.totalAmount +=
183
+ item.drawCount *
184
+ (item.stake || this.basicStake) *
185
+ item.multiplierNum *
186
+ item.lineNum *
187
+ ((_a = item.betType) === null || _a === void 0 ? void 0 : _a.combinations);
169
188
  }
170
189
  });
171
190
  this.currency = currency;
@@ -276,11 +295,31 @@ export class LotteryGamePage {
276
295
  createNewTicket() {
277
296
  this.mainTickets = [
278
297
  ...this.mainTickets,
279
- { gameId: this.gameId, ticketId: this.mainTickets.length + 1, drawCount: 1, multiplierNum: 1, completed: [false], stake: this.basicStake, betType: this.basicBetType, lineNum: this.basicLine, quickPicks: [false], betName: '' }
298
+ {
299
+ gameId: this.gameId,
300
+ ticketId: this.mainTickets.length + 1,
301
+ drawCount: 1,
302
+ multiplierNum: 1,
303
+ completed: [false],
304
+ stake: this.basicStake,
305
+ betType: this.basicBetType,
306
+ lineNum: this.basicLine,
307
+ quickPicks: [false],
308
+ betName: ''
309
+ }
280
310
  ];
281
311
  this.secondaryTickets = [
282
312
  ...this.secondaryTickets,
283
- { gameId: this.gameId, ticketId: this.secondaryTickets.length + 1, drawCount: 1, multiplierNum: 1, completed: [false], stake: this.basicStake, betType: this.basicBetType, lineNum: this.basicLine }
313
+ {
314
+ gameId: this.gameId,
315
+ ticketId: this.secondaryTickets.length + 1,
316
+ drawCount: 1,
317
+ multiplierNum: 1,
318
+ completed: [false],
319
+ stake: this.basicStake,
320
+ betType: this.basicBetType,
321
+ lineNum: this.basicLine
322
+ }
284
323
  ];
285
324
  }
286
325
  showLoginModal() {
@@ -314,10 +353,9 @@ export class LotteryGamePage {
314
353
  return indices;
315
354
  }, []);
316
355
  let mergedUniqueArray = [...new Set([...secondaryDirtyTicketLines, ...dirtyTicketLines])].sort((a, b) => a - b);
317
- ;
318
356
  if (mergedUniqueArray.length) {
319
357
  this.showSubmitError = true;
320
- let lines = mergedUniqueArray.map(item => `Line${item + 1}`).join();
358
+ let lines = mergedUniqueArray.map((item) => `Line${item + 1}`).join();
321
359
  this.submitError = `The number of the selected number(s) on ${lines} is invalid.`;
322
360
  setTimeout(() => {
323
361
  this.showSubmitError = false;
@@ -328,7 +366,11 @@ export class LotteryGamePage {
328
366
  var _a;
329
367
  body.tickets.push({
330
368
  startingDrawId: this.nextDraw,
331
- amount: (item.stake * item.drawCount * item.multiplierNum * (item.lineNum || 1) * ((_a = item.betType) === null || _a === void 0 ? void 0 : _a.combinations)).toString(),
369
+ amount: (item.stake *
370
+ item.drawCount *
371
+ item.multiplierNum *
372
+ (item.lineNum || 1) *
373
+ ((_a = item.betType) === null || _a === void 0 ? void 0 : _a.combinations)).toString(),
332
374
  gameId: this.gameId,
333
375
  gameName: this.gameData.name,
334
376
  currency: this.currency,
@@ -346,24 +388,11 @@ export class LotteryGamePage {
346
388
  multiplier: item.multiplier,
347
389
  multiplierNum: item.multiplierNum,
348
390
  drawCount: item.drawCount,
349
- quickPick: this.quickPick,
391
+ quickPick: this.quickPick
350
392
  });
351
393
  });
352
394
  return body;
353
395
  }
354
- showNotification(message, theme = '', position = 'top-end') {
355
- const notification = document.createElement('vaadin-notification');
356
- notification.renderer = (root) => {
357
- root.textContent = message;
358
- };
359
- notification.duration = 5000;
360
- if (theme) {
361
- notification.setAttribute('theme', theme);
362
- }
363
- notification.setAttribute('position', position);
364
- document.body.appendChild(notification);
365
- notification.opened = true;
366
- }
367
396
  handleSubmitTickets() {
368
397
  if (this.isSubscription && this.isSubscribed) {
369
398
  this.submitTickets();
@@ -399,19 +428,19 @@ export class LotteryGamePage {
399
428
  const timeStamp = format(new Date(), 'yyyyMMddHHMMSS');
400
429
  this.subscriptionParam.name = `${this.subscriptionParam.ruleType}_${playerId}_${timeStamp}`;
401
430
  const { id } = await fetchRequest(crateRuleUrl, 'POST', this.subscriptionParam, {
402
- 'Authorization': `Bearer ${this.sessionId}`,
431
+ Authorization: `Bearer ${this.sessionId}`
403
432
  });
404
433
  if (bodyParam) {
405
434
  const body = Object.assign(Object.assign({}, bodyParam), { ruleDefinitionId: id });
406
435
  const createTicketId = `${this.endpointTicket}/subscription`;
407
436
  await fetchRequest(createTicketId, 'POST', body, {
408
- 'Authorization': `Bearer ${this.sessionId}`,
437
+ Authorization: `Bearer ${this.sessionId}`
409
438
  });
410
- this.showNotification('Subscription rule created successfully.', 'success');
439
+ showNotification({ message: 'Subscription rule created successfully.', theme: 'success' });
411
440
  }
412
441
  }
413
442
  catch (err) {
414
- this.showNotification('Failed to create the subscription rule. Please try again.', 'error');
443
+ showNotification({ message: 'Failed to create the subscription rule. Please try again.', theme: 'error' });
415
444
  }
416
445
  this.isLoading = false;
417
446
  }
@@ -426,8 +455,8 @@ export class LotteryGamePage {
426
455
  method: 'POST',
427
456
  headers: {
428
457
  'Content-Type': 'application/json',
429
- 'Accept': 'application/json',
430
- 'Authorization': `Bearer ${this.sessionId}`,
458
+ Accept: 'application/json',
459
+ Authorization: `Bearer ${this.sessionId}`,
431
460
  'X-Idempotency-Key': uuid
432
461
  },
433
462
  body: JSON.stringify(body)
@@ -447,11 +476,11 @@ export class LotteryGamePage {
447
476
  })
448
477
  .then(() => {
449
478
  // this.successVisible = true;
450
- this.showNotification('Ticket submitted successfully.', 'success');
479
+ showNotification({ message: 'Ticket submitted successfully.', theme: 'success' });
451
480
  })
452
481
  .catch((err) => {
453
482
  console.log('Error ', err);
454
- this.showNotification('Failed to purchase the ticket. Please try again.', 'error');
483
+ showNotification({ message: 'Failed to purchase the ticket. Please try again.', theme: 'error' });
455
484
  })
456
485
  .finally(() => {
457
486
  this.isLoading = false;
@@ -473,18 +502,19 @@ export class LotteryGamePage {
473
502
  }
474
503
  return (
475
504
  /* Game details */
476
- h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, h("div", { class: "GridBanner", style: { 'background': `url(${this.backgroundUrl ? this.backgroundUrl : backgroundImagePath})`, 'background-size': 'contain', 'background-repeat': 'no-repeat', 'background-position': 'center' } }, h("div", { class: "BannerButtonsWrapper" }), 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" }, this.nextDate && 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 &&
477
- h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "low-number": (_b = (_a = this.gameData.rules) === null || _a === void 0 ? void 0 : _a.boards[0]) === null || _b === void 0 ? void 0 : _b.lowNumber, "high-number": (_d = (_c = this.gameData.rules) === null || _c === void 0 ? void 0 : _c.boards[0]) === null || _d === void 0 ? void 0 : _d.highNumber, "minimum-allowed": (_f = (_e = this.gameData.rules) === null || _e === void 0 ? void 0 : _e.boards[0]) === null || _f === void 0 ? void 0 : _f.minimumAllowed, "maxinum-allowed": (_h = (_g = this.gameData.rules) === null || _g === void 0 ? void 0 : _g.boards[0]) === null || _h === void 0 ? void 0 : _h.maxinumAllowed, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "translation-url": this.translationData })), h("div", { class: "TicketsWrapper" }, this.mainTickets.map((item) => {
478
- var _a, _b;
479
- return h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": (_a = this.gameData.rules) === null || _a === void 0 ? void 0 : _a.quickPickAvailable, "reset-button": (_b = this.gameData.rules) === null || _b === void 0 ? void 0 : _b.quickPickAvailable, "total-controllers": this.mainTickets.length, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource });
480
- })), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "OrderTicketInfo" }, h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.mainTickets.length)), h("div", null, h("span", null, this.thousandSeperator(((_k = (_j = this.mainTickets[0]) === null || _j === void 0 ? void 0 : _j.betType) === null || _k === void 0 ? void 0 : _k.combinations) * ((_l = this.mainTickets[0]) === null || _l === void 0 ? void 0 : _l.lineNum))), h("span", { class: "Multiplier" }, "x"), ((_m = this.gameData.rules) === null || _m === void 0 ? void 0 : _m.stakeMultiplierAvailable) &&
481
- h("span", null, h("span", null, ((_o = this.mainTickets[0]) === null || _o === void 0 ? void 0 : _o.multiplierNum) === 1 ? `${(_p = this.mainTickets[0]) === null || _p === void 0 ? void 0 : _p.multiplierNum} Multiplier` : `${(_q = this.mainTickets[0]) === null || _q === void 0 ? void 0 : _q.multiplierNum} Multipliers`), h("span", { class: "Multiplier" }, "x")), h("span", null, `${(_r = this.mainTickets[0]) === null || _r === void 0 ? void 0 : _r.stake} EUR`), ((_s = this.gameData.rules) === null || _s === void 0 ? void 0 : _s.drawMultiplierAvailable) &&
482
- h("span", null, h("span", { class: "Multiplier" }, "x"), h("span", null, ((_t = this.mainTickets[0]) === null || _t === void 0 ? void 0 : _t.drawCount) === 1 ? `${(_u = this.mainTickets[0]) === null || _u === void 0 ? void 0 : _u.drawCount} Draw` : `${(_v = this.mainTickets[0]) === null || _v === void 0 ? void 0 : _v.drawCount} Draws`)))), h("hr", null), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.thousandSeperator(this.totalAmount), " ", this.currency)), this.isSubscription &&
483
- h("div", { class: "SubscriptionWrapper" }, h("lottery-subscription", { endpoint: this.endpoint, endpointSubscription: this.endpointSubscription, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, gameName: this.gameData.name })), h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
484
- h("div", null, !this.isLoading &&
485
- h("div", { class: "submitWrap" }, h("div", { class: "Button", onClick: () => this.handleSubmitTickets() }, translate('orderSummarySubmit', this.language)), this.showSubmitError && h("div", { class: 'submitError' }, this.submitError), this.showApiError && h("div", { class: 'submitError' }, this.apiError), this.showSubscriptionError && h("div", { class: 'submitError' }, this.subscriptionError)), this.isLoading && h("span", { class: "Button", style: { "cursor": "default" } }, translate('loading', this.language))), !this.isLoggedIn &&
486
- h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
487
- h("div", null, h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, h("p", { class: "SubmitModalSuccess" }, translate('submitSuccess', this.language)))));
505
+ h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: (el) => (this.stylingContainer = el) }, h("div", { class: "GridBanner", style: {
506
+ background: `url(${this.backgroundUrl ? this.backgroundUrl : backgroundImagePath})`,
507
+ 'background-size': 'contain',
508
+ 'background-repeat': 'no-repeat',
509
+ 'background-position': 'center'
510
+ } }, h("div", { class: "BannerButtonsWrapper" }), 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)))), this.nextDate && (h("div", { class: "NextDrawWrapper" }, 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 && (h("div", { class: "GamePageContentWrapper" }, h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "low-number": (_b = (_a = this.gameData.rules) === null || _a === void 0 ? void 0 : _a.boards[0]) === null || _b === void 0 ? void 0 : _b.lowNumber, "high-number": (_d = (_c = this.gameData.rules) === null || _c === void 0 ? void 0 : _c.boards[0]) === null || _d === void 0 ? void 0 : _d.highNumber, "minimum-allowed": (_f = (_e = this.gameData.rules) === null || _e === void 0 ? void 0 : _e.boards[0]) === null || _f === void 0 ? void 0 : _f.minimumAllowed, "maxinum-allowed": (_h = (_g = this.gameData.rules) === null || _g === void 0 ? void 0 : _g.boards[0]) === null || _h === void 0 ? void 0 : _h.maxinumAllowed, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "translation-url": this.translationData })), h("div", { class: "TicketsWrapper" }, this.mainTickets.map((item) => {
511
+ var _a, _b;
512
+ return (h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": (_a = this.gameData.rules) === null || _a === void 0 ? void 0 : _a.quickPickAvailable, "reset-button": (_b = this.gameData.rules) === null || _b === void 0 ? void 0 : _b.quickPickAvailable, "total-controllers": this.mainTickets.length, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }));
513
+ })), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "OrderTicketInfo" }, h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.mainTickets.length)), h("div", null, h("span", null, this.thousandSeperator(((_k = (_j = this.mainTickets[0]) === null || _j === void 0 ? void 0 : _j.betType) === null || _k === void 0 ? void 0 : _k.combinations) * ((_l = this.mainTickets[0]) === null || _l === void 0 ? void 0 : _l.lineNum))), h("span", { class: "Multiplier" }, "x"), ((_m = this.gameData.rules) === null || _m === void 0 ? void 0 : _m.stakeMultiplierAvailable) && (h("span", null, h("span", null, ((_o = this.mainTickets[0]) === null || _o === void 0 ? void 0 : _o.multiplierNum) === 1
514
+ ? `${(_p = this.mainTickets[0]) === null || _p === void 0 ? void 0 : _p.multiplierNum} Multiplier`
515
+ : `${(_q = this.mainTickets[0]) === null || _q === void 0 ? void 0 : _q.multiplierNum} Multipliers`), h("span", { class: "Multiplier" }, "x"))), h("span", null, `${(_r = this.mainTickets[0]) === null || _r === void 0 ? void 0 : _r.stake} EUR`), ((_s = this.gameData.rules) === null || _s === void 0 ? void 0 : _s.drawMultiplierAvailable) && (h("span", null, h("span", { class: "Multiplier" }, "x"), h("span", null, ((_t = this.mainTickets[0]) === null || _t === void 0 ? void 0 : _t.drawCount) === 1
516
+ ? `${(_u = this.mainTickets[0]) === null || _u === void 0 ? void 0 : _u.drawCount} Draw`
517
+ : `${(_v = this.mainTickets[0]) === null || _v === void 0 ? void 0 : _v.drawCount} Draws`))))), h("hr", null), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ":", ' ', h("span", null, this.thousandSeperator(this.totalAmount), " ", this.currency)), this.isSubscription && (h("div", { class: "SubscriptionWrapper" }, h("lottery-subscription", { endpoint: this.endpoint, endpointSubscription: this.endpointSubscription, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, gameName: this.gameData.name }))), h("div", { class: "ButtonWrapper" }, this.isLoggedIn && (h("div", null, !this.isLoading && (h("div", { class: "submitWrap" }, h("div", { class: "Button", onClick: () => this.handleSubmitTickets() }, translate('orderSummarySubmit', this.language)), this.showSubmitError && h("div", { class: "submitError" }, this.submitError), this.showApiError && h("div", { class: "submitError" }, this.apiError), this.showSubscriptionError && h("div", { class: "submitError" }, this.subscriptionError))), this.isLoading && (h("span", { class: "Button", style: { cursor: 'default' } }, translate('loading', this.language))))), !this.isLoggedIn && (h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language)))))))))), this.tabIndex == 1 && (h("div", { class: "HistoryContentWrapper" }, h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }))), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, h("p", { class: "SubmitModalSuccess" }, translate('submitSuccess', this.language)))));
488
518
  }
489
519
  static get is() { return "lottery-game-page"; }
490
520
  static get encapsulation() { return "shadow"; }
@@ -787,6 +817,12 @@ export class LotteryGamePage {
787
817
  }, {
788
818
  "propName": "translationUrl",
789
819
  "methodName": "handleNewTranslations"
820
+ }, {
821
+ "propName": "endpoint",
822
+ "methodName": "watchGameInfoChange"
823
+ }, {
824
+ "propName": "gameId",
825
+ "methodName": "watchGameInfoChange"
790
826
  }];
791
827
  }
792
828
  static get listeners() {
@@ -12,7 +12,7 @@ export const isMobile = (userAgent) => {
12
12
  };
13
13
  export const generateUUID = () => {
14
14
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
15
- var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
15
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
16
16
  return v.toString(16);
17
17
  });
18
18
  };
@@ -28,13 +28,20 @@ export function fetchRequest(url, method = 'GET', body = null, headers = {}) {
28
28
  options.body = JSON.stringify(body);
29
29
  }
30
30
  fetch(url, options)
31
- .then(response => {
31
+ .then((response) => {
32
32
  if (!response.ok) {
33
33
  throw new Error(`HTTP error! Status: ${response.status}`);
34
34
  }
35
35
  return response.json();
36
36
  })
37
- .then(data => resolve(data))
38
- .catch(error => reject(error));
37
+ .then((data) => resolve(data))
38
+ .catch((error) => reject(error));
39
39
  });
40
40
  }
41
+ export const showNotification = ({ message, theme = 'success' }) => {
42
+ window.postMessage({
43
+ type: 'ShowNotificationToast',
44
+ message,
45
+ theme
46
+ });
47
+ };