@everymatrix/user-actions 1.90.28 → 1.90.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/user-actions.cjs.js +1 -1
- package/dist/cjs/user-actions_2.cjs.entry.js +104 -17
- package/dist/collection/components/user-actions/user-actions.js +39 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/user-actions.js +1 -1
- package/dist/esm/user-actions_2.entry.js +104 -17
- package/dist/types/components/user-actions/user-actions.d.ts +2 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/user-actions/user-actions.esm.js +1 -1
- package/dist/user-actions/user-actions_2.entry.js +1 -1
- package/package.json +1 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["user-actions_2.cjs",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["user-actions_2.cjs",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"gmversion":[513],"totalcalculationmode":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[513],"gmversion":[513],"totalcalculationmode":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"errorAmountMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["user-actions_2.cjs",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["user-actions_2.cjs",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"gmversion":[513],"totalcalculationmode":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[513],"gmversion":[513],"totalcalculationmode":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"errorAmountMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -72,6 +72,8 @@ const UserActions = class {
|
|
|
72
72
|
this.minimumfractiondigits = '0';
|
|
73
73
|
this.customdisplayformat = '';
|
|
74
74
|
this.alwaysshowdecimals = 'true';
|
|
75
|
+
this.gmversion = 'gm16';
|
|
76
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
75
77
|
this.actionStack = [];
|
|
76
78
|
this.customerFundsProtectionActive = false;
|
|
77
79
|
}
|
|
@@ -109,7 +111,7 @@ const UserActions = class {
|
|
|
109
111
|
return;
|
|
110
112
|
}
|
|
111
113
|
else {
|
|
112
|
-
return (index.h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency }));
|
|
114
|
+
return (index.h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency, userid: this.userid, gmversion: this.gmversion, totalcalculationmode: this.totalcalculationmode }));
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
};
|
|
@@ -395,7 +397,7 @@ const translate = (key, customLang, values) => {
|
|
|
395
397
|
return translation;
|
|
396
398
|
};
|
|
397
399
|
|
|
398
|
-
const userFundsAcknowledgmentCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserProtectionFundsTitle{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserProtectionFundsContainer{font-family:inherit;font-weight:100;height:100%;padding:1rem 1.5rem;background-color:var(--emw--color-white, #FFFFFF);display:flex;flex-direction:column;justify-content:space-between;border-radius:var(--emw--border-radius-large, 20px);max-width:fit-content}.ConsentSubmitButton{font-size:1rem;font-family:var(--emw--button-typography);padding:0.4rem 1.4rem;background:var(--emw--button-background-color, #FFFFFF);border:var(--emw--button-border, 2px solid #000000);color:var(--emw--button-text-color, #000000);border-radius:var(--emw--button-border-radius, 10px);align-self:center;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #
|
|
400
|
+
const userFundsAcknowledgmentCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserProtectionFundsTitle{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserProtectionFundsContainer{font-family:inherit;font-weight:100;height:100%;padding:1rem 1.5rem;background-color:var(--emw--color-white, #FFFFFF);display:flex;flex-direction:column;justify-content:space-between;border-radius:var(--emw--border-radius-large, 20px);max-width:fit-content}.ConsentSubmitButton{font-size:1rem;font-family:var(--emw--button-typography);padding:0.4rem 1.4rem;background:var(--emw--button-background-color, #FFFFFF);border:var(--emw--button-border, 2px solid #000000);color:var(--emw--button-text-color, #000000);border-radius:var(--emw--button-border-radius, 10px);align-self:center;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid var(--emw--color-disabled, #58586B);color:var(--emw--color-disabled, #58586B);cursor:unset}.ButtonsWrapper{display:flex;flex-direction:column;margin-top:10px;gap:40px}.ButtonsWrapper button:only-child{margin-left:auto}.UserProtectionError{color:var(--emw--color-error, #FD2839);text-align:center;height:22px}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:var(--emw--button-text-color, #000000)}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
|
|
399
401
|
const UserFundsAcknowledgmentStyle0 = userFundsAcknowledgmentCss;
|
|
400
402
|
|
|
401
403
|
const UserFundsAcknowledgment = class {
|
|
@@ -403,6 +405,89 @@ const UserFundsAcknowledgment = class {
|
|
|
403
405
|
index.registerInstance(this, hostRef);
|
|
404
406
|
this.abortController = null;
|
|
405
407
|
this.TIMEOUT_MS = 10000; // 10 seconds
|
|
408
|
+
this.currency = '';
|
|
409
|
+
this.getPlayerAccountBalanceDataCore = () => {
|
|
410
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/account`);
|
|
411
|
+
fetch(url, { method: 'GET', headers: { 'X-SessionID': this.session } })
|
|
412
|
+
.then(res => {
|
|
413
|
+
if (!res.ok) {
|
|
414
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${res.status}`;
|
|
415
|
+
throw new Error(`Failed to fetch balance data: ${res.status}`);
|
|
416
|
+
}
|
|
417
|
+
return res.json();
|
|
418
|
+
})
|
|
419
|
+
.then((data) => {
|
|
420
|
+
var _a, _b;
|
|
421
|
+
if (!data.items || !Array.isArray(data.items)) {
|
|
422
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${data.status}`;
|
|
423
|
+
throw new Error('Unexpected data format: items array missing');
|
|
424
|
+
}
|
|
425
|
+
const casinoItem = data.items.find(b => b.displayName === 'Casino');
|
|
426
|
+
if (!(casinoItem === null || casinoItem === void 0 ? void 0 : casinoItem.currency)) {
|
|
427
|
+
throw new Error('No Casino item found in balance items');
|
|
428
|
+
}
|
|
429
|
+
this.currency = casinoItem.currency;
|
|
430
|
+
this.totalCashAmount = (_b = (_a = data.totalAmount) === null || _a === void 0 ? void 0 : _a[this.currency]) !== null && _b !== void 0 ? _b : 0;
|
|
431
|
+
})
|
|
432
|
+
.catch(err => {
|
|
433
|
+
if (!this.errorAmountMessage) {
|
|
434
|
+
this.errorAmountMessage = translate('serverNotResponding', this.language);
|
|
435
|
+
}
|
|
436
|
+
console.error('Balance error:', err);
|
|
437
|
+
})
|
|
438
|
+
.finally(() => {
|
|
439
|
+
this.isLoading = false;
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
this.getPlayerAccountBalanceData16 = () => {
|
|
443
|
+
const url = new URL(`${this.endpoint}/v2/player/${this.userid}/balance`);
|
|
444
|
+
const headers = new Headers();
|
|
445
|
+
headers.append('X-SessionID', this.session);
|
|
446
|
+
fetch(url, { method: 'GET', headers })
|
|
447
|
+
.then(res => {
|
|
448
|
+
if (!res.ok) {
|
|
449
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${res.status}`;
|
|
450
|
+
throw new Error(`Failed to fetch balance data: ${res.status}`);
|
|
451
|
+
}
|
|
452
|
+
return res.json();
|
|
453
|
+
})
|
|
454
|
+
.then((data) => {
|
|
455
|
+
var _a, _b;
|
|
456
|
+
if (!data.items || !Array.isArray(data.items)) {
|
|
457
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${data.status}`;
|
|
458
|
+
throw new Error('Unexpected data format: items array missing');
|
|
459
|
+
}
|
|
460
|
+
const firstRealOrdinary = data.items.find(item => item.type === 'Real' && item.walletAccountType === 'Ordinary');
|
|
461
|
+
if (!(firstRealOrdinary === null || firstRealOrdinary === void 0 ? void 0 : firstRealOrdinary.currency)) {
|
|
462
|
+
throw new Error('No Real/Ordinary wallet found in balance items');
|
|
463
|
+
}
|
|
464
|
+
this.currency = firstRealOrdinary.currency;
|
|
465
|
+
// Resolve calculation mode fallback
|
|
466
|
+
if (!data[this.totalcalculationmode]) {
|
|
467
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
468
|
+
}
|
|
469
|
+
this.totalCashAmount = (_b = (_a = data[this.totalcalculationmode]) === null || _a === void 0 ? void 0 : _a[this.currency]) !== null && _b !== void 0 ? _b : 0;
|
|
470
|
+
})
|
|
471
|
+
.catch(err => {
|
|
472
|
+
if (!this.errorAmountMessage) {
|
|
473
|
+
this.errorAmountMessage = translate('serverNotResponding', this.language);
|
|
474
|
+
}
|
|
475
|
+
console.error('Balance fetch error', err);
|
|
476
|
+
})
|
|
477
|
+
.finally(() => {
|
|
478
|
+
this.isLoading = false;
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
this.userLegislationConsentHandler = () => {
|
|
482
|
+
if (this.checkboxInput) {
|
|
483
|
+
this.isConsentChecked = this.checkboxInput.checked;
|
|
484
|
+
}
|
|
485
|
+
// In case of a network error, permit the user to retry consents submission
|
|
486
|
+
if (this.isConsentChecked) {
|
|
487
|
+
this.consentsSubmitted = false;
|
|
488
|
+
this.errorMessage = '';
|
|
489
|
+
}
|
|
490
|
+
};
|
|
406
491
|
/**
|
|
407
492
|
* Returns the formatted balance
|
|
408
493
|
* @param balance -> the balance value to be formatted
|
|
@@ -523,7 +608,6 @@ const UserFundsAcknowledgment = class {
|
|
|
523
608
|
// 202 Accepted has no body, skip res.json()
|
|
524
609
|
if (res.status === 202) {
|
|
525
610
|
this.errorMessage = '';
|
|
526
|
-
localStorage.removeItem("totalCashAmount");
|
|
527
611
|
window.postMessage({ type: 'ProtectionFundsAccepted' }, window.location.href);
|
|
528
612
|
return;
|
|
529
613
|
}
|
|
@@ -562,10 +646,14 @@ const UserFundsAcknowledgment = class {
|
|
|
562
646
|
this.customdisplayformat = '';
|
|
563
647
|
this.alwaysshowdecimals = 'true';
|
|
564
648
|
this.playercurrency = 'EUR';
|
|
565
|
-
this.
|
|
649
|
+
this.userid = '';
|
|
650
|
+
this.gmversion = 'gm16';
|
|
651
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
652
|
+
this.isLoading = true;
|
|
566
653
|
this.isConsentChecked = false;
|
|
567
654
|
this.totalCashAmount = 0;
|
|
568
655
|
this.errorMessage = '';
|
|
656
|
+
this.errorAmountMessage = '';
|
|
569
657
|
this.consentsSubmitted = false;
|
|
570
658
|
}
|
|
571
659
|
handleNewTranslations() {
|
|
@@ -590,7 +678,6 @@ const UserFundsAcknowledgment = class {
|
|
|
590
678
|
if (this.translationUrl.length > 2) {
|
|
591
679
|
await getTranslations(this.translationUrl);
|
|
592
680
|
}
|
|
593
|
-
this.totalCashAmount = parseFloat(localStorage.getItem('totalCashAmount')) || 0;
|
|
594
681
|
}
|
|
595
682
|
componentDidLoad() {
|
|
596
683
|
if (this.stylingContainer) {
|
|
@@ -601,27 +688,27 @@ const UserFundsAcknowledgment = class {
|
|
|
601
688
|
if (this.clientStylingUrl)
|
|
602
689
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
603
690
|
}
|
|
691
|
+
switch (this.gmversion) {
|
|
692
|
+
case 'gmcore':
|
|
693
|
+
this.getPlayerAccountBalanceDataCore();
|
|
694
|
+
break;
|
|
695
|
+
case 'gm16':
|
|
696
|
+
this.getPlayerAccountBalanceData16();
|
|
697
|
+
break;
|
|
698
|
+
default:
|
|
699
|
+
throw Error(`Invalid apiversion attribute: ${this.gmversion}`);
|
|
700
|
+
}
|
|
604
701
|
}
|
|
605
702
|
disconnectedCallback() {
|
|
606
703
|
var _a;
|
|
607
704
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort('Component unmounted');
|
|
608
705
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
609
706
|
}
|
|
610
|
-
userLegislationConsentHandler() {
|
|
611
|
-
if (this.checkboxInput) {
|
|
612
|
-
this.isConsentChecked = this.checkboxInput.checked;
|
|
613
|
-
}
|
|
614
|
-
// In case of a network error, permit the user to retry consents submission
|
|
615
|
-
if (this.isConsentChecked) {
|
|
616
|
-
this.consentsSubmitted = false;
|
|
617
|
-
this.errorMessage = '';
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
707
|
consentsArea() {
|
|
621
|
-
return (index.h("div", { class: "UserProtectionFundsCheckboxArea" }, index.h("label", { class: "UserProtectionFundsCheckboxContent", htmlFor: "userProtectionFunds" }, index.h("input", { ref: el => this.checkboxInput = el, id: "userProtectionFunds", type: "checkbox", onInput:
|
|
708
|
+
return (index.h("div", { class: "UserProtectionFundsCheckboxArea" }, index.h("label", { class: "UserProtectionFundsCheckboxContent", htmlFor: "userProtectionFunds" }, index.h("input", { ref: el => this.checkboxInput = el, id: "userProtectionFunds", type: "checkbox", onInput: this.userLegislationConsentHandler }), index.h("span", { innerHTML: `${translate('protectionCheckboxLabel', this.language)}` }))));
|
|
622
709
|
}
|
|
623
710
|
render() {
|
|
624
|
-
return (index.h("div", { key: '
|
|
711
|
+
return (index.h("div", { key: '9b36bd1e33e989aaa037919387f3da77020b6e9e', class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (index.h("div", null, index.h("slot", { name: 'spinner' }), index.h("svg", { class: "spinner", viewBox: "0 0 50 50" }, index.h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" })))) : (index.h("div", { class: "UserProtectionFundsContainer" }, index.h("div", { class: "UserProtectionFundsTitle" }, index.h("h2", null, translate('protectionTitle', this.language))), index.h("div", { class: "UserProtectionFundsWrapper" }, index.h("p", { innerHTML: `${translate('protectionContent', this.language)}` })), index.h("div", { class: "UserProtectionFundsBalance" }, index.h("p", null, translate('balanceArea', this.language), " ", index.h("span", null, this.formatBalance(this.totalCashAmount)))), index.h("div", { class: "UserProtectionFundsButtonsWrapper" }, index.h("div", null, this.consentsArea()), index.h("div", null, index.h("button", { class: "UserProtectionFundsSubmitButton", disabled: !this.isConsentChecked || this.errorMessage != '' || this.consentsSubmitted, onClick: this.handleSubmit }, translate('submitButtonText', this.language))), index.h("div", { class: "UserProtectionError" }, index.h("p", null, this.errorMessage != '' && this.errorMessage), index.h("p", null, this.errorAmountMessage != '' && this.errorAmountMessage)))))));
|
|
625
712
|
}
|
|
626
713
|
static get watchers() { return {
|
|
627
714
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -26,6 +26,8 @@ export class UserActions {
|
|
|
26
26
|
this.minimumfractiondigits = '0';
|
|
27
27
|
this.customdisplayformat = '';
|
|
28
28
|
this.alwaysshowdecimals = 'true';
|
|
29
|
+
this.gmversion = 'gm16';
|
|
30
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
29
31
|
this.actionStack = [];
|
|
30
32
|
this.customerFundsProtectionActive = false;
|
|
31
33
|
}
|
|
@@ -63,7 +65,7 @@ export class UserActions {
|
|
|
63
65
|
return;
|
|
64
66
|
}
|
|
65
67
|
else {
|
|
66
|
-
return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency }));
|
|
68
|
+
return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency, userid: this.userid, gmversion: this.gmversion, totalcalculationmode: this.totalcalculationmode }));
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
static get is() { return "user-actions"; }
|
|
@@ -379,6 +381,42 @@ export class UserActions {
|
|
|
379
381
|
"attribute": "alwaysshowdecimals",
|
|
380
382
|
"reflect": true,
|
|
381
383
|
"defaultValue": "'true'"
|
|
384
|
+
},
|
|
385
|
+
"gmversion": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"mutable": false,
|
|
388
|
+
"complexType": {
|
|
389
|
+
"original": "string",
|
|
390
|
+
"resolved": "string",
|
|
391
|
+
"references": {}
|
|
392
|
+
},
|
|
393
|
+
"required": false,
|
|
394
|
+
"optional": false,
|
|
395
|
+
"docs": {
|
|
396
|
+
"tags": [],
|
|
397
|
+
"text": ""
|
|
398
|
+
},
|
|
399
|
+
"attribute": "gmversion",
|
|
400
|
+
"reflect": true,
|
|
401
|
+
"defaultValue": "'gm16'"
|
|
402
|
+
},
|
|
403
|
+
"totalcalculationmode": {
|
|
404
|
+
"type": "string",
|
|
405
|
+
"mutable": false,
|
|
406
|
+
"complexType": {
|
|
407
|
+
"original": "string",
|
|
408
|
+
"resolved": "string",
|
|
409
|
+
"references": {}
|
|
410
|
+
},
|
|
411
|
+
"required": false,
|
|
412
|
+
"optional": false,
|
|
413
|
+
"docs": {
|
|
414
|
+
"tags": [],
|
|
415
|
+
"text": ""
|
|
416
|
+
},
|
|
417
|
+
"attribute": "totalcalculationmode",
|
|
418
|
+
"reflect": true,
|
|
419
|
+
"defaultValue": "'totalCashAmount'"
|
|
382
420
|
}
|
|
383
421
|
};
|
|
384
422
|
}
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["user-actions_2",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["user-actions_2",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"gmversion":[513],"totalcalculationmode":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[513],"gmversion":[513],"totalcalculationmode":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"errorAmountMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
package/dist/esm/user-actions.js
CHANGED
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["user-actions_2",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["user-actions_2",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"userid":[1],"operatorid":[1],"playercurrency":[513],"hasfundsacknowledgment":[1],"session":[513],"language":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"gmversion":[513],"totalcalculationmode":[513],"actionStack":[32],"customerFundsProtectionActive":[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{"session":[513],"operatorid":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[1537],"translationUrl":[513,"translation-url"],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[513],"gmversion":[513],"totalcalculationmode":[513],"isLoading":[32],"isConsentChecked":[32],"totalCashAmount":[32],"errorMessage":[32],"errorAmountMessage":[32],"consentsSubmitted":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -68,6 +68,8 @@ const UserActions = class {
|
|
|
68
68
|
this.minimumfractiondigits = '0';
|
|
69
69
|
this.customdisplayformat = '';
|
|
70
70
|
this.alwaysshowdecimals = 'true';
|
|
71
|
+
this.gmversion = 'gm16';
|
|
72
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
71
73
|
this.actionStack = [];
|
|
72
74
|
this.customerFundsProtectionActive = false;
|
|
73
75
|
}
|
|
@@ -105,7 +107,7 @@ const UserActions = class {
|
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
109
|
else {
|
|
108
|
-
return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency }));
|
|
110
|
+
return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency, userid: this.userid, gmversion: this.gmversion, totalcalculationmode: this.totalcalculationmode }));
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
};
|
|
@@ -391,7 +393,7 @@ const translate = (key, customLang, values) => {
|
|
|
391
393
|
return translation;
|
|
392
394
|
};
|
|
393
395
|
|
|
394
|
-
const userFundsAcknowledgmentCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserProtectionFundsTitle{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserProtectionFundsContainer{font-family:inherit;font-weight:100;height:100%;padding:1rem 1.5rem;background-color:var(--emw--color-white, #FFFFFF);display:flex;flex-direction:column;justify-content:space-between;border-radius:var(--emw--border-radius-large, 20px);max-width:fit-content}.ConsentSubmitButton{font-size:1rem;font-family:var(--emw--button-typography);padding:0.4rem 1.4rem;background:var(--emw--button-background-color, #FFFFFF);border:var(--emw--button-border, 2px solid #000000);color:var(--emw--button-text-color, #000000);border-radius:var(--emw--button-border-radius, 10px);align-self:center;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #
|
|
396
|
+
const userFundsAcknowledgmentCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserProtectionFundsTitle{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserProtectionFundsContainer{font-family:inherit;font-weight:100;height:100%;padding:1rem 1.5rem;background-color:var(--emw--color-white, #FFFFFF);display:flex;flex-direction:column;justify-content:space-between;border-radius:var(--emw--border-radius-large, 20px);max-width:fit-content}.ConsentSubmitButton{font-size:1rem;font-family:var(--emw--button-typography);padding:0.4rem 1.4rem;background:var(--emw--button-background-color, #FFFFFF);border:var(--emw--button-border, 2px solid #000000);color:var(--emw--button-text-color, #000000);border-radius:var(--emw--button-border-radius, 10px);align-self:center;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid var(--emw--color-disabled, #58586B);color:var(--emw--color-disabled, #58586B);cursor:unset}.ButtonsWrapper{display:flex;flex-direction:column;margin-top:10px;gap:40px}.ButtonsWrapper button:only-child{margin-left:auto}.UserProtectionError{color:var(--emw--color-error, #FD2839);text-align:center;height:22px}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:var(--emw--button-text-color, #000000)}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
|
|
395
397
|
const UserFundsAcknowledgmentStyle0 = userFundsAcknowledgmentCss;
|
|
396
398
|
|
|
397
399
|
const UserFundsAcknowledgment = class {
|
|
@@ -399,6 +401,89 @@ const UserFundsAcknowledgment = class {
|
|
|
399
401
|
registerInstance(this, hostRef);
|
|
400
402
|
this.abortController = null;
|
|
401
403
|
this.TIMEOUT_MS = 10000; // 10 seconds
|
|
404
|
+
this.currency = '';
|
|
405
|
+
this.getPlayerAccountBalanceDataCore = () => {
|
|
406
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/account`);
|
|
407
|
+
fetch(url, { method: 'GET', headers: { 'X-SessionID': this.session } })
|
|
408
|
+
.then(res => {
|
|
409
|
+
if (!res.ok) {
|
|
410
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${res.status}`;
|
|
411
|
+
throw new Error(`Failed to fetch balance data: ${res.status}`);
|
|
412
|
+
}
|
|
413
|
+
return res.json();
|
|
414
|
+
})
|
|
415
|
+
.then((data) => {
|
|
416
|
+
var _a, _b;
|
|
417
|
+
if (!data.items || !Array.isArray(data.items)) {
|
|
418
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${data.status}`;
|
|
419
|
+
throw new Error('Unexpected data format: items array missing');
|
|
420
|
+
}
|
|
421
|
+
const casinoItem = data.items.find(b => b.displayName === 'Casino');
|
|
422
|
+
if (!(casinoItem === null || casinoItem === void 0 ? void 0 : casinoItem.currency)) {
|
|
423
|
+
throw new Error('No Casino item found in balance items');
|
|
424
|
+
}
|
|
425
|
+
this.currency = casinoItem.currency;
|
|
426
|
+
this.totalCashAmount = (_b = (_a = data.totalAmount) === null || _a === void 0 ? void 0 : _a[this.currency]) !== null && _b !== void 0 ? _b : 0;
|
|
427
|
+
})
|
|
428
|
+
.catch(err => {
|
|
429
|
+
if (!this.errorAmountMessage) {
|
|
430
|
+
this.errorAmountMessage = translate('serverNotResponding', this.language);
|
|
431
|
+
}
|
|
432
|
+
console.error('Balance error:', err);
|
|
433
|
+
})
|
|
434
|
+
.finally(() => {
|
|
435
|
+
this.isLoading = false;
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
this.getPlayerAccountBalanceData16 = () => {
|
|
439
|
+
const url = new URL(`${this.endpoint}/v2/player/${this.userid}/balance`);
|
|
440
|
+
const headers = new Headers();
|
|
441
|
+
headers.append('X-SessionID', this.session);
|
|
442
|
+
fetch(url, { method: 'GET', headers })
|
|
443
|
+
.then(res => {
|
|
444
|
+
if (!res.ok) {
|
|
445
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${res.status}`;
|
|
446
|
+
throw new Error(`Failed to fetch balance data: ${res.status}`);
|
|
447
|
+
}
|
|
448
|
+
return res.json();
|
|
449
|
+
})
|
|
450
|
+
.then((data) => {
|
|
451
|
+
var _a, _b;
|
|
452
|
+
if (!data.items || !Array.isArray(data.items)) {
|
|
453
|
+
this.errorAmountMessage = `${translate('apiCallError', this.language)} ${data.status}`;
|
|
454
|
+
throw new Error('Unexpected data format: items array missing');
|
|
455
|
+
}
|
|
456
|
+
const firstRealOrdinary = data.items.find(item => item.type === 'Real' && item.walletAccountType === 'Ordinary');
|
|
457
|
+
if (!(firstRealOrdinary === null || firstRealOrdinary === void 0 ? void 0 : firstRealOrdinary.currency)) {
|
|
458
|
+
throw new Error('No Real/Ordinary wallet found in balance items');
|
|
459
|
+
}
|
|
460
|
+
this.currency = firstRealOrdinary.currency;
|
|
461
|
+
// Resolve calculation mode fallback
|
|
462
|
+
if (!data[this.totalcalculationmode]) {
|
|
463
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
464
|
+
}
|
|
465
|
+
this.totalCashAmount = (_b = (_a = data[this.totalcalculationmode]) === null || _a === void 0 ? void 0 : _a[this.currency]) !== null && _b !== void 0 ? _b : 0;
|
|
466
|
+
})
|
|
467
|
+
.catch(err => {
|
|
468
|
+
if (!this.errorAmountMessage) {
|
|
469
|
+
this.errorAmountMessage = translate('serverNotResponding', this.language);
|
|
470
|
+
}
|
|
471
|
+
console.error('Balance fetch error', err);
|
|
472
|
+
})
|
|
473
|
+
.finally(() => {
|
|
474
|
+
this.isLoading = false;
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
this.userLegislationConsentHandler = () => {
|
|
478
|
+
if (this.checkboxInput) {
|
|
479
|
+
this.isConsentChecked = this.checkboxInput.checked;
|
|
480
|
+
}
|
|
481
|
+
// In case of a network error, permit the user to retry consents submission
|
|
482
|
+
if (this.isConsentChecked) {
|
|
483
|
+
this.consentsSubmitted = false;
|
|
484
|
+
this.errorMessage = '';
|
|
485
|
+
}
|
|
486
|
+
};
|
|
402
487
|
/**
|
|
403
488
|
* Returns the formatted balance
|
|
404
489
|
* @param balance -> the balance value to be formatted
|
|
@@ -519,7 +604,6 @@ const UserFundsAcknowledgment = class {
|
|
|
519
604
|
// 202 Accepted has no body, skip res.json()
|
|
520
605
|
if (res.status === 202) {
|
|
521
606
|
this.errorMessage = '';
|
|
522
|
-
localStorage.removeItem("totalCashAmount");
|
|
523
607
|
window.postMessage({ type: 'ProtectionFundsAccepted' }, window.location.href);
|
|
524
608
|
return;
|
|
525
609
|
}
|
|
@@ -558,10 +642,14 @@ const UserFundsAcknowledgment = class {
|
|
|
558
642
|
this.customdisplayformat = '';
|
|
559
643
|
this.alwaysshowdecimals = 'true';
|
|
560
644
|
this.playercurrency = 'EUR';
|
|
561
|
-
this.
|
|
645
|
+
this.userid = '';
|
|
646
|
+
this.gmversion = 'gm16';
|
|
647
|
+
this.totalcalculationmode = 'totalCashAmount';
|
|
648
|
+
this.isLoading = true;
|
|
562
649
|
this.isConsentChecked = false;
|
|
563
650
|
this.totalCashAmount = 0;
|
|
564
651
|
this.errorMessage = '';
|
|
652
|
+
this.errorAmountMessage = '';
|
|
565
653
|
this.consentsSubmitted = false;
|
|
566
654
|
}
|
|
567
655
|
handleNewTranslations() {
|
|
@@ -586,7 +674,6 @@ const UserFundsAcknowledgment = class {
|
|
|
586
674
|
if (this.translationUrl.length > 2) {
|
|
587
675
|
await getTranslations(this.translationUrl);
|
|
588
676
|
}
|
|
589
|
-
this.totalCashAmount = parseFloat(localStorage.getItem('totalCashAmount')) || 0;
|
|
590
677
|
}
|
|
591
678
|
componentDidLoad() {
|
|
592
679
|
if (this.stylingContainer) {
|
|
@@ -597,27 +684,27 @@ const UserFundsAcknowledgment = class {
|
|
|
597
684
|
if (this.clientStylingUrl)
|
|
598
685
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
599
686
|
}
|
|
687
|
+
switch (this.gmversion) {
|
|
688
|
+
case 'gmcore':
|
|
689
|
+
this.getPlayerAccountBalanceDataCore();
|
|
690
|
+
break;
|
|
691
|
+
case 'gm16':
|
|
692
|
+
this.getPlayerAccountBalanceData16();
|
|
693
|
+
break;
|
|
694
|
+
default:
|
|
695
|
+
throw Error(`Invalid apiversion attribute: ${this.gmversion}`);
|
|
696
|
+
}
|
|
600
697
|
}
|
|
601
698
|
disconnectedCallback() {
|
|
602
699
|
var _a;
|
|
603
700
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort('Component unmounted');
|
|
604
701
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
605
702
|
}
|
|
606
|
-
userLegislationConsentHandler() {
|
|
607
|
-
if (this.checkboxInput) {
|
|
608
|
-
this.isConsentChecked = this.checkboxInput.checked;
|
|
609
|
-
}
|
|
610
|
-
// In case of a network error, permit the user to retry consents submission
|
|
611
|
-
if (this.isConsentChecked) {
|
|
612
|
-
this.consentsSubmitted = false;
|
|
613
|
-
this.errorMessage = '';
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
703
|
consentsArea() {
|
|
617
|
-
return (h("div", { class: "UserProtectionFundsCheckboxArea" }, h("label", { class: "UserProtectionFundsCheckboxContent", htmlFor: "userProtectionFunds" }, h("input", { ref: el => this.checkboxInput = el, id: "userProtectionFunds", type: "checkbox", onInput:
|
|
704
|
+
return (h("div", { class: "UserProtectionFundsCheckboxArea" }, h("label", { class: "UserProtectionFundsCheckboxContent", htmlFor: "userProtectionFunds" }, h("input", { ref: el => this.checkboxInput = el, id: "userProtectionFunds", type: "checkbox", onInput: this.userLegislationConsentHandler }), h("span", { innerHTML: `${translate('protectionCheckboxLabel', this.language)}` }))));
|
|
618
705
|
}
|
|
619
706
|
render() {
|
|
620
|
-
return (h("div", { key: '
|
|
707
|
+
return (h("div", { key: '9b36bd1e33e989aaa037919387f3da77020b6e9e', class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("div", null, h("slot", { name: 'spinner' }), h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" })))) : (h("div", { class: "UserProtectionFundsContainer" }, h("div", { class: "UserProtectionFundsTitle" }, h("h2", null, translate('protectionTitle', this.language))), h("div", { class: "UserProtectionFundsWrapper" }, h("p", { innerHTML: `${translate('protectionContent', this.language)}` })), h("div", { class: "UserProtectionFundsBalance" }, h("p", null, translate('balanceArea', this.language), " ", h("span", null, this.formatBalance(this.totalCashAmount)))), h("div", { class: "UserProtectionFundsButtonsWrapper" }, h("div", null, this.consentsArea()), h("div", null, h("button", { class: "UserProtectionFundsSubmitButton", disabled: !this.isConsentChecked || this.errorMessage != '' || this.consentsSubmitted, onClick: this.handleSubmit }, translate('submitButtonText', this.language))), h("div", { class: "UserProtectionError" }, h("p", null, this.errorMessage != '' && this.errorMessage), h("p", null, this.errorAmountMessage != '' && this.errorAmountMessage)))))));
|
|
621
708
|
}
|
|
622
709
|
static get watchers() { return {
|
|
623
710
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -26,6 +26,7 @@ export namespace Components {
|
|
|
26
26
|
*/
|
|
27
27
|
"customdisplayformat": string;
|
|
28
28
|
"endpoint": string;
|
|
29
|
+
"gmversion": string;
|
|
29
30
|
/**
|
|
30
31
|
* The userid required for for the call
|
|
31
32
|
*/
|
|
@@ -43,6 +44,7 @@ export namespace Components {
|
|
|
43
44
|
* The sessionid
|
|
44
45
|
*/
|
|
45
46
|
"session": string;
|
|
47
|
+
"totalcalculationmode": string;
|
|
46
48
|
/**
|
|
47
49
|
* Translation url
|
|
48
50
|
*/
|
|
@@ -82,6 +84,7 @@ declare namespace LocalJSX {
|
|
|
82
84
|
*/
|
|
83
85
|
"customdisplayformat"?: string;
|
|
84
86
|
"endpoint": string;
|
|
87
|
+
"gmversion"?: string;
|
|
85
88
|
/**
|
|
86
89
|
* The userid required for for the call
|
|
87
90
|
*/
|
|
@@ -99,6 +102,7 @@ declare namespace LocalJSX {
|
|
|
99
102
|
* The sessionid
|
|
100
103
|
*/
|
|
101
104
|
"session"?: string;
|
|
105
|
+
"totalcalculationmode"?: string;
|
|
102
106
|
/**
|
|
103
107
|
* Translation url
|
|
104
108
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as e}from"./index-ec24e8d4.js";export{s as setNonce}from"./index-ec24e8d4.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["user-actions_2",[[1,"user-actions",{mbSource:[513,"mb-source"],endpoint:[1],userid:[1],operatorid:[1],playercurrency:[513],hasfundsacknowledgment:[1],session:[513],language:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],currencylocale:[513],currencydisplay:[513],maximumfractiondigits:[513],minimumfractiondigits:[513],customdisplayformat:[513],alwaysshowdecimals:[513],actionStack:[32],customerFundsProtectionActive:[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{session:[513],operatorid:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],endpoint:[513],language:[1537],translationUrl:[513,"translation-url"],currencylocale:[513],currencydisplay:[513],maximumfractiondigits:[513],minimumfractiondigits:[513],customdisplayformat:[513],alwaysshowdecimals:[513],playercurrency:[513],isLoading:[32],isConsentChecked:[32],totalCashAmount:[32],errorMessage:[32],consentsSubmitted:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],n))));
|
|
1
|
+
import{p as n,b as e}from"./index-ec24e8d4.js";export{s as setNonce}from"./index-ec24e8d4.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["user-actions_2",[[1,"user-actions",{mbSource:[513,"mb-source"],endpoint:[1],userid:[1],operatorid:[1],playercurrency:[513],hasfundsacknowledgment:[1],session:[513],language:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],currencylocale:[513],currencydisplay:[513],maximumfractiondigits:[513],minimumfractiondigits:[513],customdisplayformat:[513],alwaysshowdecimals:[513],gmversion:[513],totalcalculationmode:[513],actionStack:[32],customerFundsProtectionActive:[32]},[[8,"message","handleEvent"]]],[1,"user-funds-acknowledgment",{session:[513],operatorid:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],endpoint:[513],language:[1537],translationUrl:[513,"translation-url"],currencylocale:[513],currencydisplay:[513],maximumfractiondigits:[513],minimumfractiondigits:[513],customdisplayformat:[513],alwaysshowdecimals:[513],playercurrency:[513],userid:[513],gmversion:[513],totalcalculationmode:[513],isLoading:[32],isConsentChecked:[32],totalCashAmount:[32],errorMessage:[32],errorAmountMessage:[32],consentsSubmitted:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],n))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t}from"./index-ec24e8d4.js";const n={"verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"get-temporary-account-consents":{emit:"openTemporaryConsentsModal",listen:"closeTemporaryConsentsModal"},"limits-popup":{emit:"openLugasPopup",listen:"closeLugasPopup"},"video-verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"unverified-phone-number":{emit:"openSmsVerificationModal",listen:"closeSmsVerificationModal"},"expired-consents":{emit:"openExpiredConsentsModal",listen:"closeExpiredConsentsModal"},"financial-limit-notification":{emit:"openLimitNotificationModal",listen:"closeLimitNotificationModal"},"account-review-notification":{emit:"openAccountReviewModal",listen:"closeAccountReviewModal"},"accept-tax-consent":{emit:"openStakeModal",listen:"closeStakeModal"}},i=class{constructor(t){e(this,t),this.emitCurrentActionEvent=()=>{window.postMessage({type:n[this.actionStack[0].action].emit})},this.shiftActionStack=()=>{this.actionStack=this.actionStack.slice(1)},this.mbSource=void 0,this.endpoint=void 0,this.userid=void 0,this.operatorid=void 0,this.playercurrency="EUR",this.hasfundsacknowledgment="false",this.session="",this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.currencylocale="en",this.currencydisplay="symbol",this.maximumfractiondigits="2",this.minimumfractiondigits="0",this.customdisplayformat="",this.alwaysshowdecimals="true",this.actionStack=[],this.customerFundsProtectionActive=!1}handleEvent(e){var t,i;(null===(i=n[null===(t=this.actionStack[0])||void 0===t?void 0:t.action])||void 0===i?void 0:i.listen)===e.data.type&&(this.shiftActionStack(),this.actionStack.length>0&&this.emitCurrentActionEvent())}fetchUserActions(){const e=new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);return fetch(e.href).then((e=>e.json())).then((e=>{var t,i;this.actionStack=e.actions.filter((e=>n[e.action])),this.actionStack.length>0&&this.emitCurrentActionEvent(),this.customerFundsProtectionActive=null!==(i=null===(t=e.actions)||void 0===t?void 0:t.some((e=>"customer-funds-protection"===e.action)))&&void 0!==i&&i,this.customerFundsProtectionActive&&window.postMessage({type:"ProtectionFundsActive"},window.location.href)}))}componentWillLoad(){return this.fetchUserActions()}render(){return this.customerFundsProtectionActive&&"false"!==this.hasfundsacknowledgment?t("user-funds-acknowledgment",{endpoint:this.endpoint,session:this.session,operatorid:this.operatorid,language:this.language,"mb-source":this.mbSource,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"translation-url":this.translationUrl,currencylocale:this.currencylocale,currencydisplay:this.currencydisplay,maximumfractiondigits:this.maximumfractiondigits,minimumfractiondigits:this.minimumfractiondigits,playercurrency:this.playercurrency}):void 0}};i.style=":host{display:block}";const o="__WIDGET_GLOBAL_STYLE_CACHE__";function s(e,t){if(e){const n=document.createElement("style");n.innerHTML=t,e.appendChild(n)}}function r(e,t){if(!e||!t)return;const n=new URL(t);fetch(n.href).then((e=>e.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,e&&e.appendChild(n)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function a(e,t,n,i=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!i)return n=function(e,t){const n=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(n.innerHTML=t,e.appendChild(n))}))}(e,t),n;window[o]||(window[o]={}),n=function(e,t){return window.emMessageBus.subscribe(t,(n=>{if(!e)return;const i=e.getRootNode(),s=window[o];let r=s[t]&&s[t].sheet;r?s[t].refCount=s[t].refCount+1:(r=new CSSStyleSheet,r.replaceSync(n),s[t]={sheet:r,refCount:1});const a=i.adoptedStyleSheets||[];a.includes(r)||(i.adoptedStyleSheets=[...a,r])}))}(e,t);const s=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[o][t]){const e=window[o][t];e.refCount>1?e.refCount=e.refCount-1:delete window[o][t]}s()},n}const c={en:{protectionTitle:"Protection of Customer Funds",protectionContent:'<p>We hold customer funds separate from company funds.<sup class="note"><a href="https://www.gamblingcommission.gov.uk/guidance/customer-funds-segregation-disclosure-to-customers-and-reporting/example-statements-that-might-be-used-in-terms-and-conditions-for-each-of#ref-2" target="_blank">12</a></sup> These funds ar <b>not protected</b> in the event of insolvency: <b>not protected segregation.</b></p><p>For more information, please see the <a href="https://www.gamblingcommission.gov.uk/guidance/customer-funds-segregation-disclosure-to-customers-and-reporting/the-customer-funds-insolvency-ratings-system" target="_blank">customer funds insolvency ratings system</a>.</p>',balanceArea:"Your current balance:",protectionCheckboxLabel:"I understand that my funds are <b>not protected</b> if the operator becomes insolvent.",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Confirm",serverNotResponding:"Server might not be responding",apiCallError:"Request failed with status "},"en-us":{protectionTitle:"Terms and Conditions",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit",rejectButtonText:"Reject",rejectText:"Rejecting new consents will result in the inability to continue the login process and you will be logged out.",consentUpdateSuccess:"Consent update successful!",serverNotResponding:"Server might not be responding"},ro:{protectionTitle:"Termeni și Condiții",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing prin Email",privacyPolicyTitle:"Politica de Confidențialitate",userNoticeText:"Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele",submitButtonText:"Trimite",rejectButtonText:"Respinge",rejectText:"Respingerea noilor consimțăminte va duce la imposibilitatea de a continua procesul de autentificare și veți fi deconectat.",consentUpdateSuccess:"Actualizare consimțământ reușită!",serverNotResponding:"Serverul s-ar putea să nu răspundă"},hr:{protectionTitle:"Opći uvjeti i odredbe",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"E-mail makretinški sadržaj",privacyPolicyTitle:"Politika Privatnosti",userNoticeText:"Prije nego što možete nastaviti, morate pristati na sljedeće",submitButtonText:"Pošalji",rejectButtonText:"Odbij",rejectText:"Odbijanje novih pristanka rezultirat će nemogućnošću nastavka procesa prijave i bit ćete odjavljeni.",consentUpdateSuccess:"Ažuriranje pristanka uspješno!",serverNotResponding:"Poslužitelj možda ne odgovara"},fr:{protectionTitle:"Termes et Conditions",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing par Email",privacyPolicyTitle:"Politique de Confidentialité",userNoticeText:"Avant de continuer, vous devez consentir aux éléments suivants",submitButtonText:"Soumettre",rejectButtonText:"Rejeter",rejectText:"Le rejet des nouveaux consentements entraînera l'impossibilité de continuer le processus de connexion et vous serez déconnecté.",consentUpdateSuccess:"Mise à jour du consentement réussie!",serverNotResponding:"Le serveur ne répond peut-être pas"},cs:{protectionTitle:"Podmínky a ujednání",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Emailový marketing",privacyPolicyTitle:"Zásady ochrany osobních údajů",userNoticeText:"Než budete moci pokračovat, musíte souhlasit s následujícím",submitButtonText:"Odeslat",rejectButtonText:"Odmítnout",rejectText:"Odmítnutí nových souhlasů povede k nemožnosti pokračovat v procesu přihlášení a budete odhlášeni.",consentUpdateSuccess:"Aktualizace souhlasu proběhla úspěšně!",serverNotResponding:"Server možná neodpovídá"},de:{protectionTitle:"Allgemeine Geschäftsbedingungen",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"E-Mail-Marketing",privacyPolicyTitle:"Datenschutzrichtlinie",userNoticeText:"Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen",submitButtonText:"Absenden",rejectButtonText:"Ablehnen",rejectText:"Das Ablehnen neuer Zustimmungen führt dazu, dass der Anmeldevorgang nicht fortgesetzt werden kann und Sie abgemeldet werden.",consentUpdateSuccess:"Zustimmung erfolgreich aktualisiert!",serverNotResponding:"Der Server antwortet möglicherweise nicht"},es:{protectionTitle:"Términos y Condiciones",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar",rejectButtonText:"Rechazar",rejectText:"Rechazar nuevos consentimientos resultará en la imposibilidad de continuar el proceso de inicio de sesión y se cerrará la sesión.",consentUpdateSuccess:"¡Actualización del consentimiento exitosa!",serverNotResponding:"El servidor podría no estar respondiendo"},pt:{protectionTitle:"Termos e Condições",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar",rejectButtonText:"Rejeitar",rejectText:"Rejeitar novos consentimentos resultará na impossibilidade de continuar o processo de login e você será desconectado.",consentUpdateSuccess:"Atualização de consentimento bem-sucedida!",serverNotResponding:"O servidor pode não estar respondendo"},"es-mx":{protectionTitle:"Términos y Condiciones",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar",rejectButtonText:"Rechazar",rejectText:"Rechazar nuevos consentimientos resultará en la imposibilidad de continuar el proceso de inicio de sesión y se cerrará la sesión.",consentUpdateSuccess:"¡Actualización del consentimiento exitosa!",serverNotResponding:"El servidor podría no estar respondiendo"},"pt-br":{protectionTitle:"Termos e Condições",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar",rejectButtonText:"Rejeitar",rejectText:"Rejeitar novos consentimentos resultará na impossibilidade de continuar o processo de login e você será desconectado.",consentUpdateSuccess:"Atualização de consentimento bem-sucedida!",serverNotResponding:"O servidor pode não estar respondendo"}},l=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{c[t]||(c[t]={});for(let n in e[t])c[t][n]=e[t][n]})),t(!0)}))})),d=(e,t,n)=>{let i=c[void 0!==t&&t in c?t:"en"][e];if(void 0!==n)for(const[e,t]of Object.entries(n.values)){const n=new RegExp(`{${e}}`,"g");i=i.replace(n,t)}return i},u=class{constructor(t){e(this,t),this.abortController=null,this.TIMEOUT_MS=1e4,this.formatBalance=e=>{if(this.customdisplayformat)return this.formatFromCustom(e);const t=this.currencylocale||this.language,n={style:"currency",currency:this.playercurrency,useGrouping:!0,currencyDisplay:this.currencydisplay,maximumFractionDigits:""===this.maximumfractiondigits||isNaN(Number(this.maximumfractiondigits))?2:Number(this.maximumfractiondigits),minimumFractionDigits:""===this.minimumfractiondigits||isNaN(Number(this.minimumfractiondigits))?0:Number(this.minimumfractiondigits)};return new Intl.NumberFormat(t,n).format(e)},this.formatFromCustom=e=>{const t=[];let n="";for(const i of this.customdisplayformat)switch(i){default:n+=i;break;case"{":n&&t.push(n),n="";break;case"}":const[o,s]=n.split("|");if(n="","currency"===o.toLowerCase())n=this.playercurrency;else if("amount"===o.toLowerCase()){let t=",",i=".",o=2;s&&(" "!==s[0]&&(t=s[0])," "!==s[1]&&(i=s[1])," "!==s[2]&&!isNaN(Number(s[2]))&&(o=Number(s[2])));let[r,a]=String(Math.floor(e*10**o)/10**o).split(".");n+=r[0];for(let e=1;e<r.length;++e)n+=(r.length-e)%3==0?t+r[e]:r[e];let c=a||"";const l="true"===this.alwaysshowdecimals,d=Number(this.maximumfractiondigits);if(l)c=c.padEnd(d||2,"0").substring(0,d);else if(!c)break;n+=i+c}n&&t.push(n),n=""}return t.push(n),t.join("")},this.handleSubmit=()=>{var e;this.consentsSubmitted=!0,null===(e=this.abortController)||void 0===e||e.abort(),this.abortController=new AbortController;const t=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort("Request timed out")}),this.TIMEOUT_MS),n=`${this.endpoint}/api/pam/v1/actions/customer-funds-protection`,i=new Headers;return i.append("Content-Type","application/json"),i.append("X-SessionId",`${this.session}`),i.append("X-Tenant-ID",`${this.operatorid}`),fetch(n,{method:"POST",headers:i,body:JSON.stringify({accepted:!0}),signal:this.abortController.signal}).then((e=>{if(!e.ok)throw this.errorMessage=`${d("apiCallError",this.language)} ${e.status}`,new Error(`Request failed with status ${e.status}`);return 202===e.status?(this.errorMessage="",localStorage.removeItem("totalCashAmount"),void window.postMessage({type:"ProtectionFundsAccepted"},window.location.href)):e.json()})).catch((e=>{var t;"AbortError"!==e.name?(console.error("Customer funds protection request failed:",e.message),this.errorMessage=d("serverNotResponding",this.language)):"Request timed out"===(null===(t=this.abortController)||void 0===t?void 0:t.signal.reason)&&(this.errorMessage=d("serverNotResponding",this.language))})).finally((()=>{clearTimeout(t),this.abortController=null}))},this.session=void 0,this.operatorid=void 0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.endpoint=void 0,this.language="en",this.translationUrl="",this.currencylocale="en",this.currencydisplay="symbol",this.maximumfractiondigits="2",this.minimumfractiondigits="0",this.customdisplayformat="",this.alwaysshowdecimals="true",this.playercurrency="EUR",this.isLoading=!1,this.isConsentChecked=!1,this.totalCashAmount=0,this.errorMessage="",this.consentsSubmitted=!1}handleNewTranslations(){l(this.translationUrl)}handleClientStylingChange(e,t){e!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}async componentWillLoad(){this.translationUrl.length>2&&await l(this.translationUrl),this.totalCashAmount=parseFloat(localStorage.getItem("totalCashAmount"))||0}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){var e;null===(e=this.abortController)||void 0===e||e.abort("Component unmounted"),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}userLegislationConsentHandler(){this.checkboxInput&&(this.isConsentChecked=this.checkboxInput.checked),this.isConsentChecked&&(this.consentsSubmitted=!1,this.errorMessage="")}consentsArea(){return t("div",{class:"UserProtectionFundsCheckboxArea"},t("label",{class:"UserProtectionFundsCheckboxContent",htmlFor:"userProtectionFunds"},t("input",{ref:e=>this.checkboxInput=e,id:"userProtectionFunds",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),t("span",{innerHTML:`${d("protectionCheckboxLabel",this.language)}`})))}render(){return t("div",{key:"e6361dbe3338fd1bbf9b54eb41b3fddf0f8829c7",class:"QueryReferenceContainer",ref:e=>this.stylingContainer=e},this.isLoading?t("div",null,t("slot",{name:"spinner"}),t("svg",{class:"spinner",viewBox:"0 0 50 50"},t("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"}))):t("div",{class:"UserProtectionFundsContainer"},t("div",{class:"UserProtectionFundsTitle"},t("h2",null,d("protectionTitle",this.language))),t("div",{class:"UserProtectionFundsWrapper"},t("p",{innerHTML:`${d("protectionContent",this.language)}`})),t("div",{class:"UserProtectionFundsBalance"},t("p",null,d("balanceArea",this.language)," ",t("span",null,this.formatBalance(this.totalCashAmount)))),t("div",{class:"UserProtectionFundsButtonsWrapper"},t("div",null,this.consentsArea()),t("div",null,t("button",{class:"UserProtectionFundsSubmitButton",disabled:!this.isConsentChecked||""!=this.errorMessage||this.consentsSubmitted,onClick:this.handleSubmit},d("submitButtonText",this.language))),t("div",{class:"UserProtectionError"},""!=this.errorMessage&&this.errorMessage))))}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};u.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserProtectionFundsTitle{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserProtectionFundsContainer{font-family:inherit;font-weight:100;height:100%;padding:1rem 1.5rem;background-color:var(--emw--color-white, #FFFFFF);display:flex;flex-direction:column;justify-content:space-between;border-radius:var(--emw--border-radius-large, 20px);max-width:fit-content}.ConsentSubmitButton{font-size:1rem;font-family:var(--emw--button-typography);padding:0.4rem 1.4rem;background:var(--emw--button-background-color, #FFFFFF);border:var(--emw--button-border, 2px solid #000000);color:var(--emw--button-text-color, #000000);border-radius:var(--emw--button-border-radius, 10px);align-self:center;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}.ButtonsWrapper{display:flex;flex-direction:column;margin-top:10px;gap:40px}.ButtonsWrapper button:only-child{margin-left:auto}.UserProtectionError{color:var(--emw--color-error, #FD2839);text-align:center;height:22px}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:var(--emw--button-text-color, #000000)}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";export{i as user_actions,u as user_funds_acknowledgment}
|
|
1
|
+
import{r as e,h as t}from"./index-ec24e8d4.js";const i={"verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"get-temporary-account-consents":{emit:"openTemporaryConsentsModal",listen:"closeTemporaryConsentsModal"},"limits-popup":{emit:"openLugasPopup",listen:"closeLugasPopup"},"video-verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"unverified-phone-number":{emit:"openSmsVerificationModal",listen:"closeSmsVerificationModal"},"expired-consents":{emit:"openExpiredConsentsModal",listen:"closeExpiredConsentsModal"},"financial-limit-notification":{emit:"openLimitNotificationModal",listen:"closeLimitNotificationModal"},"account-review-notification":{emit:"openAccountReviewModal",listen:"closeAccountReviewModal"},"accept-tax-consent":{emit:"openStakeModal",listen:"closeStakeModal"}},n=class{constructor(t){e(this,t),this.emitCurrentActionEvent=()=>{window.postMessage({type:i[this.actionStack[0].action].emit})},this.shiftActionStack=()=>{this.actionStack=this.actionStack.slice(1)},this.mbSource=void 0,this.endpoint=void 0,this.userid=void 0,this.operatorid=void 0,this.playercurrency="EUR",this.hasfundsacknowledgment="false",this.session="",this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.currencylocale="en",this.currencydisplay="symbol",this.maximumfractiondigits="2",this.minimumfractiondigits="0",this.customdisplayformat="",this.alwaysshowdecimals="true",this.gmversion="gm16",this.totalcalculationmode="totalCashAmount",this.actionStack=[],this.customerFundsProtectionActive=!1}handleEvent(e){var t,n;(null===(n=i[null===(t=this.actionStack[0])||void 0===t?void 0:t.action])||void 0===n?void 0:n.listen)===e.data.type&&(this.shiftActionStack(),this.actionStack.length>0&&this.emitCurrentActionEvent())}fetchUserActions(){const e=new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);return fetch(e.href).then((e=>e.json())).then((e=>{var t,n;this.actionStack=e.actions.filter((e=>i[e.action])),this.actionStack.length>0&&this.emitCurrentActionEvent(),this.customerFundsProtectionActive=null!==(n=null===(t=e.actions)||void 0===t?void 0:t.some((e=>"customer-funds-protection"===e.action)))&&void 0!==n&&n,this.customerFundsProtectionActive&&window.postMessage({type:"ProtectionFundsActive"},window.location.href)}))}componentWillLoad(){return this.fetchUserActions()}render(){return this.customerFundsProtectionActive&&"false"!==this.hasfundsacknowledgment?t("user-funds-acknowledgment",{endpoint:this.endpoint,session:this.session,operatorid:this.operatorid,language:this.language,"mb-source":this.mbSource,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"translation-url":this.translationUrl,currencylocale:this.currencylocale,currencydisplay:this.currencydisplay,maximumfractiondigits:this.maximumfractiondigits,minimumfractiondigits:this.minimumfractiondigits,playercurrency:this.playercurrency,userid:this.userid,gmversion:this.gmversion,totalcalculationmode:this.totalcalculationmode}):void 0}};n.style=":host{display:block}";const o="__WIDGET_GLOBAL_STYLE_CACHE__";function s(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function r(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function a(e,t,i,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return i=function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t),i;window[o]||(window[o]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const n=e.getRootNode(),s=window[o];let r=s[t]&&s[t].sheet;r?s[t].refCount=s[t].refCount+1:(r=new CSSStyleSheet,r.replaceSync(i),s[t]={sheet:r,refCount:1});const a=n.adoptedStyleSheets||[];a.includes(r)||(n.adoptedStyleSheets=[...a,r])}))}(e,t);const s=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[o][t]){const e=window[o][t];e.refCount>1?e.refCount=e.refCount-1:delete window[o][t]}s()},i}const c={en:{protectionTitle:"Protection of Customer Funds",protectionContent:'<p>We hold customer funds separate from company funds.<sup class="note"><a href="https://www.gamblingcommission.gov.uk/guidance/customer-funds-segregation-disclosure-to-customers-and-reporting/example-statements-that-might-be-used-in-terms-and-conditions-for-each-of#ref-2" target="_blank">12</a></sup> These funds ar <b>not protected</b> in the event of insolvency: <b>not protected segregation.</b></p><p>For more information, please see the <a href="https://www.gamblingcommission.gov.uk/guidance/customer-funds-segregation-disclosure-to-customers-and-reporting/the-customer-funds-insolvency-ratings-system" target="_blank">customer funds insolvency ratings system</a>.</p>',balanceArea:"Your current balance:",protectionCheckboxLabel:"I understand that my funds are <b>not protected</b> if the operator becomes insolvent.",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Confirm",serverNotResponding:"Server might not be responding",apiCallError:"Request failed with status "},"en-us":{protectionTitle:"Terms and Conditions",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit",rejectButtonText:"Reject",rejectText:"Rejecting new consents will result in the inability to continue the login process and you will be logged out.",consentUpdateSuccess:"Consent update successful!",serverNotResponding:"Server might not be responding"},ro:{protectionTitle:"Termeni și Condiții",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing prin Email",privacyPolicyTitle:"Politica de Confidențialitate",userNoticeText:"Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele",submitButtonText:"Trimite",rejectButtonText:"Respinge",rejectText:"Respingerea noilor consimțăminte va duce la imposibilitatea de a continua procesul de autentificare și veți fi deconectat.",consentUpdateSuccess:"Actualizare consimțământ reușită!",serverNotResponding:"Serverul s-ar putea să nu răspundă"},hr:{protectionTitle:"Opći uvjeti i odredbe",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"E-mail makretinški sadržaj",privacyPolicyTitle:"Politika Privatnosti",userNoticeText:"Prije nego što možete nastaviti, morate pristati na sljedeće",submitButtonText:"Pošalji",rejectButtonText:"Odbij",rejectText:"Odbijanje novih pristanka rezultirat će nemogućnošću nastavka procesa prijave i bit ćete odjavljeni.",consentUpdateSuccess:"Ažuriranje pristanka uspješno!",serverNotResponding:"Poslužitelj možda ne odgovara"},fr:{protectionTitle:"Termes et Conditions",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing par Email",privacyPolicyTitle:"Politique de Confidentialité",userNoticeText:"Avant de continuer, vous devez consentir aux éléments suivants",submitButtonText:"Soumettre",rejectButtonText:"Rejeter",rejectText:"Le rejet des nouveaux consentements entraînera l'impossibilité de continuer le processus de connexion et vous serez déconnecté.",consentUpdateSuccess:"Mise à jour du consentement réussie!",serverNotResponding:"Le serveur ne répond peut-être pas"},cs:{protectionTitle:"Podmínky a ujednání",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Emailový marketing",privacyPolicyTitle:"Zásady ochrany osobních údajů",userNoticeText:"Než budete moci pokračovat, musíte souhlasit s následujícím",submitButtonText:"Odeslat",rejectButtonText:"Odmítnout",rejectText:"Odmítnutí nových souhlasů povede k nemožnosti pokračovat v procesu přihlášení a budete odhlášeni.",consentUpdateSuccess:"Aktualizace souhlasu proběhla úspěšně!",serverNotResponding:"Server možná neodpovídá"},de:{protectionTitle:"Allgemeine Geschäftsbedingungen",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"E-Mail-Marketing",privacyPolicyTitle:"Datenschutzrichtlinie",userNoticeText:"Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen",submitButtonText:"Absenden",rejectButtonText:"Ablehnen",rejectText:"Das Ablehnen neuer Zustimmungen führt dazu, dass der Anmeldevorgang nicht fortgesetzt werden kann und Sie abgemeldet werden.",consentUpdateSuccess:"Zustimmung erfolgreich aktualisiert!",serverNotResponding:"Der Server antwortet möglicherweise nicht"},es:{protectionTitle:"Términos y Condiciones",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar",rejectButtonText:"Rechazar",rejectText:"Rechazar nuevos consentimientos resultará en la imposibilidad de continuar el proceso de inicio de sesión y se cerrará la sesión.",consentUpdateSuccess:"¡Actualización del consentimiento exitosa!",serverNotResponding:"El servidor podría no estar respondiendo"},pt:{protectionTitle:"Termos e Condições",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar",rejectButtonText:"Rejeitar",rejectText:"Rejeitar novos consentimentos resultará na impossibilidade de continuar o processo de login e você será desconectado.",consentUpdateSuccess:"Atualização de consentimento bem-sucedida!",serverNotResponding:"O servidor pode não estar respondendo"},"es-mx":{protectionTitle:"Términos y Condiciones",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar",rejectButtonText:"Rechazar",rejectText:"Rechazar nuevos consentimientos resultará en la imposibilidad de continuar el proceso de inicio de sesión y se cerrará la sesión.",consentUpdateSuccess:"¡Actualización del consentimiento exitosa!",serverNotResponding:"El servidor podría no estar respondiendo"},"pt-br":{protectionTitle:"Termos e Condições",protectionContent:"We hold customer funds separate from company funds.",balanceArea:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar",rejectButtonText:"Rejeitar",rejectText:"Rejeitar novos consentimentos resultará na impossibilidade de continuar o processo de login e você será desconectado.",consentUpdateSuccess:"Atualização de consentimento bem-sucedida!",serverNotResponding:"O servidor pode não estar respondendo"}},l=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{c[t]||(c[t]={});for(let i in e[t])c[t][i]=e[t][i]})),t(!0)}))})),d=(e,t,i)=>{let n=c[void 0!==t&&t in c?t:"en"][e];if(void 0!==i)for(const[e,t]of Object.entries(i.values)){const i=new RegExp(`{${e}}`,"g");n=n.replace(i,t)}return n},u=class{constructor(t){e(this,t),this.abortController=null,this.TIMEOUT_MS=1e4,this.currency="",this.getPlayerAccountBalanceDataCore=()=>{const e=new URL(`${this.endpoint}/v1/player/${this.userid}/account`);fetch(e,{method:"GET",headers:{"X-SessionID":this.session}}).then((e=>{if(!e.ok)throw this.errorAmountMessage=`${d("apiCallError",this.language)} ${e.status}`,new Error(`Failed to fetch balance data: ${e.status}`);return e.json()})).then((e=>{var t,i;if(!e.items||!Array.isArray(e.items))throw this.errorAmountMessage=`${d("apiCallError",this.language)} ${e.status}`,new Error("Unexpected data format: items array missing");const n=e.items.find((e=>"Casino"===e.displayName));if(!(null==n?void 0:n.currency))throw new Error("No Casino item found in balance items");this.currency=n.currency,this.totalCashAmount=null!==(i=null===(t=e.totalAmount)||void 0===t?void 0:t[this.currency])&&void 0!==i?i:0})).catch((e=>{this.errorAmountMessage||(this.errorAmountMessage=d("serverNotResponding",this.language)),console.error("Balance error:",e)})).finally((()=>{this.isLoading=!1}))},this.getPlayerAccountBalanceData16=()=>{const e=new URL(`${this.endpoint}/v2/player/${this.userid}/balance`),t=new Headers;t.append("X-SessionID",this.session),fetch(e,{method:"GET",headers:t}).then((e=>{if(!e.ok)throw this.errorAmountMessage=`${d("apiCallError",this.language)} ${e.status}`,new Error(`Failed to fetch balance data: ${e.status}`);return e.json()})).then((e=>{var t,i;if(!e.items||!Array.isArray(e.items))throw this.errorAmountMessage=`${d("apiCallError",this.language)} ${e.status}`,new Error("Unexpected data format: items array missing");const n=e.items.find((e=>"Real"===e.type&&"Ordinary"===e.walletAccountType));if(!(null==n?void 0:n.currency))throw new Error("No Real/Ordinary wallet found in balance items");this.currency=n.currency,e[this.totalcalculationmode]||(this.totalcalculationmode="totalCashAmount"),this.totalCashAmount=null!==(i=null===(t=e[this.totalcalculationmode])||void 0===t?void 0:t[this.currency])&&void 0!==i?i:0})).catch((e=>{this.errorAmountMessage||(this.errorAmountMessage=d("serverNotResponding",this.language)),console.error("Balance fetch error",e)})).finally((()=>{this.isLoading=!1}))},this.userLegislationConsentHandler=()=>{this.checkboxInput&&(this.isConsentChecked=this.checkboxInput.checked),this.isConsentChecked&&(this.consentsSubmitted=!1,this.errorMessage="")},this.formatBalance=e=>{if(this.customdisplayformat)return this.formatFromCustom(e);const t=this.currencylocale||this.language,i={style:"currency",currency:this.playercurrency,useGrouping:!0,currencyDisplay:this.currencydisplay,maximumFractionDigits:""===this.maximumfractiondigits||isNaN(Number(this.maximumfractiondigits))?2:Number(this.maximumfractiondigits),minimumFractionDigits:""===this.minimumfractiondigits||isNaN(Number(this.minimumfractiondigits))?0:Number(this.minimumfractiondigits)};return new Intl.NumberFormat(t,i).format(e)},this.formatFromCustom=e=>{const t=[];let i="";for(const n of this.customdisplayformat)switch(n){default:i+=n;break;case"{":i&&t.push(i),i="";break;case"}":const[o,s]=i.split("|");if(i="","currency"===o.toLowerCase())i=this.playercurrency;else if("amount"===o.toLowerCase()){let t=",",n=".",o=2;s&&(" "!==s[0]&&(t=s[0])," "!==s[1]&&(n=s[1])," "!==s[2]&&!isNaN(Number(s[2]))&&(o=Number(s[2])));let[r,a]=String(Math.floor(e*10**o)/10**o).split(".");i+=r[0];for(let e=1;e<r.length;++e)i+=(r.length-e)%3==0?t+r[e]:r[e];let c=a||"";const l="true"===this.alwaysshowdecimals,d=Number(this.maximumfractiondigits);if(l)c=c.padEnd(d||2,"0").substring(0,d);else if(!c)break;i+=n+c}i&&t.push(i),i=""}return t.push(i),t.join("")},this.handleSubmit=()=>{var e;this.consentsSubmitted=!0,null===(e=this.abortController)||void 0===e||e.abort(),this.abortController=new AbortController;const t=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort("Request timed out")}),this.TIMEOUT_MS),i=`${this.endpoint}/api/pam/v1/actions/customer-funds-protection`,n=new Headers;return n.append("Content-Type","application/json"),n.append("X-SessionId",`${this.session}`),n.append("X-Tenant-ID",`${this.operatorid}`),fetch(i,{method:"POST",headers:n,body:JSON.stringify({accepted:!0}),signal:this.abortController.signal}).then((e=>{if(!e.ok)throw this.errorMessage=`${d("apiCallError",this.language)} ${e.status}`,new Error(`Request failed with status ${e.status}`);return 202===e.status?(this.errorMessage="",void window.postMessage({type:"ProtectionFundsAccepted"},window.location.href)):e.json()})).catch((e=>{var t;"AbortError"!==e.name?(console.error("Customer funds protection request failed:",e.message),this.errorMessage=d("serverNotResponding",this.language)):"Request timed out"===(null===(t=this.abortController)||void 0===t?void 0:t.signal.reason)&&(this.errorMessage=d("serverNotResponding",this.language))})).finally((()=>{clearTimeout(t),this.abortController=null}))},this.session=void 0,this.operatorid=void 0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.endpoint=void 0,this.language="en",this.translationUrl="",this.currencylocale="en",this.currencydisplay="symbol",this.maximumfractiondigits="2",this.minimumfractiondigits="0",this.customdisplayformat="",this.alwaysshowdecimals="true",this.playercurrency="EUR",this.userid="",this.gmversion="gm16",this.totalcalculationmode="totalCashAmount",this.isLoading=!0,this.isConsentChecked=!1,this.totalCashAmount=0,this.errorMessage="",this.errorAmountMessage="",this.consentsSubmitted=!1}handleNewTranslations(){l(this.translationUrl)}handleClientStylingChange(e,t){e!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}async componentWillLoad(){this.translationUrl.length>2&&await l(this.translationUrl)}componentDidLoad(){switch(this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)),this.gmversion){case"gmcore":this.getPlayerAccountBalanceDataCore();break;case"gm16":this.getPlayerAccountBalanceData16();break;default:throw Error(`Invalid apiversion attribute: ${this.gmversion}`)}}disconnectedCallback(){var e;null===(e=this.abortController)||void 0===e||e.abort("Component unmounted"),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}consentsArea(){return t("div",{class:"UserProtectionFundsCheckboxArea"},t("label",{class:"UserProtectionFundsCheckboxContent",htmlFor:"userProtectionFunds"},t("input",{ref:e=>this.checkboxInput=e,id:"userProtectionFunds",type:"checkbox",onInput:this.userLegislationConsentHandler}),t("span",{innerHTML:`${d("protectionCheckboxLabel",this.language)}`})))}render(){return t("div",{key:"9b36bd1e33e989aaa037919387f3da77020b6e9e",class:"QueryReferenceContainer",ref:e=>this.stylingContainer=e},this.isLoading?t("div",null,t("slot",{name:"spinner"}),t("svg",{class:"spinner",viewBox:"0 0 50 50"},t("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"}))):t("div",{class:"UserProtectionFundsContainer"},t("div",{class:"UserProtectionFundsTitle"},t("h2",null,d("protectionTitle",this.language))),t("div",{class:"UserProtectionFundsWrapper"},t("p",{innerHTML:`${d("protectionContent",this.language)}`})),t("div",{class:"UserProtectionFundsBalance"},t("p",null,d("balanceArea",this.language)," ",t("span",null,this.formatBalance(this.totalCashAmount)))),t("div",{class:"UserProtectionFundsButtonsWrapper"},t("div",null,this.consentsArea()),t("div",null,t("button",{class:"UserProtectionFundsSubmitButton",disabled:!this.isConsentChecked||""!=this.errorMessage||this.consentsSubmitted,onClick:this.handleSubmit},d("submitButtonText",this.language))),t("div",{class:"UserProtectionError"},t("p",null,""!=this.errorMessage&&this.errorMessage),t("p",null,""!=this.errorAmountMessage&&this.errorAmountMessage)))))}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};u.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserProtectionFundsTitle{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserProtectionFundsContainer{font-family:inherit;font-weight:100;height:100%;padding:1rem 1.5rem;background-color:var(--emw--color-white, #FFFFFF);display:flex;flex-direction:column;justify-content:space-between;border-radius:var(--emw--border-radius-large, 20px);max-width:fit-content}.ConsentSubmitButton{font-size:1rem;font-family:var(--emw--button-typography);padding:0.4rem 1.4rem;background:var(--emw--button-background-color, #FFFFFF);border:var(--emw--button-border, 2px solid #000000);color:var(--emw--button-text-color, #000000);border-radius:var(--emw--button-border-radius, 10px);align-self:center;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid var(--emw--color-disabled, #58586B);color:var(--emw--color-disabled, #58586B);cursor:unset}.ButtonsWrapper{display:flex;flex-direction:column;margin-top:10px;gap:40px}.ButtonsWrapper button:only-child{margin-left:auto}.UserProtectionError{color:var(--emw--color-error, #FD2839);text-align:center;height:22px}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:var(--emw--button-text-color, #000000)}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";export{n as user_actions,u as user_funds_acknowledgment}
|