@everymatrix/user-funds-acknowledgment 0.2.7 → 0.3.0

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const userFundsAcknowledgment = require('./user-funds-acknowledgment-f6bff2d2.js');
5
+ const userFundsAcknowledgment = require('./user-funds-acknowledgment-abad9c49.js');
6
6
  require('./index-e7d6647a.js');
7
7
 
8
8
 
@@ -478,7 +478,6 @@ const UserFundsAcknowledgment = class {
478
478
  const headers = new Headers();
479
479
  headers.append('Content-Type', 'application/json');
480
480
  headers.append('X-SessionId', `${this.session}`);
481
- headers.append('X-Tenant-ID', `${this.operatorid}`);
482
481
  return fetch(url, {
483
482
  method: 'POST',
484
483
  headers: headers,
@@ -595,7 +594,7 @@ const UserFundsAcknowledgment = class {
595
594
  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 }))));
596
595
  }
597
596
  render() {
598
- 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))))))));
597
+ return (index.h("div", { key: '2eca9d78f4a4f92ede54b5a50ef2205e0ccf1a58', 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))))))));
599
598
  }
600
599
  static get watchers() { return {
601
600
  "translationUrl": ["handleNewTranslations"],
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const userFundsAcknowledgment = require('./user-funds-acknowledgment-f6bff2d2.js');
5
+ const userFundsAcknowledgment = require('./user-funds-acknowledgment-abad9c49.js');
6
6
  require('./index-e7d6647a.js');
7
7
 
8
8
 
@@ -193,7 +193,6 @@ export class UserFundsAcknowledgment {
193
193
  const headers = new Headers();
194
194
  headers.append('Content-Type', 'application/json');
195
195
  headers.append('X-SessionId', `${this.session}`);
196
- headers.append('X-Tenant-ID', `${this.operatorid}`);
197
196
  return fetch(url, {
198
197
  method: 'POST',
199
198
  headers: headers,
@@ -310,7 +309,7 @@ export class UserFundsAcknowledgment {
310
309
  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 }))));
311
310
  }
312
311
  render() {
313
- 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))))))));
312
+ return (h("div", { key: '2eca9d78f4a4f92ede54b5a50ef2205e0ccf1a58', 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))))))));
314
313
  }
315
314
  static get is() { return "user-funds-acknowledgment"; }
316
315
  static get encapsulation() { return "shadow"; }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { U as UserFundsAcknowledgment } from './user-funds-acknowledgment-3bf8deec.js';
1
+ export { U as UserFundsAcknowledgment } from './user-funds-acknowledgment-581975b2.js';
2
2
  import './index-eb00caf2.js';
@@ -476,7 +476,6 @@ const UserFundsAcknowledgment = class {
476
476
  const headers = new Headers();
477
477
  headers.append('Content-Type', 'application/json');
478
478
  headers.append('X-SessionId', `${this.session}`);
479
- headers.append('X-Tenant-ID', `${this.operatorid}`);
480
479
  return fetch(url, {
481
480
  method: 'POST',
482
481
  headers: headers,
@@ -593,7 +592,7 @@ const UserFundsAcknowledgment = class {
593
592
  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 }))));
594
593
  }
595
594
  render() {
596
- 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))))))));
595
+ return (h("div", { key: '2eca9d78f4a4f92ede54b5a50ef2205e0ccf1a58', 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))))))));
597
596
  }
598
597
  static get watchers() { return {
599
598
  "translationUrl": ["handleNewTranslations"],
@@ -1,2 +1,2 @@
1
- export { U as user_funds_acknowledgment } from './user-funds-acknowledgment-3bf8deec.js';
1
+ export { U as user_funds_acknowledgment } from './user-funds-acknowledgment-581975b2.js';
2
2
  import './index-eb00caf2.js';
@@ -1 +1 @@
1
- export{U as UserFundsAcknowledgment}from"./user-funds-acknowledgment-3bf8deec.js";import"./index-eb00caf2.js";
1
+ export{U as UserFundsAcknowledgment}from"./user-funds-acknowledgment-581975b2.js";import"./index-eb00caf2.js";
@@ -1 +1 @@
1
- import{r as e,h as t}from"./index-eb00caf2.js";const n="__WIDGET_GLOBAL_STYLE_CACHE__";function i(e,t){if(e){const n=document.createElement("style");n.innerHTML=t,e.appendChild(n)}}function o(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 s(e,t,i,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return i=function(e,t){const n=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(n.innerHTML=t,e.appendChild(n))}))}(e,t),i;window[n]||(window[n]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const o=e.getRootNode(),s=window[n];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=o.adoptedStyleSheets||[];a.includes(r)||(o.adoptedStyleSheets=[...a,r])}))}(e,t);const s=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[n][t]){const e=window[n][t];e.refCount>1?e.refCount=e.refCount-1:delete window[n][t]}s()},i}const r={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"}},a=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{r[t]||(r[t]={});for(let n in e[t])r[t][n]=e[t][n]})),t(!0)}))})),c=(e,t,n)=>{let i=r[void 0!==t&&t in r?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},d=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=`${c("apiCallError",this.language)} ${e.status}`,new Error(`Failed to fetch balance data: ${e.status}`);return e.json()})).then((e=>{var t,n;if(!e.items||!Array.isArray(e.items))throw this.errorAmountMessage=`${c("apiCallError",this.language)} ${e.status}`,new Error("Unexpected data format: items array missing");const i=e.items.find((e=>"Casino"===e.displayName));if(!(null==i?void 0:i.currency))throw new Error("No Casino item found in balance items");this.currency=i.currency,this.totalCashAmount=null!==(n=null===(t=e.totalAmount)||void 0===t?void 0:t[this.currency])&&void 0!==n?n:0})).catch((e=>{this.errorAmountMessage||(this.errorAmountMessage=c("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=`${c("apiCallError",this.language)} ${e.status}`,new Error(`Failed to fetch balance data: ${e.status}`);return e.json()})).then((e=>{var t,n;if(!e.items||!Array.isArray(e.items))throw this.errorAmountMessage=`${c("apiCallError",this.language)} ${e.status}`,new Error("Unexpected data format: items array missing");const i=e.items.find((e=>"Real"===e.type&&"Ordinary"===e.walletAccountType));if(!(null==i?void 0:i.currency))throw new Error("No Real/Ordinary wallet found in balance items");this.currency=i.currency,e[this.totalcalculationmode]||(this.totalcalculationmode="totalCashAmount"),this.totalCashAmount=null!==(n=null===(t=e[this.totalcalculationmode])||void 0===t?void 0:t[this.currency])&&void 0!==n?n:0})).catch((e=>{this.errorAmountMessage||(this.errorAmountMessage=c("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,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 d="true"===this.alwaysshowdecimals,l=Number(this.maximumfractiondigits);if(d)c=c.padEnd(l||2,"0").substring(0,l);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=`${c("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=c("serverNotResponding",this.language)):"Request timed out"===(null===(t=this.abortController)||void 0===t?void 0:t.signal.reason)&&(this.errorMessage=c("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(){a(this.translationUrl)}handleClientStylingChange(e,t){e!=t&&i(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&o(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&s(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}async componentWillLoad(){this.translationUrl.length>2&&await a(this.translationUrl)}componentDidLoad(){switch(this.stylingContainer&&(this.mbSource&&s(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&o(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=c("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,c("protectionTitle",this.language))),t("div",{class:"UserProtectionFundsWrapper"},t("p",{innerHTML:`${c("protectionContent",this.language)}`})),t("div",{class:"UserProtectionFundsBalance"},t("p",null,c("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},c("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"]}}};d.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{d as U}
1
+ import{r as e,h as t}from"./index-eb00caf2.js";const n="__WIDGET_GLOBAL_STYLE_CACHE__";function i(e,t){if(e){const n=document.createElement("style");n.innerHTML=t,e.appendChild(n)}}function o(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 s(e,t,i,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return i=function(e,t){const n=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(n.innerHTML=t,e.appendChild(n))}))}(e,t),i;window[n]||(window[n]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const o=e.getRootNode(),s=window[n];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=o.adoptedStyleSheets||[];a.includes(r)||(o.adoptedStyleSheets=[...a,r])}))}(e,t);const s=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[n][t]){const e=window[n][t];e.refCount>1?e.refCount=e.refCount-1:delete window[n][t]}s()},i}const r={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"}},a=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{r[t]||(r[t]={});for(let n in e[t])r[t][n]=e[t][n]})),t(!0)}))})),c=(e,t,n)=>{let i=r[void 0!==t&&t in r?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},d=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=`${c("apiCallError",this.language)} ${e.status}`,new Error(`Failed to fetch balance data: ${e.status}`);return e.json()})).then((e=>{var t,n;if(!e.items||!Array.isArray(e.items))throw this.errorAmountMessage=`${c("apiCallError",this.language)} ${e.status}`,new Error("Unexpected data format: items array missing");const i=e.items.find((e=>"Casino"===e.displayName));if(!(null==i?void 0:i.currency))throw new Error("No Casino item found in balance items");this.currency=i.currency,this.totalCashAmount=null!==(n=null===(t=e.totalAmount)||void 0===t?void 0:t[this.currency])&&void 0!==n?n:0})).catch((e=>{this.errorAmountMessage||(this.errorAmountMessage=c("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=`${c("apiCallError",this.language)} ${e.status}`,new Error(`Failed to fetch balance data: ${e.status}`);return e.json()})).then((e=>{var t,n;if(!e.items||!Array.isArray(e.items))throw this.errorAmountMessage=`${c("apiCallError",this.language)} ${e.status}`,new Error("Unexpected data format: items array missing");const i=e.items.find((e=>"Real"===e.type&&"Ordinary"===e.walletAccountType));if(!(null==i?void 0:i.currency))throw new Error("No Real/Ordinary wallet found in balance items");this.currency=i.currency,e[this.totalcalculationmode]||(this.totalcalculationmode="totalCashAmount"),this.totalCashAmount=null!==(n=null===(t=e[this.totalcalculationmode])||void 0===t?void 0:t[this.currency])&&void 0!==n?n:0})).catch((e=>{this.errorAmountMessage||(this.errorAmountMessage=c("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,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 d="true"===this.alwaysshowdecimals,l=Number(this.maximumfractiondigits);if(d)c=c.padEnd(l||2,"0").substring(0,l);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}`),fetch(n,{method:"POST",headers:i,body:JSON.stringify({accepted:!0}),signal:this.abortController.signal}).then((e=>{if(!e.ok)throw this.errorMessage=`${c("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=c("serverNotResponding",this.language)):"Request timed out"===(null===(t=this.abortController)||void 0===t?void 0:t.signal.reason)&&(this.errorMessage=c("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(){a(this.translationUrl)}handleClientStylingChange(e,t){e!=t&&i(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&o(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&s(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}async componentWillLoad(){this.translationUrl.length>2&&await a(this.translationUrl)}componentDidLoad(){switch(this.stylingContainer&&(this.mbSource&&s(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&o(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=c("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:"2eca9d78f4a4f92ede54b5a50ef2205e0ccf1a58",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,c("protectionTitle",this.language))),t("div",{class:"UserProtectionFundsWrapper"},t("p",{innerHTML:`${c("protectionContent",this.language)}`})),t("div",{class:"UserProtectionFundsBalance"},t("p",null,c("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},c("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"]}}};d.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{d as U}
@@ -1 +1 @@
1
- export{U as user_funds_acknowledgment}from"./user-funds-acknowledgment-3bf8deec.js";import"./index-eb00caf2.js";
1
+ export{U as user_funds_acknowledgment}from"./user-funds-acknowledgment-581975b2.js";import"./index-eb00caf2.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-funds-acknowledgment",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",