@everymatrix/lottery-game-page 1.92.2 → 1.92.4
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.
|
@@ -15490,6 +15490,93 @@ const getTranslations$5 = (data) => {
|
|
|
15490
15490
|
});
|
|
15491
15491
|
};
|
|
15492
15492
|
|
|
15493
|
+
/**
|
|
15494
|
+
* @name isMobile
|
|
15495
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
15496
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
15497
|
+
* @returns {Boolean} true or false
|
|
15498
|
+
*/
|
|
15499
|
+
function isEmptyValueOfArray(arr) {
|
|
15500
|
+
if (arr.length === 0) {
|
|
15501
|
+
return true;
|
|
15502
|
+
}
|
|
15503
|
+
const len = arr.length;
|
|
15504
|
+
let count = 0;
|
|
15505
|
+
for (let i = 0; i < len; i++) {
|
|
15506
|
+
if (isEmptyValue(arr[i])) {
|
|
15507
|
+
count++;
|
|
15508
|
+
}
|
|
15509
|
+
else {
|
|
15510
|
+
return false;
|
|
15511
|
+
}
|
|
15512
|
+
}
|
|
15513
|
+
if (count === len) {
|
|
15514
|
+
return true;
|
|
15515
|
+
}
|
|
15516
|
+
return false;
|
|
15517
|
+
}
|
|
15518
|
+
function isEmptyValueOfObject(obj) {
|
|
15519
|
+
if (Object.keys(obj).length === 0) {
|
|
15520
|
+
return true;
|
|
15521
|
+
}
|
|
15522
|
+
const len = Object.keys(obj).length;
|
|
15523
|
+
let count = 0;
|
|
15524
|
+
for (const val of Object.values(obj)) {
|
|
15525
|
+
if (isEmptyValue(val)) {
|
|
15526
|
+
count++;
|
|
15527
|
+
}
|
|
15528
|
+
else {
|
|
15529
|
+
return false;
|
|
15530
|
+
}
|
|
15531
|
+
}
|
|
15532
|
+
if (count === len) {
|
|
15533
|
+
return true;
|
|
15534
|
+
}
|
|
15535
|
+
return false;
|
|
15536
|
+
}
|
|
15537
|
+
function isEmptyValue(value, allowZero) {
|
|
15538
|
+
if (value === null || value === undefined || value === '') {
|
|
15539
|
+
return true;
|
|
15540
|
+
}
|
|
15541
|
+
else if (value === 0 && allowZero) {
|
|
15542
|
+
return false;
|
|
15543
|
+
}
|
|
15544
|
+
else if (Array.isArray(value)) {
|
|
15545
|
+
return isEmptyValueOfArray(value);
|
|
15546
|
+
}
|
|
15547
|
+
else if (Object.prototype.toString.call(value) === '[object Object]') {
|
|
15548
|
+
return isEmptyValueOfObject(value);
|
|
15549
|
+
}
|
|
15550
|
+
else {
|
|
15551
|
+
return !value;
|
|
15552
|
+
}
|
|
15553
|
+
}
|
|
15554
|
+
function toQueryParams(params) {
|
|
15555
|
+
const finalParams = {};
|
|
15556
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
15557
|
+
if (!isEmptyValue(value, true)) {
|
|
15558
|
+
finalParams[key] = value;
|
|
15559
|
+
}
|
|
15560
|
+
});
|
|
15561
|
+
const queryString = Object.entries(finalParams)
|
|
15562
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
15563
|
+
.join('&');
|
|
15564
|
+
return queryString ? `?${queryString}` : '';
|
|
15565
|
+
}
|
|
15566
|
+
|
|
15567
|
+
var DrawStatusEnum;
|
|
15568
|
+
(function (DrawStatusEnum) {
|
|
15569
|
+
DrawStatusEnum["UPCOMING"] = "UPCOMING";
|
|
15570
|
+
DrawStatusEnum["OPEN"] = "OPEN";
|
|
15571
|
+
DrawStatusEnum["PENDING"] = "PENDING";
|
|
15572
|
+
DrawStatusEnum["ACTIVE"] = "ACTIVE";
|
|
15573
|
+
DrawStatusEnum["DRAWN"] = "DRAWN";
|
|
15574
|
+
DrawStatusEnum["SETTLED"] = "SETTLED";
|
|
15575
|
+
DrawStatusEnum["CLOSED"] = "CLOSED";
|
|
15576
|
+
DrawStatusEnum["PAYABLE"] = "PAYABLE";
|
|
15577
|
+
DrawStatusEnum["CANCELED"] = "CANCELED";
|
|
15578
|
+
})(DrawStatusEnum || (DrawStatusEnum = {}));
|
|
15579
|
+
|
|
15493
15580
|
const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:var(--emw--color-primary, #009993);background-repeat:no-repeat;background-position:center;color:var(--emw--color-typography, #000);padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.GridWrapper{background-color:var(--emw--color-background, #fff)}.DrawResultsSection{max-width:600px;margin:0px auto;padding-bottom:30px;color:var(--emw--color-typography, #000)}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:var(--emw--color-primary, #009993);padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:var(--emw--color-primary, #009993);padding:10px;text-align:center;color:var(--emw--color-background, #fff);padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff);outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton,.FilterSection .ResetButton{cursor:pointer;width:max-content;border-radius:var(--emw--button-border-radius, 4px);border:1px solid var(--emw--button-border-color, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .Active{background:var(--emw--color-primary-variant, #004d4a);color:var(--emw--color-background, #fff)}.FilterSection helper-filters{margin-left:auto}.errorText{color:var(--emw--color-error, #ff0000)}";
|
|
15494
15581
|
const LotteryDrawResultsHistoryStyle0 = lotteryDrawResultsHistoryCss;
|
|
15495
15582
|
|
|
@@ -15497,35 +15584,32 @@ const LotteryDrawResultsHistory = class {
|
|
|
15497
15584
|
constructor(hostRef) {
|
|
15498
15585
|
index.registerInstance(this, hostRef);
|
|
15499
15586
|
this.isReset = false;
|
|
15500
|
-
this.getDrawsData = () => {
|
|
15587
|
+
this.getDrawsData = async () => {
|
|
15501
15588
|
this.isLoading = true;
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
throw new Error('There was an error while fetching the data');
|
|
15589
|
+
const params = {
|
|
15590
|
+
limit: this.limit,
|
|
15591
|
+
offset: this.offset,
|
|
15592
|
+
status: [DrawStatusEnum.PAYABLE, DrawStatusEnum.CLOSED],
|
|
15593
|
+
from: this.dateFiltersFrom,
|
|
15594
|
+
to: this.dateFiltersTo
|
|
15595
|
+
};
|
|
15596
|
+
try {
|
|
15597
|
+
const res = await fetch(`${this.endpoint}/games/${this.gameId}/draws${toQueryParams(params)}`);
|
|
15598
|
+
if (!res.ok) {
|
|
15599
|
+
throw new Error(`There was an error while fetching the data. Status: ${res.status}`);
|
|
15514
15600
|
}
|
|
15515
|
-
|
|
15516
|
-
})
|
|
15517
|
-
.then((data) => {
|
|
15601
|
+
const data = await res.json();
|
|
15518
15602
|
this.winningDataSetsData = data.items || [];
|
|
15519
15603
|
this.drawData = this.winningDataSetsData.map((item) => item);
|
|
15520
15604
|
this.totalResults = data.total;
|
|
15521
|
-
}
|
|
15522
|
-
|
|
15523
|
-
console.
|
|
15524
|
-
}
|
|
15525
|
-
|
|
15605
|
+
}
|
|
15606
|
+
catch (err) {
|
|
15607
|
+
console.error('Failed to fetch draw data:', err);
|
|
15608
|
+
}
|
|
15609
|
+
finally {
|
|
15526
15610
|
this.isLoading = false;
|
|
15527
|
-
this.noResults = this.drawData.filter(draw => draw.winningNumbers).length
|
|
15528
|
-
}
|
|
15611
|
+
this.noResults = this.drawData.filter((draw) => draw.winningNumbers).length === 0;
|
|
15612
|
+
}
|
|
15529
15613
|
};
|
|
15530
15614
|
this.transDataToString = (data) => {
|
|
15531
15615
|
try {
|
|
@@ -15611,9 +15695,10 @@ const LotteryDrawResultsHistory = class {
|
|
|
15611
15695
|
clearInterval(this.interval);
|
|
15612
15696
|
}
|
|
15613
15697
|
render() {
|
|
15614
|
-
let gridHeader = index.h("div", { key: '
|
|
15615
|
-
return index.h("section", { key: '
|
|
15616
|
-
|
|
15698
|
+
let gridHeader = (index.h("div", { key: 'e4832e084ccfae7d795eedf7ac6138747764e4e5', class: "DrawResultsHeader" }, index.h("div", { key: '79638fcb05a24d05453adb065f668c2ac0375fd5', class: "DrawResultsHeaderContent" }, index.h("h4", { key: '6e95020a200139365cf7e01ef64ca7428595546e' }, translate$5('drawResultsHeader', this.language)), index.h("div", { key: '0f53a9527c2751e4ba33435f4833ab7d8c463080', class: "FilterSection" }, index.h("helper-filters", { key: '18c8dbe76602e4bb95d20a3e0df9401c24238be5', "activate-ticket-search": "false", "game-id": this.gameId, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })))));
|
|
15699
|
+
return (index.h("section", { key: '5e000a3c95bdc97e68a49165a0d7658fea684a55', class: "GridWrapper", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'd933a1a9a87de5bf7ca2c7c109e0f2b1576a0994', class: "DrawResultsSection" }, index.h("div", { key: 'a140aa6e6291f8832ec9883dafd9837e04a2909c', class: "DrawResultsAreaHistory" }, gridHeader, index.h("div", { key: '81488ac1c92b8be651d38f4eb8038e21c81508cb', class: "HistoryGridWrapper" }, index.h("div", { key: '08614a4e9ab66dcfc5f0408363ddb08a24231931', class: "HistoryGrid" }, this.isLoading && index.h("p", { key: 'ebd6fe7e16bb36335702520358ac999e34e7b5d6' }, translate$5('loading', this.language)), !this.isLoading &&
|
|
15700
|
+
!this.noResults &&
|
|
15701
|
+
this.drawData.map((item) => (index.h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true, language: this.language, "history-draw-data": this.transDataToString(item), "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }))), !this.isLoading && this.noResults && index.h("p", { key: '4a285a51dddff8e984400a6f390c1919d5fcd5ae', class: "errorText" }, translate$5('noResults', this.language)))), index.h("div", { key: '13d10caed463e12b218341531c2dd34825968d88', class: "DrawHistoryPaginationWrapper" }, this.totalResults > this.limit && (index.h("lottery-pagination", { key: '89ff3a6354036d1e3fbad82d8aec9aa4e9c19f66', arrowsActive: true, numberedNavActive: true, "is-reset": this.isReset, "first-page": false, "prev-page": true, "next-page": true, offset: this.offset, limit: this.limit, total: this.totalResults, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })))))));
|
|
15617
15702
|
}
|
|
15618
15703
|
static get watchers() { return {
|
|
15619
15704
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -15486,6 +15486,93 @@ const getTranslations$5 = (data) => {
|
|
|
15486
15486
|
});
|
|
15487
15487
|
};
|
|
15488
15488
|
|
|
15489
|
+
/**
|
|
15490
|
+
* @name isMobile
|
|
15491
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
15492
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
15493
|
+
* @returns {Boolean} true or false
|
|
15494
|
+
*/
|
|
15495
|
+
function isEmptyValueOfArray(arr) {
|
|
15496
|
+
if (arr.length === 0) {
|
|
15497
|
+
return true;
|
|
15498
|
+
}
|
|
15499
|
+
const len = arr.length;
|
|
15500
|
+
let count = 0;
|
|
15501
|
+
for (let i = 0; i < len; i++) {
|
|
15502
|
+
if (isEmptyValue(arr[i])) {
|
|
15503
|
+
count++;
|
|
15504
|
+
}
|
|
15505
|
+
else {
|
|
15506
|
+
return false;
|
|
15507
|
+
}
|
|
15508
|
+
}
|
|
15509
|
+
if (count === len) {
|
|
15510
|
+
return true;
|
|
15511
|
+
}
|
|
15512
|
+
return false;
|
|
15513
|
+
}
|
|
15514
|
+
function isEmptyValueOfObject(obj) {
|
|
15515
|
+
if (Object.keys(obj).length === 0) {
|
|
15516
|
+
return true;
|
|
15517
|
+
}
|
|
15518
|
+
const len = Object.keys(obj).length;
|
|
15519
|
+
let count = 0;
|
|
15520
|
+
for (const val of Object.values(obj)) {
|
|
15521
|
+
if (isEmptyValue(val)) {
|
|
15522
|
+
count++;
|
|
15523
|
+
}
|
|
15524
|
+
else {
|
|
15525
|
+
return false;
|
|
15526
|
+
}
|
|
15527
|
+
}
|
|
15528
|
+
if (count === len) {
|
|
15529
|
+
return true;
|
|
15530
|
+
}
|
|
15531
|
+
return false;
|
|
15532
|
+
}
|
|
15533
|
+
function isEmptyValue(value, allowZero) {
|
|
15534
|
+
if (value === null || value === undefined || value === '') {
|
|
15535
|
+
return true;
|
|
15536
|
+
}
|
|
15537
|
+
else if (value === 0 && allowZero) {
|
|
15538
|
+
return false;
|
|
15539
|
+
}
|
|
15540
|
+
else if (Array.isArray(value)) {
|
|
15541
|
+
return isEmptyValueOfArray(value);
|
|
15542
|
+
}
|
|
15543
|
+
else if (Object.prototype.toString.call(value) === '[object Object]') {
|
|
15544
|
+
return isEmptyValueOfObject(value);
|
|
15545
|
+
}
|
|
15546
|
+
else {
|
|
15547
|
+
return !value;
|
|
15548
|
+
}
|
|
15549
|
+
}
|
|
15550
|
+
function toQueryParams(params) {
|
|
15551
|
+
const finalParams = {};
|
|
15552
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
15553
|
+
if (!isEmptyValue(value, true)) {
|
|
15554
|
+
finalParams[key] = value;
|
|
15555
|
+
}
|
|
15556
|
+
});
|
|
15557
|
+
const queryString = Object.entries(finalParams)
|
|
15558
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
15559
|
+
.join('&');
|
|
15560
|
+
return queryString ? `?${queryString}` : '';
|
|
15561
|
+
}
|
|
15562
|
+
|
|
15563
|
+
var DrawStatusEnum;
|
|
15564
|
+
(function (DrawStatusEnum) {
|
|
15565
|
+
DrawStatusEnum["UPCOMING"] = "UPCOMING";
|
|
15566
|
+
DrawStatusEnum["OPEN"] = "OPEN";
|
|
15567
|
+
DrawStatusEnum["PENDING"] = "PENDING";
|
|
15568
|
+
DrawStatusEnum["ACTIVE"] = "ACTIVE";
|
|
15569
|
+
DrawStatusEnum["DRAWN"] = "DRAWN";
|
|
15570
|
+
DrawStatusEnum["SETTLED"] = "SETTLED";
|
|
15571
|
+
DrawStatusEnum["CLOSED"] = "CLOSED";
|
|
15572
|
+
DrawStatusEnum["PAYABLE"] = "PAYABLE";
|
|
15573
|
+
DrawStatusEnum["CANCELED"] = "CANCELED";
|
|
15574
|
+
})(DrawStatusEnum || (DrawStatusEnum = {}));
|
|
15575
|
+
|
|
15489
15576
|
const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:var(--emw--color-primary, #009993);background-repeat:no-repeat;background-position:center;color:var(--emw--color-typography, #000);padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.GridWrapper{background-color:var(--emw--color-background, #fff)}.DrawResultsSection{max-width:600px;margin:0px auto;padding-bottom:30px;color:var(--emw--color-typography, #000)}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:var(--emw--color-primary, #009993);padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:var(--emw--color-primary, #009993);padding:10px;text-align:center;color:var(--emw--color-background, #fff);padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff);outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton,.FilterSection .ResetButton{cursor:pointer;width:max-content;border-radius:var(--emw--button-border-radius, 4px);border:1px solid var(--emw--button-border-color, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .Active{background:var(--emw--color-primary-variant, #004d4a);color:var(--emw--color-background, #fff)}.FilterSection helper-filters{margin-left:auto}.errorText{color:var(--emw--color-error, #ff0000)}";
|
|
15490
15577
|
const LotteryDrawResultsHistoryStyle0 = lotteryDrawResultsHistoryCss;
|
|
15491
15578
|
|
|
@@ -15493,35 +15580,32 @@ const LotteryDrawResultsHistory = class {
|
|
|
15493
15580
|
constructor(hostRef) {
|
|
15494
15581
|
registerInstance(this, hostRef);
|
|
15495
15582
|
this.isReset = false;
|
|
15496
|
-
this.getDrawsData = () => {
|
|
15583
|
+
this.getDrawsData = async () => {
|
|
15497
15584
|
this.isLoading = true;
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
throw new Error('There was an error while fetching the data');
|
|
15585
|
+
const params = {
|
|
15586
|
+
limit: this.limit,
|
|
15587
|
+
offset: this.offset,
|
|
15588
|
+
status: [DrawStatusEnum.PAYABLE, DrawStatusEnum.CLOSED],
|
|
15589
|
+
from: this.dateFiltersFrom,
|
|
15590
|
+
to: this.dateFiltersTo
|
|
15591
|
+
};
|
|
15592
|
+
try {
|
|
15593
|
+
const res = await fetch(`${this.endpoint}/games/${this.gameId}/draws${toQueryParams(params)}`);
|
|
15594
|
+
if (!res.ok) {
|
|
15595
|
+
throw new Error(`There was an error while fetching the data. Status: ${res.status}`);
|
|
15510
15596
|
}
|
|
15511
|
-
|
|
15512
|
-
})
|
|
15513
|
-
.then((data) => {
|
|
15597
|
+
const data = await res.json();
|
|
15514
15598
|
this.winningDataSetsData = data.items || [];
|
|
15515
15599
|
this.drawData = this.winningDataSetsData.map((item) => item);
|
|
15516
15600
|
this.totalResults = data.total;
|
|
15517
|
-
}
|
|
15518
|
-
|
|
15519
|
-
console.
|
|
15520
|
-
}
|
|
15521
|
-
|
|
15601
|
+
}
|
|
15602
|
+
catch (err) {
|
|
15603
|
+
console.error('Failed to fetch draw data:', err);
|
|
15604
|
+
}
|
|
15605
|
+
finally {
|
|
15522
15606
|
this.isLoading = false;
|
|
15523
|
-
this.noResults = this.drawData.filter(draw => draw.winningNumbers).length
|
|
15524
|
-
}
|
|
15607
|
+
this.noResults = this.drawData.filter((draw) => draw.winningNumbers).length === 0;
|
|
15608
|
+
}
|
|
15525
15609
|
};
|
|
15526
15610
|
this.transDataToString = (data) => {
|
|
15527
15611
|
try {
|
|
@@ -15607,9 +15691,10 @@ const LotteryDrawResultsHistory = class {
|
|
|
15607
15691
|
clearInterval(this.interval);
|
|
15608
15692
|
}
|
|
15609
15693
|
render() {
|
|
15610
|
-
let gridHeader = h("div", { key: '
|
|
15611
|
-
return h("section", { key: '
|
|
15612
|
-
|
|
15694
|
+
let gridHeader = (h("div", { key: 'e4832e084ccfae7d795eedf7ac6138747764e4e5', class: "DrawResultsHeader" }, h("div", { key: '79638fcb05a24d05453adb065f668c2ac0375fd5', class: "DrawResultsHeaderContent" }, h("h4", { key: '6e95020a200139365cf7e01ef64ca7428595546e' }, translate$5('drawResultsHeader', this.language)), h("div", { key: '0f53a9527c2751e4ba33435f4833ab7d8c463080', class: "FilterSection" }, h("helper-filters", { key: '18c8dbe76602e4bb95d20a3e0df9401c24238be5', "activate-ticket-search": "false", "game-id": this.gameId, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })))));
|
|
15695
|
+
return (h("section", { key: '5e000a3c95bdc97e68a49165a0d7658fea684a55', class: "GridWrapper", ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'd933a1a9a87de5bf7ca2c7c109e0f2b1576a0994', class: "DrawResultsSection" }, h("div", { key: 'a140aa6e6291f8832ec9883dafd9837e04a2909c', class: "DrawResultsAreaHistory" }, gridHeader, h("div", { key: '81488ac1c92b8be651d38f4eb8038e21c81508cb', class: "HistoryGridWrapper" }, h("div", { key: '08614a4e9ab66dcfc5f0408363ddb08a24231931', class: "HistoryGrid" }, this.isLoading && h("p", { key: 'ebd6fe7e16bb36335702520358ac999e34e7b5d6' }, translate$5('loading', this.language)), !this.isLoading &&
|
|
15696
|
+
!this.noResults &&
|
|
15697
|
+
this.drawData.map((item) => (h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true, language: this.language, "history-draw-data": this.transDataToString(item), "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }))), !this.isLoading && this.noResults && h("p", { key: '4a285a51dddff8e984400a6f390c1919d5fcd5ae', class: "errorText" }, translate$5('noResults', this.language)))), h("div", { key: '13d10caed463e12b218341531c2dd34825968d88', class: "DrawHistoryPaginationWrapper" }, this.totalResults > this.limit && (h("lottery-pagination", { key: '89ff3a6354036d1e3fbad82d8aec9aa4e9c19f66', arrowsActive: true, numberedNavActive: true, "is-reset": this.isReset, "first-page": false, "prev-page": true, "next-page": true, offset: this.offset, limit: this.limit, total: this.totalResults, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })))))));
|
|
15613
15698
|
}
|
|
15614
15699
|
static get watchers() { return {
|
|
15615
15700
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -6662,4 +6662,4 @@ Yt("vaadin-tabs",B`
|
|
|
6662
6662
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
6663
6663
|
* MIT Licence
|
|
6664
6664
|
*/
|
|
6665
|
-
var e,i,s,r,o=9e15,n=1e9,a="0123456789abcdef",l="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-o,maxE:o,crypto:!1},d=!0,u="[DecimalError] ",p=u+"Invalid argument: ",m=u+"Precision limit exceeded",f=u+"crypto unavailable",v="[object Decimal]",b=Math.floor,g=Math.pow,y=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,k=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,C=7,S=l.length-1,T=h.length-1,D={toStringTag:v};function I(t){var e,i,s,r=t.length-1,o="",n=t[0];if(r>0){for(o+=n,e=1;e<r;e++)(i=C-(s=t[e]+"").length)&&(o+=R(i)),o+=s;(i=C-(s=(n=t[e])+"").length)&&(o+=R(i))}else if(0===n)return"0";for(;n%10==0;)n/=10;return o+n}function A(t,e,i){if(t!==~~t||t<e||t>i)throw Error(p+t)}function z(t,e,i,s){var r,o,n,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=C,r=0):(r=Math.ceil((e+1)/C),e%=C),o=g(10,C-e),a=t[r]%o|0,null==s?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),n=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):n=(i<4&&a+1==o||i>3&&a+1==o/2)&&(t[r+1]/o/100|0)==g(10,e-2)-1||(a==o/2||0==a)&&!(t[r+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),n=(s||i<4)&&9999==a||!s&&i>3&&4999==a):n=((s||i<4)&&a+1==o||!s&&i>3&&a+1==o/2)&&(t[r+1]/o/1e3|0)==g(10,e-3)-1,n}function M(t,e,i){for(var s,r,o=[0],n=0,l=t.length;n<l;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=a.indexOf(t.charAt(n++)),s=0;s<o.length;s++)o[s]>i-1&&(void 0===o[s+1]&&(o[s+1]=0),o[s+1]+=o[s]/i|0,o[s]%=i)}return o.reverse()}D.absoluteValue=D.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),P(t)},D.ceil=function(){return P(new this.constructor(this),this.e+1,2)},D.clampedTo=D.clamp=function(t,e){var i=this,s=i.constructor;if(t=new s(t),e=new s(e),!t.s||!e.s)return new s(NaN);if(t.gt(e))throw Error(p+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new s(i)},D.comparedTo=D.cmp=function(t){var e,i,s,r,o=this,n=o.d,a=(t=new o.constructor(t)).d,l=o.s,h=t.s;if(!n||!a)return l&&h?l!==h?l:n===a?0:!n^l<0?1:-1:NaN;if(!n[0]||!a[0])return n[0]?l:a[0]?-h:0;if(l!==h)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,i=(s=n.length)<(r=a.length)?s:r;e<i;++e)if(n[e]!==a[e])return n[e]>a[e]^l<0?1:-1;return s===r?0:s>r^l<0?1:-1},D.cosine=D.cos=function(){var t,e,i=this,s=i.constructor;return i.d?i.d[0]?(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s,r;if(e.isZero())return e;(s=e.d.length)<32?r=(1/J(4,i=Math.ceil(s/3))).toString():(i=16,r="2.3283064365386962890625e-10"),t.precision+=i,e=Y(t,1,e.times(r),new t(1));for(var o=i;o--;){var n=e.times(e);e=n.times(n).minus(n).times(8).plus(1)}return t.precision-=i,e}(s,K(s,i)),s.precision=t,s.rounding=e,P(2==r||3==r?i.neg():i,t,e,!0)):new s(1):new s(NaN)},D.cubeRoot=D.cbrt=function(){var t,e,i,s,r,o,n,a,l,h,c=this,u=c.constructor;if(!c.isFinite()||c.isZero())return new u(c);for(d=!1,(o=c.s*g(c.s*c,1/3))&&Math.abs(o)!=1/0?s=new u(o.toString()):(i=I(c.d),(o=((t=c.e)-i.length+1)%3)&&(i+=1==o||-2==o?"0":"00"),o=g(i,1/3),t=b((t+1)/3)-(t%3==(t<0?-1:2)),(s=new u(i=o==1/0?"5e"+t:(i=o.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),n=(t=u.precision)+3;;)if(h=(l=(a=s).times(a).times(a)).plus(c),s=N(h.plus(c).times(a),h.plus(l),n+2,1),I(a.d).slice(0,n)===(i=I(s.d)).slice(0,n)){if("9999"!=(i=i.slice(n-3,n+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(P(s,t+1,1),e=!s.times(s).times(s).eq(c));break}if(!r&&(P(a,t+1,0),a.times(a).times(a).eq(c))){s=a;break}n+=4,r=1}return d=!0,P(s,t,u.rounding,e)},D.decimalPlaces=D.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=((t=e.length-1)-b(this.e/C))*C,t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},D.dividedBy=D.div=function(t){return N(this,new this.constructor(t))},D.dividedToIntegerBy=D.divToInt=function(t){var e=this.constructor;return P(N(this,new e(t),0,1,1),e.precision,e.rounding)},D.equals=D.eq=function(t){return 0===this.cmp(t)},D.floor=function(){return P(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(t){return this.cmp(t)>0},D.greaterThanOrEqualTo=D.gte=function(t){var e=this.cmp(t);return 1==e||0===e},D.hyperbolicCosine=D.cosh=function(){var t,e,i,s,r,o=this,n=o.constructor,a=new n(1);if(!o.isFinite())return new n(o.s?1/0:NaN);if(o.isZero())return a;s=n.rounding,n.precision=(i=n.precision)+Math.max(o.e,o.sd())+4,n.rounding=1,(r=o.d.length)<32?e=(1/J(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=Y(n,1,o.times(e),new n(1),!0);for(var l,h=t,c=new n(8);h--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return P(o,n.precision=i,n.rounding=s,!0)},D.hyperbolicSine=D.sinh=function(){var t,e,i,s,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(i=o.rounding,o.precision=(e=o.precision)+Math.max(r.e,r.sd())+4,o.rounding=1,(s=r.d.length)<3)r=Y(o,2,r,r,!0);else{t=1.4*Math.sqrt(s),r=Y(o,2,r=r.times(1/J(5,t=t>16?16:0|t)),r,!0);for(var n,a=new o(5),l=new o(16),h=new o(20);t--;)n=r.times(r),r=r.times(a.plus(n.times(l.times(n).plus(h))))}return o.precision=e,o.rounding=i,P(r,e,i,!0)},D.hyperbolicTangent=D.tanh=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+7,s.rounding=1,N(i.sinh(),i.cosh(),s.precision=t,s.rounding=e)):new s(i.s)},D.inverseCosine=D.acos=function(){var t=this,e=t.constructor,i=t.abs().cmp(1),s=e.precision,r=e.rounding;return-1!==i?0===i?t.isNeg()?F(e,s,r):new e(0):new e(NaN):t.isZero()?F(e,s+4,r).times(.5):(e.precision=s+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=s,e.rounding=r,t.times(2))},D.inverseHyperbolicCosine=D.acosh=function(){var t,e,i=this,s=i.constructor;return i.lte(1)?new s(i.eq(1)?0:NaN):i.isFinite()?(e=s.rounding,s.precision=(t=s.precision)+Math.max(Math.abs(i.e),i.sd())+4,s.rounding=1,d=!1,i=i.times(i).minus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln()):new s(i)},D.inverseHyperbolicSine=D.asinh=function(){var t,e,i=this,s=i.constructor;return!i.isFinite()||i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,s.rounding=1,d=!1,i=i.times(i).plus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln())},D.inverseHyperbolicTangent=D.atanh=function(){var t,e,i,s,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=o.precision,e=o.rounding,s=r.sd(),Math.max(s,t)<2*-r.e-1?P(new o(r),t,e,!0):(o.precision=i=s-r.e,r=N(r.plus(1),new o(1).minus(r),i+t,1),o.precision=t+4,o.rounding=1,r=r.ln(),o.precision=t,o.rounding=e,r.times(.5))):new o(NaN)},D.inverseSine=D.asin=function(){var t,e,i,s,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),i=o.precision,s=o.rounding,-1!==e?0===e?((t=F(o,i+4,s).times(.5)).s=r.s,t):new o(NaN):(o.precision=i+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=i,o.rounding=s,r.times(2)))},D.inverseTangent=D.atan=function(){var t,e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(h.isFinite()){if(h.isZero())return new c(h);if(h.abs().eq(1)&&u+4<=T)return(n=F(c,u+4,p).times(.25)).s=h.s,n}else{if(!h.s)return new c(NaN);if(u+4<=T)return(n=F(c,u+4,p).times(.5)).s=h.s,n}for(c.precision=a=u+10,c.rounding=1,t=i=Math.min(28,a/C+2|0);t;--t)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/C),s=1,l=h.times(h),n=new c(h),r=h;-1!==t;)if(r=r.times(l),o=n.minus(r.div(s+=2)),r=r.times(l),void 0!==(n=o.plus(r.div(s+=2))).d[e])for(t=e;n.d[t]===o.d[t]&&t--;);return i&&(n=n.times(2<<i-1)),d=!0,P(n,c.precision=u,c.rounding=p,!0)},D.isFinite=function(){return!!this.d},D.isInteger=D.isInt=function(){return!!this.d&&b(this.e/C)>this.d.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isPositive=D.isPos=function(){return this.s>0},D.isZero=function(){return!!this.d&&0===this.d[0]},D.lessThan=D.lt=function(t){return this.cmp(t)<0},D.lessThanOrEqualTo=D.lte=function(t){return this.cmp(t)<1},D.logarithm=D.log=function(t){var e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=h.d,h.s<0||!i||!i[0]||h.eq(1))return new c(i&&!i[0]?-1/0:1!=h.s?NaN:i?0:1/0);if(e)if(i.length>1)o=!0;else{for(r=i[0];r%10==0;)r/=10;o=1!==r}if(d=!1,n=G(h,a=u+5),s=e?E(c,a+10):G(t,a),z((l=N(n,s,a,1)).d,r=u,p))do{if(n=G(h,a+=10),s=e?E(c,a+10):G(t,a),l=N(n,s,a,1),!o){+I(l.d).slice(r+1,r+15)+1==1e14&&(l=P(l,u+1,0));break}}while(z(l.d,r+=10,p));return d=!0,P(l,u,p)},D.minus=D.sub=function(t){var e,i,s,r,o,n,a,l,h,c,u,p,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d?t.s=-t.s:t=new f(t.d||m.s!==t.s?m:NaN):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(p=t.d,a=f.precision,l=f.rounding,!(h=m.d)[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!h[0])return new f(3===l?-0:0);t=new f(m)}return d?P(t,a,l):t}if(i=b(t.e/C),c=b(m.e/C),h=h.slice(),o=c-i){for((u=o<0)?(e=h,o=-o,n=p.length):(e=p,i=c,n=h.length),o>(s=Math.max(Math.ceil(a/C),n)+2)&&(o=s,e.length=1),e.reverse(),s=o;s--;)e.push(0);e.reverse()}else{for((u=(s=h.length)<(n=p.length))&&(n=s),s=0;s<n;s++)if(h[s]!=p[s]){u=h[s]<p[s];break}o=0}for(u&&(e=h,h=p,p=e,t.s=-t.s),s=p.length-(n=h.length);s>0;--s)h[n++]=0;for(s=p.length;s>o;){if(h[--s]<p[s]){for(r=s;r&&0===h[--r];)h[r]=_-1;--h[r],h[s]+=_}h[s]-=p[s]}for(;0===h[--n];)h.pop();for(;0===h[0];h.shift())--i;return h[0]?(t.d=h,t.e=O(h,i),d?P(t,a,l):t):new f(3===l?-0:0)},D.modulo=D.mod=function(t){var e,i=this,s=i.constructor;return t=new s(t),!i.d||!t.s||t.d&&!t.d[0]?new s(NaN):!t.d||i.d&&!i.d[0]?P(new s(i),s.precision,s.rounding):(d=!1,9==s.modulo?(e=N(i,t.abs(),0,3,1)).s*=t.s:e=N(i,t,0,s.modulo,1),e=e.times(t),d=!0,i.minus(e))},D.naturalExponential=D.exp=function(){return H(this)},D.naturalLogarithm=D.ln=function(){return G(this)},D.negated=D.neg=function(){var t=new this.constructor(this);return t.s=-t.s,P(t)},D.plus=D.add=function(t){var e,i,s,r,o,n,a,l,h,c,u=this,p=u.constructor;if(t=new p(t),!u.d||!t.d)return u.s&&t.s?u.d||(t=new p(t.d||u.s===t.s?u:NaN)):t=new p(NaN),t;if(u.s!=t.s)return t.s=-t.s,u.minus(t);if(c=t.d,a=p.precision,l=p.rounding,!(h=u.d)[0]||!c[0])return c[0]||(t=new p(u)),d?P(t,a,l):t;if(o=b(u.e/C),s=b(t.e/C),h=h.slice(),r=o-s){for(r<0?(i=h,r=-r,n=c.length):(i=c,s=o,n=h.length),r>(n=(o=Math.ceil(a/C))>n?o+1:n+1)&&(r=n,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((n=h.length)-(r=c.length)<0&&(r=n,i=c,c=h,h=i),e=0;r;)e=(h[--r]=h[r]+c[r]+e)/_|0,h[r]%=_;for(e&&(h.unshift(e),++s),n=h.length;0==h[--n];)h.pop();return t.d=h,t.e=O(h,s),d?P(t,a,l):t},D.precision=D.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return i.d?(e=j(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},D.round=function(){var t=this,e=t.constructor;return P(new e(t),t.e+1,e.rounding)},D.sine=D.sin=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s=e.d.length;if(s<3)return e.isZero()?e:Y(t,2,e,e);i=1.4*Math.sqrt(s),e=Y(t,2,e=e.times(1/J(5,i=i>16?16:0|i)),e);for(var r,o=new t(5),n=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(o.plus(r.times(n.times(r).minus(a))));return e}(s,K(s,i)),s.precision=t,s.rounding=e,P(r>2?i.neg():i,t,e,!0)):new s(NaN)},D.squareRoot=D.sqrt=function(){var t,e,i,s,r,o,n=this,a=n.d,l=n.e,h=n.s,c=n.constructor;if(1!==h||!a||!a[0])return new c(!h||h<0&&(!a||a[0])?NaN:a?n:1/0);for(d=!1,0==(h=Math.sqrt(+n))||h==1/0?(((e=I(a)).length+l)%2==0&&(e+="0"),h=Math.sqrt(e),l=b((l+1)/2)-(l<0||l%2),s=new c(e=h==1/0?"5e"+l:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+l)):s=new c(h.toString()),i=(l=c.precision)+3;;)if(s=(o=s).plus(N(n,o,i+2,1)).times(.5),I(o.d).slice(0,i)===(e=I(s.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(P(s,l+1,1),t=!s.times(s).eq(n));break}if(!r&&(P(o,l+1,0),o.times(o).eq(n))){s=o;break}i+=4,r=1}return d=!0,P(s,l,c.rounding,t)},D.tangent=D.tan=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+10,s.rounding=1,(i=i.sin()).s=1,i=N(i,new s(1).minus(i.times(i)).sqrt(),t+10,0),s.precision=t,s.rounding=e,P(2==r||4==r?i.neg():i,t,e,!0)):new s(NaN)},D.times=D.mul=function(t){var e,i,s,r,o,n,a,l,h,c=this,u=c.constructor,p=c.d,m=(t=new u(t)).d;if(t.s*=c.s,!(p&&p[0]&&m&&m[0]))return new u(!t.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*t.s:t.s/0);for(i=b(c.e/C)+b(t.e/C),(l=p.length)<(h=m.length)&&(o=p,p=m,m=o,n=l,l=h,h=n),o=[],s=n=l+h;s--;)o.push(0);for(s=h;--s>=0;){for(e=0,r=l+s;r>s;)a=o[r]+m[s]*p[r-s-1]+e,o[r--]=a%_|0,e=a/_|0;o[r]=(o[r]+e)%_|0}for(;!o[--n];)o.pop();return e?++i:o.shift(),t.d=o,t.e=O(o,i),d?P(t,u.precision,u.rounding):t},D.toBinary=function(t,e){return Z(this,2,t,e)},D.toDecimalPlaces=D.toDP=function(t,e){var i=this,s=i.constructor;return i=new s(i),void 0===t?i:(A(t,0,n),void 0===e?e=s.rounding:A(e,0,8),P(i,t+i.e+1,e))},D.toExponential=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,!0):(A(t,0,n),void 0===e?e=r.rounding:A(e,0,8),i=B(s=P(new r(s),t+1,e),!0,t+1)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toFixed=function(t,e){var i,s,r=this,o=r.constructor;return void 0===t?i=B(r):(A(t,0,n),void 0===e?e=o.rounding:A(e,0,8),i=B(s=P(new o(r),t+r.e+1,e),!1,t+s.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},D.toFraction=function(t){var e,i,s,r,o,n,a,l,h,c,u,m,f=this,v=f.d,b=f.constructor;if(!v)return new b(f);if(h=i=new b(1),s=l=new b(0),o=(e=new b(s)).e=j(v)-f.e-1,e.d[0]=g(10,(n=o%C)<0?C+n:n),null==t)t=o>0?e:h;else{if(!(a=new b(t)).isInt()||a.lt(h))throw Error(p+a);t=a.gt(e)?o>0?e:h:a}for(d=!1,a=new b(I(v)),c=b.precision,b.precision=o=v.length*C*2;u=N(a,e,0,1,1),1!=(r=i.plus(u.times(s))).cmp(t);)i=s,s=r,h=l.plus(u.times(r=h)),l=r,e=a.minus(u.times(r=e)),a=r;return r=N(t.minus(i),s,0,1,1),l=l.plus(r.times(h)),i=i.plus(r.times(s)),l.s=h.s=f.s,m=N(h,s,o,1).minus(f).abs().cmp(N(l,i,o,1).minus(f).abs())<1?[h,s]:[l,i],b.precision=c,d=!0,m},D.toHexadecimal=D.toHex=function(t,e){return Z(this,16,t,e)},D.toNearest=function(t,e){var i=this,s=i.constructor;if(i=new s(i),null==t){if(!i.d)return i;t=new s(1),e=s.rounding}else{if(t=new s(t),void 0===e?e=s.rounding:A(e,0,8),!i.d)return t.s?i:t;if(!t.d)return t.s&&(t.s=i.s),t}return t.d[0]?(d=!1,i=N(i,t,0,e,1).times(t),d=!0,P(i)):(t.s=i.s,i=t),i},D.toNumber=function(){return+this},D.toOctal=function(t,e){return Z(this,8,t,e)},D.toPower=D.pow=function(t){var e,i,s,r,o,n,a=this,l=a.constructor,h=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(g(+a,h));if((a=new l(a)).eq(1))return a;if(s=l.precision,o=l.rounding,t.eq(1))return P(a,s,o);if((e=b(t.e/C))>=t.d.length-1&&(i=h<0?-h:h)<=9007199254740991)return r=L(l,a,i,s),t.s<0?new l(1).div(r):P(r,s,o);if((n=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(n=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=n,a}return(e=0!=(i=g(+a,h))&&isFinite(i)?new l(i+"").e:b(h*(Math.log("0."+I(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?n/0:0):(d=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=H(t.times(G(a,s+i)),s)).d&&z((r=P(r,s+5,1)).d,s,o)&&+I((r=P(H(t.times(G(a,(e=s+10)+i)),e),e+5,1)).d).slice(s+1,s+15)+1==1e14&&(r=P(r,s+1,0)),r.s=n,d=!0,l.rounding=o,P(r,s,o))},D.toPrecision=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,s.e<=r.toExpNeg||s.e>=r.toExpPos):(A(t,1,n),void 0===e?e=r.rounding:A(e,0,8),i=B(s=P(new r(s),t,e),t<=s.e||s.e<=r.toExpNeg,t)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toSignificantDigits=D.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(A(t,1,n),void 0===e?e=i.rounding:A(e,0,8)),P(new i(this),t,e)},D.toString=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},D.truncated=D.trunc=function(){return P(new this.constructor(this),this.e+1,1)},D.valueOf=D.toJSON=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var N=function(){function t(t,e,i){var s,r=0,o=t.length;for(t=t.slice();o--;)t[o]=(s=t[o]*e+r)%i|0,r=s/i|0;return r&&t.unshift(r),t}function e(t,e,i,s){var r,o;if(i!=s)o=i>s?1:-1;else for(r=o=0;r<i;r++)if(t[r]!=e[r]){o=t[r]>e[r]?1:-1;break}return o}function s(t,e,i,s){for(var r=0;i--;)t[i]-=r,t[i]=(r=t[i]<e[i]?1:0)*s+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,o,n,a,l,h){var c,d,u,p,m,f,v,g,y,w,x,k,S,T,D,I,A,z,M,N,B=r.constructor,O=r.s==o.s?1:-1,E=r.d,F=o.d;if(!(E&&E[0]&&F&&F[0]))return new B(r.s&&o.s&&(E?!F||E[0]!=F[0]:F)?E&&0==E[0]||!F?0*O:O/0:NaN);for(h?(m=1,d=r.e-o.e):(h=_,d=b(r.e/(m=C))-b(o.e/m)),M=F.length,A=E.length,w=(y=new B(O)).d=[],u=0;F[u]==(E[u]||0);u++);if(F[u]>(E[u]||0)&&d--,null==n?(T=n=B.precision,a=B.rounding):T=l?n+(r.e-o.e)+1:n,T<0)w.push(1),f=!0;else{if(T=T/m+2|0,u=0,1==M){for(p=0,F=F[0],T++;(u<A||p)&&T--;u++)w[u]=(D=p*h+(E[u]||0))/F|0,p=D%F|0;f=p||u<A}else{for((p=h/(F[0]+1)|0)>1&&(F=t(F,p,h),E=t(E,p,h),M=F.length,A=E.length),I=M,k=(x=E.slice(0,M)).length;k<M;)x[k++]=0;(N=F.slice()).unshift(0),z=F[0],F[1]>=h/2&&++z;do{p=0,(c=e(F,x,M,k))<0?(S=x[0],M!=k&&(S=S*h+(x[1]||0)),(p=S/z|0)>1?(p>=h&&(p=h-1),1==(c=e(v=t(F,p,h),x,g=v.length,k=x.length))&&(p--,s(v,M<g?N:F,g,h))):(0==p&&(c=p=1),v=F.slice()),(g=v.length)<k&&v.unshift(0),s(x,v,k,h),-1==c&&(c=e(F,x,M,k=x.length))<1&&(p++,s(x,M<k?N:F,k,h)),k=x.length):0===c&&(p++,x=[0]),w[u++]=p,c&&x[0]?x[k++]=E[I]||0:(x=[E[I]],k=1)}while((I++<A||void 0!==x[0])&&T--);f=void 0!==x[0]}w[0]||w.shift()}if(1==m)y.e=d,i=f;else{for(u=1,p=w[0];p>=10;p/=10)u++;y.e=u+d*m-1,P(y,l?n+y.e+1:n,a,f)}return y}}();function P(t,e,i,s){var r,o,n,a,l,h,c,u,p,m=t.constructor;t:if(null!=e){if(!(u=t.d))return t;for(r=1,a=u[0];a>=10;a/=10)r++;if((o=e-r)<0)o+=C,l=(c=u[p=0])/g(10,r-(n=e)-1)%10|0;else if((p=Math.ceil((o+1)/C))>=(a=u.length)){if(!s)break t;for(;a++<=p;)u.push(0);c=l=0,r=1,n=(o%=C)-C+1}else{for(c=a=u[p],r=1;a>=10;a/=10)r++;l=(n=(o%=C)-C+r)<0?0:c/g(10,r-n-1)%10|0}if(s=s||e<0||void 0!==u[p+1]||(n<0?c:c%g(10,r-n-1)),h=i<4?(l||s)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||s||6==i&&(o>0?n>0?c/g(10,r-n):0:u[p-1])%10&1||i==(t.s<0?8:7)),e<1||!u[0])return u.length=0,h?(u[0]=g(10,(C-(e-=t.e+1)%C)%C),t.e=-e||0):u[0]=t.e=0,t;if(0==o?(u.length=p,a=1,p--):(u.length=p+1,a=g(10,C-o),u[p]=n>0?(c/g(10,r-n)%g(10,n)|0)*a:0),h)for(;;){if(0==p){for(o=1,n=u[0];n>=10;n/=10)o++;for(n=u[0]+=a,a=1;n>=10;n/=10)a++;o!=a&&(t.e++,u[0]==_&&(u[0]=1));break}if(u[p]+=a,u[p]!=_)break;u[p--]=0,a=1}for(o=u.length;0===u[--o];)u.pop()}return d&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function B(t,e,i){if(!t.isFinite())return U(t);var s,r=t.e,o=I(t.d),n=o.length;return e?(i&&(s=i-n)>0?o=o.charAt(0)+"."+o.slice(1)+R(s):n>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):r<0?(o="0."+R(-r-1)+o,i&&(s=i-n)>0&&(o+=R(s))):r>=n?(o+=R(r+1-n),i&&(s=i-r-1)>0&&(o=o+"."+R(s))):((s=r+1)<n&&(o=o.slice(0,s)+"."+o.slice(s)),i&&(s=i-n)>0&&(r+1===n&&(o+="."),o+=R(s))),o}function O(t,e){var i=t[0];for(e*=C;i>=10;i/=10)e++;return e}function E(t,e,i){if(e>S)throw d=!0,i&&(t.precision=i),Error(m);return P(new t(l),e,1,!0)}function F(t,e,i){if(e>T)throw Error(m);return P(new t(h),e,i,!0)}function j(t){var e=t.length-1,i=e*C+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function R(t){for(var e="";t--;)e+="0";return e}function L(t,e,i,s){var r,o=new t(1),n=Math.ceil(s/C+4);for(d=!1;;){if(i%2&&X((o=o.times(e)).d,n)&&(r=!0),0===(i=b(i/2))){i=o.d.length-1,r&&0===o.d[i]&&++o.d[i];break}X((e=e.times(e)).d,n)}return d=!0,o}function $(t){return 1&t.d[t.d.length-1]}function W(t,e,i){for(var s,r,o=new t(e[0]),n=0;++n<e.length;){if(!(r=new t(e[n])).s){o=r;break}((s=o.cmp(r))===i||0===s&&o.s===i)&&(o=r)}return o}function H(t,e){var i,s,r,o,n,a,l,h=0,c=0,u=0,p=t.constructor,m=p.rounding,f=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,l=f):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),u+=5;for(l+=s=Math.log(g(2,u))/Math.LN10*2+5|0,i=o=n=new p(1),p.precision=l;;){if(o=P(o.times(t),l,1),i=i.times(++c),I((a=n.plus(N(o,i,l,1))).d).slice(0,l)===I(n.d).slice(0,l)){for(r=u;r--;)n=P(n.times(n),l,1);if(null!=e)return p.precision=f,n;if(!(h<3&&z(n.d,l-s,m,h)))return P(n,p.precision=f,m,d=!0);p.precision=l+=10,i=o=a=new p(1),c=0,h++}n=a}}function G(t,e){var i,s,r,o,n,a,l,h,c,u,p,m=1,f=t,v=f.d,b=f.constructor,g=b.rounding,y=b.precision;if(f.s<0||!v||!v[0]||!f.e&&1==v[0]&&1==v.length)return new b(v&&!v[0]?-1/0:1!=f.s?NaN:v?0:f);if(null==e?(d=!1,c=y):c=e,b.precision=c+=10,s=(i=I(v)).charAt(0),!(Math.abs(o=f.e)<15e14))return h=E(b,c+2,y).times(o+""),f=G(new b(s+"."+i.slice(1)),c-10).plus(h),b.precision=y,null==e?P(f,y,g,d=!0):f;for(;s<7&&1!=s||1==s&&i.charAt(1)>3;)s=(i=I((f=f.times(t)).d)).charAt(0),m++;for(o=f.e,s>1?(f=new b("0."+i),o++):f=new b(s+"."+i.slice(1)),u=f,l=n=f=N(f.minus(1),f.plus(1),c,1),p=P(f.times(f),c,1),r=3;;){if(n=P(n.times(p),c,1),I((h=l.plus(N(n,new b(r),c,1))).d).slice(0,c)===I(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(E(b,c+2,y).times(o+""))),l=N(l,new b(m),c,1),null!=e)return b.precision=y,l;if(!z(l.d,c-10,g,a))return P(l,b.precision=y,g,d=!0);b.precision=c+=10,h=n=f=N(u.minus(1),u.plus(1),c,1),p=P(f.times(f),c,1),r=a=1}l=h,r+=2}}function U(t){return String(t.s*t.s/0)}function V(t,e){var i,s,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(s=e.search(/e/i))>0?(i<0&&(i=s),i+=+e.slice(s+1),e=e.substring(0,s)):i<0&&(i=e.length),s=0;48===e.charCodeAt(s);s++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(s,r)){if(r-=s,t.e=i=i-s-1,t.d=[],s=(i+1)%C,i<0&&(s+=C),s<r){for(s&&t.d.push(+e.slice(0,s)),r-=C;s<r;)t.d.push(+e.slice(s,s+=C));e=e.slice(s),s=C-e.length}else s-=r;for(;s--;)e+="0";t.d.push(+e),d&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function q(t,i){var s,r,o,n,a,l,h,c,u;if(i.indexOf("_")>-1){if(i=i.replace(/(\d)_(?=\d)/g,"$1"),k.test(i))return V(t,i)}else if("Infinity"===i||"NaN"===i)return+i||(t.s=NaN),t.e=NaN,t.d=null,t;if(w.test(i))s=16,i=i.toLowerCase();else if(y.test(i))s=2;else{if(!x.test(i))throw Error(p+i);s=8}for((n=i.search(/p/i))>0?(h=+i.slice(n+1),i=i.substring(2,n)):i=i.slice(2),n=i.indexOf("."),r=t.constructor,(a=n>=0)&&(n=(l=(i=i.replace(".","")).length)-n,o=L(r,new r(s),n,2*n)),n=u=(c=M(i,s,_)).length-1;0===c[n];--n)c.pop();return n<0?new r(0*t.s):(t.e=O(c,u),t.d=c,d=!1,a&&(t=N(t,o,4*l)),h&&(t=t.times(Math.abs(h)<54?g(2,h):e.pow(2,h))),d=!0,t)}function Y(t,e,i,s,r){var o,n,a,l,h=t.precision,c=Math.ceil(h/C);for(d=!1,l=i.times(i),a=new t(s);;){if(n=N(a.times(l),new t(e++*e++),h,1),a=r?s.plus(n):s.minus(n),s=N(n.times(l),new t(e++*e++),h,1),void 0!==(n=a.plus(s)).d[c]){for(o=c;n.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=s,s=n,n=o}return d=!0,n.d.length=c+1,n}function J(t,e){for(var i=t;--e;)i*=t;return i}function K(t,e){var i,s=e.s<0,o=F(t,t.precision,1),n=o.times(.5);if((e=e.abs()).lte(n))return r=s?4:1,e;if((i=e.divToInt(o)).isZero())r=s?3:2;else{if((e=e.minus(i.times(o))).lte(n))return r=$(i)?s?2:3:s?4:1,e;r=$(i)?s?1:4:s?3:2}return e.minus(o).abs()}function Z(t,e,s,r){var o,l,h,c,d,u,p,m,f,v=t.constructor,b=void 0!==s;if(b?(A(s,1,n),void 0===r?r=v.rounding:A(r,0,8)):(s=v.precision,r=v.rounding),t.isFinite()){for(b?(o=2,16==e?s=4*s-3:8==e&&(s=3*s-2)):o=e,(h=(p=B(t)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new v(1)).e=p.length-h,f.d=M(B(f),10,o),f.e=f.d.length),l=d=(m=M(p,10,o)).length;0==m[--d];)m.pop();if(m[0]){if(h<0?l--:((t=new v(t)).d=m,t.e=l,m=(t=N(t,f,s,r,0,o)).d,l=t.e,u=i),h=m[s],c=o/2,u=u||void 0!==m[s+1],u=r<4?(void 0!==h||u)&&(0===r||r===(t.s<0?3:2)):h>c||h===c&&(4===r||u||6===r&&1&m[s-1]||r===(t.s<0?8:7)),m.length=s,u)for(;++m[--s]>o-1;)m[s]=0,s||(++l,m.unshift(1));for(d=m.length;!m[d-1];--d);for(h=0,p="";h<d;h++)p+=a.charAt(m[h]);if(b){if(d>1)if(16==e||8==e){for(h=16==e?4:3,--d;d%h;d++)p+="0";for(d=(m=M(p,o,e)).length;!m[d-1];--d);for(h=1,p="1.";h<d;h++)p+=a.charAt(m[h])}else p=p.charAt(0)+"."+p.slice(1);p=p+(l<0?"p":"p+")+l}else if(l<0){for(;++l;)p="0"+p;p="0."+p}else if(++l>d)for(l-=d;l--;)p+="0";else l<d&&(p=p.slice(0,l)+"."+p.slice(l))}else p=b?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=U(t);return t.s<0?"-"+p:p}function X(t,e){if(t.length>e)return t.length=e,!0}function Q(t){return new this(t).abs()}function tt(t){return new this(t).acos()}function et(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function st(t){return new this(t).asin()}function rt(t){return new this(t).asinh()}function ot(t){return new this(t).atan()}function nt(t){return new this(t).atanh()}function at(t,e){t=new this(t),e=new this(e);var i,s=this.precision,r=this.rounding,o=s+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?F(this,s,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=F(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,i=this.atan(N(t,e,o,1)),e=F(this,o,1),this.precision=s,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(N(t,e,o,1)):(i=F(this,o,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function lt(t){return new this(t).cbrt()}function ht(t){return P(t=new this(t),t.e+1,2)}function ct(t,e,i){return new this(t).clamp(e,i)}function dt(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,i,s,r=!0===t.defaults,a=["precision",1,n,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(i=a[e],r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!(b(s)===s&&s>=a[e+1]&&s<=a[e+2]))throw Error(p+i+": "+s);this[i]=s}if(i="crypto",r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!0!==s&&!1!==s&&0!==s&&1!==s)throw Error(p+i+": "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(f);this[i]=!0}else this[i]=!1}return this}function ut(t){return new this(t).cos()}function pt(t){return new this(t).cosh()}function mt(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function vt(t){return P(t=new this(t),t.e+1,3)}function bt(){var t,e,i=new this(0);for(d=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return d=!0,new this(1/0);i=e}return d=!0,i.sqrt()}function gt(t){return t instanceof e||t&&t.toStringTag===v||!1}function yt(t){return new this(t).ln()}function wt(t,e){return new this(t).log(e)}function xt(t){return new this(t).log(2)}function kt(t){return new this(t).log(10)}function _t(){return W(this,arguments,-1)}function Ct(){return W(this,arguments,1)}function St(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function Dt(t,e){return new this(t).pow(e)}function It(t){var e,i,s,r,o=0,a=new this(1),l=[];if(void 0===t?t=this.precision:A(t,1,n),s=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(s));o<s;)(r=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=r%1e7;else{if(!crypto.randomBytes)throw Error(f);for(e=crypto.randomBytes(s*=4);o<s;)(r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(l.push(r%1e7),o+=4);o=s/4}else for(;o<s;)l[o++]=1e7*Math.random()|0;for(s=l[--o],t%=C,s&&t&&(r=g(10,C-t),l[o]=(s/r|0)*r);0===l[o];o--)l.pop();if(o<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=C)l.shift();for(s=1,r=l[0];r>=10;r/=10)s++;s<C&&(i-=C-s)}return a.e=i,a.d=l,a}function At(t){return P(t=new this(t),t.e+1,this.rounding)}function zt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Mt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function Pt(t){return new this(t).sqrt()}function Bt(t,e){return new this(t).sub(e)}function Ot(){var t=0,e=arguments,i=new this(e[t]);for(d=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return d=!0,P(i,this.precision,this.rounding)}function Et(t){return new this(t).tan()}function Ft(t){return new this(t).tanh()}function jt(t){return P(t=new this(t),t.e+1,1)}e=function t(e){var i,s,r;function o(t){var e,i,s,r=this;if(!(r instanceof o))return new o(t);if(r.constructor=o,gt(t))return r.s=t.s,void(d?!t.d||t.e>o.maxE?(r.e=NaN,r.d=null):t.e<o.minE?(r.e=0,r.d=[0]):(r.e=t.e,r.d=t.d.slice()):(r.e=t.e,r.d=t.d?t.d.slice():t.d));if("number"==(s=typeof t)){if(0===t)return r.s=1/t<0?-1:1,r.e=0,void(r.d=[0]);if(t<0?(t=-t,r.s=-1):r.s=1,t===~~t&&t<1e7){for(e=0,i=t;i>=10;i/=10)e++;return void(d?e>o.maxE?(r.e=NaN,r.d=null):e<o.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[t]):(r.e=e,r.d=[t]))}return 0*t!=0?(t||(r.s=NaN),r.e=NaN,void(r.d=null)):V(r,t.toString())}if("string"===s)return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),k.test(t)?V(r,t):q(r,t);if("bigint"===s)return t<0?(t=-t,r.s=-1):r.s=1,V(r,t.toString());throw Error(p+t)}if(o.prototype=D,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=dt,o.clone=t,o.isDecimal=gt,o.abs=Q,o.acos=tt,o.acosh=et,o.add=it,o.asin=st,o.asinh=rt,o.atan=ot,o.atanh=nt,o.atan2=at,o.cbrt=lt,o.ceil=ht,o.clamp=ct,o.cos=ut,o.cosh=pt,o.div=mt,o.exp=ft,o.floor=vt,o.hypot=bt,o.ln=yt,o.log=wt,o.log10=kt,o.log2=xt,o.max=_t,o.min=Ct,o.mod=St,o.mul=Tt,o.pow=Dt,o.random=It,o.round=At,o.sign=zt,o.sin=Mt,o.sinh=Nt,o.sqrt=Pt,o.sub=Bt,o.sum=Ot,o.tan=Et,o.tanh=Ft,o.trunc=jt,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(s=r[i++])||(e[s]=this[s]);return o.config(e),o}(c),e.prototype.constructor=e,e.default=e.Decimal=e,l=new e(l),h=new e(h),Gh.exports?("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(D[Symbol.for("nodejs.util.inspect.custom")]=D.toString,D[Symbol.toStringTag]="Decimal"),Gh.exports=e):(t||(t="undefined"!=typeof self&&self&&self.self==self?self:window),s=t.Decimal,e.noConflict=function(){return t.Decimal=s,e},t.Decimal=e)}(Uh);const qh=Vh.exports,Yh=class{constructor(e){t(this,e),this.ticketDrawDetails=[],this.ticketDrawDetailsFlag=!0,this.displayPrizeCategory=t=>{const e=new Map;t.forEach((t=>{let i=t.divisionDisplayName,s=t.currency;if(i&&"None"!==i){const r=new qh(t.amount);if(e.has(i)){const t=e.get(i),o=t.amount.plus(r);e.set(i,{amount:o,currency:s,times:t.times+1})}else e.set(i,{amount:r,currency:s,times:1})}}));const i=[];for(let[t,s]of e.entries()){const e=s.amount.times(100).floor().dividedBy(100);i.push({prizeName:t,amount:e.toNumber(),currency:s.currency,times:s.times})}return i.sort(((t,e)=>e.prizeName.localeCompare(t.prizeName))),i},this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.playerId=void 0,this.drawMode=!1,this.drawId="",this.gameName="",this.ticketDate="",this.ticketStatus="",this.ticketId="",this.ticketType="",this.ticketAmount="",this.ticketCurrency="",this.ticketMultiplier=!1,this.ticketMultiplierNum=void 0,this.ticketDrawCount=0,this.ticketNumbers="",this.sessionId="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.ticketDrawData="",this.historyDrawData="",this.tabValue="",this.translationUrl=void 0,this.multiplier=3,this.isLoading=!0,this.hasErrors=!1,this.errorText="",this.ticketData=[],this.ticketDataLoaded=!1,this.ticketDraws=[],this.toggleDrawer=[!1],this.drawData=void 0,this.resultMap={Won:"Win",Lost:"Lose"}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Wh[e][i]=t[e][i]})))}connectedCallback(){if(this.historyDrawData&&(this.drawData=JSON.parse(this.historyDrawData)),this.ticketNumbers){let t=JSON.parse(this.ticketNumbers);this.gridNumbers=t.map((t=>t.selections)),this.gridSecondaryNumbers=t.map((t=>t.secondarySelections||[]))}this.isLoading=!1}componentWillRender(){this.ticketDrawData&&this.ticketDrawDetailsFlag&&(this.ticketDrawDetails=JSON.parse(this.ticketDrawData),this.ticketDrawDetails.forEach((t=>{this.getDrawData(t.drawId).then((e=>{t.drawData=Object.assign({},e);let i=this.displayPrizeCategory(t.details);t.details=[...i]}))})),this.ticketDrawDetailsFlag=!1)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}getDrawData(t){return this.isLoading=!0,new Promise(((e,i)=>{let s=new URL(`${this.endpoint}/games/${this.gameId}/draws/${t||this.drawId}`);fetch(s.href).then((t=>t.json())).then((i=>{t?e(i):(this.drawData=i,e(!0)),this.isLoading=!1})).catch((t=>{i(t),this.isLoading=!1}))}))}drawerToggle(t){this.toggleDrawer=this.toggleDrawer.map(((e,i)=>i==t?!e:e)),t>=this.toggleDrawer.length&&this.toggleDrawer.push(!0)}getDivision(t,e){var i,s;let r=t.division,o=null===(s=null===(i=e.drawData)||void 0===i?void 0:i.prizes)||void 0===s?void 0:s.filter((t=>t.order===r));return o&&o.length?o[0].division:null}render(){return this.isLoading?s("p",null,"Loading, please wait ..."):this.hasErrors?void s("p",null,this.errorText):s("section",{class:"DrawResultsSection",ref:t=>this.stylingContainer=t},this.drawMode?s("div",{class:"DrawResultsArea"},this.drawData&&s("div",null,s("div",{class:"DrawResultsHeader"},s("span",null,Hh("drawId",this.language),": ",this.drawData.id),s("span",null,Hh("drawDate",this.language),": ",xh(new Date(this.drawData.date),"dd/MM/yyyy"))),s("div",{class:"DrawResultsBody"},s("div",{class:"DrawNumbersGrid"},s("p",null,Hh("drawNumbersGridDraw",this.language)),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":this.drawData.winningNumbers.length&&this.drawData.winningNumbers[0].numbers.join(","),"secondary-numbers":this.drawData.winningNumbers.length?this.drawData.winningNumbers[0].secondaryNumbers.join(","):"","display-selected":!0,selectable:!1,language:this.language,"grid-type":"ticket","translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),s("div",{class:"DrawPrizes"},s("label",{class:"Label"},Hh("prize",this.language)," "),this.drawData.prizes.length?s("div",null," ",this.drawData.prizes.filter((t=>"None"!==t.division)).map((t=>s("div",null,s("span",{style:{"margin-right":"5px"}},t.division,":"),s("span",{style:{"margin-right":"4px"}}," ",this.thousandSeperator(t.amount.value)),s("span",null,t.amount.currency))))):s("div",null,"None")))))):s("div",{class:"DrawResultsArea TicketDraws"},s("div",{class:"DrawResultsBody"},s("div",{class:"TicketIdContainer"},s("label",{class:"Label"},Hh("ticketId",this.language),": ",s("span",null,this.ticketId))),s("div",{class:"TicketTypeContainer"},s("label",{class:"Label"},Hh("ticketType",this.language),": ",s("span",null,this.ticketType))),s("div",{class:"TicketAmountContainer"},s("label",{class:"Label"},Hh("ticketAmount",this.language),":"," ",s("span",null,`${this.thousandSeperator(this.ticketAmount)} ${this.ticketCurrency}`))),s("div",{class:"DrawNumbersGrid"},this.gridNumbers.map(((t,e)=>{var i;return s("div",null,s("label",{class:"Label"},Hh("drawNumbersGridTicket",this.language),":"),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":t.join(","),"secondary-numbers":null===(i=this.gridSecondaryNumbers[e])||void 0===i?void 0:i.join(","),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))}))),this.ticketMultiplier&&s("div",{class:"DrawMultipler"},s("label",{class:"Label"},Hh("multiplierNum",this.language),": ",this.thousandSeperator(this.ticketMultiplierNum))),s("div",{class:"NumberOfDrawsContainer"},s("label",{class:"Label"},Hh("numberOfDraws",this.language),": ",this.thousandSeperator(this.ticketDrawCount)),s("div",{class:"DrawTicketsContainer"},this.ticketDrawDetails&&this.ticketDrawDetails.length>0&&s("div",{class:"ExpandableBoxes"},this.ticketDrawDetails.map(((t,e)=>{var i,r,o,n,a,l,h,c;return s("div",{class:{ExpandableBox:!0,ShowBox:this.toggleDrawer[e]},onClick:this.drawerToggle.bind(this,e)},s("div",{class:"ExpandableBoxHeader"},s("div",{class:"TicketResultContainer"},s("p",null,Hh("ticketResult",this.language),": ",this.resultMap[t.state])),"won"==t.state&&s("div",{class:"AmountWonContainer"},s("p",null,Hh("amountWon",this.language),":"," ",Number(t.amount).toLocaleString("en")," ",t.currency)),"lost"==t.state&&s("div",{class:"DrawIdContainer"},s("p",null,Hh("drawId",this.language),": ",t.drawId))),s("div",{class:"ExpandableBoxBody"},s("div",{class:"DrawIdContainer"},s("p",null,Hh("drawId",this.language),": ",t.drawId)),s("div",{class:"DrawDateContainer"},s("p",null,Hh("drawDate",this.language),": ",null===(i=t.drawData)||void 0===i?void 0:i.date.slice(0,10)," |"," ",null===(r=t.drawData)||void 0===r?void 0:r.date.slice(11,19))),s("div",{class:"DrawNumbersGrid"},t.drawData&&s("div",{class:"BulletContainer"},s("label",{class:"Label"},Hh("drawNumbersGridDraw",this.language),":"),s("lottery-grid",{"selected-numbers":(null===(n=null===(o=t.drawData)||void 0===o?void 0:o.winningNumbers)||void 0===n?void 0:n.length)&&(null===(a=t.drawData.winningNumbers[0].numbers)||void 0===a?void 0:a.join(",")),"secondary-numbers":(null===(h=null===(l=t.drawData)||void 0===l?void 0:l.winningNumbers)||void 0===h?void 0:h.length)&&(null===(c=t.drawData.winningNumbers[0].secondaryNumbers)||void 0===c?void 0:c.join(",")),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),t.details.length>0&&s("div",{class:"DrawPrizes"},s("label",{class:"Label"},Hh("prize",this.language),":"),s("span",null,t.details.map((t=>s("span",null,s("div",null,s("span",null,t.prizeName,t.times>1?" x "+t.times:"",":"," "),s("span",{style:{"margin-right":"4px"}},this.thousandSeperator(t.amount)),s("span",null,t.currency)))))))))}))))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Yh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.DrawResultsArea{margin-top:15px}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background-secondary, #f5f5f5);font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid var(--emw--color-typography, #009993)}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px;margin-bottom:10px;color:var(--emw--color-typography, #000)}.DrawNumbersGrid label{display:block;margin-bottom:7px}.Label{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid var(--emw--color-gray-250, #ccc);border-radius:5px;background-color:var(--emw--color-background-secondary, #f5f5f5)}.ExpandableBox{border-bottom:1px solid var(--emw--color-gray-250, #ccc);transition:height 300ms ease-in-out;overflow:hidden;height:80px;background-color:var(--emw--color-background, #fff)}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:var(--emw--color-primary, #009993)}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:"";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:var(--emw--color-primary, #009993)}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:var(--emw--color-primary, #009993);transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:auto}';const Jh=["ro","en","fr","ar","hr"],Kh={en:{drawResultsHeader:"Draw results history",viewAllResults:"View All",noResults:"No results.",loading:"Loading, please wait ...",resetButton:"Reset"},ro:{drawResultsHeader:"Istoricul extragerilor",viewAllResults:"Vezi toate rezultatele",noResults:"Niciun rezultat",loading:"Loading, please wait ..."},fr:{drawResultsHeader:"Dessiner l'historique des résultats",viewAllResults:"Voir tout",noResults:"Aucun résultat",loading:"Loading, please wait ..."},ar:{drawResultsHeader:"سجل نتائج السحب",viewAllResults:"عرض الكل",noResults:"لا توجد نتائج",loading:"Loading, please wait ..."},hr:{drawResultsHeader:"Povijest rezultata izvlačenja",viewAllResults:"Pogledaj sve",noResults:"Nema rezultata",loading:"Loading, please wait ..."}},Zh=(t,e)=>{const i=e;return Kh[void 0!==i&&Jh.includes(i)?i:"en"][t]},Xh=class{constructor(e){t(this,e),this.isReset=!1,this.getDrawsData=()=>{this.isLoading=!0;let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);t.searchParams.append("limit",this.limit.toString()),t.searchParams.append("offset",this.offset.toString()),t.searchParams.append("status","CLOSED"),this.dateFiltersFrom&&t.searchParams.append("from",this.dateFiltersFrom),this.dateFiltersTo&&t.searchParams.append("to",this.dateFiltersTo),fetch(t.href).then((t=>{if(t.status>=300)throw new Error("There was an error while fetching the data");return t.json()})).then((t=>{this.winningDataSetsData=t.items||[],this.drawData=this.winningDataSetsData.map((t=>t)),this.totalResults=t.total})).catch((t=>{console.log("err",t)})).finally((()=>{this.isLoading=!1,this.noResults=0==this.drawData.filter((t=>t.winningNumbers)).length}))},this.transDataToString=t=>{try{return JSON.stringify(t)}catch(t){throw new Error(t)}},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.drawData=[],this.winningDataSetsData=[""],this.dateFiltersFrom="",this.dateFiltersTo="",this.isLoading=!1,this.noResults=!1,this.activeIndex=0,this.totalResults=0,this.limit=5,this.offset=0}filtersHandler(t){this.dateFiltersFrom=t.detail.filterFromCalendar,this.dateFiltersTo=t.detail.filterToCalendar,this.limit=5,this.offset=0,this.getDrawsData()}clearFiltersHandler(){this.dateFiltersFrom="",this.dateFiltersTo="",this.limit=5,this.offset=0,this.drawData=this.winningDataSetsData,this.getDrawsData()}hpPageChange(t){this.limit=t.detail.limit,this.offset=t.detail.offset,this.isReset=!1,this.getDrawsData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}connectedCallback(){this.getDrawsData()}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Kh[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){clearInterval(this.interval)}render(){let t=s("div",{key:"72acbc970af5b1a036e0a8ea14663db0976a74c8",class:"DrawResultsHeader"},s("div",{key:"72425da8513e4d6dbd77be5401989f86bb311142",class:"DrawResultsHeaderContent"},s("h4",{key:"e1384b90952829f7901c4902a1a70590dec9816d"},Zh("drawResultsHeader",this.language)),s("div",{key:"36f27b349ce66c6666bb9fa8f51562772b86a977",class:"FilterSection"},s("helper-filters",{key:"b5f1e7af2f0cc625de6a489e22933fa46c6877f3","activate-ticket-search":"false","game-id":this.gameId,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))));return s("section",{key:"7d0806bd2c6a1ba0f1fe9156725b0bdce2f3a5c3",class:"GridWrapper",ref:t=>this.stylingContainer=t},s("div",{key:"3dba02fb66ae9dde255519ed56e7abacc14c81ef",class:"DrawResultsSection"},s("div",{key:"3d638b6eea89d23ff948f6c589d29a415cb08a9c",class:"DrawResultsAreaHistory"},t,s("div",{key:"ee7526abebb96a0d3b6ec9e60d781cdd42919d22",class:"HistoryGridWrapper"},s("div",{key:"50fb1dc5e88ab1f01b36df45e6f4f2172c718f4f",class:"HistoryGrid"},this.isLoading&&s("p",{key:"73c72137af98c395606386d0b5c3c15cd70db89c"},Zh("loading",this.language)),!this.isLoading&&!this.noResults&&this.drawData.map((t=>s("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,"draw-id":t.id,"draw-mode":!0,language:this.language,"history-draw-data":this.transDataToString(t),"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),!this.isLoading&&this.noResults&&s("p",{key:"93dd230728c90acaebb973a2251443133c4df180",class:"errorText"},Zh("noResults",this.language)))),s("div",{key:"cc9b735aed978c5e6cb6ca130501b015dc1c2217",class:"DrawHistoryPaginationWrapper"},this.totalResults>this.limit&&s("lottery-pagination",{key:"b5ac8b4e6005b74975abbefd3a1be5ce33f17004",arrowsActive:!0,numberedNavActive:!0,"is-reset":this.isReset,"first-page":!1,"prev-page":!0,"next-page":!0,offset:this.offset,limit:this.limit,total:this.totalResults,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Xh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridBanner{background-color:var(--emw--color-primary, #009993);background-repeat:no-repeat;background-position:center;color:var(--emw--color-typography, #000);padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.GridWrapper{background-color:var(--emw--color-background, #fff)}.DrawResultsSection{max-width:600px;margin:0px auto;padding-bottom:30px;color:var(--emw--color-typography, #000)}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:var(--emw--color-primary, #009993);padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:var(--emw--color-primary, #009993);padding:10px;text-align:center;color:var(--emw--color-background, #fff);padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff);outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton,.FilterSection .ResetButton{cursor:pointer;width:max-content;border-radius:var(--emw--button-border-radius, 4px);border:1px solid var(--emw--button-border-color, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .Active{background:var(--emw--color-primary-variant, #004d4a);color:var(--emw--color-background, #fff)}.FilterSection helper-filters{margin-left:auto}.errorText{color:var(--emw--color-error, #ff0000)}';const Qh=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"0bb2683f87461804914d26c708499902d92dc503",class:"GamePageDetailsContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"2ba23b953a9519ccb36fd203c3ac98a366673822","header-title":"Game Details",collapsed:!1,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"54c18e3a6fde25ff0953bb7b15b8a1200e237fd0",class:"AccordionContainer",slot:"accordionContent"},s("helper-tabs",{key:"0cb93435825bf7a42636848ffd5ff67a30369cfa","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Qh.style=":host{display:block}";const tc=["ro","en","fr","ar","hr"],ec={en:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDrawIn:"Next draw in: ",startIn:"Sales Start in:",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",ticketFailed:"Failed to submit tickets.",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ...",emptyText:"Sorry. The Game is not available now."},ro:{error:"Eroare",backButton:"Inapoi",lobbyButton:"Lobby",nextDrawIn:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",submitSuccess:"Submit successfully!",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",modalLogin:"Please login to submit a ticket",loading:"Se incarca, va rugam asteptati ..."},fr:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDrawIn:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ..."},ar:{error:"خطأ",backButton:"خلف",lobbyButton:"ردهة",nextDrawIn:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",submitSuccess:"Submit successfully!",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة",loading:"Loading, please wait ..."},hr:{error:"Greška",backButton:"Nazad",lobbyButton:"Lobby",nextDrawIn:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",submitSuccess:"Submit successfully!",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",modalLogin:"Molimo prijavite se da uplatite listić",loading:"Učitavanje, molimo pričekajte ..."}},ic=(t,e)=>{const i=e;return ec[void 0!==i&&tc.includes(i)?i:"en"][t]},sc=t=>new Promise(((e,i)=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])ec[e][i]=t[e][i]})),e(ec)})).catch((t=>{i(t)}))}));var rc,oc;!function(t){t.OPEN="OPEN"}(rc||(rc={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(oc||(oc={}));const nc=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));function ac(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n=nc(),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const lc=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})};function hc(t,e){if(!t)return;let i=function(t,e,i){Al(2,arguments);var s,r=function(t,e){return Al(2,arguments),zl(t).getTime()-zl(e).getTime()}(t,e)/1e3;return((s=null==i?void 0:i.roundingMethod)?Ol[s]:Ol[El])(r)}("string"==typeof t?kh(t):t,e&&new Date);if(i<0)return"0D 00H 00M 00S";const s=Math.floor(i/86400);i%=86400;const r=Math.floor(i/3600);i%=3600;const o=Math.floor(i/60),n=i%60;return`${s}D ${r.toString().padStart(2,"0")}H ${o.toString().padStart(2,"0")}M ${n.toString().padStart(2,"0")}S`}const cc="TICKET_INVALID_TOKEN",dc=class{constructor(i){t(this,i),this.goBackEvent=e(this,"goBackEvent",7),this.goToLobbyEvent=e(this,"goToLobbyEvent",7),this.resetAllTicketSelection=e(this,"resetAllTicketSelection",7),this.quickPick=!1,this.gameData={},this.secondarySelectionAllowed=!1,this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId=void 0,this.language="en",this.backgroundUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tickets=[],this.mainTickets=[],this.secondaryTickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.nextDate=void 0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.isLoading=!1,this.showSubmitError=!1,this.submitError="",this.showApiError=!1,this.apiError="",this.translationData=void 0,this.isSubscription=!1,this.subscriptionParam=null,this.showSubscriptionError=!1,this.subscriptionError="",this.isSubscribed=!1,this.isFetchingGame=!1,this.drawSubmitAvailable=!1,this.formattedTime=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleNewTranslations(){this.isLoading=!0,sc(this.translationUrl).then((()=>{this.isLoading=!1}))}watchGameInfoChange(t,e){t&&t!=e&&this.getGameDetails()}async componentWillLoad(){this.gameId&&this.endpoint&&this.getGameDetails(),this.sessionId&&(this.isLoggedIn=!0);const t=[];if(this.translationUrl){const e=sc(this.translationUrl).then((t=>{this.translationData=JSON.stringify(t)})).catch((t=>{console.log(t)}));t.push(e)}return Promise.all(t)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isFetchingGame=!0,fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{var e,i,s,r,o;if(this.gameData=t,this.basicStake=this.gameData.rules.stakes.length?Number(this.gameData.rules.stakes[0].value):0,this.basicLine=(null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.length)?this.gameData.rules.betTypes[0].boardsAllowed[0]:1,this.basicBetType=this.gameData.rules.betTypes[0],this.gameData&&function(t={}){return!(!t||!t.id||t.status!==rc.OPEN)}(null===(i=this.gameData)||void 0===i?void 0:i.currentDraw)){this.nextDate=null===(s=this.gameData.currentDraw)||void 0===s?void 0:s.date;const e=null===(o=null===(r=this.gameData)||void 0===r?void 0:r.currentDraw)||void 0===o?void 0:o.wagerStartTime,i=()=>{var i;const s=new Date;e&&function(t,e){Al(2,arguments);var i=zl(t),s=zl(e);return i.getTime()<s.getTime()}(s,kh(e))?(this.drawSubmitAvailable=!1,this.formattedTime={start:hc(e,s)}):(this.drawSubmitAvailable=!0,this.formattedTime={nextIn:hc(null===(i=null==t?void 0:t.currentDraw)||void 0===i?void 0:i.date,s)}),"0D 00H 00M 00S"===this.formattedTime.nextIn&&clearInterval(this.interval)};i(),this.interval=setInterval(i,1e3)}this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed,this.quickPick=this.gameData.rules.quickPickAvailable,this.isSubscription=this.gameData.rules.wagerTypes&&this.gameData.rules.wagerTypes.includes("Subscription");let n=this.gameData.draws?this.gameData.draws.filter((t=>!t.winningNumbers)):[];n.length>0&&(this.nextDraw=n[0].id),this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>{this.isFetchingGame=!1}))}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.mainTickets.forEach((t=>{var e;t.completed.every((t=>t))&&(this.totalAmount+=t.drawCount*(t.stake||this.basicStake)*t.multiplierNum*t.lineNum*(null===(e=t.betType)||void 0===e?void 0:e.combinations))})),this.currency=t}gridFilledHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!0,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:t.detail.drawCount,stake:e.stake||this.basicStake,selectedNumbers:i,multiplierNum:t.detail.multiplierNum,multiplier:t.detail.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:t.detail.quickPicks,betName:t.detail.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}gridDirtyHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!1,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:e.drawCount,stake:e.stake,selectedNumbers:i,multiplierNum:e.multiplierNum,multiplier:e.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:e.quickPicks,betName:e.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}modalCloseEvent(){this.loginModalVisible=!1,this.successVisible=!1}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.mainTickets[e-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(t){const{ticketId:e,multiplierNum:i,multiplier:s}=t.detail;this.mainTickets[e-1].multiplierNum=i,this.mainTickets[e-1].multiplier=s,this.calculateTotalAmount()}drawMultiplierChangeHandler(t){const{ticketId:e,drawCount:i}=t.detail;this.mainTickets[e-1].drawCount=i,this.calculateTotalAmount()}lineMultiplierChangeHandler(t){const{ticketId:e,lineNum:i}=t.detail;this.mainTickets[e-1].lineNum=i,this.mainTickets[e-1].completed=Array.from({length:i},(()=>!1)),this.mainTickets[e-1].selectedNumbers=[],this.mainTickets[e-1].quickPicks=[]}betTypeChangeHandler(t){const{ticketId:e,betType:i}=t.detail;this.mainTickets[e-1].betType=i}createNewTicket(){this.mainTickets=[...this.mainTickets,{gameId:this.gameId,ticketId:this.mainTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine,quickPicks:[!1],betName:""}],this.secondaryTickets=[...this.secondaryTickets,{gameId:this.gameId,ticketId:this.secondaryTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine}]}showLoginModal(){this.loginModalVisible=!0}handleSubscriptionReady(t){this.subscriptionParam=t.detail}handleSubscriptionCheckChange(t){this.isSubscribed=t.detail}buildTicketParam(){let t={playerId:this.playerId.toString(),tickets:[]},e=[];this.secondarySelectionAllowed&&(e=this.secondaryTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]));let i=this.mainTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]),s=[...new Set([...e,...i])].sort(((t,e)=>t-e));if(s.length){this.showSubmitError=!0;let t=s.map((t=>`Line${t+1}`)).join();return this.submitError=`The number of the selected number(s) on ${t} is invalid.`,setTimeout((()=>{this.showSubmitError=!1}),3e3),null}return this.mainTickets.forEach(((e,i)=>{var s;t.tickets.push({startingDrawId:this.nextDraw,amount:(e.stake*e.drawCount*e.multiplierNum*(e.lineNum||1)*(null===(s=e.betType)||void 0===s?void 0:s.combinations)).toString(),gameId:this.gameId,gameName:this.gameData.name,currency:this.currency,selection:e.selectedNumbers.map(((t,s)=>{var r;return{betType:(null===(r=e.betType)||void 0===r?void 0:r.id)||this.gameData.rules.defaultBetType,stake:e.stake,selections:t,secondarySelections:this.secondarySelectionAllowed?this.secondaryTickets[i].selectedNumbers[s]:[],quickPick:e.quickPicks[s],betName:e.betName}})),multiplier:e.multiplier,multiplierNum:e.multiplierNum,drawCount:e.drawCount,quickPick:this.quickPick})})),t}handleSubmitTickets(){this.drawSubmitAvailable&&(this.isSubscription&&this.isSubscribed?(this.submitTickets(),this.submitSubscriptionTickets()):this.submitTickets())}async submitSubscriptionTickets(){try{let t=await this.buildTicketParam();if(!t)return;if(!this.subscriptionParam||"string"==typeof this.subscriptionParam)return this.subscriptionError="string"==typeof this.subscriptionParam?this.subscriptionParam:"Ouccurence is required.",this.showSubscriptionError=!0,void setTimeout((()=>{this.showSubscriptionError=!1}),3e3);this.isLoading=!0;const e=this.playerId.toString(),i=`${this.endpoint}/player/${e}/ruleDefinition`;this.subscriptionParam.playerId=e;const s=xh(new Date,"yyyyMMddHHMMSS");this.subscriptionParam.name=`${this.subscriptionParam.ruleType}_${e}_${s}`;const{id:r}=await ac(i,"POST",this.subscriptionParam,{Authorization:`Bearer ${this.sessionId}`});if(t){const e=Object.assign(Object.assign({},t),{ruleDefinitionId:r}),i=`${this.endpoint}/subscription`;await ac(i,"POST",e,{Authorization:`Bearer ${this.sessionId}`}),lc({message:"Subscription rule created successfully.",theme:"success"});const s=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(s),console.log("resetAllTicketSelection event emitted through document after subscription ticket submission")}}catch(t){lc({message:"Failed to create the subscription rule. Please try again.",theme:"error"})}this.isLoading=!1}submitTickets(){let t=new URL(`${this.endpoint}/tickets`);const e=this.buildTicketParam();e?(this.isLoading=!0,(({body:t,sessionId:e,url:i})=>{const s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":nc()},body:JSON.stringify(t)};return fetch(i,s).then((t=>{if(401===t.status)throw new Error(cc);if(t.status>300)throw new Error(t.statusText);return t.json().then((e=>{if(!(i=e.tickets)||!i.length||i.some((t=>t.state!==oc.Purchased)))throw new Error(t.statusText);var i;return e}))}))})({body:e,sessionId:this.sessionId,url:t.href}).then((()=>{lc({message:"Ticket submitted successfully.",theme:"success"}),this.resetAllTicketSelection.emit();const t=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(t)})).catch((t=>{lc(t.message!==cc?{message:ic("ticketFailed",this.language),theme:"error"}:{message:cc,theme:"error"})})).finally((()=>{this.isLoading=!1}))):console.log("No valid ticket parameters to submit")}goBack(){this.goBackEvent.emit()}goToLobby(){this.goToLobbyEvent.emit()}render(){var t,e,i,r,o,n,a,l,h,c,d,u,p,m,f,v,b,g,y,w,x,k,_;return this.hasErrors?s("div",{class:"GamePage"},s("div",{class:"Title"},ic("error",this.language))):s("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr",ref:t=>this.stylingContainer=t},s("div",{class:"GridBanner",style:{background:this.backgroundUrl?`url(${this.backgroundUrl})`:"","background-size":"contain","background-repeat":"no-repeat","background-position":"center"}},s("div",{class:"BannerButtonsWrapper"}),s("div",{class:"Tabs"},s("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},ic("buy",this.language)),s("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},ic("viewLatest",this.language)))),this.isFetchingGame?s("div",{class:"fetching"},"Loading..."):s("div",{class:"GamePageWrap"},this.nextDate?s("div",null,s("div",{class:"NextDrawWrapper"},s("div",{class:"NextDraw"},(null===(t=this.formattedTime)||void 0===t?void 0:t.start)?s("p",{class:"BannerText"},ic("startIn",this.language)):s("p",{class:"BannerText"},ic("nextDrawIn",this.language)),s("div",{class:"BannerCountdown"},(null===(e=this.formattedTime)||void 0===e?void 0:e.start)||(null===(i=this.formattedTime)||void 0===i?void 0:i.nextIn)))),0==this.tabIndex&&s("div",{class:"GamePageContentWrapper"},s("div",{class:"GamePageContent"},s("div",{class:"GameDetails"},s("lottery-game-details",{"low-number":null===(o=null===(r=this.gameData.rules)||void 0===r?void 0:r.boards[0])||void 0===o?void 0:o.lowNumber,"high-number":null===(a=null===(n=this.gameData.rules)||void 0===n?void 0:n.boards[0])||void 0===a?void 0:a.highNumber,"minimum-allowed":null===(h=null===(l=this.gameData.rules)||void 0===l?void 0:l.boards[0])||void 0===h?void 0:h.minimumAllowed,"maxinum-allowed":null===(d=null===(c=this.gameData.rules)||void 0===c?void 0:c.boards[0])||void 0===d?void 0:d.maxinumAllowed,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"translation-url":this.translationData})),s("div",{class:"TicketsWrapper"},this.mainTickets.map((t=>{var e,i;return s("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":null===(e=this.gameData.rules)||void 0===e?void 0:e.quickPickAvailable,"reset-button":null===(i=this.gameData.rules)||void 0===i?void 0:i.quickPickAvailable,"total-controllers":this.mainTickets.length,"translation-url":this.translationData,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})}))),s("div",{class:"OrderSummary"},s("h3",{class:"OrderSummaryTitle"},ic("orderSummaryTitle",this.language)),s("div",{class:"OrderTicketInfo"},s("div",{class:"Ticket"},ic("orderSummaryTickets",this.language),": ",s("span",null,this.mainTickets.length)),s("div",null,s("span",null,this.thousandSeperator((null===(p=null===(u=this.mainTickets[0])||void 0===u?void 0:u.betType)||void 0===p?void 0:p.combinations)*(null===(m=this.mainTickets[0])||void 0===m?void 0:m.lineNum))),s("span",{class:"Multiplier"},"x"),(null===(f=this.gameData.rules)||void 0===f?void 0:f.stakeMultiplierAvailable)&&s("span",null,s("span",null,1===(null===(v=this.mainTickets[0])||void 0===v?void 0:v.multiplierNum)?`${null===(b=this.mainTickets[0])||void 0===b?void 0:b.multiplierNum} Multiplier`:`${null===(g=this.mainTickets[0])||void 0===g?void 0:g.multiplierNum} Multipliers`),s("span",{class:"Multiplier"},"x")),s("span",null,`${null===(y=this.mainTickets[0])||void 0===y?void 0:y.stake} EUR`),(null===(w=this.gameData.rules)||void 0===w?void 0:w.drawMultiplierAvailable)&&s("span",null,s("span",{class:"Multiplier"},"x"),s("span",null,1===(null===(x=this.mainTickets[0])||void 0===x?void 0:x.drawCount)?`${null===(k=this.mainTickets[0])||void 0===k?void 0:k.drawCount} Draw`:`${null===(_=this.mainTickets[0])||void 0===_?void 0:_.drawCount} Draws`)))),s("hr",null),s("div",{class:"Total"},ic("orderSummaryTotal",this.language),":"," ",s("span",null,this.thousandSeperator(this.totalAmount)," ",this.currency)),this.isSubscription&&s("div",{class:"SubscriptionWrapper"},s("lottery-subscription",{endpoint:this.endpoint,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,gameName:this.gameData.name})),s("div",{class:"ButtonWrapper"},this.isLoggedIn&&s("div",null,!this.isLoading&&s("div",{class:"submitWrap"},s("div",{class:{Button:!0,ButtonDisabled:!this.drawSubmitAvailable},onClick:()=>this.handleSubmitTickets()},ic("orderSummarySubmit",this.language)),this.showSubmitError&&s("div",{class:"submitError"},this.submitError),this.showApiError&&s("div",{class:"submitError"},this.apiError),this.showSubscriptionError&&s("div",{class:"submitError"},this.subscriptionError)),this.isLoading&&s("span",{class:"Button",style:{cursor:"default"}},ic("loading",this.language))),!this.isLoggedIn&&s("div",null,s("span",{class:"Button",onClick:()=>this.showLoginModal()},ic("orderSummarySubmit",this.language)),s("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},ic("modalLogin",this.language)))))))),1==this.tabIndex&&s("div",{class:"HistoryContentWrapper"},s("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}))):s("div",{class:"noActiveDraw"},ic("emptyText",this.language))),s("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},ic("submitSuccess",this.language))))}static get assetsDirs(){return["../static"]}get element(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"],endpoint:["watchGameInfoChange"],gameId:["watchGameInfoChange"]}}};dc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");\n:host {\n display: block;\n font-family: "Roboto", sans-serif;\n}\n\n.GamePage {\n background-color: var(--emw--color-background, #fff);\n}\n.GamePage .GridBanner {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n background-repeat: no-repeat;\n background-position: center;\n color: var(--emw--color-typography, #000);\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.GamePage .GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,\n.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GamePage .GridBanner .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.GamePage .TotalWinnings {\n color: var(--emw--color-typography, #000);\n font-size: 18px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n text-transform: uppercase;\n}\n.GamePage .TotalWinnings span {\n font-size: 18px;\n font-weight: 700;\n}\n.GamePage .NextDraw {\n color: var(--emw--color-primary, #009993);\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto;\n text-align: center;\n text-transform: uppercase;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 4px;\n}\n.GamePage .NextDraw .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n}\n.GamePage .NextDraw .BannerCountdown {\n font-size: 22px;\n color: var(--emw--color-primary, #009993);\n display: flex;\n gap: 20px;\n}\n.GamePage .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n}\n.GamePage .Tabs .TabButton {\n border-radius: var(--emw--button-border-radius, 4px);\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid var(--emw--color-primary, #009993);\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.GamePage .Tabs .TabButton.Active {\n color: var(--emw--color-primary, #009993);\n background: var(--emw--color-gray-50, #f5f5f5);\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n}\n\n.LastDrawResultsTitle {\n color: var(--emw--color-primary, #009993);\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: var(--emw--button-border-radius, 4px);\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.NextDrawWrapper {\n padding: 10px 15px;\n background: var(--emw--color-background, #fff);\n}\n.NextDrawWrapper .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n.NextDrawWrapper .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: var(--emw--color-primary, #009993);\n font-weight: bolder;\n justify-content: center;\n}\n\n.GamePageContent {\n max-width: 1200px;\n margin: 0 auto;\n background: var(--emw--color-background, #fff);\n container-type: inline-size;\n container-name: gamePage;\n}\n\n.TicketsWrapper {\n min-height: 300px;\n}\n\n@container gamePage (min-width: 1200px) {\n .GamePageContent .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GamePageContent .GameDetails {\n float: right;\n width: 49%;\n }\n .GamePageContent .OrderSummary {\n float: right;\n width: 49%;\n }\n}\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: var(--emw--button-border-radius, 4px);\n color: var(--emw--color-typography, #000);\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: var(--emw--color-background, #fff);\n}\n.OrderSummary .OrderSummaryTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n text-transform: uppercase;\n text-align: center;\n}\n.OrderSummary .OrderTicketInfo {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n.OrderSummary .OrderTicketInfo .Multiplier {\n margin: 0 6px;\n}\n.OrderSummary .Ticket {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n margin-right: 30px;\n}\n.OrderSummary .Ticket span {\n text-align: right;\n}\n.OrderSummary hr {\n border: none;\n border-top: 1px double var(--emw--color-gray-100, #e6e6e6);\n color: var(--emw--color-gray-100, #e6e6e6);\n width: 100%;\n}\n.OrderSummary .Total {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n}\n.OrderSummary .Total span {\n text-align: right;\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ButtonWrapper .Button {\n cursor: pointer;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.ButtonWrapper .Button:hover {\n background: var(--emw--color-secondary, #00aba4);\n}\n.ButtonWrapper .Button.ButtonDisabled {\n pointer-events: none;\n background: var(--emw--color-background-tertiary, #ccc);\n}\n.ButtonWrapper .submitError {\n margin-top: 10px;\n color: var(--emw--color-error, #ff3d00);\n}\n.ButtonWrapper .submitWrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.SubmitModalSuccess {\n text-align: center;\n font-size: 18px;\n padding: 20px;\n}\n\n.DeleteTicketModalWrapper {\n padding: 20px;\n text-align: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalText {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n line-height: 22px;\n margin-bottom: 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-error, #ff3d00);\n border: 1px solid var(--emw--color-error, #ff3d00);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover {\n background: var(--emw--color-tertiary, #ff6536);\n border: 1px solid var(--emw--color-error, #ff3d00);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid var(--emw--color-secondary, #00aba4);\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n}\n\n.GamePage {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.GamePage .GamePageContentWrapper,\n.GamePage .HistoryContentWrapper {\n padding: 15px;\n flex: 1;\n background: var(--emw--color-background, #fff);\n}\n\n.HistoryContentWrapper::after,\n.GamePageContent::after {\n content: "";\n display: block;\n clear: both;\n}\n\n.GamePageWrap .noActiveDraw {\n margin: 10% auto 0px;\n padding: 24px;\n border: 1px solid var(--emw--color-primary, #009993);\n border-radius: 4px;\n width: 280px;\n color: var(--emw--color-primary, #009993);\n}\n\n.fetching {\n margin: 40px auto;\n}';const uc=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.gridClearAllEvent=e(this,"gridClearAllEvent",7),this.selectedCounter=0,this.ticketId=void 0,this.totalNumbers=0,this.gameId=void 0,this.maximumAllowed=7,this.minimumAllowed=3,this.numberRange=void 0,this.selectable=!0,this.selectedNumbers="",this.secondaryNumbers="",this.displaySelected=!1,this.language="en",this.gridIndex=void 0,this.gridType="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.highNumber=47,this.lowNumber=1,this.selectionType="mainSelection",this.partialQuickpickAvailable=!1,this.numbers=[],this.bonusNumbers=[]}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.secondaryNumbers.length>0&&(this.bonusNumbers=this.secondaryNumbers.split(",").map((t=>({number:t,selected:!0,selectable:this.selectable})))),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e)).map((t=>t.toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>({number:e.number,selected:e.number==t.detail.value?t.detail.selected:e.selected,selectable:e.selectable}))),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter>=this.minimumAllowed&&this.selectedCounter<=this.maximumAllowed&&(this.numbers=this.numbers.map((t=>this.selectedCounter===this.maximumAllowed?{number:t.number,selected:t.selected,selectable:!!t.selected}:{number:t.number,selected:t.selected,selectable:!0})),JSON.parse(this.numberRange).includes(this.selectedCounter)?this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter-=1,this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),0===this.selectedCounter&&this.gridClearAllEvent.emit(this.gridIndex),this.selectedCounter<this.minimumAllowed?this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async resetSelectionHandler(t){t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:[]}))}async autoSelectionHandler(t){if(t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex){this.resetSelectionHandler(t);let e=Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e));e=this.shuffleArray(e),e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:!!this.partialQuickpickAvailable&&e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.minimumAllowed}}render(){return s("div",{key:"f62b5b1e5a6cf7bcaa13ce2c8a281bc93fa439f7",class:"GridContainer",ref:t=>this.stylingContainer=t},s("div",{key:"e381adbfff57e2cc343188c46037eb45ab798cac",class:"ticket"===this.gridType?"Grid TicketGrid":"Grid"},this.numbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))),this.bonusNumbers.length?this.bonusNumbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"is-bonus":!0,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))):""))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};uc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}';const pc=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),mc={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},fc=(t,e)=>mc[void 0!==e&&e in mc?e:"en"][t],vc=class{constructor(i){t(this,i),this.hpPageChange=e(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=t=>{switch(t){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt,this.nextPage=!0;break;case"nextPage":this.offsetInt+=this.limitInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage}this.previousPage=!!this.offsetInt,this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(t,e)=>{isNaN(t)?0===e&&this.currentPage<=4?this.navigateTo("firstPage"):0===e&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===e&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):(1===t?(this.offsetInt=t-1,this.previousPage=!1):(this.offsetInt=(t-1)*this.limitInt,this.nextPage=!(t>this.endInt)),this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt}))},this.nextPage=!1,this.prevPage=!1,this.offset=0,this.limit=10,this.total=1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.arrowsActive=void 0,this.secondaryArrowsActive=void 0,this.numberedNavActive=void 0,this.isReset=!1,this.translationUrl=void 0,this.offsetInt=void 0,this.lastPage=!1,this.previousPage=!1,this.limitInt=void 0,this.totalInt=void 0,this.pagesArray=[],this.endInt=0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])mc[e][i]=t[e][i]})))}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.nextPage=!!this.isReset||this.nextPage,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?this.endInt>3?(this.pagesArray=Array.from({length:4},((t,e)=>e+1)),this.pagesArray.push("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((t,e)=>this.currentPage+e-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.endInt>4?(this.pagesArray=Array.from({length:4},((t,e)=>this.endInt-2+e)),this.pagesArray.unshift("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){let t=s("ul",{class:"PaginationArea"},this.pagesArray.map(((t,e)=>s("li",{class:"PaginationItem"+(t===this.currentPage?" ActiveItem":" ")+" "+(pc(this.userAgent)?"MobileButtons":"")},s("button",{disabled:t===this.currentPage,onClick:this.paginationNavigation.bind(this,t,e)},s("span",null,t)))))),e=s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"firstPage")},s("span",{class:"NavigationButton"},fc("firstPage",this.language)),s("span",{class:"NavigationIcon"})),i=s("div",{class:"LeftItems"},this.secondaryArrowsActive&&e,s("button",{disabled:!this.prevPage||1===this.currentPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},fc("previousPage",this.language)),s("span",{class:"NavigationIcon"})));pc(this.userAgent)&&(i=s("div",{class:"LeftItems"},s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},fc("previousPage",this.language)),s("span",{class:"NavigationIcon"}))));let r=s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"lastPage")},s("span",{class:"NavigationButton"},fc("lastPage",this.language)),s("span",{class:"NavigationIcon"})),o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},fc("nextPage",this.language)),s("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&r);return pc(this.userAgent)&&(o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},fc("nextPage",this.language)),s("span",{class:"NavigationIcon"})))),s("div",{id:"PaginationContainer",ref:t=>this.stylingContainer=t},this.arrowsActive&&i,this.numberedNavActive&&t,this.arrowsActive&&o)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};vc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993)}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:var(--emw--color-typography, #000);cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);opacity:0.8}button{width:100px;height:32px;border:1px solid var(--emw--color-gray-150, #6f6f6f);border-radius:5px;background:var(--emw--color-gray-150, #6f6f6f);color:var(--emw--color-typography-inverse, #fff);font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:var(--emw--color-primary-variant, #004d4a);border-color:var(--emw--color-primary-variant, #004d4a)}button:disabled{background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-typography-inverse, #fff);cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}}';const bc=["ro","en","hr"],gc={en:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ro:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},fr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ar:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},hr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"}},yc=(t,e)=>{const i=e;return gc[void 0!==i&&bc.includes(i)?i:"en"][t]};function wc(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const xc=class{constructor(i){t(this,i),this.subscriptionCompleted=e(this,"subscriptionCompleted",7),this.subscriptionCheckChange=e(this,"subscriptionCheckChange",7),this.changeDateParam=()=>{if(this.filterData.from&&!this.filterData.to){let t=this.filterData.from,e=t.split("/");t=new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),0,0,0)).toISOString();const i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:"",fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}if(this.filterData.from&&this.filterData.to){const{from:t,to:e}=this.transDate(this.filterData.from,this.filterData.to),i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:e,fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}},this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{from:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{to:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.translationUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.gameName=void 0,this.isSubscribed=!1,this.frequenceList=[],this.frequenceState="",this.filterData={from:"",to:""},this.subscriptionCode="lottery-subscription-widget001",this.conditionId="",this.paramId="",this.conditionRule=void 0,this.paramRule=void 0,this.peroidRule=void 0,this.startDateRule=void 0,this.endDateRule=void 0,this.gameNameRule=void 0,this.ruleType=""}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])gc[e][i]=t[e][i]}))),this.getSubscriptionData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}transDate(t,e){let i=t.split("/"),s=e.split("/");return{from:new Date(Date.UTC(Number(i[2]),Number(i[1])-1,Number(i[0]),0,0,0)).toISOString(),to:new Date(Date.UTC(Number(s[2]),Number(s[1])-1,Number(s[0]),23,59,59)).toISOString()}}async getSubscriptionData(){try{const t=`${this.endpoint}/feWidgetConfig/${this.subscriptionCode}`,{conditionMetadataId:e,paramMetadataId:i,ruleType:s}=await wc(t);this.conditionId=e,this.paramId=i,this.ruleType=s;const r=`${this.endpoint}/metadata/${this.conditionId}`,o=`${this.endpoint}/metadata/${this.paramId}`,[n,a]=await Promise.allSettled([wc(r),wc(o)]);if("fulfilled"!==n.status||"fulfilled"!==a.status)throw new Error("Failed to get subscription data");this.conditionRule=n.value,this.paramRule=a.value,this.conditionRule.fields&&(this.peroidRule=this.conditionRule.fields.find((t=>"Period"===t.code)),this.startDateRule=this.conditionRule.fields.find((t=>"StartDate"===t.code)),this.endDateRule=this.conditionRule.fields.find((t=>"EndDate"===t.code)),this.gameNameRule=this.conditionRule.fields.find((t=>"GameName"===t.code)),this.frequenceList=this.peroidRule.enums.map((t=>({label:t.text,value:t.key}))))}catch(t){console.error(t)}}handleCheckboxchange(t){this.isSubscribed=t.target.checked,this.subscriptionCheckChange.emit(this.isSubscribed)}handleSelectionChange(t){if(this.frequenceState=t.detail.value,"NeverMissADraw"===this.frequenceState&&this.isSubscribed){const t={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};t.params=this.paramRule.fields.map((t=>({value:"",fieldId:t.id}))),this.subscriptionCompleted.emit(t)}else"Custom"===this.frequenceState&&this.isSubscribed&&this.subscriptionCompleted.emit("Subscription start date is required.")}formateDate(t){const{year:e,month:i,day:s}=t;return xh(new Date(e,i,s),"dd/MM/yyyy")}parseDate(t){const[e,i,s]=t.split("/");return{year:s,month:parseInt(i)-1,day:e}}changeFormate(t){const[e,i,s]=t.split("/");return`${s}-${i}-${e}`}setDateFormate(t){t&&(t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate}))}render(){return s("div",{key:"185b4f76308ff8df614f520f5eb93a19c619cbcd",class:"subscripitonContainer",ref:t=>this.stylingContainer=t},s("vaadin-checkbox",{key:"c3af7821b5bacbfc8527ad242ddc6cb9d8b5234d",label:"Subscription",checked:this.isSubscribed,onChange:this.handleCheckboxchange.bind(this)}),this.isSubscribed&&s("div",{key:"e567968dca8f1150f751662e2834ffeb60e791cd",class:"secondConditon"},s("span",{key:"5999241e246949594cf39d1dade31deb04e17f1a",style:{"margin-right":"8px"}},"Occurrence: "),s("vaadin-select",{key:"50a04ac0202ab7912cd56043cda5d8f915a9151e",items:this.frequenceList,value:this.frequenceState,"on-value-changed":this.handleSelectionChange.bind(this)}),"Custom"===this.frequenceState&&s("div",{key:"329650009ba11791abf137bfd75b18ce982c6ee9",class:"thirdCondition"},s("div",{key:"f29c8951aa53637f6f66ab523b847e0937f2f323",class:"filterCalenderWrap"},s("div",{key:"a19a4c4ba091397bf79c0969b9fc7bafd3fef519",class:"filterText"},"Subscription Start Date*"),s("div",{key:"fd91ca7fc3df5250e2e88f6c34cd92e8b91b9907",class:"filter"},s("vaadin-date-picker",{value:this.filterData.from,key:"filterFromCalendar",max:void 0===this.filterData.to?void 0:this.changeFormate(this.filterData.to),onChange:this.handleFilterFrom,placeholder:yc("filterFromCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))),s("div",{key:"450a8c165db8ddb42d3c731f49257d17e9426c40",class:"filterCalenderWrap"},s("div",{key:"e66f7308e413493e84ae659b02f8eb11a025f559",class:"filterText"},"Subscription End Date"),s("div",{key:"4644c0873295e22573f9e2d1927b649e10ecd3f5",class:"filter"},s("vaadin-date-picker",{value:this.filterData.to,key:"filterToCalendar",min:void 0===this.filterData.from?void 0:this.changeFormate(this.filterData.from),onChange:this.handleFilterTo,placeholder:yc("filterToCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};xc.style=".subscripitonContainer{margin-bottom:40px}.subscripitonContainer vaadin-checkbox[checked]::part(checkbox){background-color:var(--emw--color-primary, #009993)}.subscripitonContainer .secondCondition{padding-left:24px}.subscripitonContainer .thirdCondition{display:flex;gap:24px;align-items:center}.subscripitonContainer .thirdCondition,.subscripitonContainer .secondConditon{margin:16px 0}";const kc=["ro","en","hr"],_c={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},Cc=(t,e)=>{const i=e;return _c[void 0!==i&&kc.includes(i)?i:"en"][t]},Sc=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.drawMultiplierChange=e(this,"drawMultiplierChange",7),this.lineMultiplierChange=e(this,"lineMultiplierChange",7),this.betTypeChange=e(this,"betTypeChange",7),this.endpoint=void 0,this.gameId=void 0,this.numberOfGrids=1,this.multipleDraws=!0,this.ticketId=void 0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=[],this.isCustomSelect=!1,this.amountInfo={},this.stakeMultiplier="1",this.lineMultiplier=0,this.isCustomSelectStake=!1,this.isCustomSelectDraw=!1,this.isCustomSelectLine=!1,this.drawMultiplier=1,this.secondarySelectionAllowed=!1,this.partialQuickpickAvailable=!1,this.boardsAllowed=[],this.tabIndex=0,this.groupType=[],this.playType=[],this.selectedPlayTypeId="",this.maximumAllowed=6,this.numberRange=[],this.secondaryNumberRange=[],this.secondaryMaximumAllowed=1,this.minimumAllowed=6,this.secondaryMinimumAllowed=1,this.quickPicks=[]}handleLineMultiplierChange(t){this.grids=Array.from({length:t},((t,e)=>e+1)),this.ticketDone=Array.from({length:t},(()=>!1)),this.quickPicks=Array.from({length:t},(()=>!1)),this.grids.forEach(((t,e)=>{this.resetSelection.emit({ticketId:this.ticketId,index:e})}))}handleTabIndexChange(t){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)})),this.setDrawMultiplier(1),this.setStakeMultiplier("1"),this.amountInfo=this.gameData.rules.stakes[0],this.setWagerPerDraw(this.amountInfo),this.playType=this.groupType[t].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.boardsAllowed=this.playType[0].boardsAllowed,this.setLineMultiplier(this.boardsAllowed[0]),this.selectedPlayTypeId=this.playType[0].value,this.numberRange=this.playType[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=this.playType[0].secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange),this.betTypeChange.emit({ticketId:this.ticketId,betType:this.playType[0]})}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}checkForClickOutside(t){this.selectRef&&!this.selectRef.contains(t.composedPath()[0])&&(this.isCustomSelect=!1),this.selectStakeRef&&!this.selectStakeRef.contains(t.composedPath()[0])&&(this.isCustomSelectStake=!1),this.selectDrawRef&&!this.selectDrawRef.contains(t.composedPath()[0])&&(this.isCustomSelectDraw=!1),this.selectLineRef&&!this.selectLineRef.contains(t.composedPath()[0])&&(this.isCustomSelectLine=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{var e;this.isLoading=!1,this.gameData=t,this.amountInfo=this.gameData.rules.stakes[0],this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed;const i=this.gameData.rules.betTypes.reduce(((t,e)=>(e.group?(t.groups[e.group]||(t.groups[e.group]=[]),t.groups[e.group].push(e)):t.noGroup.push({groupName:e.name||e.id,betType:[Object.assign({},e)]}),t)),{groups:{},noGroup:[]}),s=Object.entries(i.groups).map((([t,e])=>({groupName:t,betType:e})));this.groupType=[...i.noGroup,...s],this.playType=this.groupType[0].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.partialQuickpickAvailable=this.gameData.rules.partialQuickpickAvailable,this.boardsAllowed=null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.filter((t=>"Prima"===t.id))[0].boardsAllowed,this.lineMultiplier=this.boardsAllowed[0];let r=this.gameData.rules.betTypes[0].secondarySelectionRules;this.numberRange=this.gameData.rules.betTypes[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=r.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])_c[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{drawCount:this.drawMultiplier,multiplierNum:Number(this.stakeMultiplier),multiplier:this.gameData.rules.stakeMultiplierAvailable,quickPicks:this.quickPicks,betName:this.playType.length>1?this.playType.find((t=>t.value===this.selectedPlayTypeId)).label:this.groupType[this.tabIndex].groupName}),this.ticketDone=[...this.ticketDone.slice(0,t.detail.index),!0,...this.ticketDone.slice(t.detail.index+1)],this.ticketCompleted.emit(this.ticket)}handleGridClearAllEvent(t){let e=t.detail;this.ticketDone=[...this.ticketDone.slice(0,e),!1,...this.ticketDone.slice(e+1)],this.quickPicks[e]=!1}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.autoSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!0}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)],this.resetSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!1}toggleResetAllSeletion(){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)}))}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}toggleSelection(){this.isCustomSelectStake=!this.isCustomSelectStake}toggleLineSelection(){this.isCustomSelectLine=!this.isCustomSelectLine}toggleDrawSelection(){this.isCustomSelectDraw=!this.isCustomSelectDraw}setWagerPerDraw(t){this.amountInfo={value:t.value,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.value)}setStakeMultiplier(t){this.stakeMultiplier=t,this.isCustomSelectStake=!1,this.multiplierChange.emit({ticketId:this.ticketId,multiplierNum:Number(t),multiplier:this.gameData.rules.stakeMultiplierAvailable})}setLineMultiplier(t){this.lineMultiplier=t,this.isCustomSelectLine=!1,this.lineMultiplierChange.emit({ticketId:this.ticketId,lineNum:t})}setDrawMultiplier(t){this.drawMultiplier=t,this.isCustomSelectDraw=!1,this.drawMultiplierChange.emit({ticketId:this.ticketId,drawCount:t})}handlePlayTypeChange(t){this.selectedPlayTypeId=t;let e=this.playType.filter((e=>e.id===t))[0];this.boardsAllowed=e.boardsAllowed,this.numberRange=e.selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=e.secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange);for(let t=0;t<this.lineMultiplier;t++)this.toggleResetSelection(t);this.betTypeChange.emit({ticketId:this.ticketId,betType:e}),this.setLineMultiplier(this.boardsAllowed[0])}render(){if(this.isLoading)return s("div",null,s("p",null,Cc("loading",this.language)));if(this.hasErrors)return s("div",null,s("p",null,Cc("error",this.language)));{const{rules:t}=this.gameData;return s("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},s("p",{class:"TicketTitle"},this.gameData.name),s("div",{class:"TicketTabs"},this.groupType.map(((t,e)=>s("div",{class:"TabButton"+(this.tabIndex==e?" Active":""),onClick:()=>this.tabIndex=e},t.groupName)))),this.playType.length>1&&s("div",null,s("label",{class:"Label"},Cc("playType",this.language),": "),s("vaadin-select",{style:{width:"160px"},items:this.playType,value:this.selectedPlayTypeId,"on-value-changed":t=>this.handlePlayTypeChange(t.detail.value)})),this.boardsAllowed.length>1&&s("div",null,s("label",{class:"Label"},Cc("lines",this.language),": "),s("div",{class:"WagerInput"},s("div",{ref:t=>this.selectLineRef=t,class:this.isCustomSelectLine?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleLineSelection()},s("span",null,this.lineMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},this.boardsAllowed.map((t=>s("li",{class:this.lineMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setLineMultiplier(t)},t)))))))),this.grids.map(((e,i)=>s("div",null,s("div",{class:"TicketGridHeader"},s("div",null,Cc("lineName",this.language),i+1),this.resetButton&&this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection(i)},Cc("resetButton",this.language))),this.autoPick&&!this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection(i)},Cc("autoButton",this.language)))),s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].selectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.maximumAllowed,"minimum-allowed":this.minimumAllowed,"number-range":JSON.stringify(this.numberRange),"high-number":t.boards[0].highNumber,"low-number":t.boards[0].lowNumber,"total-numbers":t.boards[0].highNumber-t.boards[0].lowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"mainSelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),this.secondarySelectionAllowed&&s("div",{class:"SecondarySelectionWrapper"},s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].secondarySelectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.secondaryMaximumAllowed,"minimum-allowed":this.secondaryMinimumAllowed,"number-range":JSON.stringify(this.secondaryNumberRange),"high-number":t.boards[0].secondaryHighNumber,"low-number":t.boards[0].secondaryLowNumber,"total-numbers":t.boards[0].secondaryHighNumber-t.boards[0].secondaryLowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"secondarySelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))),t.stakeMultiplierAvailable&&s("div",null,s("label",{class:"Label"},Cc("multiplier",this.language),": "),s("div",{class:"WagerInput"},t.stakeMultipliers.length>1?s("div",{ref:t=>this.selectStakeRef=t,class:this.isCustomSelectStake?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleSelection()},s("span",null,this.stakeMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakeMultipliers.map((t=>s("li",{class:this.stakeMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setStakeMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.stakeMultipliers[0]||1,type:"number",disabled:!0})))),t.drawMultiplierAvailable&&s("div",null,s("label",{class:"Label"},Cc("numberOfDraws",this.language),": "),s("div",{class:"WagerInput"},t.durations.length>1?s("div",{ref:t=>this.selectDrawRef=t,class:this.isCustomSelectDraw?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleDrawSelection()},s("span",null,this.drawMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.durations.map((t=>s("li",{class:this.drawMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setDrawMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.durations[0]||1,type:"number",disabled:!0})))),s("div",null,s("label",{class:"Label"},Cc("wagerPerDraw",this.language),": "),s("div",{class:"WagerInput"},t.stakes.length>1?s("div",{ref:t=>this.selectRef=t,class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleClass()},s("span",null,this.amountInfo.value," ",this.amountInfo.currency),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakes.map((t=>s("li",{class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setWagerPerDraw(t)},t.value," ",t.currency)))))):s("div",null,s("input",{min:"1",value:t.stakes[0].value,type:"number",disabled:!0}),s("span",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{lineMultiplier:["handleLineMultiplierChange"],tabIndex:["handleTabIndexChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Sc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.TicketTabs{display:flex;overflow:auto}.TicketTabs .TabButton{color:var(--emw--color-primary, #009993);margin:0 40px 10px 0;cursor:pointer}.TicketTabs .Active{border-bottom:1px solid var(--emw--color-primary, #009993)}.ButtonContainer{display:flex;justify-content:flex-end}.SecondarySelectionWrapper{margin-top:20px}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:var(--emw--color-typography, #000)}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:var(--emw--color-typography, #000);padding:10px;margin-left:8px}.AutoButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.ResetButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-typography-inverse, #fff)}.ResetButton:hover{background:var(--emw--color-tertiary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}.TicketGridHeader{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-top:10px}.TicketGridBullets{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;padding:20px;margin-top:5px;margin-bottom:10px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid var(--emw--color-background-tertiary, #ccc);overflow:hidden;background:var(--emw--color-typography-inverse, #fff);z-index:20}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:var(--emw--color-background, #009993);color:var(--emw--color-typography-inverse, #fff)}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:var(--emw--color-background-tertiary, #ccc);border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:var(--emw--color-background-secondary, #f5f5f5)}';const Tc=["ro","en","fr","ar","hr"],Dc={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}},Ic=(t,e)=>{const i=e;return Dc[void 0!==i&&Tc.includes(i)?i:"en"][t]},Ac=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.endpoint="",this.ticketId=1,this.ticketDescription=void 0,this.gameId=void 0,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1,this.totalControllers=1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Dc[e][i]=t[e][i]})))}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"28756fcff01b738bfe8339114445032a5da757c2",class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"18a566d1c97ccbf74cd759215df3a18faf5c43dc","header-title":`${Ic("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":1!==this.totalControllers,collapsed:!this.last||this.collapsed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"3a056f64dc8572b66f50cb151adde2caea2cd427",slot:"accordionContent"},s("lottery-ticket",{key:"06a0696b79840c05381429b1b87af94b478b09f0",endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"translation-url":this.translationUrl,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Ac.style=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}';export{h as general_multi_select,u as helper_accordion,Mh as helper_filters,Ph as helper_modal,jh as helper_tab,Rh as helper_tabs,Lh as lottery_bullet,Yh as lottery_draw_results,Xh as lottery_draw_results_history,Qh as lottery_game_details,dc as lottery_game_page,uc as lottery_grid,vc as lottery_pagination,xc as lottery_subscription,Sc as lottery_ticket,Ac as lottery_ticket_controller}
|
|
6665
|
+
var e,i,s,r,o=9e15,n=1e9,a="0123456789abcdef",l="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-o,maxE:o,crypto:!1},d=!0,u="[DecimalError] ",p=u+"Invalid argument: ",m=u+"Precision limit exceeded",f=u+"crypto unavailable",v="[object Decimal]",b=Math.floor,g=Math.pow,y=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,k=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,C=7,S=l.length-1,T=h.length-1,D={toStringTag:v};function I(t){var e,i,s,r=t.length-1,o="",n=t[0];if(r>0){for(o+=n,e=1;e<r;e++)(i=C-(s=t[e]+"").length)&&(o+=R(i)),o+=s;(i=C-(s=(n=t[e])+"").length)&&(o+=R(i))}else if(0===n)return"0";for(;n%10==0;)n/=10;return o+n}function A(t,e,i){if(t!==~~t||t<e||t>i)throw Error(p+t)}function z(t,e,i,s){var r,o,n,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=C,r=0):(r=Math.ceil((e+1)/C),e%=C),o=g(10,C-e),a=t[r]%o|0,null==s?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),n=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):n=(i<4&&a+1==o||i>3&&a+1==o/2)&&(t[r+1]/o/100|0)==g(10,e-2)-1||(a==o/2||0==a)&&!(t[r+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),n=(s||i<4)&&9999==a||!s&&i>3&&4999==a):n=((s||i<4)&&a+1==o||!s&&i>3&&a+1==o/2)&&(t[r+1]/o/1e3|0)==g(10,e-3)-1,n}function M(t,e,i){for(var s,r,o=[0],n=0,l=t.length;n<l;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=a.indexOf(t.charAt(n++)),s=0;s<o.length;s++)o[s]>i-1&&(void 0===o[s+1]&&(o[s+1]=0),o[s+1]+=o[s]/i|0,o[s]%=i)}return o.reverse()}D.absoluteValue=D.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),P(t)},D.ceil=function(){return P(new this.constructor(this),this.e+1,2)},D.clampedTo=D.clamp=function(t,e){var i=this,s=i.constructor;if(t=new s(t),e=new s(e),!t.s||!e.s)return new s(NaN);if(t.gt(e))throw Error(p+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new s(i)},D.comparedTo=D.cmp=function(t){var e,i,s,r,o=this,n=o.d,a=(t=new o.constructor(t)).d,l=o.s,h=t.s;if(!n||!a)return l&&h?l!==h?l:n===a?0:!n^l<0?1:-1:NaN;if(!n[0]||!a[0])return n[0]?l:a[0]?-h:0;if(l!==h)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,i=(s=n.length)<(r=a.length)?s:r;e<i;++e)if(n[e]!==a[e])return n[e]>a[e]^l<0?1:-1;return s===r?0:s>r^l<0?1:-1},D.cosine=D.cos=function(){var t,e,i=this,s=i.constructor;return i.d?i.d[0]?(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s,r;if(e.isZero())return e;(s=e.d.length)<32?r=(1/J(4,i=Math.ceil(s/3))).toString():(i=16,r="2.3283064365386962890625e-10"),t.precision+=i,e=Y(t,1,e.times(r),new t(1));for(var o=i;o--;){var n=e.times(e);e=n.times(n).minus(n).times(8).plus(1)}return t.precision-=i,e}(s,K(s,i)),s.precision=t,s.rounding=e,P(2==r||3==r?i.neg():i,t,e,!0)):new s(1):new s(NaN)},D.cubeRoot=D.cbrt=function(){var t,e,i,s,r,o,n,a,l,h,c=this,u=c.constructor;if(!c.isFinite()||c.isZero())return new u(c);for(d=!1,(o=c.s*g(c.s*c,1/3))&&Math.abs(o)!=1/0?s=new u(o.toString()):(i=I(c.d),(o=((t=c.e)-i.length+1)%3)&&(i+=1==o||-2==o?"0":"00"),o=g(i,1/3),t=b((t+1)/3)-(t%3==(t<0?-1:2)),(s=new u(i=o==1/0?"5e"+t:(i=o.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),n=(t=u.precision)+3;;)if(h=(l=(a=s).times(a).times(a)).plus(c),s=N(h.plus(c).times(a),h.plus(l),n+2,1),I(a.d).slice(0,n)===(i=I(s.d)).slice(0,n)){if("9999"!=(i=i.slice(n-3,n+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(P(s,t+1,1),e=!s.times(s).times(s).eq(c));break}if(!r&&(P(a,t+1,0),a.times(a).times(a).eq(c))){s=a;break}n+=4,r=1}return d=!0,P(s,t,u.rounding,e)},D.decimalPlaces=D.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=((t=e.length-1)-b(this.e/C))*C,t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},D.dividedBy=D.div=function(t){return N(this,new this.constructor(t))},D.dividedToIntegerBy=D.divToInt=function(t){var e=this.constructor;return P(N(this,new e(t),0,1,1),e.precision,e.rounding)},D.equals=D.eq=function(t){return 0===this.cmp(t)},D.floor=function(){return P(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(t){return this.cmp(t)>0},D.greaterThanOrEqualTo=D.gte=function(t){var e=this.cmp(t);return 1==e||0===e},D.hyperbolicCosine=D.cosh=function(){var t,e,i,s,r,o=this,n=o.constructor,a=new n(1);if(!o.isFinite())return new n(o.s?1/0:NaN);if(o.isZero())return a;s=n.rounding,n.precision=(i=n.precision)+Math.max(o.e,o.sd())+4,n.rounding=1,(r=o.d.length)<32?e=(1/J(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=Y(n,1,o.times(e),new n(1),!0);for(var l,h=t,c=new n(8);h--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return P(o,n.precision=i,n.rounding=s,!0)},D.hyperbolicSine=D.sinh=function(){var t,e,i,s,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(i=o.rounding,o.precision=(e=o.precision)+Math.max(r.e,r.sd())+4,o.rounding=1,(s=r.d.length)<3)r=Y(o,2,r,r,!0);else{t=1.4*Math.sqrt(s),r=Y(o,2,r=r.times(1/J(5,t=t>16?16:0|t)),r,!0);for(var n,a=new o(5),l=new o(16),h=new o(20);t--;)n=r.times(r),r=r.times(a.plus(n.times(l.times(n).plus(h))))}return o.precision=e,o.rounding=i,P(r,e,i,!0)},D.hyperbolicTangent=D.tanh=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+7,s.rounding=1,N(i.sinh(),i.cosh(),s.precision=t,s.rounding=e)):new s(i.s)},D.inverseCosine=D.acos=function(){var t=this,e=t.constructor,i=t.abs().cmp(1),s=e.precision,r=e.rounding;return-1!==i?0===i?t.isNeg()?F(e,s,r):new e(0):new e(NaN):t.isZero()?F(e,s+4,r).times(.5):(e.precision=s+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=s,e.rounding=r,t.times(2))},D.inverseHyperbolicCosine=D.acosh=function(){var t,e,i=this,s=i.constructor;return i.lte(1)?new s(i.eq(1)?0:NaN):i.isFinite()?(e=s.rounding,s.precision=(t=s.precision)+Math.max(Math.abs(i.e),i.sd())+4,s.rounding=1,d=!1,i=i.times(i).minus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln()):new s(i)},D.inverseHyperbolicSine=D.asinh=function(){var t,e,i=this,s=i.constructor;return!i.isFinite()||i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,s.rounding=1,d=!1,i=i.times(i).plus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln())},D.inverseHyperbolicTangent=D.atanh=function(){var t,e,i,s,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=o.precision,e=o.rounding,s=r.sd(),Math.max(s,t)<2*-r.e-1?P(new o(r),t,e,!0):(o.precision=i=s-r.e,r=N(r.plus(1),new o(1).minus(r),i+t,1),o.precision=t+4,o.rounding=1,r=r.ln(),o.precision=t,o.rounding=e,r.times(.5))):new o(NaN)},D.inverseSine=D.asin=function(){var t,e,i,s,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),i=o.precision,s=o.rounding,-1!==e?0===e?((t=F(o,i+4,s).times(.5)).s=r.s,t):new o(NaN):(o.precision=i+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=i,o.rounding=s,r.times(2)))},D.inverseTangent=D.atan=function(){var t,e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(h.isFinite()){if(h.isZero())return new c(h);if(h.abs().eq(1)&&u+4<=T)return(n=F(c,u+4,p).times(.25)).s=h.s,n}else{if(!h.s)return new c(NaN);if(u+4<=T)return(n=F(c,u+4,p).times(.5)).s=h.s,n}for(c.precision=a=u+10,c.rounding=1,t=i=Math.min(28,a/C+2|0);t;--t)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/C),s=1,l=h.times(h),n=new c(h),r=h;-1!==t;)if(r=r.times(l),o=n.minus(r.div(s+=2)),r=r.times(l),void 0!==(n=o.plus(r.div(s+=2))).d[e])for(t=e;n.d[t]===o.d[t]&&t--;);return i&&(n=n.times(2<<i-1)),d=!0,P(n,c.precision=u,c.rounding=p,!0)},D.isFinite=function(){return!!this.d},D.isInteger=D.isInt=function(){return!!this.d&&b(this.e/C)>this.d.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isPositive=D.isPos=function(){return this.s>0},D.isZero=function(){return!!this.d&&0===this.d[0]},D.lessThan=D.lt=function(t){return this.cmp(t)<0},D.lessThanOrEqualTo=D.lte=function(t){return this.cmp(t)<1},D.logarithm=D.log=function(t){var e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=h.d,h.s<0||!i||!i[0]||h.eq(1))return new c(i&&!i[0]?-1/0:1!=h.s?NaN:i?0:1/0);if(e)if(i.length>1)o=!0;else{for(r=i[0];r%10==0;)r/=10;o=1!==r}if(d=!1,n=G(h,a=u+5),s=e?E(c,a+10):G(t,a),z((l=N(n,s,a,1)).d,r=u,p))do{if(n=G(h,a+=10),s=e?E(c,a+10):G(t,a),l=N(n,s,a,1),!o){+I(l.d).slice(r+1,r+15)+1==1e14&&(l=P(l,u+1,0));break}}while(z(l.d,r+=10,p));return d=!0,P(l,u,p)},D.minus=D.sub=function(t){var e,i,s,r,o,n,a,l,h,c,u,p,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d?t.s=-t.s:t=new f(t.d||m.s!==t.s?m:NaN):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(p=t.d,a=f.precision,l=f.rounding,!(h=m.d)[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!h[0])return new f(3===l?-0:0);t=new f(m)}return d?P(t,a,l):t}if(i=b(t.e/C),c=b(m.e/C),h=h.slice(),o=c-i){for((u=o<0)?(e=h,o=-o,n=p.length):(e=p,i=c,n=h.length),o>(s=Math.max(Math.ceil(a/C),n)+2)&&(o=s,e.length=1),e.reverse(),s=o;s--;)e.push(0);e.reverse()}else{for((u=(s=h.length)<(n=p.length))&&(n=s),s=0;s<n;s++)if(h[s]!=p[s]){u=h[s]<p[s];break}o=0}for(u&&(e=h,h=p,p=e,t.s=-t.s),s=p.length-(n=h.length);s>0;--s)h[n++]=0;for(s=p.length;s>o;){if(h[--s]<p[s]){for(r=s;r&&0===h[--r];)h[r]=_-1;--h[r],h[s]+=_}h[s]-=p[s]}for(;0===h[--n];)h.pop();for(;0===h[0];h.shift())--i;return h[0]?(t.d=h,t.e=O(h,i),d?P(t,a,l):t):new f(3===l?-0:0)},D.modulo=D.mod=function(t){var e,i=this,s=i.constructor;return t=new s(t),!i.d||!t.s||t.d&&!t.d[0]?new s(NaN):!t.d||i.d&&!i.d[0]?P(new s(i),s.precision,s.rounding):(d=!1,9==s.modulo?(e=N(i,t.abs(),0,3,1)).s*=t.s:e=N(i,t,0,s.modulo,1),e=e.times(t),d=!0,i.minus(e))},D.naturalExponential=D.exp=function(){return H(this)},D.naturalLogarithm=D.ln=function(){return G(this)},D.negated=D.neg=function(){var t=new this.constructor(this);return t.s=-t.s,P(t)},D.plus=D.add=function(t){var e,i,s,r,o,n,a,l,h,c,u=this,p=u.constructor;if(t=new p(t),!u.d||!t.d)return u.s&&t.s?u.d||(t=new p(t.d||u.s===t.s?u:NaN)):t=new p(NaN),t;if(u.s!=t.s)return t.s=-t.s,u.minus(t);if(c=t.d,a=p.precision,l=p.rounding,!(h=u.d)[0]||!c[0])return c[0]||(t=new p(u)),d?P(t,a,l):t;if(o=b(u.e/C),s=b(t.e/C),h=h.slice(),r=o-s){for(r<0?(i=h,r=-r,n=c.length):(i=c,s=o,n=h.length),r>(n=(o=Math.ceil(a/C))>n?o+1:n+1)&&(r=n,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((n=h.length)-(r=c.length)<0&&(r=n,i=c,c=h,h=i),e=0;r;)e=(h[--r]=h[r]+c[r]+e)/_|0,h[r]%=_;for(e&&(h.unshift(e),++s),n=h.length;0==h[--n];)h.pop();return t.d=h,t.e=O(h,s),d?P(t,a,l):t},D.precision=D.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return i.d?(e=j(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},D.round=function(){var t=this,e=t.constructor;return P(new e(t),t.e+1,e.rounding)},D.sine=D.sin=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s=e.d.length;if(s<3)return e.isZero()?e:Y(t,2,e,e);i=1.4*Math.sqrt(s),e=Y(t,2,e=e.times(1/J(5,i=i>16?16:0|i)),e);for(var r,o=new t(5),n=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(o.plus(r.times(n.times(r).minus(a))));return e}(s,K(s,i)),s.precision=t,s.rounding=e,P(r>2?i.neg():i,t,e,!0)):new s(NaN)},D.squareRoot=D.sqrt=function(){var t,e,i,s,r,o,n=this,a=n.d,l=n.e,h=n.s,c=n.constructor;if(1!==h||!a||!a[0])return new c(!h||h<0&&(!a||a[0])?NaN:a?n:1/0);for(d=!1,0==(h=Math.sqrt(+n))||h==1/0?(((e=I(a)).length+l)%2==0&&(e+="0"),h=Math.sqrt(e),l=b((l+1)/2)-(l<0||l%2),s=new c(e=h==1/0?"5e"+l:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+l)):s=new c(h.toString()),i=(l=c.precision)+3;;)if(s=(o=s).plus(N(n,o,i+2,1)).times(.5),I(o.d).slice(0,i)===(e=I(s.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(P(s,l+1,1),t=!s.times(s).eq(n));break}if(!r&&(P(o,l+1,0),o.times(o).eq(n))){s=o;break}i+=4,r=1}return d=!0,P(s,l,c.rounding,t)},D.tangent=D.tan=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+10,s.rounding=1,(i=i.sin()).s=1,i=N(i,new s(1).minus(i.times(i)).sqrt(),t+10,0),s.precision=t,s.rounding=e,P(2==r||4==r?i.neg():i,t,e,!0)):new s(NaN)},D.times=D.mul=function(t){var e,i,s,r,o,n,a,l,h,c=this,u=c.constructor,p=c.d,m=(t=new u(t)).d;if(t.s*=c.s,!(p&&p[0]&&m&&m[0]))return new u(!t.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*t.s:t.s/0);for(i=b(c.e/C)+b(t.e/C),(l=p.length)<(h=m.length)&&(o=p,p=m,m=o,n=l,l=h,h=n),o=[],s=n=l+h;s--;)o.push(0);for(s=h;--s>=0;){for(e=0,r=l+s;r>s;)a=o[r]+m[s]*p[r-s-1]+e,o[r--]=a%_|0,e=a/_|0;o[r]=(o[r]+e)%_|0}for(;!o[--n];)o.pop();return e?++i:o.shift(),t.d=o,t.e=O(o,i),d?P(t,u.precision,u.rounding):t},D.toBinary=function(t,e){return Z(this,2,t,e)},D.toDecimalPlaces=D.toDP=function(t,e){var i=this,s=i.constructor;return i=new s(i),void 0===t?i:(A(t,0,n),void 0===e?e=s.rounding:A(e,0,8),P(i,t+i.e+1,e))},D.toExponential=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,!0):(A(t,0,n),void 0===e?e=r.rounding:A(e,0,8),i=B(s=P(new r(s),t+1,e),!0,t+1)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toFixed=function(t,e){var i,s,r=this,o=r.constructor;return void 0===t?i=B(r):(A(t,0,n),void 0===e?e=o.rounding:A(e,0,8),i=B(s=P(new o(r),t+r.e+1,e),!1,t+s.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},D.toFraction=function(t){var e,i,s,r,o,n,a,l,h,c,u,m,f=this,v=f.d,b=f.constructor;if(!v)return new b(f);if(h=i=new b(1),s=l=new b(0),o=(e=new b(s)).e=j(v)-f.e-1,e.d[0]=g(10,(n=o%C)<0?C+n:n),null==t)t=o>0?e:h;else{if(!(a=new b(t)).isInt()||a.lt(h))throw Error(p+a);t=a.gt(e)?o>0?e:h:a}for(d=!1,a=new b(I(v)),c=b.precision,b.precision=o=v.length*C*2;u=N(a,e,0,1,1),1!=(r=i.plus(u.times(s))).cmp(t);)i=s,s=r,h=l.plus(u.times(r=h)),l=r,e=a.minus(u.times(r=e)),a=r;return r=N(t.minus(i),s,0,1,1),l=l.plus(r.times(h)),i=i.plus(r.times(s)),l.s=h.s=f.s,m=N(h,s,o,1).minus(f).abs().cmp(N(l,i,o,1).minus(f).abs())<1?[h,s]:[l,i],b.precision=c,d=!0,m},D.toHexadecimal=D.toHex=function(t,e){return Z(this,16,t,e)},D.toNearest=function(t,e){var i=this,s=i.constructor;if(i=new s(i),null==t){if(!i.d)return i;t=new s(1),e=s.rounding}else{if(t=new s(t),void 0===e?e=s.rounding:A(e,0,8),!i.d)return t.s?i:t;if(!t.d)return t.s&&(t.s=i.s),t}return t.d[0]?(d=!1,i=N(i,t,0,e,1).times(t),d=!0,P(i)):(t.s=i.s,i=t),i},D.toNumber=function(){return+this},D.toOctal=function(t,e){return Z(this,8,t,e)},D.toPower=D.pow=function(t){var e,i,s,r,o,n,a=this,l=a.constructor,h=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(g(+a,h));if((a=new l(a)).eq(1))return a;if(s=l.precision,o=l.rounding,t.eq(1))return P(a,s,o);if((e=b(t.e/C))>=t.d.length-1&&(i=h<0?-h:h)<=9007199254740991)return r=L(l,a,i,s),t.s<0?new l(1).div(r):P(r,s,o);if((n=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(n=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=n,a}return(e=0!=(i=g(+a,h))&&isFinite(i)?new l(i+"").e:b(h*(Math.log("0."+I(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?n/0:0):(d=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=H(t.times(G(a,s+i)),s)).d&&z((r=P(r,s+5,1)).d,s,o)&&+I((r=P(H(t.times(G(a,(e=s+10)+i)),e),e+5,1)).d).slice(s+1,s+15)+1==1e14&&(r=P(r,s+1,0)),r.s=n,d=!0,l.rounding=o,P(r,s,o))},D.toPrecision=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,s.e<=r.toExpNeg||s.e>=r.toExpPos):(A(t,1,n),void 0===e?e=r.rounding:A(e,0,8),i=B(s=P(new r(s),t,e),t<=s.e||s.e<=r.toExpNeg,t)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toSignificantDigits=D.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(A(t,1,n),void 0===e?e=i.rounding:A(e,0,8)),P(new i(this),t,e)},D.toString=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},D.truncated=D.trunc=function(){return P(new this.constructor(this),this.e+1,1)},D.valueOf=D.toJSON=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var N=function(){function t(t,e,i){var s,r=0,o=t.length;for(t=t.slice();o--;)t[o]=(s=t[o]*e+r)%i|0,r=s/i|0;return r&&t.unshift(r),t}function e(t,e,i,s){var r,o;if(i!=s)o=i>s?1:-1;else for(r=o=0;r<i;r++)if(t[r]!=e[r]){o=t[r]>e[r]?1:-1;break}return o}function s(t,e,i,s){for(var r=0;i--;)t[i]-=r,t[i]=(r=t[i]<e[i]?1:0)*s+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,o,n,a,l,h){var c,d,u,p,m,f,v,g,y,w,x,k,S,T,D,I,A,z,M,N,B=r.constructor,O=r.s==o.s?1:-1,E=r.d,F=o.d;if(!(E&&E[0]&&F&&F[0]))return new B(r.s&&o.s&&(E?!F||E[0]!=F[0]:F)?E&&0==E[0]||!F?0*O:O/0:NaN);for(h?(m=1,d=r.e-o.e):(h=_,d=b(r.e/(m=C))-b(o.e/m)),M=F.length,A=E.length,w=(y=new B(O)).d=[],u=0;F[u]==(E[u]||0);u++);if(F[u]>(E[u]||0)&&d--,null==n?(T=n=B.precision,a=B.rounding):T=l?n+(r.e-o.e)+1:n,T<0)w.push(1),f=!0;else{if(T=T/m+2|0,u=0,1==M){for(p=0,F=F[0],T++;(u<A||p)&&T--;u++)w[u]=(D=p*h+(E[u]||0))/F|0,p=D%F|0;f=p||u<A}else{for((p=h/(F[0]+1)|0)>1&&(F=t(F,p,h),E=t(E,p,h),M=F.length,A=E.length),I=M,k=(x=E.slice(0,M)).length;k<M;)x[k++]=0;(N=F.slice()).unshift(0),z=F[0],F[1]>=h/2&&++z;do{p=0,(c=e(F,x,M,k))<0?(S=x[0],M!=k&&(S=S*h+(x[1]||0)),(p=S/z|0)>1?(p>=h&&(p=h-1),1==(c=e(v=t(F,p,h),x,g=v.length,k=x.length))&&(p--,s(v,M<g?N:F,g,h))):(0==p&&(c=p=1),v=F.slice()),(g=v.length)<k&&v.unshift(0),s(x,v,k,h),-1==c&&(c=e(F,x,M,k=x.length))<1&&(p++,s(x,M<k?N:F,k,h)),k=x.length):0===c&&(p++,x=[0]),w[u++]=p,c&&x[0]?x[k++]=E[I]||0:(x=[E[I]],k=1)}while((I++<A||void 0!==x[0])&&T--);f=void 0!==x[0]}w[0]||w.shift()}if(1==m)y.e=d,i=f;else{for(u=1,p=w[0];p>=10;p/=10)u++;y.e=u+d*m-1,P(y,l?n+y.e+1:n,a,f)}return y}}();function P(t,e,i,s){var r,o,n,a,l,h,c,u,p,m=t.constructor;t:if(null!=e){if(!(u=t.d))return t;for(r=1,a=u[0];a>=10;a/=10)r++;if((o=e-r)<0)o+=C,l=(c=u[p=0])/g(10,r-(n=e)-1)%10|0;else if((p=Math.ceil((o+1)/C))>=(a=u.length)){if(!s)break t;for(;a++<=p;)u.push(0);c=l=0,r=1,n=(o%=C)-C+1}else{for(c=a=u[p],r=1;a>=10;a/=10)r++;l=(n=(o%=C)-C+r)<0?0:c/g(10,r-n-1)%10|0}if(s=s||e<0||void 0!==u[p+1]||(n<0?c:c%g(10,r-n-1)),h=i<4?(l||s)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||s||6==i&&(o>0?n>0?c/g(10,r-n):0:u[p-1])%10&1||i==(t.s<0?8:7)),e<1||!u[0])return u.length=0,h?(u[0]=g(10,(C-(e-=t.e+1)%C)%C),t.e=-e||0):u[0]=t.e=0,t;if(0==o?(u.length=p,a=1,p--):(u.length=p+1,a=g(10,C-o),u[p]=n>0?(c/g(10,r-n)%g(10,n)|0)*a:0),h)for(;;){if(0==p){for(o=1,n=u[0];n>=10;n/=10)o++;for(n=u[0]+=a,a=1;n>=10;n/=10)a++;o!=a&&(t.e++,u[0]==_&&(u[0]=1));break}if(u[p]+=a,u[p]!=_)break;u[p--]=0,a=1}for(o=u.length;0===u[--o];)u.pop()}return d&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function B(t,e,i){if(!t.isFinite())return U(t);var s,r=t.e,o=I(t.d),n=o.length;return e?(i&&(s=i-n)>0?o=o.charAt(0)+"."+o.slice(1)+R(s):n>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):r<0?(o="0."+R(-r-1)+o,i&&(s=i-n)>0&&(o+=R(s))):r>=n?(o+=R(r+1-n),i&&(s=i-r-1)>0&&(o=o+"."+R(s))):((s=r+1)<n&&(o=o.slice(0,s)+"."+o.slice(s)),i&&(s=i-n)>0&&(r+1===n&&(o+="."),o+=R(s))),o}function O(t,e){var i=t[0];for(e*=C;i>=10;i/=10)e++;return e}function E(t,e,i){if(e>S)throw d=!0,i&&(t.precision=i),Error(m);return P(new t(l),e,1,!0)}function F(t,e,i){if(e>T)throw Error(m);return P(new t(h),e,i,!0)}function j(t){var e=t.length-1,i=e*C+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function R(t){for(var e="";t--;)e+="0";return e}function L(t,e,i,s){var r,o=new t(1),n=Math.ceil(s/C+4);for(d=!1;;){if(i%2&&X((o=o.times(e)).d,n)&&(r=!0),0===(i=b(i/2))){i=o.d.length-1,r&&0===o.d[i]&&++o.d[i];break}X((e=e.times(e)).d,n)}return d=!0,o}function $(t){return 1&t.d[t.d.length-1]}function W(t,e,i){for(var s,r,o=new t(e[0]),n=0;++n<e.length;){if(!(r=new t(e[n])).s){o=r;break}((s=o.cmp(r))===i||0===s&&o.s===i)&&(o=r)}return o}function H(t,e){var i,s,r,o,n,a,l,h=0,c=0,u=0,p=t.constructor,m=p.rounding,f=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,l=f):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),u+=5;for(l+=s=Math.log(g(2,u))/Math.LN10*2+5|0,i=o=n=new p(1),p.precision=l;;){if(o=P(o.times(t),l,1),i=i.times(++c),I((a=n.plus(N(o,i,l,1))).d).slice(0,l)===I(n.d).slice(0,l)){for(r=u;r--;)n=P(n.times(n),l,1);if(null!=e)return p.precision=f,n;if(!(h<3&&z(n.d,l-s,m,h)))return P(n,p.precision=f,m,d=!0);p.precision=l+=10,i=o=a=new p(1),c=0,h++}n=a}}function G(t,e){var i,s,r,o,n,a,l,h,c,u,p,m=1,f=t,v=f.d,b=f.constructor,g=b.rounding,y=b.precision;if(f.s<0||!v||!v[0]||!f.e&&1==v[0]&&1==v.length)return new b(v&&!v[0]?-1/0:1!=f.s?NaN:v?0:f);if(null==e?(d=!1,c=y):c=e,b.precision=c+=10,s=(i=I(v)).charAt(0),!(Math.abs(o=f.e)<15e14))return h=E(b,c+2,y).times(o+""),f=G(new b(s+"."+i.slice(1)),c-10).plus(h),b.precision=y,null==e?P(f,y,g,d=!0):f;for(;s<7&&1!=s||1==s&&i.charAt(1)>3;)s=(i=I((f=f.times(t)).d)).charAt(0),m++;for(o=f.e,s>1?(f=new b("0."+i),o++):f=new b(s+"."+i.slice(1)),u=f,l=n=f=N(f.minus(1),f.plus(1),c,1),p=P(f.times(f),c,1),r=3;;){if(n=P(n.times(p),c,1),I((h=l.plus(N(n,new b(r),c,1))).d).slice(0,c)===I(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(E(b,c+2,y).times(o+""))),l=N(l,new b(m),c,1),null!=e)return b.precision=y,l;if(!z(l.d,c-10,g,a))return P(l,b.precision=y,g,d=!0);b.precision=c+=10,h=n=f=N(u.minus(1),u.plus(1),c,1),p=P(f.times(f),c,1),r=a=1}l=h,r+=2}}function U(t){return String(t.s*t.s/0)}function V(t,e){var i,s,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(s=e.search(/e/i))>0?(i<0&&(i=s),i+=+e.slice(s+1),e=e.substring(0,s)):i<0&&(i=e.length),s=0;48===e.charCodeAt(s);s++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(s,r)){if(r-=s,t.e=i=i-s-1,t.d=[],s=(i+1)%C,i<0&&(s+=C),s<r){for(s&&t.d.push(+e.slice(0,s)),r-=C;s<r;)t.d.push(+e.slice(s,s+=C));e=e.slice(s),s=C-e.length}else s-=r;for(;s--;)e+="0";t.d.push(+e),d&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function q(t,i){var s,r,o,n,a,l,h,c,u;if(i.indexOf("_")>-1){if(i=i.replace(/(\d)_(?=\d)/g,"$1"),k.test(i))return V(t,i)}else if("Infinity"===i||"NaN"===i)return+i||(t.s=NaN),t.e=NaN,t.d=null,t;if(w.test(i))s=16,i=i.toLowerCase();else if(y.test(i))s=2;else{if(!x.test(i))throw Error(p+i);s=8}for((n=i.search(/p/i))>0?(h=+i.slice(n+1),i=i.substring(2,n)):i=i.slice(2),n=i.indexOf("."),r=t.constructor,(a=n>=0)&&(n=(l=(i=i.replace(".","")).length)-n,o=L(r,new r(s),n,2*n)),n=u=(c=M(i,s,_)).length-1;0===c[n];--n)c.pop();return n<0?new r(0*t.s):(t.e=O(c,u),t.d=c,d=!1,a&&(t=N(t,o,4*l)),h&&(t=t.times(Math.abs(h)<54?g(2,h):e.pow(2,h))),d=!0,t)}function Y(t,e,i,s,r){var o,n,a,l,h=t.precision,c=Math.ceil(h/C);for(d=!1,l=i.times(i),a=new t(s);;){if(n=N(a.times(l),new t(e++*e++),h,1),a=r?s.plus(n):s.minus(n),s=N(n.times(l),new t(e++*e++),h,1),void 0!==(n=a.plus(s)).d[c]){for(o=c;n.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=s,s=n,n=o}return d=!0,n.d.length=c+1,n}function J(t,e){for(var i=t;--e;)i*=t;return i}function K(t,e){var i,s=e.s<0,o=F(t,t.precision,1),n=o.times(.5);if((e=e.abs()).lte(n))return r=s?4:1,e;if((i=e.divToInt(o)).isZero())r=s?3:2;else{if((e=e.minus(i.times(o))).lte(n))return r=$(i)?s?2:3:s?4:1,e;r=$(i)?s?1:4:s?3:2}return e.minus(o).abs()}function Z(t,e,s,r){var o,l,h,c,d,u,p,m,f,v=t.constructor,b=void 0!==s;if(b?(A(s,1,n),void 0===r?r=v.rounding:A(r,0,8)):(s=v.precision,r=v.rounding),t.isFinite()){for(b?(o=2,16==e?s=4*s-3:8==e&&(s=3*s-2)):o=e,(h=(p=B(t)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new v(1)).e=p.length-h,f.d=M(B(f),10,o),f.e=f.d.length),l=d=(m=M(p,10,o)).length;0==m[--d];)m.pop();if(m[0]){if(h<0?l--:((t=new v(t)).d=m,t.e=l,m=(t=N(t,f,s,r,0,o)).d,l=t.e,u=i),h=m[s],c=o/2,u=u||void 0!==m[s+1],u=r<4?(void 0!==h||u)&&(0===r||r===(t.s<0?3:2)):h>c||h===c&&(4===r||u||6===r&&1&m[s-1]||r===(t.s<0?8:7)),m.length=s,u)for(;++m[--s]>o-1;)m[s]=0,s||(++l,m.unshift(1));for(d=m.length;!m[d-1];--d);for(h=0,p="";h<d;h++)p+=a.charAt(m[h]);if(b){if(d>1)if(16==e||8==e){for(h=16==e?4:3,--d;d%h;d++)p+="0";for(d=(m=M(p,o,e)).length;!m[d-1];--d);for(h=1,p="1.";h<d;h++)p+=a.charAt(m[h])}else p=p.charAt(0)+"."+p.slice(1);p=p+(l<0?"p":"p+")+l}else if(l<0){for(;++l;)p="0"+p;p="0."+p}else if(++l>d)for(l-=d;l--;)p+="0";else l<d&&(p=p.slice(0,l)+"."+p.slice(l))}else p=b?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=U(t);return t.s<0?"-"+p:p}function X(t,e){if(t.length>e)return t.length=e,!0}function Q(t){return new this(t).abs()}function tt(t){return new this(t).acos()}function et(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function st(t){return new this(t).asin()}function rt(t){return new this(t).asinh()}function ot(t){return new this(t).atan()}function nt(t){return new this(t).atanh()}function at(t,e){t=new this(t),e=new this(e);var i,s=this.precision,r=this.rounding,o=s+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?F(this,s,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=F(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,i=this.atan(N(t,e,o,1)),e=F(this,o,1),this.precision=s,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(N(t,e,o,1)):(i=F(this,o,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function lt(t){return new this(t).cbrt()}function ht(t){return P(t=new this(t),t.e+1,2)}function ct(t,e,i){return new this(t).clamp(e,i)}function dt(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,i,s,r=!0===t.defaults,a=["precision",1,n,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(i=a[e],r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!(b(s)===s&&s>=a[e+1]&&s<=a[e+2]))throw Error(p+i+": "+s);this[i]=s}if(i="crypto",r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!0!==s&&!1!==s&&0!==s&&1!==s)throw Error(p+i+": "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(f);this[i]=!0}else this[i]=!1}return this}function ut(t){return new this(t).cos()}function pt(t){return new this(t).cosh()}function mt(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function vt(t){return P(t=new this(t),t.e+1,3)}function bt(){var t,e,i=new this(0);for(d=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return d=!0,new this(1/0);i=e}return d=!0,i.sqrt()}function gt(t){return t instanceof e||t&&t.toStringTag===v||!1}function yt(t){return new this(t).ln()}function wt(t,e){return new this(t).log(e)}function xt(t){return new this(t).log(2)}function kt(t){return new this(t).log(10)}function _t(){return W(this,arguments,-1)}function Ct(){return W(this,arguments,1)}function St(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function Dt(t,e){return new this(t).pow(e)}function It(t){var e,i,s,r,o=0,a=new this(1),l=[];if(void 0===t?t=this.precision:A(t,1,n),s=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(s));o<s;)(r=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=r%1e7;else{if(!crypto.randomBytes)throw Error(f);for(e=crypto.randomBytes(s*=4);o<s;)(r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(l.push(r%1e7),o+=4);o=s/4}else for(;o<s;)l[o++]=1e7*Math.random()|0;for(s=l[--o],t%=C,s&&t&&(r=g(10,C-t),l[o]=(s/r|0)*r);0===l[o];o--)l.pop();if(o<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=C)l.shift();for(s=1,r=l[0];r>=10;r/=10)s++;s<C&&(i-=C-s)}return a.e=i,a.d=l,a}function At(t){return P(t=new this(t),t.e+1,this.rounding)}function zt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Mt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function Pt(t){return new this(t).sqrt()}function Bt(t,e){return new this(t).sub(e)}function Ot(){var t=0,e=arguments,i=new this(e[t]);for(d=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return d=!0,P(i,this.precision,this.rounding)}function Et(t){return new this(t).tan()}function Ft(t){return new this(t).tanh()}function jt(t){return P(t=new this(t),t.e+1,1)}e=function t(e){var i,s,r;function o(t){var e,i,s,r=this;if(!(r instanceof o))return new o(t);if(r.constructor=o,gt(t))return r.s=t.s,void(d?!t.d||t.e>o.maxE?(r.e=NaN,r.d=null):t.e<o.minE?(r.e=0,r.d=[0]):(r.e=t.e,r.d=t.d.slice()):(r.e=t.e,r.d=t.d?t.d.slice():t.d));if("number"==(s=typeof t)){if(0===t)return r.s=1/t<0?-1:1,r.e=0,void(r.d=[0]);if(t<0?(t=-t,r.s=-1):r.s=1,t===~~t&&t<1e7){for(e=0,i=t;i>=10;i/=10)e++;return void(d?e>o.maxE?(r.e=NaN,r.d=null):e<o.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[t]):(r.e=e,r.d=[t]))}return 0*t!=0?(t||(r.s=NaN),r.e=NaN,void(r.d=null)):V(r,t.toString())}if("string"===s)return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),k.test(t)?V(r,t):q(r,t);if("bigint"===s)return t<0?(t=-t,r.s=-1):r.s=1,V(r,t.toString());throw Error(p+t)}if(o.prototype=D,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=dt,o.clone=t,o.isDecimal=gt,o.abs=Q,o.acos=tt,o.acosh=et,o.add=it,o.asin=st,o.asinh=rt,o.atan=ot,o.atanh=nt,o.atan2=at,o.cbrt=lt,o.ceil=ht,o.clamp=ct,o.cos=ut,o.cosh=pt,o.div=mt,o.exp=ft,o.floor=vt,o.hypot=bt,o.ln=yt,o.log=wt,o.log10=kt,o.log2=xt,o.max=_t,o.min=Ct,o.mod=St,o.mul=Tt,o.pow=Dt,o.random=It,o.round=At,o.sign=zt,o.sin=Mt,o.sinh=Nt,o.sqrt=Pt,o.sub=Bt,o.sum=Ot,o.tan=Et,o.tanh=Ft,o.trunc=jt,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(s=r[i++])||(e[s]=this[s]);return o.config(e),o}(c),e.prototype.constructor=e,e.default=e.Decimal=e,l=new e(l),h=new e(h),Gh.exports?("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(D[Symbol.for("nodejs.util.inspect.custom")]=D.toString,D[Symbol.toStringTag]="Decimal"),Gh.exports=e):(t||(t="undefined"!=typeof self&&self&&self.self==self?self:window),s=t.Decimal,e.noConflict=function(){return t.Decimal=s,e},t.Decimal=e)}(Uh);const qh=Vh.exports,Yh=class{constructor(e){t(this,e),this.ticketDrawDetails=[],this.ticketDrawDetailsFlag=!0,this.displayPrizeCategory=t=>{const e=new Map;t.forEach((t=>{let i=t.divisionDisplayName,s=t.currency;if(i&&"None"!==i){const r=new qh(t.amount);if(e.has(i)){const t=e.get(i),o=t.amount.plus(r);e.set(i,{amount:o,currency:s,times:t.times+1})}else e.set(i,{amount:r,currency:s,times:1})}}));const i=[];for(let[t,s]of e.entries()){const e=s.amount.times(100).floor().dividedBy(100);i.push({prizeName:t,amount:e.toNumber(),currency:s.currency,times:s.times})}return i.sort(((t,e)=>e.prizeName.localeCompare(t.prizeName))),i},this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.playerId=void 0,this.drawMode=!1,this.drawId="",this.gameName="",this.ticketDate="",this.ticketStatus="",this.ticketId="",this.ticketType="",this.ticketAmount="",this.ticketCurrency="",this.ticketMultiplier=!1,this.ticketMultiplierNum=void 0,this.ticketDrawCount=0,this.ticketNumbers="",this.sessionId="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.ticketDrawData="",this.historyDrawData="",this.tabValue="",this.translationUrl=void 0,this.multiplier=3,this.isLoading=!0,this.hasErrors=!1,this.errorText="",this.ticketData=[],this.ticketDataLoaded=!1,this.ticketDraws=[],this.toggleDrawer=[!1],this.drawData=void 0,this.resultMap={Won:"Win",Lost:"Lose"}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Wh[e][i]=t[e][i]})))}connectedCallback(){if(this.historyDrawData&&(this.drawData=JSON.parse(this.historyDrawData)),this.ticketNumbers){let t=JSON.parse(this.ticketNumbers);this.gridNumbers=t.map((t=>t.selections)),this.gridSecondaryNumbers=t.map((t=>t.secondarySelections||[]))}this.isLoading=!1}componentWillRender(){this.ticketDrawData&&this.ticketDrawDetailsFlag&&(this.ticketDrawDetails=JSON.parse(this.ticketDrawData),this.ticketDrawDetails.forEach((t=>{this.getDrawData(t.drawId).then((e=>{t.drawData=Object.assign({},e);let i=this.displayPrizeCategory(t.details);t.details=[...i]}))})),this.ticketDrawDetailsFlag=!1)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}getDrawData(t){return this.isLoading=!0,new Promise(((e,i)=>{let s=new URL(`${this.endpoint}/games/${this.gameId}/draws/${t||this.drawId}`);fetch(s.href).then((t=>t.json())).then((i=>{t?e(i):(this.drawData=i,e(!0)),this.isLoading=!1})).catch((t=>{i(t),this.isLoading=!1}))}))}drawerToggle(t){this.toggleDrawer=this.toggleDrawer.map(((e,i)=>i==t?!e:e)),t>=this.toggleDrawer.length&&this.toggleDrawer.push(!0)}getDivision(t,e){var i,s;let r=t.division,o=null===(s=null===(i=e.drawData)||void 0===i?void 0:i.prizes)||void 0===s?void 0:s.filter((t=>t.order===r));return o&&o.length?o[0].division:null}render(){return this.isLoading?s("p",null,"Loading, please wait ..."):this.hasErrors?void s("p",null,this.errorText):s("section",{class:"DrawResultsSection",ref:t=>this.stylingContainer=t},this.drawMode?s("div",{class:"DrawResultsArea"},this.drawData&&s("div",null,s("div",{class:"DrawResultsHeader"},s("span",null,Hh("drawId",this.language),": ",this.drawData.id),s("span",null,Hh("drawDate",this.language),": ",xh(new Date(this.drawData.date),"dd/MM/yyyy"))),s("div",{class:"DrawResultsBody"},s("div",{class:"DrawNumbersGrid"},s("p",null,Hh("drawNumbersGridDraw",this.language)),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":this.drawData.winningNumbers.length&&this.drawData.winningNumbers[0].numbers.join(","),"secondary-numbers":this.drawData.winningNumbers.length?this.drawData.winningNumbers[0].secondaryNumbers.join(","):"","display-selected":!0,selectable:!1,language:this.language,"grid-type":"ticket","translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),s("div",{class:"DrawPrizes"},s("label",{class:"Label"},Hh("prize",this.language)," "),this.drawData.prizes.length?s("div",null," ",this.drawData.prizes.filter((t=>"None"!==t.division)).map((t=>s("div",null,s("span",{style:{"margin-right":"5px"}},t.division,":"),s("span",{style:{"margin-right":"4px"}}," ",this.thousandSeperator(t.amount.value)),s("span",null,t.amount.currency))))):s("div",null,"None")))))):s("div",{class:"DrawResultsArea TicketDraws"},s("div",{class:"DrawResultsBody"},s("div",{class:"TicketIdContainer"},s("label",{class:"Label"},Hh("ticketId",this.language),": ",s("span",null,this.ticketId))),s("div",{class:"TicketTypeContainer"},s("label",{class:"Label"},Hh("ticketType",this.language),": ",s("span",null,this.ticketType))),s("div",{class:"TicketAmountContainer"},s("label",{class:"Label"},Hh("ticketAmount",this.language),":"," ",s("span",null,`${this.thousandSeperator(this.ticketAmount)} ${this.ticketCurrency}`))),s("div",{class:"DrawNumbersGrid"},this.gridNumbers.map(((t,e)=>{var i;return s("div",null,s("label",{class:"Label"},Hh("drawNumbersGridTicket",this.language),":"),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":t.join(","),"secondary-numbers":null===(i=this.gridSecondaryNumbers[e])||void 0===i?void 0:i.join(","),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))}))),this.ticketMultiplier&&s("div",{class:"DrawMultipler"},s("label",{class:"Label"},Hh("multiplierNum",this.language),": ",this.thousandSeperator(this.ticketMultiplierNum))),s("div",{class:"NumberOfDrawsContainer"},s("label",{class:"Label"},Hh("numberOfDraws",this.language),": ",this.thousandSeperator(this.ticketDrawCount)),s("div",{class:"DrawTicketsContainer"},this.ticketDrawDetails&&this.ticketDrawDetails.length>0&&s("div",{class:"ExpandableBoxes"},this.ticketDrawDetails.map(((t,e)=>{var i,r,o,n,a,l,h,c;return s("div",{class:{ExpandableBox:!0,ShowBox:this.toggleDrawer[e]},onClick:this.drawerToggle.bind(this,e)},s("div",{class:"ExpandableBoxHeader"},s("div",{class:"TicketResultContainer"},s("p",null,Hh("ticketResult",this.language),": ",this.resultMap[t.state])),"won"==t.state&&s("div",{class:"AmountWonContainer"},s("p",null,Hh("amountWon",this.language),":"," ",Number(t.amount).toLocaleString("en")," ",t.currency)),"lost"==t.state&&s("div",{class:"DrawIdContainer"},s("p",null,Hh("drawId",this.language),": ",t.drawId))),s("div",{class:"ExpandableBoxBody"},s("div",{class:"DrawIdContainer"},s("p",null,Hh("drawId",this.language),": ",t.drawId)),s("div",{class:"DrawDateContainer"},s("p",null,Hh("drawDate",this.language),": ",null===(i=t.drawData)||void 0===i?void 0:i.date.slice(0,10)," |"," ",null===(r=t.drawData)||void 0===r?void 0:r.date.slice(11,19))),s("div",{class:"DrawNumbersGrid"},t.drawData&&s("div",{class:"BulletContainer"},s("label",{class:"Label"},Hh("drawNumbersGridDraw",this.language),":"),s("lottery-grid",{"selected-numbers":(null===(n=null===(o=t.drawData)||void 0===o?void 0:o.winningNumbers)||void 0===n?void 0:n.length)&&(null===(a=t.drawData.winningNumbers[0].numbers)||void 0===a?void 0:a.join(",")),"secondary-numbers":(null===(h=null===(l=t.drawData)||void 0===l?void 0:l.winningNumbers)||void 0===h?void 0:h.length)&&(null===(c=t.drawData.winningNumbers[0].secondaryNumbers)||void 0===c?void 0:c.join(",")),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),t.details.length>0&&s("div",{class:"DrawPrizes"},s("label",{class:"Label"},Hh("prize",this.language),":"),s("span",null,t.details.map((t=>s("span",null,s("div",null,s("span",null,t.prizeName,t.times>1?" x "+t.times:"",":"," "),s("span",{style:{"margin-right":"4px"}},this.thousandSeperator(t.amount)),s("span",null,t.currency)))))))))}))))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Yh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.DrawResultsArea{margin-top:15px}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background-secondary, #f5f5f5);font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid var(--emw--color-typography, #009993)}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px;margin-bottom:10px;color:var(--emw--color-typography, #000)}.DrawNumbersGrid label{display:block;margin-bottom:7px}.Label{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid var(--emw--color-gray-250, #ccc);border-radius:5px;background-color:var(--emw--color-background-secondary, #f5f5f5)}.ExpandableBox{border-bottom:1px solid var(--emw--color-gray-250, #ccc);transition:height 300ms ease-in-out;overflow:hidden;height:80px;background-color:var(--emw--color-background, #fff)}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:var(--emw--color-primary, #009993)}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:"";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:var(--emw--color-primary, #009993)}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:var(--emw--color-primary, #009993);transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:auto}';const Jh=["ro","en","fr","ar","hr"],Kh={en:{drawResultsHeader:"Draw results history",viewAllResults:"View All",noResults:"No results.",loading:"Loading, please wait ...",resetButton:"Reset"},ro:{drawResultsHeader:"Istoricul extragerilor",viewAllResults:"Vezi toate rezultatele",noResults:"Niciun rezultat",loading:"Loading, please wait ..."},fr:{drawResultsHeader:"Dessiner l'historique des résultats",viewAllResults:"Voir tout",noResults:"Aucun résultat",loading:"Loading, please wait ..."},ar:{drawResultsHeader:"سجل نتائج السحب",viewAllResults:"عرض الكل",noResults:"لا توجد نتائج",loading:"Loading, please wait ..."},hr:{drawResultsHeader:"Povijest rezultata izvlačenja",viewAllResults:"Pogledaj sve",noResults:"Nema rezultata",loading:"Loading, please wait ..."}},Zh=(t,e)=>{const i=e;return Kh[void 0!==i&&Jh.includes(i)?i:"en"][t]};function Xh(t,e){return null==t||""===t||(0!==t||!e)&&(Array.isArray(t)?function(t){if(0===t.length)return!0;const e=t.length;let i=0;for(let s=0;s<e;s++){if(!Xh(t[s]))return!1;i++}return i===e}(t):"[object Object]"===Object.prototype.toString.call(t)?function(t){if(0===Object.keys(t).length)return!0;const e=Object.keys(t).length;let i=0;for(const e of Object.values(t)){if(!Xh(e))return!1;i++}return i===e}(t):!t)}var Qh;!function(t){t.UPCOMING="UPCOMING",t.OPEN="OPEN",t.PENDING="PENDING",t.ACTIVE="ACTIVE",t.DRAWN="DRAWN",t.SETTLED="SETTLED",t.CLOSED="CLOSED",t.PAYABLE="PAYABLE",t.CANCELED="CANCELED"}(Qh||(Qh={}));const tc=class{constructor(e){t(this,e),this.isReset=!1,this.getDrawsData=async()=>{this.isLoading=!0;const t={limit:this.limit,offset:this.offset,status:[Qh.PAYABLE,Qh.CLOSED],from:this.dateFiltersFrom,to:this.dateFiltersTo};try{const e=await fetch(`${this.endpoint}/games/${this.gameId}/draws${function(t){const e={};Object.entries(t).forEach((([t,i])=>{Xh(i,!0)||(e[t]=i)}));const i=Object.entries(e).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&");return i?`?${i}`:""}(t)}`);if(!e.ok)throw new Error(`There was an error while fetching the data. Status: ${e.status}`);const i=await e.json();this.winningDataSetsData=i.items||[],this.drawData=this.winningDataSetsData.map((t=>t)),this.totalResults=i.total}catch(t){console.error("Failed to fetch draw data:",t)}finally{this.isLoading=!1,this.noResults=0===this.drawData.filter((t=>t.winningNumbers)).length}},this.transDataToString=t=>{try{return JSON.stringify(t)}catch(t){throw new Error(t)}},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.drawData=[],this.winningDataSetsData=[""],this.dateFiltersFrom="",this.dateFiltersTo="",this.isLoading=!1,this.noResults=!1,this.activeIndex=0,this.totalResults=0,this.limit=5,this.offset=0}filtersHandler(t){this.dateFiltersFrom=t.detail.filterFromCalendar,this.dateFiltersTo=t.detail.filterToCalendar,this.limit=5,this.offset=0,this.getDrawsData()}clearFiltersHandler(){this.dateFiltersFrom="",this.dateFiltersTo="",this.limit=5,this.offset=0,this.drawData=this.winningDataSetsData,this.getDrawsData()}hpPageChange(t){this.limit=t.detail.limit,this.offset=t.detail.offset,this.isReset=!1,this.getDrawsData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}connectedCallback(){this.getDrawsData()}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Kh[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){clearInterval(this.interval)}render(){let t=s("div",{key:"e4832e084ccfae7d795eedf7ac6138747764e4e5",class:"DrawResultsHeader"},s("div",{key:"79638fcb05a24d05453adb065f668c2ac0375fd5",class:"DrawResultsHeaderContent"},s("h4",{key:"6e95020a200139365cf7e01ef64ca7428595546e"},Zh("drawResultsHeader",this.language)),s("div",{key:"0f53a9527c2751e4ba33435f4833ab7d8c463080",class:"FilterSection"},s("helper-filters",{key:"18c8dbe76602e4bb95d20a3e0df9401c24238be5","activate-ticket-search":"false","game-id":this.gameId,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))));return s("section",{key:"5e000a3c95bdc97e68a49165a0d7658fea684a55",class:"GridWrapper",ref:t=>this.stylingContainer=t},s("div",{key:"d933a1a9a87de5bf7ca2c7c109e0f2b1576a0994",class:"DrawResultsSection"},s("div",{key:"a140aa6e6291f8832ec9883dafd9837e04a2909c",class:"DrawResultsAreaHistory"},t,s("div",{key:"81488ac1c92b8be651d38f4eb8038e21c81508cb",class:"HistoryGridWrapper"},s("div",{key:"08614a4e9ab66dcfc5f0408363ddb08a24231931",class:"HistoryGrid"},this.isLoading&&s("p",{key:"ebd6fe7e16bb36335702520358ac999e34e7b5d6"},Zh("loading",this.language)),!this.isLoading&&!this.noResults&&this.drawData.map((t=>s("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,"draw-id":t.id,"draw-mode":!0,language:this.language,"history-draw-data":this.transDataToString(t),"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),!this.isLoading&&this.noResults&&s("p",{key:"4a285a51dddff8e984400a6f390c1919d5fcd5ae",class:"errorText"},Zh("noResults",this.language)))),s("div",{key:"13d10caed463e12b218341531c2dd34825968d88",class:"DrawHistoryPaginationWrapper"},this.totalResults>this.limit&&s("lottery-pagination",{key:"89ff3a6354036d1e3fbad82d8aec9aa4e9c19f66",arrowsActive:!0,numberedNavActive:!0,"is-reset":this.isReset,"first-page":!1,"prev-page":!0,"next-page":!0,offset:this.offset,limit:this.limit,total:this.totalResults,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};tc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridBanner{background-color:var(--emw--color-primary, #009993);background-repeat:no-repeat;background-position:center;color:var(--emw--color-typography, #000);padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.GridWrapper{background-color:var(--emw--color-background, #fff)}.DrawResultsSection{max-width:600px;margin:0px auto;padding-bottom:30px;color:var(--emw--color-typography, #000)}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:var(--emw--color-primary, #009993);padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:var(--emw--color-primary, #009993);padding:10px;text-align:center;color:var(--emw--color-background, #fff);padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff);outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton,.FilterSection .ResetButton{cursor:pointer;width:max-content;border-radius:var(--emw--button-border-radius, 4px);border:1px solid var(--emw--button-border-color, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .Active{background:var(--emw--color-primary-variant, #004d4a);color:var(--emw--color-background, #fff)}.FilterSection helper-filters{margin-left:auto}.errorText{color:var(--emw--color-error, #ff0000)}';const ec=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"0bb2683f87461804914d26c708499902d92dc503",class:"GamePageDetailsContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"2ba23b953a9519ccb36fd203c3ac98a366673822","header-title":"Game Details",collapsed:!1,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"54c18e3a6fde25ff0953bb7b15b8a1200e237fd0",class:"AccordionContainer",slot:"accordionContent"},s("helper-tabs",{key:"0cb93435825bf7a42636848ffd5ff67a30369cfa","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};ec.style=":host{display:block}";const ic=["ro","en","fr","ar","hr"],sc={en:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDrawIn:"Next draw in: ",startIn:"Sales Start in:",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",ticketFailed:"Failed to submit tickets.",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ...",emptyText:"Sorry. The Game is not available now."},ro:{error:"Eroare",backButton:"Inapoi",lobbyButton:"Lobby",nextDrawIn:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",submitSuccess:"Submit successfully!",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",modalLogin:"Please login to submit a ticket",loading:"Se incarca, va rugam asteptati ..."},fr:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDrawIn:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ..."},ar:{error:"خطأ",backButton:"خلف",lobbyButton:"ردهة",nextDrawIn:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",submitSuccess:"Submit successfully!",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة",loading:"Loading, please wait ..."},hr:{error:"Greška",backButton:"Nazad",lobbyButton:"Lobby",nextDrawIn:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",submitSuccess:"Submit successfully!",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",modalLogin:"Molimo prijavite se da uplatite listić",loading:"Učitavanje, molimo pričekajte ..."}},rc=(t,e)=>{const i=e;return sc[void 0!==i&&ic.includes(i)?i:"en"][t]},oc=t=>new Promise(((e,i)=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])sc[e][i]=t[e][i]})),e(sc)})).catch((t=>{i(t)}))}));var nc,ac;!function(t){t.OPEN="OPEN"}(nc||(nc={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(ac||(ac={}));const lc=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));function hc(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n=lc(),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const cc=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})};function dc(t,e){if(!t)return;let i=function(t,e,i){Al(2,arguments);var s,r=function(t,e){return Al(2,arguments),zl(t).getTime()-zl(e).getTime()}(t,e)/1e3;return((s=null==i?void 0:i.roundingMethod)?Ol[s]:Ol[El])(r)}("string"==typeof t?kh(t):t,e&&new Date);if(i<0)return"0D 00H 00M 00S";const s=Math.floor(i/86400);i%=86400;const r=Math.floor(i/3600);i%=3600;const o=Math.floor(i/60),n=i%60;return`${s}D ${r.toString().padStart(2,"0")}H ${o.toString().padStart(2,"0")}M ${n.toString().padStart(2,"0")}S`}const uc="TICKET_INVALID_TOKEN",pc=class{constructor(i){t(this,i),this.goBackEvent=e(this,"goBackEvent",7),this.goToLobbyEvent=e(this,"goToLobbyEvent",7),this.resetAllTicketSelection=e(this,"resetAllTicketSelection",7),this.quickPick=!1,this.gameData={},this.secondarySelectionAllowed=!1,this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId=void 0,this.language="en",this.backgroundUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tickets=[],this.mainTickets=[],this.secondaryTickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.nextDate=void 0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.isLoading=!1,this.showSubmitError=!1,this.submitError="",this.showApiError=!1,this.apiError="",this.translationData=void 0,this.isSubscription=!1,this.subscriptionParam=null,this.showSubscriptionError=!1,this.subscriptionError="",this.isSubscribed=!1,this.isFetchingGame=!1,this.drawSubmitAvailable=!1,this.formattedTime=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleNewTranslations(){this.isLoading=!0,oc(this.translationUrl).then((()=>{this.isLoading=!1}))}watchGameInfoChange(t,e){t&&t!=e&&this.getGameDetails()}async componentWillLoad(){this.gameId&&this.endpoint&&this.getGameDetails(),this.sessionId&&(this.isLoggedIn=!0);const t=[];if(this.translationUrl){const e=oc(this.translationUrl).then((t=>{this.translationData=JSON.stringify(t)})).catch((t=>{console.log(t)}));t.push(e)}return Promise.all(t)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isFetchingGame=!0,fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{var e,i,s,r,o;if(this.gameData=t,this.basicStake=this.gameData.rules.stakes.length?Number(this.gameData.rules.stakes[0].value):0,this.basicLine=(null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.length)?this.gameData.rules.betTypes[0].boardsAllowed[0]:1,this.basicBetType=this.gameData.rules.betTypes[0],this.gameData&&function(t={}){return!(!t||!t.id||t.status!==nc.OPEN)}(null===(i=this.gameData)||void 0===i?void 0:i.currentDraw)){this.nextDate=null===(s=this.gameData.currentDraw)||void 0===s?void 0:s.date;const e=null===(o=null===(r=this.gameData)||void 0===r?void 0:r.currentDraw)||void 0===o?void 0:o.wagerStartTime,i=()=>{var i;const s=new Date;e&&function(t,e){Al(2,arguments);var i=zl(t),s=zl(e);return i.getTime()<s.getTime()}(s,kh(e))?(this.drawSubmitAvailable=!1,this.formattedTime={start:dc(e,s)}):(this.drawSubmitAvailable=!0,this.formattedTime={nextIn:dc(null===(i=null==t?void 0:t.currentDraw)||void 0===i?void 0:i.date,s)}),"0D 00H 00M 00S"===this.formattedTime.nextIn&&clearInterval(this.interval)};i(),this.interval=setInterval(i,1e3)}this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed,this.quickPick=this.gameData.rules.quickPickAvailable,this.isSubscription=this.gameData.rules.wagerTypes&&this.gameData.rules.wagerTypes.includes("Subscription");let n=this.gameData.draws?this.gameData.draws.filter((t=>!t.winningNumbers)):[];n.length>0&&(this.nextDraw=n[0].id),this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>{this.isFetchingGame=!1}))}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.mainTickets.forEach((t=>{var e;t.completed.every((t=>t))&&(this.totalAmount+=t.drawCount*(t.stake||this.basicStake)*t.multiplierNum*t.lineNum*(null===(e=t.betType)||void 0===e?void 0:e.combinations))})),this.currency=t}gridFilledHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!0,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:t.detail.drawCount,stake:e.stake||this.basicStake,selectedNumbers:i,multiplierNum:t.detail.multiplierNum,multiplier:t.detail.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:t.detail.quickPicks,betName:t.detail.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}gridDirtyHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!1,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:e.drawCount,stake:e.stake,selectedNumbers:i,multiplierNum:e.multiplierNum,multiplier:e.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:e.quickPicks,betName:e.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}modalCloseEvent(){this.loginModalVisible=!1,this.successVisible=!1}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.mainTickets[e-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(t){const{ticketId:e,multiplierNum:i,multiplier:s}=t.detail;this.mainTickets[e-1].multiplierNum=i,this.mainTickets[e-1].multiplier=s,this.calculateTotalAmount()}drawMultiplierChangeHandler(t){const{ticketId:e,drawCount:i}=t.detail;this.mainTickets[e-1].drawCount=i,this.calculateTotalAmount()}lineMultiplierChangeHandler(t){const{ticketId:e,lineNum:i}=t.detail;this.mainTickets[e-1].lineNum=i,this.mainTickets[e-1].completed=Array.from({length:i},(()=>!1)),this.mainTickets[e-1].selectedNumbers=[],this.mainTickets[e-1].quickPicks=[]}betTypeChangeHandler(t){const{ticketId:e,betType:i}=t.detail;this.mainTickets[e-1].betType=i}createNewTicket(){this.mainTickets=[...this.mainTickets,{gameId:this.gameId,ticketId:this.mainTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine,quickPicks:[!1],betName:""}],this.secondaryTickets=[...this.secondaryTickets,{gameId:this.gameId,ticketId:this.secondaryTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine}]}showLoginModal(){this.loginModalVisible=!0}handleSubscriptionReady(t){this.subscriptionParam=t.detail}handleSubscriptionCheckChange(t){this.isSubscribed=t.detail}buildTicketParam(){let t={playerId:this.playerId.toString(),tickets:[]},e=[];this.secondarySelectionAllowed&&(e=this.secondaryTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]));let i=this.mainTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]),s=[...new Set([...e,...i])].sort(((t,e)=>t-e));if(s.length){this.showSubmitError=!0;let t=s.map((t=>`Line${t+1}`)).join();return this.submitError=`The number of the selected number(s) on ${t} is invalid.`,setTimeout((()=>{this.showSubmitError=!1}),3e3),null}return this.mainTickets.forEach(((e,i)=>{var s;t.tickets.push({startingDrawId:this.nextDraw,amount:(e.stake*e.drawCount*e.multiplierNum*(e.lineNum||1)*(null===(s=e.betType)||void 0===s?void 0:s.combinations)).toString(),gameId:this.gameId,gameName:this.gameData.name,currency:this.currency,selection:e.selectedNumbers.map(((t,s)=>{var r;return{betType:(null===(r=e.betType)||void 0===r?void 0:r.id)||this.gameData.rules.defaultBetType,stake:e.stake,selections:t,secondarySelections:this.secondarySelectionAllowed?this.secondaryTickets[i].selectedNumbers[s]:[],quickPick:e.quickPicks[s],betName:e.betName}})),multiplier:e.multiplier,multiplierNum:e.multiplierNum,drawCount:e.drawCount,quickPick:this.quickPick})})),t}handleSubmitTickets(){this.drawSubmitAvailable&&(this.isSubscription&&this.isSubscribed?(this.submitTickets(),this.submitSubscriptionTickets()):this.submitTickets())}async submitSubscriptionTickets(){try{let t=await this.buildTicketParam();if(!t)return;if(!this.subscriptionParam||"string"==typeof this.subscriptionParam)return this.subscriptionError="string"==typeof this.subscriptionParam?this.subscriptionParam:"Ouccurence is required.",this.showSubscriptionError=!0,void setTimeout((()=>{this.showSubscriptionError=!1}),3e3);this.isLoading=!0;const e=this.playerId.toString(),i=`${this.endpoint}/player/${e}/ruleDefinition`;this.subscriptionParam.playerId=e;const s=xh(new Date,"yyyyMMddHHMMSS");this.subscriptionParam.name=`${this.subscriptionParam.ruleType}_${e}_${s}`;const{id:r}=await hc(i,"POST",this.subscriptionParam,{Authorization:`Bearer ${this.sessionId}`});if(t){const e=Object.assign(Object.assign({},t),{ruleDefinitionId:r}),i=`${this.endpoint}/subscription`;await hc(i,"POST",e,{Authorization:`Bearer ${this.sessionId}`}),cc({message:"Subscription rule created successfully.",theme:"success"});const s=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(s),console.log("resetAllTicketSelection event emitted through document after subscription ticket submission")}}catch(t){cc({message:"Failed to create the subscription rule. Please try again.",theme:"error"})}this.isLoading=!1}submitTickets(){let t=new URL(`${this.endpoint}/tickets`);const e=this.buildTicketParam();e?(this.isLoading=!0,(({body:t,sessionId:e,url:i})=>{const s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":lc()},body:JSON.stringify(t)};return fetch(i,s).then((t=>{if(401===t.status)throw new Error(uc);if(t.status>300)throw new Error(t.statusText);return t.json().then((e=>{if(!(i=e.tickets)||!i.length||i.some((t=>t.state!==ac.Purchased)))throw new Error(t.statusText);var i;return e}))}))})({body:e,sessionId:this.sessionId,url:t.href}).then((()=>{cc({message:"Ticket submitted successfully.",theme:"success"}),this.resetAllTicketSelection.emit();const t=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(t)})).catch((t=>{cc(t.message!==uc?{message:rc("ticketFailed",this.language),theme:"error"}:{message:uc,theme:"error"})})).finally((()=>{this.isLoading=!1}))):console.log("No valid ticket parameters to submit")}goBack(){this.goBackEvent.emit()}goToLobby(){this.goToLobbyEvent.emit()}render(){var t,e,i,r,o,n,a,l,h,c,d,u,p,m,f,v,b,g,y,w,x,k,_;return this.hasErrors?s("div",{class:"GamePage"},s("div",{class:"Title"},rc("error",this.language))):s("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr",ref:t=>this.stylingContainer=t},s("div",{class:"GridBanner",style:{background:this.backgroundUrl?`url(${this.backgroundUrl})`:"","background-size":"contain","background-repeat":"no-repeat","background-position":"center"}},s("div",{class:"BannerButtonsWrapper"}),s("div",{class:"Tabs"},s("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},rc("buy",this.language)),s("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},rc("viewLatest",this.language)))),this.isFetchingGame?s("div",{class:"fetching"},"Loading..."):s("div",{class:"GamePageWrap"},this.nextDate?s("div",null,s("div",{class:"NextDrawWrapper"},s("div",{class:"NextDraw"},(null===(t=this.formattedTime)||void 0===t?void 0:t.start)?s("p",{class:"BannerText"},rc("startIn",this.language)):s("p",{class:"BannerText"},rc("nextDrawIn",this.language)),s("div",{class:"BannerCountdown"},(null===(e=this.formattedTime)||void 0===e?void 0:e.start)||(null===(i=this.formattedTime)||void 0===i?void 0:i.nextIn)))),0==this.tabIndex&&s("div",{class:"GamePageContentWrapper"},s("div",{class:"GamePageContent"},s("div",{class:"GameDetails"},s("lottery-game-details",{"low-number":null===(o=null===(r=this.gameData.rules)||void 0===r?void 0:r.boards[0])||void 0===o?void 0:o.lowNumber,"high-number":null===(a=null===(n=this.gameData.rules)||void 0===n?void 0:n.boards[0])||void 0===a?void 0:a.highNumber,"minimum-allowed":null===(h=null===(l=this.gameData.rules)||void 0===l?void 0:l.boards[0])||void 0===h?void 0:h.minimumAllowed,"maxinum-allowed":null===(d=null===(c=this.gameData.rules)||void 0===c?void 0:c.boards[0])||void 0===d?void 0:d.maxinumAllowed,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"translation-url":this.translationData})),s("div",{class:"TicketsWrapper"},this.mainTickets.map((t=>{var e,i;return s("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":null===(e=this.gameData.rules)||void 0===e?void 0:e.quickPickAvailable,"reset-button":null===(i=this.gameData.rules)||void 0===i?void 0:i.quickPickAvailable,"total-controllers":this.mainTickets.length,"translation-url":this.translationData,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})}))),s("div",{class:"OrderSummary"},s("h3",{class:"OrderSummaryTitle"},rc("orderSummaryTitle",this.language)),s("div",{class:"OrderTicketInfo"},s("div",{class:"Ticket"},rc("orderSummaryTickets",this.language),": ",s("span",null,this.mainTickets.length)),s("div",null,s("span",null,this.thousandSeperator((null===(p=null===(u=this.mainTickets[0])||void 0===u?void 0:u.betType)||void 0===p?void 0:p.combinations)*(null===(m=this.mainTickets[0])||void 0===m?void 0:m.lineNum))),s("span",{class:"Multiplier"},"x"),(null===(f=this.gameData.rules)||void 0===f?void 0:f.stakeMultiplierAvailable)&&s("span",null,s("span",null,1===(null===(v=this.mainTickets[0])||void 0===v?void 0:v.multiplierNum)?`${null===(b=this.mainTickets[0])||void 0===b?void 0:b.multiplierNum} Multiplier`:`${null===(g=this.mainTickets[0])||void 0===g?void 0:g.multiplierNum} Multipliers`),s("span",{class:"Multiplier"},"x")),s("span",null,`${null===(y=this.mainTickets[0])||void 0===y?void 0:y.stake} EUR`),(null===(w=this.gameData.rules)||void 0===w?void 0:w.drawMultiplierAvailable)&&s("span",null,s("span",{class:"Multiplier"},"x"),s("span",null,1===(null===(x=this.mainTickets[0])||void 0===x?void 0:x.drawCount)?`${null===(k=this.mainTickets[0])||void 0===k?void 0:k.drawCount} Draw`:`${null===(_=this.mainTickets[0])||void 0===_?void 0:_.drawCount} Draws`)))),s("hr",null),s("div",{class:"Total"},rc("orderSummaryTotal",this.language),":"," ",s("span",null,this.thousandSeperator(this.totalAmount)," ",this.currency)),this.isSubscription&&s("div",{class:"SubscriptionWrapper"},s("lottery-subscription",{endpoint:this.endpoint,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,gameName:this.gameData.name})),s("div",{class:"ButtonWrapper"},this.isLoggedIn&&s("div",null,!this.isLoading&&s("div",{class:"submitWrap"},s("div",{class:{Button:!0,ButtonDisabled:!this.drawSubmitAvailable},onClick:()=>this.handleSubmitTickets()},rc("orderSummarySubmit",this.language)),this.showSubmitError&&s("div",{class:"submitError"},this.submitError),this.showApiError&&s("div",{class:"submitError"},this.apiError),this.showSubscriptionError&&s("div",{class:"submitError"},this.subscriptionError)),this.isLoading&&s("span",{class:"Button",style:{cursor:"default"}},rc("loading",this.language))),!this.isLoggedIn&&s("div",null,s("span",{class:"Button",onClick:()=>this.showLoginModal()},rc("orderSummarySubmit",this.language)),s("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},rc("modalLogin",this.language)))))))),1==this.tabIndex&&s("div",{class:"HistoryContentWrapper"},s("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}))):s("div",{class:"noActiveDraw"},rc("emptyText",this.language))),s("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},rc("submitSuccess",this.language))))}static get assetsDirs(){return["../static"]}get element(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"],endpoint:["watchGameInfoChange"],gameId:["watchGameInfoChange"]}}};pc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");\n:host {\n display: block;\n font-family: "Roboto", sans-serif;\n}\n\n.GamePage {\n background-color: var(--emw--color-background, #fff);\n}\n.GamePage .GridBanner {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n background-repeat: no-repeat;\n background-position: center;\n color: var(--emw--color-typography, #000);\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.GamePage .GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,\n.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GamePage .GridBanner .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.GamePage .TotalWinnings {\n color: var(--emw--color-typography, #000);\n font-size: 18px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n text-transform: uppercase;\n}\n.GamePage .TotalWinnings span {\n font-size: 18px;\n font-weight: 700;\n}\n.GamePage .NextDraw {\n color: var(--emw--color-primary, #009993);\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto;\n text-align: center;\n text-transform: uppercase;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 4px;\n}\n.GamePage .NextDraw .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n}\n.GamePage .NextDraw .BannerCountdown {\n font-size: 22px;\n color: var(--emw--color-primary, #009993);\n display: flex;\n gap: 20px;\n}\n.GamePage .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n}\n.GamePage .Tabs .TabButton {\n border-radius: var(--emw--button-border-radius, 4px);\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid var(--emw--color-primary, #009993);\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.GamePage .Tabs .TabButton.Active {\n color: var(--emw--color-primary, #009993);\n background: var(--emw--color-gray-50, #f5f5f5);\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n}\n\n.LastDrawResultsTitle {\n color: var(--emw--color-primary, #009993);\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: var(--emw--button-border-radius, 4px);\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.NextDrawWrapper {\n padding: 10px 15px;\n background: var(--emw--color-background, #fff);\n}\n.NextDrawWrapper .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n.NextDrawWrapper .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: var(--emw--color-primary, #009993);\n font-weight: bolder;\n justify-content: center;\n}\n\n.GamePageContent {\n max-width: 1200px;\n margin: 0 auto;\n background: var(--emw--color-background, #fff);\n container-type: inline-size;\n container-name: gamePage;\n}\n\n.TicketsWrapper {\n min-height: 300px;\n}\n\n@container gamePage (min-width: 1200px) {\n .GamePageContent .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GamePageContent .GameDetails {\n float: right;\n width: 49%;\n }\n .GamePageContent .OrderSummary {\n float: right;\n width: 49%;\n }\n}\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: var(--emw--button-border-radius, 4px);\n color: var(--emw--color-typography, #000);\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: var(--emw--color-background, #fff);\n}\n.OrderSummary .OrderSummaryTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n text-transform: uppercase;\n text-align: center;\n}\n.OrderSummary .OrderTicketInfo {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n.OrderSummary .OrderTicketInfo .Multiplier {\n margin: 0 6px;\n}\n.OrderSummary .Ticket {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n margin-right: 30px;\n}\n.OrderSummary .Ticket span {\n text-align: right;\n}\n.OrderSummary hr {\n border: none;\n border-top: 1px double var(--emw--color-gray-100, #e6e6e6);\n color: var(--emw--color-gray-100, #e6e6e6);\n width: 100%;\n}\n.OrderSummary .Total {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n}\n.OrderSummary .Total span {\n text-align: right;\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ButtonWrapper .Button {\n cursor: pointer;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.ButtonWrapper .Button:hover {\n background: var(--emw--color-secondary, #00aba4);\n}\n.ButtonWrapper .Button.ButtonDisabled {\n pointer-events: none;\n background: var(--emw--color-background-tertiary, #ccc);\n}\n.ButtonWrapper .submitError {\n margin-top: 10px;\n color: var(--emw--color-error, #ff3d00);\n}\n.ButtonWrapper .submitWrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.SubmitModalSuccess {\n text-align: center;\n font-size: 18px;\n padding: 20px;\n}\n\n.DeleteTicketModalWrapper {\n padding: 20px;\n text-align: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalText {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n line-height: 22px;\n margin-bottom: 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-error, #ff3d00);\n border: 1px solid var(--emw--color-error, #ff3d00);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover {\n background: var(--emw--color-tertiary, #ff6536);\n border: 1px solid var(--emw--color-error, #ff3d00);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid var(--emw--color-secondary, #00aba4);\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n}\n\n.GamePage {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.GamePage .GamePageContentWrapper,\n.GamePage .HistoryContentWrapper {\n padding: 15px;\n flex: 1;\n background: var(--emw--color-background, #fff);\n}\n\n.HistoryContentWrapper::after,\n.GamePageContent::after {\n content: "";\n display: block;\n clear: both;\n}\n\n.GamePageWrap .noActiveDraw {\n margin: 10% auto 0px;\n padding: 24px;\n border: 1px solid var(--emw--color-primary, #009993);\n border-radius: 4px;\n width: 280px;\n color: var(--emw--color-primary, #009993);\n}\n\n.fetching {\n margin: 40px auto;\n}';const mc=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.gridClearAllEvent=e(this,"gridClearAllEvent",7),this.selectedCounter=0,this.ticketId=void 0,this.totalNumbers=0,this.gameId=void 0,this.maximumAllowed=7,this.minimumAllowed=3,this.numberRange=void 0,this.selectable=!0,this.selectedNumbers="",this.secondaryNumbers="",this.displaySelected=!1,this.language="en",this.gridIndex=void 0,this.gridType="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.highNumber=47,this.lowNumber=1,this.selectionType="mainSelection",this.partialQuickpickAvailable=!1,this.numbers=[],this.bonusNumbers=[]}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.secondaryNumbers.length>0&&(this.bonusNumbers=this.secondaryNumbers.split(",").map((t=>({number:t,selected:!0,selectable:this.selectable})))),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e)).map((t=>t.toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>({number:e.number,selected:e.number==t.detail.value?t.detail.selected:e.selected,selectable:e.selectable}))),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter>=this.minimumAllowed&&this.selectedCounter<=this.maximumAllowed&&(this.numbers=this.numbers.map((t=>this.selectedCounter===this.maximumAllowed?{number:t.number,selected:t.selected,selectable:!!t.selected}:{number:t.number,selected:t.selected,selectable:!0})),JSON.parse(this.numberRange).includes(this.selectedCounter)?this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter-=1,this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),0===this.selectedCounter&&this.gridClearAllEvent.emit(this.gridIndex),this.selectedCounter<this.minimumAllowed?this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async resetSelectionHandler(t){t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:[]}))}async autoSelectionHandler(t){if(t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex){this.resetSelectionHandler(t);let e=Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e));e=this.shuffleArray(e),e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:!!this.partialQuickpickAvailable&&e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.minimumAllowed}}render(){return s("div",{key:"f62b5b1e5a6cf7bcaa13ce2c8a281bc93fa439f7",class:"GridContainer",ref:t=>this.stylingContainer=t},s("div",{key:"e381adbfff57e2cc343188c46037eb45ab798cac",class:"ticket"===this.gridType?"Grid TicketGrid":"Grid"},this.numbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))),this.bonusNumbers.length?this.bonusNumbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"is-bonus":!0,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))):""))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};mc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}';const fc=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),vc={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},bc=(t,e)=>vc[void 0!==e&&e in vc?e:"en"][t],gc=class{constructor(i){t(this,i),this.hpPageChange=e(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=t=>{switch(t){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt,this.nextPage=!0;break;case"nextPage":this.offsetInt+=this.limitInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage}this.previousPage=!!this.offsetInt,this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(t,e)=>{isNaN(t)?0===e&&this.currentPage<=4?this.navigateTo("firstPage"):0===e&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===e&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):(1===t?(this.offsetInt=t-1,this.previousPage=!1):(this.offsetInt=(t-1)*this.limitInt,this.nextPage=!(t>this.endInt)),this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt}))},this.nextPage=!1,this.prevPage=!1,this.offset=0,this.limit=10,this.total=1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.arrowsActive=void 0,this.secondaryArrowsActive=void 0,this.numberedNavActive=void 0,this.isReset=!1,this.translationUrl=void 0,this.offsetInt=void 0,this.lastPage=!1,this.previousPage=!1,this.limitInt=void 0,this.totalInt=void 0,this.pagesArray=[],this.endInt=0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])vc[e][i]=t[e][i]})))}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.nextPage=!!this.isReset||this.nextPage,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?this.endInt>3?(this.pagesArray=Array.from({length:4},((t,e)=>e+1)),this.pagesArray.push("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((t,e)=>this.currentPage+e-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.endInt>4?(this.pagesArray=Array.from({length:4},((t,e)=>this.endInt-2+e)),this.pagesArray.unshift("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){let t=s("ul",{class:"PaginationArea"},this.pagesArray.map(((t,e)=>s("li",{class:"PaginationItem"+(t===this.currentPage?" ActiveItem":" ")+" "+(fc(this.userAgent)?"MobileButtons":"")},s("button",{disabled:t===this.currentPage,onClick:this.paginationNavigation.bind(this,t,e)},s("span",null,t)))))),e=s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"firstPage")},s("span",{class:"NavigationButton"},bc("firstPage",this.language)),s("span",{class:"NavigationIcon"})),i=s("div",{class:"LeftItems"},this.secondaryArrowsActive&&e,s("button",{disabled:!this.prevPage||1===this.currentPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},bc("previousPage",this.language)),s("span",{class:"NavigationIcon"})));fc(this.userAgent)&&(i=s("div",{class:"LeftItems"},s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},bc("previousPage",this.language)),s("span",{class:"NavigationIcon"}))));let r=s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"lastPage")},s("span",{class:"NavigationButton"},bc("lastPage",this.language)),s("span",{class:"NavigationIcon"})),o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},bc("nextPage",this.language)),s("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&r);return fc(this.userAgent)&&(o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},bc("nextPage",this.language)),s("span",{class:"NavigationIcon"})))),s("div",{id:"PaginationContainer",ref:t=>this.stylingContainer=t},this.arrowsActive&&i,this.numberedNavActive&&t,this.arrowsActive&&o)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};gc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993)}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:var(--emw--color-typography, #000);cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);opacity:0.8}button{width:100px;height:32px;border:1px solid var(--emw--color-gray-150, #6f6f6f);border-radius:5px;background:var(--emw--color-gray-150, #6f6f6f);color:var(--emw--color-typography-inverse, #fff);font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:var(--emw--color-primary-variant, #004d4a);border-color:var(--emw--color-primary-variant, #004d4a)}button:disabled{background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-typography-inverse, #fff);cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}}';const yc=["ro","en","hr"],wc={en:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ro:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},fr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ar:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},hr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"}},xc=(t,e)=>{const i=e;return wc[void 0!==i&&yc.includes(i)?i:"en"][t]};function kc(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const _c=class{constructor(i){t(this,i),this.subscriptionCompleted=e(this,"subscriptionCompleted",7),this.subscriptionCheckChange=e(this,"subscriptionCheckChange",7),this.changeDateParam=()=>{if(this.filterData.from&&!this.filterData.to){let t=this.filterData.from,e=t.split("/");t=new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),0,0,0)).toISOString();const i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:"",fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}if(this.filterData.from&&this.filterData.to){const{from:t,to:e}=this.transDate(this.filterData.from,this.filterData.to),i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:e,fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}},this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{from:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{to:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.translationUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.gameName=void 0,this.isSubscribed=!1,this.frequenceList=[],this.frequenceState="",this.filterData={from:"",to:""},this.subscriptionCode="lottery-subscription-widget001",this.conditionId="",this.paramId="",this.conditionRule=void 0,this.paramRule=void 0,this.peroidRule=void 0,this.startDateRule=void 0,this.endDateRule=void 0,this.gameNameRule=void 0,this.ruleType=""}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])wc[e][i]=t[e][i]}))),this.getSubscriptionData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}transDate(t,e){let i=t.split("/"),s=e.split("/");return{from:new Date(Date.UTC(Number(i[2]),Number(i[1])-1,Number(i[0]),0,0,0)).toISOString(),to:new Date(Date.UTC(Number(s[2]),Number(s[1])-1,Number(s[0]),23,59,59)).toISOString()}}async getSubscriptionData(){try{const t=`${this.endpoint}/feWidgetConfig/${this.subscriptionCode}`,{conditionMetadataId:e,paramMetadataId:i,ruleType:s}=await kc(t);this.conditionId=e,this.paramId=i,this.ruleType=s;const r=`${this.endpoint}/metadata/${this.conditionId}`,o=`${this.endpoint}/metadata/${this.paramId}`,[n,a]=await Promise.allSettled([kc(r),kc(o)]);if("fulfilled"!==n.status||"fulfilled"!==a.status)throw new Error("Failed to get subscription data");this.conditionRule=n.value,this.paramRule=a.value,this.conditionRule.fields&&(this.peroidRule=this.conditionRule.fields.find((t=>"Period"===t.code)),this.startDateRule=this.conditionRule.fields.find((t=>"StartDate"===t.code)),this.endDateRule=this.conditionRule.fields.find((t=>"EndDate"===t.code)),this.gameNameRule=this.conditionRule.fields.find((t=>"GameName"===t.code)),this.frequenceList=this.peroidRule.enums.map((t=>({label:t.text,value:t.key}))))}catch(t){console.error(t)}}handleCheckboxchange(t){this.isSubscribed=t.target.checked,this.subscriptionCheckChange.emit(this.isSubscribed)}handleSelectionChange(t){if(this.frequenceState=t.detail.value,"NeverMissADraw"===this.frequenceState&&this.isSubscribed){const t={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};t.params=this.paramRule.fields.map((t=>({value:"",fieldId:t.id}))),this.subscriptionCompleted.emit(t)}else"Custom"===this.frequenceState&&this.isSubscribed&&this.subscriptionCompleted.emit("Subscription start date is required.")}formateDate(t){const{year:e,month:i,day:s}=t;return xh(new Date(e,i,s),"dd/MM/yyyy")}parseDate(t){const[e,i,s]=t.split("/");return{year:s,month:parseInt(i)-1,day:e}}changeFormate(t){const[e,i,s]=t.split("/");return`${s}-${i}-${e}`}setDateFormate(t){t&&(t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate}))}render(){return s("div",{key:"185b4f76308ff8df614f520f5eb93a19c619cbcd",class:"subscripitonContainer",ref:t=>this.stylingContainer=t},s("vaadin-checkbox",{key:"c3af7821b5bacbfc8527ad242ddc6cb9d8b5234d",label:"Subscription",checked:this.isSubscribed,onChange:this.handleCheckboxchange.bind(this)}),this.isSubscribed&&s("div",{key:"e567968dca8f1150f751662e2834ffeb60e791cd",class:"secondConditon"},s("span",{key:"5999241e246949594cf39d1dade31deb04e17f1a",style:{"margin-right":"8px"}},"Occurrence: "),s("vaadin-select",{key:"50a04ac0202ab7912cd56043cda5d8f915a9151e",items:this.frequenceList,value:this.frequenceState,"on-value-changed":this.handleSelectionChange.bind(this)}),"Custom"===this.frequenceState&&s("div",{key:"329650009ba11791abf137bfd75b18ce982c6ee9",class:"thirdCondition"},s("div",{key:"f29c8951aa53637f6f66ab523b847e0937f2f323",class:"filterCalenderWrap"},s("div",{key:"a19a4c4ba091397bf79c0969b9fc7bafd3fef519",class:"filterText"},"Subscription Start Date*"),s("div",{key:"fd91ca7fc3df5250e2e88f6c34cd92e8b91b9907",class:"filter"},s("vaadin-date-picker",{value:this.filterData.from,key:"filterFromCalendar",max:void 0===this.filterData.to?void 0:this.changeFormate(this.filterData.to),onChange:this.handleFilterFrom,placeholder:xc("filterFromCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))),s("div",{key:"450a8c165db8ddb42d3c731f49257d17e9426c40",class:"filterCalenderWrap"},s("div",{key:"e66f7308e413493e84ae659b02f8eb11a025f559",class:"filterText"},"Subscription End Date"),s("div",{key:"4644c0873295e22573f9e2d1927b649e10ecd3f5",class:"filter"},s("vaadin-date-picker",{value:this.filterData.to,key:"filterToCalendar",min:void 0===this.filterData.from?void 0:this.changeFormate(this.filterData.from),onChange:this.handleFilterTo,placeholder:xc("filterToCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};_c.style=".subscripitonContainer{margin-bottom:40px}.subscripitonContainer vaadin-checkbox[checked]::part(checkbox){background-color:var(--emw--color-primary, #009993)}.subscripitonContainer .secondCondition{padding-left:24px}.subscripitonContainer .thirdCondition{display:flex;gap:24px;align-items:center}.subscripitonContainer .thirdCondition,.subscripitonContainer .secondConditon{margin:16px 0}";const Cc=["ro","en","hr"],Sc={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},Tc=(t,e)=>{const i=e;return Sc[void 0!==i&&Cc.includes(i)?i:"en"][t]},Dc=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.drawMultiplierChange=e(this,"drawMultiplierChange",7),this.lineMultiplierChange=e(this,"lineMultiplierChange",7),this.betTypeChange=e(this,"betTypeChange",7),this.endpoint=void 0,this.gameId=void 0,this.numberOfGrids=1,this.multipleDraws=!0,this.ticketId=void 0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=[],this.isCustomSelect=!1,this.amountInfo={},this.stakeMultiplier="1",this.lineMultiplier=0,this.isCustomSelectStake=!1,this.isCustomSelectDraw=!1,this.isCustomSelectLine=!1,this.drawMultiplier=1,this.secondarySelectionAllowed=!1,this.partialQuickpickAvailable=!1,this.boardsAllowed=[],this.tabIndex=0,this.groupType=[],this.playType=[],this.selectedPlayTypeId="",this.maximumAllowed=6,this.numberRange=[],this.secondaryNumberRange=[],this.secondaryMaximumAllowed=1,this.minimumAllowed=6,this.secondaryMinimumAllowed=1,this.quickPicks=[]}handleLineMultiplierChange(t){this.grids=Array.from({length:t},((t,e)=>e+1)),this.ticketDone=Array.from({length:t},(()=>!1)),this.quickPicks=Array.from({length:t},(()=>!1)),this.grids.forEach(((t,e)=>{this.resetSelection.emit({ticketId:this.ticketId,index:e})}))}handleTabIndexChange(t){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)})),this.setDrawMultiplier(1),this.setStakeMultiplier("1"),this.amountInfo=this.gameData.rules.stakes[0],this.setWagerPerDraw(this.amountInfo),this.playType=this.groupType[t].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.boardsAllowed=this.playType[0].boardsAllowed,this.setLineMultiplier(this.boardsAllowed[0]),this.selectedPlayTypeId=this.playType[0].value,this.numberRange=this.playType[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=this.playType[0].secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange),this.betTypeChange.emit({ticketId:this.ticketId,betType:this.playType[0]})}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}checkForClickOutside(t){this.selectRef&&!this.selectRef.contains(t.composedPath()[0])&&(this.isCustomSelect=!1),this.selectStakeRef&&!this.selectStakeRef.contains(t.composedPath()[0])&&(this.isCustomSelectStake=!1),this.selectDrawRef&&!this.selectDrawRef.contains(t.composedPath()[0])&&(this.isCustomSelectDraw=!1),this.selectLineRef&&!this.selectLineRef.contains(t.composedPath()[0])&&(this.isCustomSelectLine=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{var e;this.isLoading=!1,this.gameData=t,this.amountInfo=this.gameData.rules.stakes[0],this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed;const i=this.gameData.rules.betTypes.reduce(((t,e)=>(e.group?(t.groups[e.group]||(t.groups[e.group]=[]),t.groups[e.group].push(e)):t.noGroup.push({groupName:e.name||e.id,betType:[Object.assign({},e)]}),t)),{groups:{},noGroup:[]}),s=Object.entries(i.groups).map((([t,e])=>({groupName:t,betType:e})));this.groupType=[...i.noGroup,...s],this.playType=this.groupType[0].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.partialQuickpickAvailable=this.gameData.rules.partialQuickpickAvailable,this.boardsAllowed=null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.filter((t=>"Prima"===t.id))[0].boardsAllowed,this.lineMultiplier=this.boardsAllowed[0];let r=this.gameData.rules.betTypes[0].secondarySelectionRules;this.numberRange=this.gameData.rules.betTypes[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=r.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Sc[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{drawCount:this.drawMultiplier,multiplierNum:Number(this.stakeMultiplier),multiplier:this.gameData.rules.stakeMultiplierAvailable,quickPicks:this.quickPicks,betName:this.playType.length>1?this.playType.find((t=>t.value===this.selectedPlayTypeId)).label:this.groupType[this.tabIndex].groupName}),this.ticketDone=[...this.ticketDone.slice(0,t.detail.index),!0,...this.ticketDone.slice(t.detail.index+1)],this.ticketCompleted.emit(this.ticket)}handleGridClearAllEvent(t){let e=t.detail;this.ticketDone=[...this.ticketDone.slice(0,e),!1,...this.ticketDone.slice(e+1)],this.quickPicks[e]=!1}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.autoSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!0}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)],this.resetSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!1}toggleResetAllSeletion(){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)}))}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}toggleSelection(){this.isCustomSelectStake=!this.isCustomSelectStake}toggleLineSelection(){this.isCustomSelectLine=!this.isCustomSelectLine}toggleDrawSelection(){this.isCustomSelectDraw=!this.isCustomSelectDraw}setWagerPerDraw(t){this.amountInfo={value:t.value,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.value)}setStakeMultiplier(t){this.stakeMultiplier=t,this.isCustomSelectStake=!1,this.multiplierChange.emit({ticketId:this.ticketId,multiplierNum:Number(t),multiplier:this.gameData.rules.stakeMultiplierAvailable})}setLineMultiplier(t){this.lineMultiplier=t,this.isCustomSelectLine=!1,this.lineMultiplierChange.emit({ticketId:this.ticketId,lineNum:t})}setDrawMultiplier(t){this.drawMultiplier=t,this.isCustomSelectDraw=!1,this.drawMultiplierChange.emit({ticketId:this.ticketId,drawCount:t})}handlePlayTypeChange(t){this.selectedPlayTypeId=t;let e=this.playType.filter((e=>e.id===t))[0];this.boardsAllowed=e.boardsAllowed,this.numberRange=e.selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=e.secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange);for(let t=0;t<this.lineMultiplier;t++)this.toggleResetSelection(t);this.betTypeChange.emit({ticketId:this.ticketId,betType:e}),this.setLineMultiplier(this.boardsAllowed[0])}render(){if(this.isLoading)return s("div",null,s("p",null,Tc("loading",this.language)));if(this.hasErrors)return s("div",null,s("p",null,Tc("error",this.language)));{const{rules:t}=this.gameData;return s("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},s("p",{class:"TicketTitle"},this.gameData.name),s("div",{class:"TicketTabs"},this.groupType.map(((t,e)=>s("div",{class:"TabButton"+(this.tabIndex==e?" Active":""),onClick:()=>this.tabIndex=e},t.groupName)))),this.playType.length>1&&s("div",null,s("label",{class:"Label"},Tc("playType",this.language),": "),s("vaadin-select",{style:{width:"160px"},items:this.playType,value:this.selectedPlayTypeId,"on-value-changed":t=>this.handlePlayTypeChange(t.detail.value)})),this.boardsAllowed.length>1&&s("div",null,s("label",{class:"Label"},Tc("lines",this.language),": "),s("div",{class:"WagerInput"},s("div",{ref:t=>this.selectLineRef=t,class:this.isCustomSelectLine?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleLineSelection()},s("span",null,this.lineMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},this.boardsAllowed.map((t=>s("li",{class:this.lineMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setLineMultiplier(t)},t)))))))),this.grids.map(((e,i)=>s("div",null,s("div",{class:"TicketGridHeader"},s("div",null,Tc("lineName",this.language),i+1),this.resetButton&&this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection(i)},Tc("resetButton",this.language))),this.autoPick&&!this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection(i)},Tc("autoButton",this.language)))),s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].selectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.maximumAllowed,"minimum-allowed":this.minimumAllowed,"number-range":JSON.stringify(this.numberRange),"high-number":t.boards[0].highNumber,"low-number":t.boards[0].lowNumber,"total-numbers":t.boards[0].highNumber-t.boards[0].lowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"mainSelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),this.secondarySelectionAllowed&&s("div",{class:"SecondarySelectionWrapper"},s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].secondarySelectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.secondaryMaximumAllowed,"minimum-allowed":this.secondaryMinimumAllowed,"number-range":JSON.stringify(this.secondaryNumberRange),"high-number":t.boards[0].secondaryHighNumber,"low-number":t.boards[0].secondaryLowNumber,"total-numbers":t.boards[0].secondaryHighNumber-t.boards[0].secondaryLowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"secondarySelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))),t.stakeMultiplierAvailable&&s("div",null,s("label",{class:"Label"},Tc("multiplier",this.language),": "),s("div",{class:"WagerInput"},t.stakeMultipliers.length>1?s("div",{ref:t=>this.selectStakeRef=t,class:this.isCustomSelectStake?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleSelection()},s("span",null,this.stakeMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakeMultipliers.map((t=>s("li",{class:this.stakeMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setStakeMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.stakeMultipliers[0]||1,type:"number",disabled:!0})))),t.drawMultiplierAvailable&&s("div",null,s("label",{class:"Label"},Tc("numberOfDraws",this.language),": "),s("div",{class:"WagerInput"},t.durations.length>1?s("div",{ref:t=>this.selectDrawRef=t,class:this.isCustomSelectDraw?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleDrawSelection()},s("span",null,this.drawMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.durations.map((t=>s("li",{class:this.drawMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setDrawMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.durations[0]||1,type:"number",disabled:!0})))),s("div",null,s("label",{class:"Label"},Tc("wagerPerDraw",this.language),": "),s("div",{class:"WagerInput"},t.stakes.length>1?s("div",{ref:t=>this.selectRef=t,class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleClass()},s("span",null,this.amountInfo.value," ",this.amountInfo.currency),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakes.map((t=>s("li",{class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setWagerPerDraw(t)},t.value," ",t.currency)))))):s("div",null,s("input",{min:"1",value:t.stakes[0].value,type:"number",disabled:!0}),s("span",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{lineMultiplier:["handleLineMultiplierChange"],tabIndex:["handleTabIndexChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Dc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.TicketTabs{display:flex;overflow:auto}.TicketTabs .TabButton{color:var(--emw--color-primary, #009993);margin:0 40px 10px 0;cursor:pointer}.TicketTabs .Active{border-bottom:1px solid var(--emw--color-primary, #009993)}.ButtonContainer{display:flex;justify-content:flex-end}.SecondarySelectionWrapper{margin-top:20px}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:var(--emw--color-typography, #000)}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:var(--emw--color-typography, #000);padding:10px;margin-left:8px}.AutoButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.ResetButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-typography-inverse, #fff)}.ResetButton:hover{background:var(--emw--color-tertiary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}.TicketGridHeader{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-top:10px}.TicketGridBullets{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;padding:20px;margin-top:5px;margin-bottom:10px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid var(--emw--color-background-tertiary, #ccc);overflow:hidden;background:var(--emw--color-typography-inverse, #fff);z-index:20}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:var(--emw--color-background, #009993);color:var(--emw--color-typography-inverse, #fff)}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:var(--emw--color-background-tertiary, #ccc);border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:var(--emw--color-background-secondary, #f5f5f5)}';const Ic=["ro","en","fr","ar","hr"],Ac={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}},zc=(t,e)=>{const i=e;return Ac[void 0!==i&&Ic.includes(i)?i:"en"][t]},Mc=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.endpoint="",this.ticketId=1,this.ticketDescription=void 0,this.gameId=void 0,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1,this.totalControllers=1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Ac[e][i]=t[e][i]})))}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"28756fcff01b738bfe8339114445032a5da757c2",class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"18a566d1c97ccbf74cd759215df3a18faf5c43dc","header-title":`${zc("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":1!==this.totalControllers,collapsed:!this.last||this.collapsed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"3a056f64dc8572b66f50cb151adde2caea2cd427",slot:"accordionContent"},s("lottery-ticket",{key:"06a0696b79840c05381429b1b87af94b478b09f0",endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"translation-url":this.translationUrl,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Mc.style=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}';export{h as general_multi_select,u as helper_accordion,Mh as helper_filters,Ph as helper_modal,jh as helper_tab,Rh as helper_tabs,Lh as lottery_bullet,Yh as lottery_draw_results,tc as lottery_draw_results_history,ec as lottery_game_details,pc as lottery_game_page,mc as lottery_grid,gc as lottery_pagination,_c as lottery_subscription,Dc as lottery_ticket,Mc as lottery_ticket_controller}
|