@everymatrix/user-actions 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.
- 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 +8 -5
- package/dist/collection/components/user-actions/user-actions.js +20 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/user-actions.js +1 -1
- package/dist/esm/user-actions_2.entry.js +8 -5
- package/dist/types/components/user-actions/user-actions.d.ts +4 -0
- package/dist/types/components.d.ts +8 -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],"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":[1],"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);
|
|
11
|
+
return index.bootstrapLazy([["user-actions_2.cjs",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"operator":[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"],"operator":[1],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[1],"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],"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":[1],"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);
|
|
22
|
+
return index.bootstrapLazy([["user-actions_2.cjs",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"operator":[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"],"operator":[1],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[1],"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;
|
|
@@ -57,6 +57,7 @@ const UserActions = class {
|
|
|
57
57
|
};
|
|
58
58
|
this.mbSource = undefined;
|
|
59
59
|
this.endpoint = undefined;
|
|
60
|
+
this.operator = 'operator';
|
|
60
61
|
this.userid = undefined;
|
|
61
62
|
this.operatorid = undefined;
|
|
62
63
|
this.playercurrency = 'EUR';
|
|
@@ -111,7 +112,7 @@ const UserActions = class {
|
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
else {
|
|
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 }));
|
|
115
|
+
return (index.h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, operator: this.operator, 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 }));
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
};
|
|
@@ -239,9 +240,9 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
239
240
|
const TRANSLATIONS = {
|
|
240
241
|
en: {
|
|
241
242
|
protectionTitle: 'Protection of Customer Funds',
|
|
242
|
-
protectionContent: '<p>We hold customer funds separate from
|
|
243
|
+
protectionContent: '<p>We hold customer funds separate from <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">company funds</a>. These funds are <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>',
|
|
243
244
|
balanceArea: 'Your current balance:',
|
|
244
|
-
protectionCheckboxLabel: 'I understand that my funds are <b>not protected</b> if
|
|
245
|
+
protectionCheckboxLabel: 'I understand that my funds are <b>not protected</b> if ${operatorName} becomes insolvent.',
|
|
245
246
|
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
246
247
|
submitButtonText: 'Confirm',
|
|
247
248
|
serverNotResponding: 'Server might not be responding',
|
|
@@ -639,6 +640,7 @@ const UserFundsAcknowledgment = class {
|
|
|
639
640
|
this.endpoint = undefined;
|
|
640
641
|
this.language = 'en';
|
|
641
642
|
this.translationUrl = '';
|
|
643
|
+
this.operator = '';
|
|
642
644
|
this.currencylocale = 'en';
|
|
643
645
|
this.currencydisplay = 'symbol';
|
|
644
646
|
this.maximumfractiondigits = '2';
|
|
@@ -705,10 +707,11 @@ const UserFundsAcknowledgment = class {
|
|
|
705
707
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
706
708
|
}
|
|
707
709
|
consentsArea() {
|
|
708
|
-
|
|
710
|
+
const protectionCheckboxLabel = translate('protectionCheckboxLabel', this.language).replace('${operatorName}', this.operator);
|
|
711
|
+
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: protectionCheckboxLabel }))));
|
|
709
712
|
}
|
|
710
713
|
render() {
|
|
711
|
-
return (index.h("div", { key: '
|
|
714
|
+
return (index.h("div", { key: 'cc73425a68ccc58ea4c19f7cd057e27ecaca7b7b', 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))), (this.errorMessage || this.errorAmountMessage) && (index.h("div", { class: "UserProtectionError" }, index.h("p", null, this.errorMessage != '' && this.errorMessage), index.h("p", null, this.errorAmountMessage != '' && this.errorAmountMessage))))))));
|
|
712
715
|
}
|
|
713
716
|
static get watchers() { return {
|
|
714
717
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -11,6 +11,7 @@ export class UserActions {
|
|
|
11
11
|
};
|
|
12
12
|
this.mbSource = undefined;
|
|
13
13
|
this.endpoint = undefined;
|
|
14
|
+
this.operator = 'operator';
|
|
14
15
|
this.userid = undefined;
|
|
15
16
|
this.operatorid = undefined;
|
|
16
17
|
this.playercurrency = 'EUR';
|
|
@@ -65,7 +66,7 @@ export class UserActions {
|
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
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 }));
|
|
69
|
+
return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, operator: this.operator, 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 }));
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
static get is() { return "user-actions"; }
|
|
@@ -116,6 +117,24 @@ export class UserActions {
|
|
|
116
117
|
"attribute": "endpoint",
|
|
117
118
|
"reflect": false
|
|
118
119
|
},
|
|
120
|
+
"operator": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "string",
|
|
125
|
+
"resolved": "string",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Operator name"
|
|
133
|
+
},
|
|
134
|
+
"attribute": "operator",
|
|
135
|
+
"reflect": false,
|
|
136
|
+
"defaultValue": "'operator'"
|
|
137
|
+
},
|
|
119
138
|
"userid": {
|
|
120
139
|
"type": "string",
|
|
121
140
|
"mutable": false,
|
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],"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":[1],"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);
|
|
8
|
+
return bootstrapLazy([["user-actions_2",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"operator":[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"],"operator":[1],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[1],"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],"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":[1],"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);
|
|
19
|
+
return bootstrapLazy([["user-actions_2",[[1,"user-actions",{"mbSource":[513,"mb-source"],"endpoint":[1],"operator":[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"],"operator":[1],"currencylocale":[513],"currencydisplay":[513],"maximumfractiondigits":[513],"minimumfractiondigits":[513],"customdisplayformat":[513],"alwaysshowdecimals":[513],"playercurrency":[513],"userid":[1],"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
|
});
|
|
@@ -53,6 +53,7 @@ const UserActions = class {
|
|
|
53
53
|
};
|
|
54
54
|
this.mbSource = undefined;
|
|
55
55
|
this.endpoint = undefined;
|
|
56
|
+
this.operator = 'operator';
|
|
56
57
|
this.userid = undefined;
|
|
57
58
|
this.operatorid = undefined;
|
|
58
59
|
this.playercurrency = 'EUR';
|
|
@@ -107,7 +108,7 @@ const UserActions = class {
|
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
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 }));
|
|
111
|
+
return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, operator: this.operator, 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 }));
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
};
|
|
@@ -235,9 +236,9 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
235
236
|
const TRANSLATIONS = {
|
|
236
237
|
en: {
|
|
237
238
|
protectionTitle: 'Protection of Customer Funds',
|
|
238
|
-
protectionContent: '<p>We hold customer funds separate from
|
|
239
|
+
protectionContent: '<p>We hold customer funds separate from <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">company funds</a>. These funds are <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>',
|
|
239
240
|
balanceArea: 'Your current balance:',
|
|
240
|
-
protectionCheckboxLabel: 'I understand that my funds are <b>not protected</b> if
|
|
241
|
+
protectionCheckboxLabel: 'I understand that my funds are <b>not protected</b> if ${operatorName} becomes insolvent.',
|
|
241
242
|
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
242
243
|
submitButtonText: 'Confirm',
|
|
243
244
|
serverNotResponding: 'Server might not be responding',
|
|
@@ -635,6 +636,7 @@ const UserFundsAcknowledgment = class {
|
|
|
635
636
|
this.endpoint = undefined;
|
|
636
637
|
this.language = 'en';
|
|
637
638
|
this.translationUrl = '';
|
|
639
|
+
this.operator = '';
|
|
638
640
|
this.currencylocale = 'en';
|
|
639
641
|
this.currencydisplay = 'symbol';
|
|
640
642
|
this.maximumfractiondigits = '2';
|
|
@@ -701,10 +703,11 @@ const UserFundsAcknowledgment = class {
|
|
|
701
703
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
702
704
|
}
|
|
703
705
|
consentsArea() {
|
|
704
|
-
|
|
706
|
+
const protectionCheckboxLabel = translate('protectionCheckboxLabel', this.language).replace('${operatorName}', this.operator);
|
|
707
|
+
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: protectionCheckboxLabel }))));
|
|
705
708
|
}
|
|
706
709
|
render() {
|
|
707
|
-
return (h("div", { key: '
|
|
710
|
+
return (h("div", { key: 'cc73425a68ccc58ea4c19f7cd057e27ecaca7b7b', 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))), (this.errorMessage || this.errorAmountMessage) && (h("div", { class: "UserProtectionError" }, h("p", null, this.errorMessage != '' && this.errorMessage), h("p", null, this.errorAmountMessage != '' && this.errorAmountMessage))))))));
|
|
708
711
|
}
|
|
709
712
|
static get watchers() { return {
|
|
710
713
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -38,6 +38,10 @@ export namespace Components {
|
|
|
38
38
|
"maximumfractiondigits": string;
|
|
39
39
|
"mbSource": string;
|
|
40
40
|
"minimumfractiondigits": string;
|
|
41
|
+
/**
|
|
42
|
+
* Operator name
|
|
43
|
+
*/
|
|
44
|
+
"operator": string;
|
|
41
45
|
"operatorid": string;
|
|
42
46
|
"playercurrency": string;
|
|
43
47
|
/**
|
|
@@ -99,6 +103,10 @@ declare namespace LocalJSX {
|
|
|
99
103
|
"maximumfractiondigits"?: string;
|
|
100
104
|
"mbSource"?: string;
|
|
101
105
|
"minimumfractiondigits"?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Operator name
|
|
108
|
+
*/
|
|
109
|
+
"operator"?: string;
|
|
102
110
|
"operatorid"?: string;
|
|
103
111
|
"playercurrency"?: string;
|
|
104
112
|
/**
|
|
@@ -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],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:[1],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
|
+
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],operator:[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"],operator:[1],currencylocale:[513],currencydisplay:[513],maximumfractiondigits:[513],minimumfractiondigits:[513],customdisplayformat:[513],alwaysshowdecimals:[513],playercurrency:[513],userid:[1],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 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=void 0,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:"4b83615d1b42c72de845e1ca293a162bd9e958ce",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}
|
|
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.operator="operator",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,operator:this.operator,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 <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">company funds</a>. These funds are <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 ${operatorName} 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.operator="",this.currencylocale="en",this.currencydisplay="symbol",this.maximumfractiondigits="2",this.minimumfractiondigits="0",this.customdisplayformat="",this.alwaysshowdecimals="true",this.playercurrency="EUR",this.userid=void 0,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(){const e=d("protectionCheckboxLabel",this.language).replace("${operatorName}",this.operator);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:e})))}render(){return t("div",{key:"cc73425a68ccc58ea4c19f7cd057e27ecaca7b7b",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))),(this.errorMessage||this.errorAmountMessage)&&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}
|