@everymatrix/user-action-controller 1.60.0 → 1.60.2
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/player-user-consents_2.cjs.entry.js +1 -1
- package/dist/esm/player-user-consents_2.entry.js +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.dev.d.ts +2 -0
- package/dist/user-action-controller/p-a6c8de57.entry.js +1 -0
- package/dist/user-action-controller/user-action-controller.esm.js +1 -1
- package/package.json +1 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.dev.d.ts +0 -2
- package/dist/user-action-controller/p-1091a4ea.entry.js +0 -1
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -187,7 +187,7 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color
|
|
190
|
+
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emw--color-primary), #52d004;font-weight:bold}#userConsent{appearance:none;width:18px;border-radius:3px;height:18px;border:1px solid var(--emw--color-black, #000000);background-color:var(--emw--color-primary), #52d004;cursor:pointer;position:relative}#userConsent:checked{background-color:var(--emw--color-primary), #52d004;background-color:#52d004;border:1px solid var(--emw--color-white, #000000)}#userConsent:checked::after{content:\"\";position:absolute;width:4px;height:8px;border:solid var(--emw--color-black, #000000);background-color:var(--emw--color-primary), #52d004;border-width:0 2px 2px 0;top:2px;left:5px;transform:rotate(45deg)}";
|
|
191
191
|
const PlayerUserConsentsStyle0 = playerUserConsentsCss;
|
|
192
192
|
|
|
193
193
|
const PlayerUserConsents = class {
|
|
@@ -183,7 +183,7 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color
|
|
186
|
+
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emw--color-primary), #52d004;font-weight:bold}#userConsent{appearance:none;width:18px;border-radius:3px;height:18px;border:1px solid var(--emw--color-black, #000000);background-color:var(--emw--color-primary), #52d004;cursor:pointer;position:relative}#userConsent:checked{background-color:var(--emw--color-primary), #52d004;background-color:#52d004;border:1px solid var(--emw--color-white, #000000)}#userConsent:checked::after{content:\"\";position:absolute;width:4px;height:8px;border:solid var(--emw--color-black, #000000);background-color:var(--emw--color-primary), #52d004;border-width:0 2px 2px 0;top:2px;left:5px;transform:rotate(45deg)}";
|
|
187
187
|
const PlayerUserConsentsStyle0 = playerUserConsentsCss;
|
|
188
188
|
|
|
189
189
|
const PlayerUserConsents = class {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i}from"./p-21db0506.js";const n={en:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},ro:{termsAndConditions:{acceptPart1:"Accept ",acceptPart2:" platformei. Am citit şi înţeles ",acceptPart3:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",tc:"Termenii şi condiţiile"},privacyPolicy:{readUnderstandPart1:"Am citit şi înţeles ",readUnderstandPart2:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",privacy:"Politica de confidenţialitate"},sms:"Sunt de acord să primesc promoţii de marketing prin SMS.",emailmarketing:"Sunt de acord să primesc promoţii de marketing pe e-mail."},hr:{termsAndConditions:{acceptPart1:"Prihvaćam Opće uvjete i odredbe ",acceptPart2:"",acceptPart3:"",tcLink:"Opći uvjeti i odredbe"},privacyPolicy:{readUnderstandPart1:"Pročitao sam i razumijem Politiku Privatnosti ",readUnderstandPart2:", i potvrđujem da imam više od 18 godina",privacyLink:"Politika Privatnosti"},sms:"Želim dobivati marketinški sadržaj putem sms",emailmarketing:"Želim dobivati marketinški sadržaj putem e-maila"},fr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},cs:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},de:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."}},s=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])n[e][i]=t[e][i]})),e(!0)}))})),o=(t,e,i)=>{let s=(o=n[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),o));var o;if(null===s)return t;if(void 0!==i)for(const[t,e]of Object.entries(i)){const i=new RegExp(`{${t}}`,"g");s=s.replace(i,e)}return s};function r(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function a(t,e){const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function c(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}const d=class{constructor(i){t(this,i),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.mbSource=void 0,this.textContent=""}handleNewTranslations(){s(this.translationUrl)}handleStylingUrlChange(t,e){t!==e&&a(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){this.translationUrl.length>2&&await s(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?c(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}determineTextContent(){if("gmcore"===this.gmVersion&&"termsandconditions"===this.consentType)return i("p",null,o("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},o("termsAndConditions.tcLink",this.lang)),o("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},o("privacyPolicy.privacyLink",this.lang)),o("termsAndConditions.acceptPart3",this.lang));if("gm16"===this.gmVersion){if("termsandconditions"===this.consentType)return i("p",null,o("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},o("termsAndConditions.tcLink",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,o("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},o("privacyPolicy.privacyLink",this.lang)),o("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,o(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{key:"aba04e96251f2f0febe96883b931193fb5ca8c94",ref:t=>this.stylingContainer=t},i("p",{key:"d3f0cbeb5b45b4538462a53c41ab041b176a7c26",class:"ConsentTitle"},this.consentTitle),i("label",{key:"800ab8d45e87b075402c3178e60a16866d0321d4",class:"UserConsent",htmlFor:"userConsent"},i("input",{key:"919c15c353a8146661eca2870e7a63f7c689953e",ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{key:"f7126adee1ba5540837da4b852961d08a9eae857",class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}}};d.style=':host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emw--color-primary), #52d004;font-weight:bold}#userConsent{appearance:none;width:18px;border-radius:3px;height:18px;border:1px solid var(--emw--color-black, #000000);background-color:var(--emw--color-primary), #52d004;cursor:pointer;position:relative}#userConsent:checked{background-color:var(--emw--color-primary), #52d004;background-color:#52d004;border:1px solid var(--emw--color-white, #000000)}#userConsent:checked::after{content:"";position:absolute;width:4px;height:8px;border:solid var(--emw--color-black, #000000);background-color:var(--emw--color-primary), #52d004;border-width:0 2px 2px 0;top:2px;left:5px;transform:rotate(45deg)}';const l={en:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},"en-us":{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},ro:{termsAndConditionsTitle:"Termeni și Condiții",smsTitle:"Marketing prin SMS",emailMarketingTitle:"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"},hr:{termsAndConditionsTitle:"Opći uvjeti i odredbe",smsTitle:"SMS makretinški sadržaj",emailMarketingTitle:"E-mail makretinški sadržaj",privacyPolicyTitle:"Politika Privatnosti",userNoticeText:"Prije nego što možete nastaviti, morate pristati na sljedeće",submitButtonText:"Pošalji"},fr:{termsAndConditionsTitle:"Termes et Conditions",smsTitle:"Marketing par SMS",emailMarketingTitle:"Marketing par Email",privacyPolicyTitle:"Politique de Confidentialité",userNoticeText:"Avant de continuer, vous devez consentir aux éléments suivants",submitButtonText:"Soumettre"},cs:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},de:{termsAndConditionsTitle:"Allgemeine Geschäftsbedingungen",smsTitle:"SMS-Marketing",emailMarketingTitle:"E-Mail-Marketing",privacyPolicyTitle:"Datenschutzrichtlinie",userNoticeText:"Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen",submitButtonText:"Absenden"},es:{termsAndConditionsTitle:"Términos y Condiciones",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar"},pt:{termsAndConditionsTitle:"Termos e Condições",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar"},"es-mx":{termsAndConditionsTitle:"Términos y Condiciones",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar"},"pt-br":{termsAndConditionsTitle:"Termos e Condições",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar"}},h=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{l[e]||(l[e]={});for(let i in t[e])l[e][i]=t[e][i]})),e(!0)}))})),m=(t,e,i)=>{let n=l[void 0!==e&&e in l?e:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},p=class{constructor(e){t(this,e),this.mandatoryActions=["termsandconditions","privacypolicy"],this.userActions=[],this.consentTitles={termsandconditions:m("termsAndConditionsTitle",this.lang),sms:m("smsTitle",this.lang),emailmarketing:m("emailMarketingTitle",this.lang),privacypolicy:m("privacyPolicyTitle",this.lang)},this.endpoint=void 0,this.userSession=void 0,this.userId=void 0,this.lang="en",this.includeSubmitButton=void 0,this.gmVersion="",this.translationUrl="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.queryFired=!1,this.readyActionsCount=0,this.activeUserActions=[],this.userActionsValidated=!0,this.receivedQueryResponses=0,this.isLoading=!0,this.mandatoryActionsChecked=0,this.mandatoryItems=void 0}handleNewTranslations(){h(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}handleQueryResponse(){this.receivedQueryResponses===this.activeUserActions.length&&this.updateUserConsents()}userLegislationConsentHandler(t){const e=t.detail.type,i=t.detail.value;this.mandatoryActions.includes(e)&&!1===this.queryFired&&(!0===i?this.mandatoryActionsChecked++:this.mandatoryActionsChecked--),this.queryFired&&(this.userActions.push(Object.assign({tagCode:e,status:(t=>"gm16"===this.gmVersion?t?1:0:t?"Accepted":"Denied")(i)},"gm16"===this.gmVersion&&{note:""})),this.receivedQueryResponses++)}determineUserActionsCore(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/consent`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.items.forEach((t=>{"Expired"===t.status&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}determineUserActions16(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.consents.forEach((t=>{2===t.status&&"pepconsent"!==t.tagCode&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}updateUserConsents(){const t="gmcore"===this.gmVersion?new URL(`${this.endpoint}/v1/player/${this.userId}/consent`):new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);let e={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-SessionId":`${this.userSession}`},body:JSON.stringify({consents:this.userActions})};fetch(t.href,e).then((t=>t.json())).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:"Consent update successful!"}},window.location.href)})).catch((t=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Server might not be responding",err:t}},window.location.href)})).finally((()=>{window.postMessage({type:"UserActionsCompleted"},window.location.href)}))}handleApplyClick(){this.queryFired=!0}async componentWillLoad(){"gmcore"===this.gmVersion&&this.determineUserActionsCore(),"gm16"===this.gmVersion&&this.determineUserActions16(),this.translationUrl.length>2&&await h(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?c(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}calcMandatoryActions(){this.mandatoryItems=0,this.mandatoryActions.map((t=>{this.activeUserActions.includes(t)&&this.mandatoryItems++}))}render(){return this.mandatoryItems>0?(this.userActionsValidated=this.mandatoryActionsChecked===this.mandatoryItems,i("div",{class:"QueryReferenceContainer",ref:t=>this.stylingContainer=t},this.isLoading?i("slot",{name:"spinner"})&&i("svg",{class:"spinner",viewBox:"0 0 50 50"},i("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})):i("div",{class:"UserActionController"},i("h2",{class:"UserConsentNotice"},m("userNoticeText",this.lang)),i("div",{class:"PlayerLegislationWrapper"},this.activeUserActions.map((t=>i("slot",{name:t},i("player-user-consents",{lang:this.lang,"gm-version":this.gmVersion,"translation-url":this.translationUrl,consentType:t,consentTitle:this.consentTitles[t],queried:this.queryFired,mandatory:this.mandatoryActions.includes(t),"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"client-styling":this.clientStyling}))))),this.includeSubmitButton&&i("button",{class:"ConsentSubmitButton",disabled:!this.userActionsValidated,onClick:()=>this.handleApplyClick()},m("submitButtonText",this.lang))))):void 0}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],receivedQueryResponses:["handleQueryResponse"]}}};p.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.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, #D0046C));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 player_user_consents,p as user_action_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as e}from"./p-21db0506.js";export{s as setNonce}from"./p-21db0506.js";import{g as t}from"./p-e1255160.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["p-
|
|
1
|
+
import{p as n,b as e}from"./p-21db0506.js";export{s as setNonce}from"./p-21db0506.js";import{g as t}from"./p-e1255160.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["p-a6c8de57",[[1,"user-action-controller",{endpoint:[513],userSession:[513,"user-session"],userId:[513,"user-id"],lang:[1537],includeSubmitButton:[516,"include-submit-button"],gmVersion:[1,"gm-version"],translationUrl:[513,"translation-url"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],queryFired:[32],readyActionsCount:[32],activeUserActions:[32],userActionsValidated:[32],receivedQueryResponses:[32],isLoading:[32],mandatoryActionsChecked:[32],mandatoryItems:[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]],{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],receivedQueryResponses:["handleQueryResponse"]}],[1,"player-user-consents",{lang:[1537],queried:[516],consentType:[513,"consent-type"],mandatory:[516],gmVersion:[1,"gm-version"],consentTitle:[513,"consent-title"],clientStyling:[1,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],mbSource:[513,"mb-source"],textContent:[32]},null,{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}]]]],n))));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-21db0506.js";const n={en:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},ro:{termsAndConditions:{acceptPart1:"Accept ",acceptPart2:" platformei. Am citit şi înţeles ",acceptPart3:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",tc:"Termenii şi condiţiile"},privacyPolicy:{readUnderstandPart1:"Am citit şi înţeles ",readUnderstandPart2:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",privacy:"Politica de confidenţialitate"},sms:"Sunt de acord să primesc promoţii de marketing prin SMS.",emailmarketing:"Sunt de acord să primesc promoţii de marketing pe e-mail."},hr:{termsAndConditions:{acceptPart1:"Prihvaćam Opće uvjete i odredbe ",acceptPart2:"",acceptPart3:"",tcLink:"Opći uvjeti i odredbe"},privacyPolicy:{readUnderstandPart1:"Pročitao sam i razumijem Politiku Privatnosti ",readUnderstandPart2:", i potvrđujem da imam više od 18 godina",privacyLink:"Politika Privatnosti"},sms:"Želim dobivati marketinški sadržaj putem sms",emailmarketing:"Želim dobivati marketinški sadržaj putem e-maila"},fr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},cs:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},de:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."}},s=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])n[e][i]=t[e][i]})),e(!0)}))})),a=(t,e,i)=>{let s=(a=n[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),a));var a;if(null===s)return t;if(void 0!==i)for(const[t,e]of Object.entries(i)){const i=new RegExp(`{${t}}`,"g");s=s.replace(i,e)}return s};function o(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function r(t,e){const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function c(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}const d=class{constructor(i){t(this,i),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.mbSource=void 0,this.textContent=""}handleNewTranslations(){s(this.translationUrl)}handleStylingUrlChange(t,e){t!==e&&r(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){this.translationUrl.length>2&&await s(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?c(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}determineTextContent(){if("gmcore"===this.gmVersion&&"termsandconditions"===this.consentType)return i("p",null,a("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},a("termsAndConditions.tcLink",this.lang)),a("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacyLink",this.lang)),a("termsAndConditions.acceptPart3",this.lang));if("gm16"===this.gmVersion){if("termsandconditions"===this.consentType)return i("p",null,a("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},a("termsAndConditions.tcLink",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,a("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacyLink",this.lang)),a("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,a(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{key:"aba04e96251f2f0febe96883b931193fb5ca8c94",ref:t=>this.stylingContainer=t},i("p",{key:"d3f0cbeb5b45b4538462a53c41ab041b176a7c26",class:"ConsentTitle"},this.consentTitle),i("label",{key:"800ab8d45e87b075402c3178e60a16866d0321d4",class:"UserConsent",htmlFor:"userConsent"},i("input",{key:"919c15c353a8146661eca2870e7a63f7c689953e",ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{key:"f7126adee1ba5540837da4b852961d08a9eae857",class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}}};d.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emw--color-primary);font-weight:bold}";const l={en:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},"en-us":{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},ro:{termsAndConditionsTitle:"Termeni și Condiții",smsTitle:"Marketing prin SMS",emailMarketingTitle:"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"},hr:{termsAndConditionsTitle:"Opći uvjeti i odredbe",smsTitle:"SMS makretinški sadržaj",emailMarketingTitle:"E-mail makretinški sadržaj",privacyPolicyTitle:"Politika Privatnosti",userNoticeText:"Prije nego što možete nastaviti, morate pristati na sljedeće",submitButtonText:"Pošalji"},fr:{termsAndConditionsTitle:"Termes et Conditions",smsTitle:"Marketing par SMS",emailMarketingTitle:"Marketing par Email",privacyPolicyTitle:"Politique de Confidentialité",userNoticeText:"Avant de continuer, vous devez consentir aux éléments suivants",submitButtonText:"Soumettre"},cs:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},de:{termsAndConditionsTitle:"Allgemeine Geschäftsbedingungen",smsTitle:"SMS-Marketing",emailMarketingTitle:"E-Mail-Marketing",privacyPolicyTitle:"Datenschutzrichtlinie",userNoticeText:"Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen",submitButtonText:"Absenden"},es:{termsAndConditionsTitle:"Términos y Condiciones",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar"},pt:{termsAndConditionsTitle:"Termos e Condições",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar"},"es-mx":{termsAndConditionsTitle:"Términos y Condiciones",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar"},"pt-br":{termsAndConditionsTitle:"Termos e Condições",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar"}},h=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{l[e]||(l[e]={});for(let i in t[e])l[e][i]=t[e][i]})),e(!0)}))})),m=(t,e,i)=>{let n=l[void 0!==e&&e in l?e:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},p=class{constructor(e){t(this,e),this.mandatoryActions=["termsandconditions","privacypolicy"],this.userActions=[],this.consentTitles={termsandconditions:m("termsAndConditionsTitle",this.lang),sms:m("smsTitle",this.lang),emailmarketing:m("emailMarketingTitle",this.lang),privacypolicy:m("privacyPolicyTitle",this.lang)},this.endpoint=void 0,this.userSession=void 0,this.userId=void 0,this.lang="en",this.includeSubmitButton=void 0,this.gmVersion="",this.translationUrl="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.queryFired=!1,this.readyActionsCount=0,this.activeUserActions=[],this.userActionsValidated=!0,this.receivedQueryResponses=0,this.isLoading=!0,this.mandatoryActionsChecked=0,this.mandatoryItems=void 0}handleNewTranslations(){h(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}handleQueryResponse(){this.receivedQueryResponses===this.activeUserActions.length&&this.updateUserConsents()}userLegislationConsentHandler(t){const e=t.detail.type,i=t.detail.value;this.mandatoryActions.includes(e)&&!1===this.queryFired&&(!0===i?this.mandatoryActionsChecked++:this.mandatoryActionsChecked--),this.queryFired&&(this.userActions.push(Object.assign({tagCode:e,status:(t=>"gm16"===this.gmVersion?t?1:0:t?"Accepted":"Denied")(i)},"gm16"===this.gmVersion&&{note:""})),this.receivedQueryResponses++)}determineUserActionsCore(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/consent`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.items.forEach((t=>{"Expired"===t.status&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}determineUserActions16(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.consents.forEach((t=>{2===t.status&&"pepconsent"!==t.tagCode&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}updateUserConsents(){const t="gmcore"===this.gmVersion?new URL(`${this.endpoint}/v1/player/${this.userId}/consent`):new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);let e={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-SessionId":`${this.userSession}`},body:JSON.stringify({consents:this.userActions})};fetch(t.href,e).then((t=>t.json())).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:"Consent update successful!"}},window.location.href)})).catch((t=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Server might not be responding",err:t}},window.location.href)})).finally((()=>{window.postMessage({type:"UserActionsCompleted"},window.location.href)}))}handleApplyClick(){this.queryFired=!0}async componentWillLoad(){"gmcore"===this.gmVersion&&this.determineUserActionsCore(),"gm16"===this.gmVersion&&this.determineUserActions16(),this.translationUrl.length>2&&await h(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?c(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}calcMandatoryActions(){this.mandatoryItems=0,this.mandatoryActions.map((t=>{this.activeUserActions.includes(t)&&this.mandatoryItems++}))}render(){return this.mandatoryItems>0?(this.userActionsValidated=this.mandatoryActionsChecked===this.mandatoryItems,i("div",{class:"QueryReferenceContainer",ref:t=>this.stylingContainer=t},this.isLoading?i("slot",{name:"spinner"})&&i("svg",{class:"spinner",viewBox:"0 0 50 50"},i("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})):i("div",{class:"UserActionController"},i("h2",{class:"UserConsentNotice"},m("userNoticeText",this.lang)),i("div",{class:"PlayerLegislationWrapper"},this.activeUserActions.map((t=>i("slot",{name:t},i("player-user-consents",{lang:this.lang,"gm-version":this.gmVersion,"translation-url":this.translationUrl,consentType:t,consentTitle:this.consentTitles[t],queried:this.queryFired,mandatory:this.mandatoryActions.includes(t),"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"client-styling":this.clientStyling}))))),this.includeSubmitButton&&i("button",{class:"ConsentSubmitButton",disabled:!this.userActionsValidated,onClick:()=>this.handleApplyClick()},m("submitButtonText",this.lang))))):void 0}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],receivedQueryResponses:["handleQueryResponse"]}}};p.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.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, #D0046C));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 player_user_consents,p as user_action_controller}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|