@everymatrix/bonus-elevate-levels 1.94.23 → 1.94.25

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.
@@ -1 +1 @@
1
- import{p as e,b as l}from"./index-422aaa76.js";export{s as setNonce}from"./index-422aaa76.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const l=import.meta.url,t={};return""!==l&&(t.resourcesUrl=new URL(".",l).href),e(t)})().then((async e=>(await t(),l([["bonus-elevate-levels_5",[[1,"bonus-elevate-levels",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],endpoint:[513],language:[513],translationUrl:[513,"translation-url"],selectedLevelId:[1537,"selected-level-id"],showDefault:[4,"show-default"],elevateLevelParamProxy:[32],elevateLevels:[32],currentLevel:[32],errorMessage:[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{levels:[16],language:[1],selectedLevelId:[1537,"selected-level-id"],showSliderButton:[32],touchPosStart:[32],touchPosEnd:[32],offset:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{selectedLevelId:["levelsChangedHandler"]}],[0,"elevate-level-presentation",{elevateLevel:[16]}],[0,"elevate-levels-data",{scopeParams:[1544,"scope-params"]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[1,"translation-url"],targetTranslations:[16]},null,{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
1
+ import{p as e,b as l}from"./index-422aaa76.js";export{s as setNonce}from"./index-422aaa76.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const l=import.meta.url,t={};return""!==l&&(t.resourcesUrl=new URL(".",l).href),e(t)})().then((async e=>(await t(),l([["bonus-elevate-levels_5",[[1,"bonus-elevate-levels",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],endpoint:[513],language:[513],translationUrl:[513,"translation-url"],selectedLevelId:[1537,"selected-level-id"],showDefault:[4,"show-default"],elevateLevelParamProxy:[32],elevateLevels:[32],currentLevel:[32],errorMessage:[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}],[0,"elevate-level-list",{levels:[16],language:[1],selectedLevelId:[1537,"selected-level-id"],showSliderButton:[32],touchPosStart:[32],touchPosEnd:[32],offset:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{selectedLevelId:["levelsChangedHandler"]}],[0,"elevate-level-presentation",{elevateLevel:[16]}],[0,"elevate-levels-data",{scopeParams:[1544,"scope-params"]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[1,"translation-url"],targetTranslations:[16]},null,{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
@@ -1 +1 @@
1
- import{r as e,h as t,c as i,H as s,g as l}from"./index-422aaa76.js";const n=["ro","en","fr","hr","tr"],o={en:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},fr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},hr:{level:"Razina",seeAll:"Vidi sve",privilegesFor:"Privilegije za",termsAndConditions:"Uvjeti i odredbe",noLevelsSet:"There is no level set",points:"Points"},ro:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},tr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"}},a=(e,t)=>{const i=t;return o[void 0!==i&&(n.includes(i)||o[i])?i:"en"][e]},r=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.translationUrl="",this.selectedLevelId=void 0,this.showDefault=void 0,this.elevateLevelParamProxy=void 0,this.elevateLevels=[],this.currentLevel=void 0,this.errorMessage=void 0}selectedLevelChangedHandler(e){e.detail&&(this.currentLevel=Object.assign({},e.detail.level))}selectedLevelIdChangedHandler(){if(this.selectedLevelId&&this.elevateLevels){const e=this.elevateLevels.filter((e=>e.id==this.selectedLevelId))[0];this.currentLevel=Object.assign({},e)}}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language:this.language})}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.currentLevel&&(this.currentLevel=Object.assign({},e.detail.currentLevel)),e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=a("loadElevateLevelErrorMessage",this.language)))}onTCClick(){window.postMessage({type:"termAndConditionClicked"},window.location.href)}componentWillLoad(){this.elevateLevelParamProxy={endpoint:this.endpoint,language:this.language,selectedLevelId:this.selectedLevelId,showDefault:this.showDefault}}render(){var e;return t("div",{key:"6bc46c87633a9a295108e50886096f67dd35d44a",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"902d2796991a8acf293761255ab10f2cee54a92e",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"7e47a25dce1d0fba40e3e432dd9c805aa5bbe308",class:"LevelContent"},(null===(e=this.elevateLevels)||void 0===e?void 0:e.length)?t("elevate-level-list",{language:this.language,selectedLevelId:this.selectedLevelId,levels:this.elevateLevels}):a("noLevelsSet",this.language),this.currentLevel&&t("elevate-level-presentation",{key:"dcfad9aa4422545fa74a7b8b957eb72001506046",elevateLevel:this.currentLevel})),this.errorMessage&&t("div",{key:"7e2741168e50a1ee2adebe39c2c3433b5c9bf7ca"},this.errorMessage),t("general-styling-wrapper",{key:"74cae021838f61964a519c2f200cfbb1f8470778",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:o,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};var h;r.style=":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}",function(e){e[e.slideToRight=1]="slideToRight",e[e.slideToLeft=-1]="slideToLeft"}(h||(h={}));const d=class{constructor(t){var s;e(this,t),this.selectedLevelChanged=i(this,"selectedLevelChanged",7),this.minOffset=0,this.isMobile=!!((s=window.navigator.userAgent).toLowerCase().match(/android/i)||s.toLowerCase().match(/blackberry|bb/i)||s.toLowerCase().match(/iphone|ipad|ipod/i)||s.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.levels=void 0,this.language=void 0,this.selectedLevelId=void 0,this.showSliderButton=!1,this.touchPosStart=void 0,this.touchPosEnd=void 0,this.offset=0}onLevelClicked(e){this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=e.id}levelsChangedHandler(){this.initOffsetOfLevelItems()}initOffsetOfLevelItems(){if(!this.levels||0==this.levels.length||!this.selectedLevelId)return;const e=this.levels.findIndex((e=>this.selectedLevelId==e.id));if(this.onLevelClicked(this.levels[-1==e?0:e]),this.levels.length<=this.moveCountForOneTouch)return;let t=Math.floor((-1==e?1:e+1)/this.moveCountForOneTouch)*this.moveCountForOneTouch*this.childElementWidth*-1;this.offset=t<=this.minOffset?this.minOffset:t>=0?0:t}onTouchStart(e){this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}}onTouchMove(e){this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY};const t=this.touchPosEnd.clientX-this.touchPosStart.clientX,i=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(t)>Math.abs(i)&&this.slideTo(t>0?h.slideToRight:h.slideToLeft)}slideTo(e){let t=this.levelsElement.offsetLeft+this.childElementWidth*this.moveCountForOneTouch*e;if(t%this.childElementWidth!=0){const i=Math.floor(t/this.childElementWidth)*this.childElementWidth,s=Math.ceil(t/this.childElementWidth)*this.childElementWidth;t=e==h.slideToRight?i:s}this.offset=t<this.minOffset?this.minOffset:t>=0?0:t}initLevelSlider(){var e;if(!(null===(e=this.levelsElement)||void 0===e?void 0:e.firstElementChild))return void console.log("Widget[elevate-level-list] DOM is not ready.");this.showSliderButton=!this.isMobile&&this.levelsElement.clientWidth>this.levelsElement.parentElement.clientWidth,this.minOffset=this.levelsElement.parentElement.clientWidth-this.levelsElement.clientWidth,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,this.moveCountForOneTouch=Math.ceil(this.levelsElement.parentElement.clientWidth/this.childElementWidth)-1;const t=this.levelsElement.childElementCount;this.childElementWidth+=(this.levelsElement.clientWidth-this.childElementWidth*t)/(t-1)}debounce(e,t){{let i;return()=>{clearTimeout(i),i=setTimeout((()=>{e()}),t)}}}convertNumberToCompactForm(e){return e>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"b":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"m":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":e.toString()}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){return t(s,{key:"c2eb983ff3df4868204eec8e527efa08c9e5afa0"},this.levels&&[t("div",{key:"9f6563c030a7725761b9a73cffb8e2d8d8f47c32",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"9e3d3422bd2171d26821c1f74e3ab7418b97643d",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"ac0002e40e037edd0c0893c9250f36e18e451f16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"242903f38deb464844d722e0e7fe90665de99d6a",class:"LevelItemsWrapper"},t("div",{key:"739328ff99ecd777b9e2ff6914034a5bbc7eac90",style:{left:`${this.offset}px`},class:"LevelItems "+(this.isMobile?"Mobile":""),id:"levelItems",ref:e=>{this.levelsElement=e}},this.levels.map(((e,i)=>t("div",{class:"Item "+(this.selectedLevelId==e.id?"Active":""),onClick:this.onLevelClicked.bind(this,e)},t("img",{alt:`Presentation Icon for ${e.presentation.displayName}`,class:"LevelImg",src:e.presentation.asset}),t("span",{class:"LevelName",title:e.presentation.displayName},e.presentation.displayName),t("span",{class:"LevelPoints"},0==i?"":">",this.convertNumberToCompactForm(e.firstEntryPoints)," ",a("points",this.language))))))),t("div",{key:"2366c09b46bfec309bd4f8d5991d457f04dbf038",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"c52ef4f99444d1185e9b8ce4287f0f2886c622ae",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"acc266646133bb636b52f8776380e6aedc93f937","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return l(this)}static get watchers(){return{selectedLevelId:["levelsChangedHandler"]}}};d.style="elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";const c=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(s,{key:"16d128717e716f7ca7d3bb77fc3a2e67209318b6"},t("div",{key:"658657abdfc64844bd2af40562efe40385e1735a",class:"Row Desc"},t("h3",{key:"ec5871c2f810c8c120bf99510717381175bc1ef4"},this.elevateLevel.presentation.displayName),t("p",{key:"865915c6eea90295238fb47eaa91c8f968199ca5"},t("span",{key:"2b90c6c5d6957b73fc4a0f53d53da0ca023a4f0a",class:"TxtDesc",innerHTML:this.elevateLevel.presentation.description}))))}};c.style=":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";var v,f,p,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b={exports:{}};v=b,f=b.exports,p=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==g)return g;throw new Error("unable to locate global object")}(),v.exports=f=p.fetch,p.fetch&&(f.default=p.fetch.bind(p)),f.Headers=p.Headers,f.Request=p.Request,f.Response=p.Response;const u=b.exports,w=class{constructor(t){e(this,t),this.elevateLevelsDataChange=i(this,"elevateLevelsDataChange",7),this.scopeParams=void 0}async componentWillRender(){if(!this.scopeParams.endpoint)return;let e=new URL(`${this.scopeParams.endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);await u(e.href).then((e=>e.json())).then((e=>{const t=e.data.sort(((e,t)=>e.firstEntryPoints<t.firstEntryPoints?-1:1));let i=this.scopeParams.selectedLevelId;if(!i&&this.scopeParams.showDefault&&t.length>0&&(i=t[0].id),i){const e=t.filter((e=>e.id==i))[0];this.elevateLevelsDataChange.emit({currentLevel:e})}this.elevateLevelsDataChange.emit({clearError:!0}),this.elevateLevelsDataChange.emit({elevateLevels:t})})).catch((e=>{this.elevateLevelsDataChange.emit({errorMessage:{type:"errorWhenLoadElevateLevels",err:e}}),console.error(e)}))}};w.style=":host{display:block}";const m="__WIDGET_GLOBAL_STYLE_CACHE__";function y(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function L(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function C(e,t,i,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return i=function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t),i;window[m]||(window[m]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const s=e.getRootNode(),l=window[m];let n=l[t]&&l[t].sheet;n?l[t].refCount=l[t].refCount+1:(n=new CSSStyleSheet,n.replaceSync(i),l[t]={sheet:n,refCount:1});const o=s.adoptedStyleSheets||[];o.includes(n)||(s.adoptedStyleSheets=[...o,n])}))}(e,t);const l=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[m][t]){const e=window[m][t];e.refCount>1?e.refCount=e.refCount-1:delete window[m][t]}l()},i}const x=class{constructor(t){e(this,t),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(this.mbSource&&C(this.el,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&y(this.el,this.clientStyling),this.clientStylingUrl&&L(this.el,this.clientStylingUrl),this.stylingAppends=!0)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleMbSourceChange(e,t){e!=t&&C(this.el,`${this.mbSource}.Style`,this.stylingSubscription)}handleClientStylingChange(e,t){e!=t&&y(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&L(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&y(this.el,this.clientStyling),this.clientStylingUrl&&L(this.el,this.clientStylingUrl),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const s=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]||{},Object.keys(t[e]).forEach((s=>{if(!i.en[s])return;const l=i.en[s];"object"==typeof t[e][s]?(i[e][s]=i[e][s]||Object.assign({},l),Object.keys(t[e][s]).forEach((l=>{i[e][s][l]=t[e][s][l]}))):i[e][s]=t[e][s]||Object.assign({},l)}))})),e(!0)})).catch((t=>{console.error("Failed to load translations:",t),e(!1)}))})));e.push(s)}var t,i;return await Promise.all(e)}render(){return t("div",{key:"e660ceb69f5e848c788c3924fc814c0fa7a777a2",class:"StyleShell"},t("slot",{key:"35014b6c0c32532af11e6a629ba9b13942504d21",name:"mainContent"}))}get el(){return l(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};x.style=":host{display:block}";export{r as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,w as elevate_levels_data,x as general_styling_wrapper}
1
+ import{r as e,h as t,c as i,H as s,g as l}from"./index-422aaa76.js";const n={en:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},fr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},hr:{level:"Razina",seeAll:"Vidi sve",privilegesFor:"Privilegije za",termsAndConditions:"Uvjeti i odredbe",noLevelsSet:"There is no level set",points:"Points"},ro:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},tr:{level:"seviye",seeAll:"Tümünü Gör",termsAndConditions:"Şartlar ve Koşullar",loadElevateLevelErrorMessage:"Seviyeler yüklenirken hata oluştu",noLevelsSet:"Tanımlı seviye bulunmuyor",points:"Puanlar"}},o=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{n[t]||(n[t]={});for(let i in e[t])n[t][i]=e[t][i]})),t(!0)})).catch((e=>{console.error("Failed to load translations:",e),t(!1)}))})),a=(e,t,i)=>{let s=n[void 0!==t&&t in n?t:"en"][e]||e;if(null==i?void 0:i.values)for(const[e,t]of Object.entries(i.values)){const i=new RegExp(`{${e}}`,"g");s=s.replace(i,t)}return s},r=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.translationUrl="",this.selectedLevelId=void 0,this.showDefault=void 0,this.elevateLevelParamProxy=void 0,this.elevateLevels=[],this.currentLevel=void 0,this.errorMessage=void 0}selectedLevelChangedHandler(e){e.detail&&(this.currentLevel=Object.assign({},e.detail.level))}selectedLevelIdChangedHandler(){if(this.selectedLevelId&&this.elevateLevels){const e=this.elevateLevels.filter((e=>e.id==this.selectedLevelId))[0];this.currentLevel=Object.assign({},e)}}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language:this.language})}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.currentLevel&&(this.currentLevel=Object.assign({},e.detail.currentLevel)),e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=a("loadElevateLevelErrorMessage",this.language)))}onTCClick(){window.postMessage({type:"termAndConditionClicked"},window.location.href)}handleNewTranslations(){o(this.translationUrl)}async componentWillLoad(){this.elevateLevelParamProxy={endpoint:this.endpoint,language:this.language,selectedLevelId:this.selectedLevelId,showDefault:this.showDefault},this.translationUrl&&await o(this.translationUrl)}render(){var e;return t("div",{key:"c506affafae3a59eb45b22d0a73d0f3e070767a4",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"90159b78c27186afbda74016cce2172fa051430d",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"02518d5c73df9144f274891778d10c4df04bff92",class:"LevelContent"},(null===(e=this.elevateLevels)||void 0===e?void 0:e.length)?t("elevate-level-list",{language:this.language,selectedLevelId:this.selectedLevelId,levels:this.elevateLevels}):a("noLevelsSet",this.language),this.currentLevel&&t("elevate-level-presentation",{key:"3c25372f312b38a780ad1d5823a3872d3a9de929",elevateLevel:this.currentLevel})),this.errorMessage&&t("div",{key:"00ee0bdab9f324a309a925f3d1465eceffae502d"},this.errorMessage),t("general-styling-wrapper",{key:"e9e36fd78d644bb2035256ff06a4118d776b1778",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:n,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}}};var h;r.style=":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}",function(e){e[e.slideToRight=1]="slideToRight",e[e.slideToLeft=-1]="slideToLeft"}(h||(h={}));const d=class{constructor(t){var s;e(this,t),this.selectedLevelChanged=i(this,"selectedLevelChanged",7),this.minOffset=0,this.isMobile=!!((s=window.navigator.userAgent).toLowerCase().match(/android/i)||s.toLowerCase().match(/blackberry|bb/i)||s.toLowerCase().match(/iphone|ipad|ipod/i)||s.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.levels=void 0,this.language=void 0,this.selectedLevelId=void 0,this.showSliderButton=!1,this.touchPosStart=void 0,this.touchPosEnd=void 0,this.offset=0}onLevelClicked(e){this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=e.id}levelsChangedHandler(){this.initOffsetOfLevelItems()}initOffsetOfLevelItems(){if(!this.levels||0==this.levels.length||!this.selectedLevelId)return;const e=this.levels.findIndex((e=>this.selectedLevelId==e.id));if(this.onLevelClicked(this.levels[-1==e?0:e]),this.levels.length<=this.moveCountForOneTouch)return;let t=Math.floor((-1==e?1:e+1)/this.moveCountForOneTouch)*this.moveCountForOneTouch*this.childElementWidth*-1;this.offset=t<=this.minOffset?this.minOffset:t>=0?0:t}onTouchStart(e){this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}}onTouchMove(e){this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY};const t=this.touchPosEnd.clientX-this.touchPosStart.clientX,i=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(t)>Math.abs(i)&&this.slideTo(t>0?h.slideToRight:h.slideToLeft)}slideTo(e){let t=this.levelsElement.offsetLeft+this.childElementWidth*this.moveCountForOneTouch*e;if(t%this.childElementWidth!=0){const i=Math.floor(t/this.childElementWidth)*this.childElementWidth,s=Math.ceil(t/this.childElementWidth)*this.childElementWidth;t=e==h.slideToRight?i:s}this.offset=t<this.minOffset?this.minOffset:t>=0?0:t}initLevelSlider(){var e;if(!(null===(e=this.levelsElement)||void 0===e?void 0:e.firstElementChild))return void console.log("Widget[elevate-level-list] DOM is not ready.");this.showSliderButton=!this.isMobile&&this.levelsElement.clientWidth>this.levelsElement.parentElement.clientWidth,this.minOffset=this.levelsElement.parentElement.clientWidth-this.levelsElement.clientWidth,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,this.moveCountForOneTouch=Math.ceil(this.levelsElement.parentElement.clientWidth/this.childElementWidth)-1;const t=this.levelsElement.childElementCount;this.childElementWidth+=(this.levelsElement.clientWidth-this.childElementWidth*t)/(t-1)}debounce(e,t){{let i;return()=>{clearTimeout(i),i=setTimeout((()=>{e()}),t)}}}convertNumberToCompactForm(e){return e>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"b":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"m":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":e.toString()}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){return t(s,{key:"c2eb983ff3df4868204eec8e527efa08c9e5afa0"},this.levels&&[t("div",{key:"9f6563c030a7725761b9a73cffb8e2d8d8f47c32",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"9e3d3422bd2171d26821c1f74e3ab7418b97643d",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"ac0002e40e037edd0c0893c9250f36e18e451f16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"242903f38deb464844d722e0e7fe90665de99d6a",class:"LevelItemsWrapper"},t("div",{key:"739328ff99ecd777b9e2ff6914034a5bbc7eac90",style:{left:`${this.offset}px`},class:"LevelItems "+(this.isMobile?"Mobile":""),id:"levelItems",ref:e=>{this.levelsElement=e}},this.levels.map(((e,i)=>t("div",{class:"Item "+(this.selectedLevelId==e.id?"Active":""),onClick:this.onLevelClicked.bind(this,e)},t("img",{alt:`Presentation Icon for ${e.presentation.displayName}`,class:"LevelImg",src:e.presentation.asset}),t("span",{class:"LevelName",title:e.presentation.displayName},e.presentation.displayName),t("span",{class:"LevelPoints"},0==i?"":">",this.convertNumberToCompactForm(e.firstEntryPoints)," ",a("points",this.language))))))),t("div",{key:"2366c09b46bfec309bd4f8d5991d457f04dbf038",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"c52ef4f99444d1185e9b8ce4287f0f2886c622ae",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"acc266646133bb636b52f8776380e6aedc93f937","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return l(this)}static get watchers(){return{selectedLevelId:["levelsChangedHandler"]}}};d.style="elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";const c=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(s,{key:"16d128717e716f7ca7d3bb77fc3a2e67209318b6"},t("div",{key:"658657abdfc64844bd2af40562efe40385e1735a",class:"Row Desc"},t("h3",{key:"ec5871c2f810c8c120bf99510717381175bc1ef4"},this.elevateLevel.presentation.displayName),t("p",{key:"865915c6eea90295238fb47eaa91c8f968199ca5"},t("span",{key:"2b90c6c5d6957b73fc4a0f53d53da0ca023a4f0a",class:"TxtDesc",innerHTML:this.elevateLevel.presentation.description}))))}};c.style=":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";var v,f,p,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},u={exports:{}};v=u,f=u.exports,p=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==g)return g;throw new Error("unable to locate global object")}(),v.exports=f=p.fetch,p.fetch&&(f.default=p.fetch.bind(p)),f.Headers=p.Headers,f.Request=p.Request,f.Response=p.Response;const b=u.exports,w=class{constructor(t){e(this,t),this.elevateLevelsDataChange=i(this,"elevateLevelsDataChange",7),this.scopeParams=void 0}async componentWillRender(){if(!this.scopeParams.endpoint)return;let e=new URL(`${this.scopeParams.endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);await b(e.href).then((e=>e.json())).then((e=>{const t=e.data.sort(((e,t)=>e.firstEntryPoints<t.firstEntryPoints?-1:1));let i=this.scopeParams.selectedLevelId;if(!i&&this.scopeParams.showDefault&&t.length>0&&(i=t[0].id),i){const e=t.filter((e=>e.id==i))[0];this.elevateLevelsDataChange.emit({currentLevel:e})}this.elevateLevelsDataChange.emit({clearError:!0}),this.elevateLevelsDataChange.emit({elevateLevels:t})})).catch((e=>{this.elevateLevelsDataChange.emit({errorMessage:{type:"errorWhenLoadElevateLevels",err:e}}),console.error(e)}))}};w.style=":host{display:block}";const m="__WIDGET_GLOBAL_STYLE_CACHE__";function y(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function L(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function x(e,t,i,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return i=function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t),i;window[m]||(window[m]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const s=e.getRootNode(),l=window[m];let n=l[t]&&l[t].sheet;n?l[t].refCount=l[t].refCount+1:(n=new CSSStyleSheet,n.replaceSync(i),l[t]={sheet:n,refCount:1});const o=s.adoptedStyleSheets||[];o.includes(n)||(s.adoptedStyleSheets=[...o,n])}))}(e,t);const l=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[m][t]){const e=window[m][t];e.refCount>1?e.refCount=e.refCount-1:delete window[m][t]}l()},i}const C=class{constructor(t){e(this,t),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(this.mbSource&&x(this.el,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&y(this.el,this.clientStyling),this.clientStylingUrl&&L(this.el,this.clientStylingUrl),this.stylingAppends=!0)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleMbSourceChange(e,t){e!=t&&x(this.el,`${this.mbSource}.Style`,this.stylingSubscription)}handleClientStylingChange(e,t){e!=t&&y(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&L(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&y(this.el,this.clientStyling),this.clientStylingUrl&&L(this.el,this.clientStylingUrl),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const s=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]||{},Object.keys(t[e]).forEach((s=>{if(!i.en[s])return;const l=i.en[s];"object"==typeof t[e][s]?(i[e][s]=i[e][s]||Object.assign({},l),Object.keys(t[e][s]).forEach((l=>{i[e][s][l]=t[e][s][l]}))):i[e][s]=t[e][s]||Object.assign({},l)}))})),e(!0)})).catch((t=>{console.error("Failed to load translations:",t),e(!1)}))})));e.push(s)}var t,i;return await Promise.all(e)}render(){return t("div",{key:"e660ceb69f5e848c788c3924fc814c0fa7a777a2",class:"StyleShell"},t("slot",{key:"35014b6c0c32532af11e6a629ba9b13942504d21",name:"mainContent"}))}get el(){return l(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};C.style=":host{display:block}";export{r as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,w as elevate_levels_data,C as general_styling_wrapper}
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["bonus-elevate-levels_5.cjs",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
22
+ return index.bootstrapLazy([["bonus-elevate-levels_5.cjs",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-129a8e19.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr', 'tr'];
9
8
  const TRANSLATIONS = {
10
9
  en: {
11
10
  level: 'level',
@@ -40,17 +39,45 @@ const TRANSLATIONS = {
40
39
  points: 'Points',
41
40
  },
42
41
  tr: {
43
- level: 'level',
44
- seeAll: 'See All',
45
- termsAndConditions: 'Terms & Conditions',
46
- loadElevateLevelErrorMessage: 'Error when load elevate levels',
47
- noLevelsSet: 'There is no level set',
48
- points: 'Points',
42
+ level: "seviye",
43
+ seeAll: "Tümünü Gör",
44
+ termsAndConditions: "Şartlar ve Koşullar",
45
+ loadElevateLevelErrorMessage: "Seviyeler yüklenirken hata oluştu",
46
+ noLevelsSet: "Tanımlı seviye bulunmuyor",
47
+ points: "Puanlar"
49
48
  }
50
49
  };
51
- const translate = (key, customLang) => {
50
+ const getTranslations = (url) => {
51
+ return new Promise((resolve) => {
52
+ fetch(url)
53
+ .then((res) => res.json())
54
+ .then((data) => {
55
+ Object.keys(data).forEach((lang) => {
56
+ if (!TRANSLATIONS[lang]) {
57
+ TRANSLATIONS[lang] = {};
58
+ }
59
+ for (let key in data[lang]) {
60
+ TRANSLATIONS[lang][key] = data[lang][key];
61
+ }
62
+ });
63
+ resolve(true);
64
+ })
65
+ .catch((error) => {
66
+ console.error('Failed to load translations:', error);
67
+ resolve(false);
68
+ });
69
+ });
70
+ };
71
+ const translate = (key, customLang, values) => {
52
72
  const lang = customLang;
53
- return TRANSLATIONS[lang !== undefined && (SUPPORTED_LANGUAGES.includes(lang) || TRANSLATIONS[lang]) ? lang : DEFAULT_LANGUAGE][key];
73
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key] || key;
74
+ if (values === null || values === void 0 ? void 0 : values.values) {
75
+ for (const [key, value] of Object.entries(values.values)) {
76
+ const regex = new RegExp(`{${key}}`, 'g');
77
+ translation = translation.replace(regex, value);
78
+ }
79
+ }
80
+ return translation;
54
81
  };
55
82
 
56
83
  const bonusElevateLevelsCss = ":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}";
@@ -110,23 +137,30 @@ const BonusElevateLevels = class {
110
137
  onTCClick() {
111
138
  window.postMessage({ type: 'termAndConditionClicked' }, window.location.href);
112
139
  }
113
- componentWillLoad() {
140
+ handleNewTranslations() {
141
+ getTranslations(this.translationUrl);
142
+ }
143
+ async componentWillLoad() {
114
144
  this.elevateLevelParamProxy = {
115
145
  endpoint: this.endpoint, language: this.language, selectedLevelId: this.selectedLevelId,
116
146
  showDefault: this.showDefault
117
147
  };
148
+ if (this.translationUrl) {
149
+ await getTranslations(this.translationUrl);
150
+ }
118
151
  }
119
152
  render() {
120
153
  var _a;
121
- return (index.h("div", { key: '6bc46c87633a9a295108e50886096f67dd35d44a', class: "ElevateLevelContent" }, index.h("elevate-levels-data", { key: '902d2796991a8acf293761255ab10f2cee54a92e', scopeParams: this.elevateLevelParamProxy }), index.h("div", { key: '7e47a25dce1d0fba40e3e432dd9c805aa5bbe308', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
154
+ return (index.h("div", { key: 'c506affafae3a59eb45b22d0a73d0f3e070767a4', class: "ElevateLevelContent" }, index.h("elevate-levels-data", { key: '90159b78c27186afbda74016cce2172fa051430d', scopeParams: this.elevateLevelParamProxy }), index.h("div", { key: '02518d5c73df9144f274891778d10c4df04bff92', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
122
155
  index.h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
123
- index.h("elevate-level-presentation", { key: 'dcfad9aa4422545fa74a7b8b957eb72001506046', elevateLevel: this.currentLevel })), this.errorMessage && index.h("div", { key: '7e2741168e50a1ee2adebe39c2c3433b5c9bf7ca' }, this.errorMessage), index.h("general-styling-wrapper", { key: '74cae021838f61964a519c2f200cfbb1f8470778', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
156
+ index.h("elevate-level-presentation", { key: '3c25372f312b38a780ad1d5823a3872d3a9de929', elevateLevel: this.currentLevel })), this.errorMessage && index.h("div", { key: '00ee0bdab9f324a309a925f3d1465eceffae502d' }, this.errorMessage), index.h("general-styling-wrapper", { key: 'e9e36fd78d644bb2035256ff06a4118d776b1778', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
124
157
  }
125
158
  static get watchers() { return {
126
159
  "selectedLevelId": ["selectedLevelIdChangedHandler"],
127
160
  "elevateLevels": ["selectedLevelIdChangedHandler"],
128
161
  "endpoint": ["onSessionOrEndpointChange"],
129
- "language": ["onSessionOrEndpointChange"]
162
+ "language": ["onSessionOrEndpointChange"],
163
+ "translationUrl": ["handleNewTranslations"]
130
164
  }; }
131
165
  };
132
166
  BonusElevateLevels.style = BonusElevateLevelsStyle0;
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["bonus-elevate-levels_5.cjs",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
11
+ return index.bootstrapLazy([["bonus-elevate-levels_5.cjs",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- import { translate, TRANSLATIONS } from "../../utils/locale.utils";
2
+ import { getTranslations, translate, TRANSLATIONS } from "../../utils/locale.utils";
3
3
  export class BonusElevateLevels {
4
4
  constructor() {
5
5
  this.clientStyling = '';
@@ -53,17 +53,23 @@ export class BonusElevateLevels {
53
53
  onTCClick() {
54
54
  window.postMessage({ type: 'termAndConditionClicked' }, window.location.href);
55
55
  }
56
- componentWillLoad() {
56
+ handleNewTranslations() {
57
+ getTranslations(this.translationUrl);
58
+ }
59
+ async componentWillLoad() {
57
60
  this.elevateLevelParamProxy = {
58
61
  endpoint: this.endpoint, language: this.language, selectedLevelId: this.selectedLevelId,
59
62
  showDefault: this.showDefault
60
63
  };
64
+ if (this.translationUrl) {
65
+ await getTranslations(this.translationUrl);
66
+ }
61
67
  }
62
68
  render() {
63
69
  var _a;
64
- return (h("div", { key: '6bc46c87633a9a295108e50886096f67dd35d44a', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: '902d2796991a8acf293761255ab10f2cee54a92e', scopeParams: this.elevateLevelParamProxy }), h("div", { key: '7e47a25dce1d0fba40e3e432dd9c805aa5bbe308', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
70
+ return (h("div", { key: 'c506affafae3a59eb45b22d0a73d0f3e070767a4', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: '90159b78c27186afbda74016cce2172fa051430d', scopeParams: this.elevateLevelParamProxy }), h("div", { key: '02518d5c73df9144f274891778d10c4df04bff92', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
65
71
  h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
66
- h("elevate-level-presentation", { key: 'dcfad9aa4422545fa74a7b8b957eb72001506046', elevateLevel: this.currentLevel })), this.errorMessage && h("div", { key: '7e2741168e50a1ee2adebe39c2c3433b5c9bf7ca' }, this.errorMessage), h("general-styling-wrapper", { key: '74cae021838f61964a519c2f200cfbb1f8470778', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
72
+ h("elevate-level-presentation", { key: '3c25372f312b38a780ad1d5823a3872d3a9de929', elevateLevel: this.currentLevel })), this.errorMessage && h("div", { key: '00ee0bdab9f324a309a925f3d1465eceffae502d' }, this.errorMessage), h("general-styling-wrapper", { key: 'e9e36fd78d644bb2035256ff06a4118d776b1778', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
67
73
  }
68
74
  static get is() { return "bonus-elevate-levels"; }
69
75
  static get encapsulation() { return "shadow"; }
@@ -242,6 +248,9 @@ export class BonusElevateLevels {
242
248
  }, {
243
249
  "propName": "language",
244
250
  "methodName": "onSessionOrEndpointChange"
251
+ }, {
252
+ "propName": "translationUrl",
253
+ "methodName": "handleNewTranslations"
245
254
  }];
246
255
  }
247
256
  static get listeners() {
@@ -1,5 +1,4 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr', 'tr'];
3
2
  export const TRANSLATIONS = {
4
3
  en: {
5
4
  level: 'level',
@@ -34,15 +33,43 @@ export const TRANSLATIONS = {
34
33
  points: 'Points',
35
34
  },
36
35
  tr: {
37
- level: 'level',
38
- seeAll: 'See All',
39
- termsAndConditions: 'Terms & Conditions',
40
- loadElevateLevelErrorMessage: 'Error when load elevate levels',
41
- noLevelsSet: 'There is no level set',
42
- points: 'Points',
36
+ level: "seviye",
37
+ seeAll: "Tümünü Gör",
38
+ termsAndConditions: "Şartlar ve Koşullar",
39
+ loadElevateLevelErrorMessage: "Seviyeler yüklenirken hata oluştu",
40
+ noLevelsSet: "Tanımlı seviye bulunmuyor",
41
+ points: "Puanlar"
43
42
  }
44
43
  };
45
- export const translate = (key, customLang) => {
44
+ export const getTranslations = (url) => {
45
+ return new Promise((resolve) => {
46
+ fetch(url)
47
+ .then((res) => res.json())
48
+ .then((data) => {
49
+ Object.keys(data).forEach((lang) => {
50
+ if (!TRANSLATIONS[lang]) {
51
+ TRANSLATIONS[lang] = {};
52
+ }
53
+ for (let key in data[lang]) {
54
+ TRANSLATIONS[lang][key] = data[lang][key];
55
+ }
56
+ });
57
+ resolve(true);
58
+ })
59
+ .catch((error) => {
60
+ console.error('Failed to load translations:', error);
61
+ resolve(false);
62
+ });
63
+ });
64
+ };
65
+ export const translate = (key, customLang, values) => {
46
66
  const lang = customLang;
47
- return TRANSLATIONS[lang !== undefined && (SUPPORTED_LANGUAGES.includes(lang) || TRANSLATIONS[lang]) ? lang : DEFAULT_LANGUAGE][key];
67
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key] || key;
68
+ if (values === null || values === void 0 ? void 0 : values.values) {
69
+ for (const [key, value] of Object.entries(values.values)) {
70
+ const regex = new RegExp(`{${key}}`, 'g');
71
+ translation = translation.replace(regex, value);
72
+ }
73
+ }
74
+ return translation;
48
75
  };
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["bonus-elevate-levels_5",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
19
+ return bootstrapLazy([["bonus-elevate-levels_5",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
20
20
  });
@@ -1,7 +1,6 @@
1
1
  import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './index-422aaa76.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr', 'tr'];
5
4
  const TRANSLATIONS = {
6
5
  en: {
7
6
  level: 'level',
@@ -36,17 +35,45 @@ const TRANSLATIONS = {
36
35
  points: 'Points',
37
36
  },
38
37
  tr: {
39
- level: 'level',
40
- seeAll: 'See All',
41
- termsAndConditions: 'Terms & Conditions',
42
- loadElevateLevelErrorMessage: 'Error when load elevate levels',
43
- noLevelsSet: 'There is no level set',
44
- points: 'Points',
38
+ level: "seviye",
39
+ seeAll: "Tümünü Gör",
40
+ termsAndConditions: "Şartlar ve Koşullar",
41
+ loadElevateLevelErrorMessage: "Seviyeler yüklenirken hata oluştu",
42
+ noLevelsSet: "Tanımlı seviye bulunmuyor",
43
+ points: "Puanlar"
45
44
  }
46
45
  };
47
- const translate = (key, customLang) => {
46
+ const getTranslations = (url) => {
47
+ return new Promise((resolve) => {
48
+ fetch(url)
49
+ .then((res) => res.json())
50
+ .then((data) => {
51
+ Object.keys(data).forEach((lang) => {
52
+ if (!TRANSLATIONS[lang]) {
53
+ TRANSLATIONS[lang] = {};
54
+ }
55
+ for (let key in data[lang]) {
56
+ TRANSLATIONS[lang][key] = data[lang][key];
57
+ }
58
+ });
59
+ resolve(true);
60
+ })
61
+ .catch((error) => {
62
+ console.error('Failed to load translations:', error);
63
+ resolve(false);
64
+ });
65
+ });
66
+ };
67
+ const translate = (key, customLang, values) => {
48
68
  const lang = customLang;
49
- return TRANSLATIONS[lang !== undefined && (SUPPORTED_LANGUAGES.includes(lang) || TRANSLATIONS[lang]) ? lang : DEFAULT_LANGUAGE][key];
69
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key] || key;
70
+ if (values === null || values === void 0 ? void 0 : values.values) {
71
+ for (const [key, value] of Object.entries(values.values)) {
72
+ const regex = new RegExp(`{${key}}`, 'g');
73
+ translation = translation.replace(regex, value);
74
+ }
75
+ }
76
+ return translation;
50
77
  };
51
78
 
52
79
  const bonusElevateLevelsCss = ":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}";
@@ -106,23 +133,30 @@ const BonusElevateLevels = class {
106
133
  onTCClick() {
107
134
  window.postMessage({ type: 'termAndConditionClicked' }, window.location.href);
108
135
  }
109
- componentWillLoad() {
136
+ handleNewTranslations() {
137
+ getTranslations(this.translationUrl);
138
+ }
139
+ async componentWillLoad() {
110
140
  this.elevateLevelParamProxy = {
111
141
  endpoint: this.endpoint, language: this.language, selectedLevelId: this.selectedLevelId,
112
142
  showDefault: this.showDefault
113
143
  };
144
+ if (this.translationUrl) {
145
+ await getTranslations(this.translationUrl);
146
+ }
114
147
  }
115
148
  render() {
116
149
  var _a;
117
- return (h("div", { key: '6bc46c87633a9a295108e50886096f67dd35d44a', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: '902d2796991a8acf293761255ab10f2cee54a92e', scopeParams: this.elevateLevelParamProxy }), h("div", { key: '7e47a25dce1d0fba40e3e432dd9c805aa5bbe308', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
150
+ return (h("div", { key: 'c506affafae3a59eb45b22d0a73d0f3e070767a4', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: '90159b78c27186afbda74016cce2172fa051430d', scopeParams: this.elevateLevelParamProxy }), h("div", { key: '02518d5c73df9144f274891778d10c4df04bff92', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
118
151
  h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
119
- h("elevate-level-presentation", { key: 'dcfad9aa4422545fa74a7b8b957eb72001506046', elevateLevel: this.currentLevel })), this.errorMessage && h("div", { key: '7e2741168e50a1ee2adebe39c2c3433b5c9bf7ca' }, this.errorMessage), h("general-styling-wrapper", { key: '74cae021838f61964a519c2f200cfbb1f8470778', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
152
+ h("elevate-level-presentation", { key: '3c25372f312b38a780ad1d5823a3872d3a9de929', elevateLevel: this.currentLevel })), this.errorMessage && h("div", { key: '00ee0bdab9f324a309a925f3d1465eceffae502d' }, this.errorMessage), h("general-styling-wrapper", { key: 'e9e36fd78d644bb2035256ff06a4118d776b1778', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
120
153
  }
121
154
  static get watchers() { return {
122
155
  "selectedLevelId": ["selectedLevelIdChangedHandler"],
123
156
  "elevateLevels": ["selectedLevelIdChangedHandler"],
124
157
  "endpoint": ["onSessionOrEndpointChange"],
125
- "language": ["onSessionOrEndpointChange"]
158
+ "language": ["onSessionOrEndpointChange"],
159
+ "translationUrl": ["handleNewTranslations"]
126
160
  }; }
127
161
  };
128
162
  BonusElevateLevels.style = BonusElevateLevelsStyle0;
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["bonus-elevate-levels_5",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
8
+ return bootstrapLazy([["bonus-elevate-levels_5",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -46,6 +46,7 @@ export declare class BonusElevateLevels {
46
46
  onSessionOrEndpointChange(): void;
47
47
  elevateLevelsDataChangeHandler(event: CustomEvent): void;
48
48
  onTCClick(): void;
49
- componentWillLoad(): void;
49
+ handleNewTranslations(): void;
50
+ componentWillLoad(): Promise<void>;
50
51
  render(): any;
51
52
  }
@@ -6,5 +6,6 @@ interface Translations {
6
6
  [key: string]: Translation;
7
7
  }
8
8
  export declare const TRANSLATIONS: Translations;
9
- export declare const translate: (key: string, customLang?: any) => string;
9
+ export declare const getTranslations: (url: string) => Promise<unknown>;
10
+ export declare const translate: (key: string, customLang?: any, values?: any) => string;
10
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/bonus-elevate-levels",
3
- "version": "1.94.23",
3
+ "version": "1.94.25",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",