@everymatrix/bonus-elevate-levels 1.94.76 → 1.94.77
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/bonus-elevate-levels/bonus-elevate-levels.esm.js +1 -1
- package/dist/bonus-elevate-levels/bonus-elevate-levels_5.entry.js +1 -1
- package/dist/cjs/bonus-elevate-levels.cjs.js +1 -1
- package/dist/cjs/bonus-elevate-levels_5.cjs.entry.js +14 -13
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/bonus-elevate-levels/bonus-elevate-levels.js +3 -3
- package/dist/collection/components/elevate-level-list/elevate-level-list.js +12 -9
- package/dist/esm/bonus-elevate-levels.js +1 -1
- package/dist/esm/bonus-elevate-levels_5.entry.js +14 -13
- package/dist/esm/loader.js +1 -1
- package/dist/types/models/elevate-levels.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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 n}from"./app-globals-0f993ce5.js";(()=>{const l=import.meta.url,n={};return""!==l&&(n.resourcesUrl=new URL(".",l).href),e(n)})().then((async e=>(await n(),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"],[1,"touchend","onTouchEnd"],[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 n}from"./app-globals-0f993ce5.js";(()=>{const l=import.meta.url,n={};return""!==l&&(n.resourcesUrl=new URL(".",l).href),e(n)})().then((async e=>(await n(),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"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{selectedLevelId:["levelsChangedHandler"],levels:["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 n}from"./index-422aaa76.js";const l={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=>{l[t]||(l[t]={});for(let i in e[t])l[t][i]=e[t][i]})),t(!0)})).catch((e=>{console.error("Failed to load translations:",e),t(!1)}))})),r=(e,t,i)=>{let s=l[void 0!==t&&t in l?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},a=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=r("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}):r("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:l,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}}};var h;a.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}centerLevelItem(e){if(!this.isMobile||!this.levelsElement||e<0||!this.levelsElement.children[e])return;const t=this.levelsElement.parentElement;if(!t)return;const i=this.levelsElement.children[e],s=t.clientWidth,n=Math.min(0,s-this.levelsElement.scrollWidth);let l=s/2-(i.offsetLeft+i.offsetWidth/2);l=l<n?n:l>0?0:l,this.minOffset=n,this.offset=l}moveToLevelItem(e,t=!1){if(!this.levelsElement||e<0||!this.levelsElement.children[e])return;const i=this.levelsElement.parentElement;if(!i)return;const s=this.levelsElement.children[e],n=i.clientWidth,l=this.isMobile?this.getMobileContentWidth():this.levelsElement.clientWidth,o=Math.min(0,n-l);if(l<=n)return this.minOffset=0,void(this.offset=0);const r=s.offsetLeft,a=s.offsetWidth;let h;if(t)h=n/2-(r+a/2);else{const e=-this.offset,t=r+a;if(r>=e&&t<=e+n)return;h=r<e?-r:n-t}h=h<o?o:h>0?0:h,this.minOffset=o,this.offset=h}getMobileContentWidth(){return this.levelsElement?Array.from(this.levelsElement.children).reduce(((e,t)=>{const i=window.getComputedStyle(t),s=parseFloat(i.marginLeft)||0,n=parseFloat(i.marginRight)||0;return e+t.offsetWidth+s+n}),0):0}onLevelClicked(e){var t,i;if(this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=e.id,this.isMobile){const s=null!==(i=null===(t=this.levels)||void 0===t?void 0:t.findIndex((t=>t.id===e.id)))&&void 0!==i?i:-1;requestAnimationFrame((()=>{this.centerLevelItem(s)}))}}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(-1===e&&this.levels[0])return void(this.selectedLevelId=this.levels[0].id);if(this.levels.length<=1)return void(this.offset=0);const t=-1===e?0:e;requestAnimationFrame((()=>{var e;if(this.isMobile)return void this.moveToLevelItem(t,!0);const i=null===(e=this.levelsElement)||void 0===e?void 0:e.parentElement;return i&&this.levelsElement?this.levelsElement.clientWidth<=i.clientWidth?(this.offset=0,void(this.minOffset=0)):void this.moveToLevelItem(t,!1):void 0}))}onTouchStart(e){this.isMobile&&(this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY},this.touchPosEnd=this.touchPosStart)}onTouchMove(e){this.isMobile&&(this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY})}onTouchEnd(){if(!this.isMobile||!this.touchPosStart||!this.touchPosEnd||!this.levels||this.levels.length<=1)return;const e=this.touchPosEnd.clientX-this.touchPosStart.clientX,t=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(e)<=30||Math.abs(e)<=Math.abs(t)||this.slideTo(e>0?h.slideToRight:h.slideToLeft)}slideTo(e){if(!this.levelsElement||!this.childElementWidth||!this.moveCountForOneTouch||this.levelsElement.childElementCount<=1)return void(this.offset=0);let t=(this.isMobile?this.offset: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.");const t=this.levelsElement.parentElement.clientWidth,i=this.isMobile?this.getMobileContentWidth():this.levelsElement.clientWidth,s=this.levelsElement.childElementCount;if(s<=1)return this.showSliderButton=!1,this.minOffset=0,this.offset=0,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,void(this.moveCountForOneTouch=1);this.showSliderButton=!this.isMobile&&this.levelsElement.clientWidth>t,this.minOffset=t-i,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,s>1&&(this.childElementWidth+=(i-this.childElementWidth*s)/(s-1)),this.moveCountForOneTouch=Math.max(1,Math.ceil(t/this.childElementWidth)-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(){var e;return t(s,{key:"be32d43c10d5e1c61eeb5e5b6cd61ec7d72b15e8"},this.levels&&[t("div",{key:"441873d210aced36adc248b12bb0c33bda7a5dc4",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"c027246db26476fb5732e10d54d7810acba3cba5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"6510f4456731665071efd4b97ec6d2aff6a7d88d","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"03c91821b5d20210a9d9e3fa3a91286a9ed6708e",class:"LevelItemsWrapper"},t("div",{key:"0822b2bccb7193d467fa0e1d0c5690d58cbf8b07",style:{left:`${this.offset}px`},class:`LevelItems ${this.isMobile?"Mobile":""} ${this.isMobile&&1===(null===(e=this.levels)||void 0===e?void 0:e.length)?"SingleItem":""}`,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)," ",r("points",this.language))))))),t("div",{key:"3e61ac048f0271439c1e0173f0bc157eee1a236a",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"7442b3809f32bdeb5c1cdef14d286dc89be3ae5f",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"d607ef73547f486de56ae011a34e034bddacd846","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return n(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}.LevelItems.Mobile.SingleItem{left:0 !important;width:100%;display:flex;justify-content:center;flex-wrap:nowrap;padding:0}.LevelItems.Mobile.SingleItem .Item{flex-grow:0;flex-shrink:0}.LevelItems.Mobile{overflow:visible !important;display:flex;flex-wrap:nowrap;width:100%}.LevelItems.Mobile .Item{flex-shrink:0}";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,u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},g={exports:{}};v=g,f=g.exports,p=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==u)return u;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=g.exports,m=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)}))}};m.style=":host{display:block}";const w="__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[w]||(window[w]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const s=e.getRootNode(),n=window[w];let l=n[t]&&n[t].sheet;l?n[t].refCount=n[t].refCount+1:(l=new CSSStyleSheet,l.replaceSync(i),n[t]={sheet:l,refCount:1});const o=s.adoptedStyleSheets||[];o.includes(l)||(s.adoptedStyleSheets=[...o,l])}))}(e,t);const n=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[w][t]){const e=window[w][t];e.refCount>1?e.refCount=e.refCount-1:delete window[w][t]}n()},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 n=i.en[s];"object"==typeof t[e][s]?(i[e][s]=i[e][s]||Object.assign({},n),Object.keys(t[e][s]).forEach((n=>{i[e][s][n]=t[e][s][n]}))):i[e][s]=t[e][s]||Object.assign({},n)}))})),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 n(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};C.style=":host{display:block}";export{a as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,m as elevate_levels_data,C as general_styling_wrapper}
|
|
1
|
+
import{r as e,h as t,c as i,H as s,g as n}from"./index-422aaa76.js";const l={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=>{l[t]||(l[t]={});for(let i in e[t])l[t][i]=e[t][i]})),t(!0)})).catch((e=>{console.error("Failed to load translations:",e),t(!1)}))})),r=(e,t,i)=>{let s=l[void 0!==t&&t in l?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},a=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=>String(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=r("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:"7aa388e84c7a9e59348b6e45361c4919741b9624",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"b76f32e406048ad419df1530d3bff5a4a255b653",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"cc3ba085a59f88dbcb1ca4f3ddff4c8485ab6bfe",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}):r("noLevelsSet",this.language),this.currentLevel&&t("elevate-level-presentation",{key:"e6b3cd07ba039a3150ef49cc3c19060bdca962f3",elevateLevel:this.currentLevel})),this.errorMessage&&t("div",{key:"16174771432e7d6f8e8d81a9fbe5f23241233905"},this.errorMessage),t("general-styling-wrapper",{key:"ae82134e983be2852f1475f731cd568146dc6d2e",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:l,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}}};var h;a.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}centerLevelItem(e){if(!this.isMobile||!this.levelsElement||e<0||!this.levelsElement.children[e])return;const t=this.levelsElement.parentElement;if(!t)return;const i=this.levelsElement.children[e],s=t.clientWidth,n=Math.min(0,s-this.levelsElement.scrollWidth);let l=s/2-(i.offsetLeft+i.offsetWidth/2);l=l<n?n:l>0?0:l,this.minOffset=n,this.offset=l}moveToLevelItem(e,t=!1){if(!this.levelsElement||e<0||!this.levelsElement.children[e])return;const i=this.levelsElement.parentElement;if(!i)return;const s=this.levelsElement.children[e],n=i.clientWidth,l=this.isMobile?this.getMobileContentWidth():this.levelsElement.clientWidth,o=Math.min(0,n-l);if(l<=n)return this.minOffset=0,void(this.offset=0);const r=s.offsetLeft,a=s.offsetWidth;let h;if(t)h=n/2-(r+a/2);else{const e=-this.offset,t=r+a;if(r>=e&&t<=e+n)return;h=r<e?-r:n-t}h=h<o?o:h>0?0:h,this.minOffset=o,this.offset=h}getMobileContentWidth(){return this.levelsElement?Array.from(this.levelsElement.children).reduce(((e,t)=>{const i=window.getComputedStyle(t),s=parseFloat(i.marginLeft)||0,n=parseFloat(i.marginRight)||0;return e+t.offsetWidth+s+n}),0):0}onLevelClicked(e){var t,i;if(this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=String(e.id),this.isMobile){const s=null!==(i=null===(t=this.levels)||void 0===t?void 0:t.findIndex((t=>t.id===e.id)))&&void 0!==i?i:-1;requestAnimationFrame((()=>{this.centerLevelItem(s)}))}}levelsChangedHandler(){this.initOffsetOfLevelItems()}initOffsetOfLevelItems(){if(!this.levels||0===this.levels.length||!this.selectedLevelId)return;const e=this.levels.findIndex((e=>this.selectedLevelId===String(e.id)));if(-1===e&&this.levels[0])return void(this.selectedLevelId=String(this.levels[0].id));if(this.levels.length<=1)return void(this.offset=0);const t=-1===e?0:e;requestAnimationFrame((()=>{var e;if(this.isMobile)return void this.centerLevelItem(t);const i=null===(e=this.levelsElement)||void 0===e?void 0:e.parentElement;return i&&this.levelsElement?this.levelsElement.clientWidth<=i.clientWidth?(this.offset=0,void(this.minOffset=0)):void this.moveToLevelItem(t,!1):void 0}))}onTouchStart(e){this.isMobile&&(this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY},this.touchPosEnd=this.touchPosStart)}onTouchMove(e){this.isMobile&&(this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY})}onTouchEnd(){if(!this.isMobile||!this.touchPosStart||!this.touchPosEnd||!this.levels||this.levels.length<=1)return;const e=this.touchPosEnd.clientX-this.touchPosStart.clientX,t=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(e)<=30||Math.abs(e)<=Math.abs(t)||this.slideTo(e>0?h.slideToRight:h.slideToLeft)}slideTo(e){if(!this.levelsElement||!this.childElementWidth||!this.moveCountForOneTouch||this.levelsElement.childElementCount<=1)return void(this.offset=0);let t=(this.isMobile?this.offset: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.");const t=this.levelsElement.parentElement.clientWidth,i=this.isMobile?this.getMobileContentWidth():this.levelsElement.clientWidth,s=this.levelsElement.childElementCount;if(s<=1)return this.showSliderButton=!1,this.minOffset=0,this.offset=0,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,void(this.moveCountForOneTouch=1);this.showSliderButton=!this.isMobile&&this.levelsElement.clientWidth>t,this.minOffset=t-i,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,s>1&&(this.childElementWidth+=(i-this.childElementWidth*s)/(s-1)),this.moveCountForOneTouch=Math.max(1,Math.ceil(t/this.childElementWidth)-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(){var e;return t(s,{key:"a05bed04ea468e866bc9df6c498fca11d9f4403d"},this.levels&&[t("div",{key:"03645566f555f37f1e3ed413fbca2d6c7787b6e7",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"1e5924a4a3ac2c2e9086f2c97d56fd03c484c94c",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"05b99dc69d70705fa688c2e1093f20e56e421129","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"712dfb9307283503be5950fe63068817a8d5c84f",class:"LevelItemsWrapper"},t("div",{key:"a2d158dd5bb5dd14ce3690771b91fa499588d005",style:{left:`${this.offset}px`},class:`LevelItems ${this.isMobile?"Mobile":""} ${this.isMobile&&1===(null===(e=this.levels)||void 0===e?void 0:e.length)?"SingleItem":""}`,id:"levelItems",ref:e=>{this.levelsElement=e}},this.levels.map(((e,i)=>t("div",{class:"Item "+(this.selectedLevelId===String(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)," ",r("points",this.language))))))),t("div",{key:"c161b946c15a55f7e97646d39d7bf897a906abdb",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"b6dd2bf96aa83941eb0cd8fdff3862c7618fd1d0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"56f6094b35782e8d6257c7d0ce44fa01a944338d","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return n(this)}static get watchers(){return{selectedLevelId:["levelsChangedHandler"],levels:["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}.LevelItems.Mobile.SingleItem{left:0 !important;width:100%;display:flex;justify-content:center;flex-wrap:nowrap;padding:0}.LevelItems.Mobile.SingleItem .Item{flex-grow:0;flex-shrink:0}.LevelItems.Mobile{overflow:visible !important;display:flex;flex-wrap:nowrap;width:100%}.LevelItems.Mobile .Item{flex-shrink:0}";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,u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},g={exports:{}};v=g,f=g.exports,p=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==u)return u;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=g.exports,m=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)}))}};m.style=":host{display:block}";const w="__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[w]||(window[w]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const s=e.getRootNode(),n=window[w];let l=n[t]&&n[t].sheet;l?n[t].refCount=n[t].refCount+1:(l=new CSSStyleSheet,l.replaceSync(i),n[t]={sheet:l,refCount:1});const o=s.adoptedStyleSheets||[];o.includes(l)||(s.adoptedStyleSheets=[...o,l])}))}(e,t);const n=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[w][t]){const e=window[w][t];e.refCount>1?e.refCount=e.refCount-1:delete window[w][t]}n()},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 n=i.en[s];"object"==typeof t[e][s]?(i[e][s]=i[e][s]||Object.assign({},n),Object.keys(t[e][s]).forEach((n=>{i[e][s][n]=t[e][s][n]}))):i[e][s]=t[e][s]||Object.assign({},n)}))})),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 n(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};C.style=":host{display:block}";export{a as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,m 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"],"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"],[1,"touchend","onTouchEnd"],[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"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"],"levels":["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;
|
|
@@ -107,7 +107,7 @@ const BonusElevateLevels = class {
|
|
|
107
107
|
selectedLevelIdChangedHandler() {
|
|
108
108
|
if (this.selectedLevelId && this.elevateLevels) {
|
|
109
109
|
const currentLevel = this.elevateLevels.filter((item) => {
|
|
110
|
-
return item.id
|
|
110
|
+
return String(item.id) === this.selectedLevelId;
|
|
111
111
|
})[0];
|
|
112
112
|
this.currentLevel = Object.assign({}, currentLevel);
|
|
113
113
|
}
|
|
@@ -151,9 +151,9 @@ const BonusElevateLevels = class {
|
|
|
151
151
|
}
|
|
152
152
|
render() {
|
|
153
153
|
var _a;
|
|
154
|
-
return (index.h("div", { key: '
|
|
154
|
+
return (index.h("div", { key: '7aa388e84c7a9e59348b6e45361c4919741b9624', class: "ElevateLevelContent" }, index.h("elevate-levels-data", { key: 'b76f32e406048ad419df1530d3bff5a4a255b653', scopeParams: this.elevateLevelParamProxy }), index.h("div", { key: 'cc3ba085a59f88dbcb1ca4f3ddff4c8485ab6bfe', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
155
155
|
index.h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
|
|
156
|
-
index.h("elevate-level-presentation", { key: '
|
|
156
|
+
index.h("elevate-level-presentation", { key: 'e6b3cd07ba039a3150ef49cc3c19060bdca962f3', elevateLevel: this.currentLevel })), this.errorMessage && index.h("div", { key: '16174771432e7d6f8e8d81a9fbe5f23241233905' }, this.errorMessage), index.h("general-styling-wrapper", { key: 'ae82134e983be2852f1475f731cd568146dc6d2e', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
|
|
157
157
|
}
|
|
158
158
|
static get watchers() { return {
|
|
159
159
|
"selectedLevelId": ["selectedLevelIdChangedHandler"],
|
|
@@ -287,7 +287,7 @@ const ElevateLevelList = class {
|
|
|
287
287
|
onLevelClicked(elevateLevel) {
|
|
288
288
|
var _a, _b;
|
|
289
289
|
this.selectedLevelChanged.emit({ level: elevateLevel });
|
|
290
|
-
this.selectedLevelId = elevateLevel.id;
|
|
290
|
+
this.selectedLevelId = String(elevateLevel.id);
|
|
291
291
|
if (this.isMobile) {
|
|
292
292
|
const levelIndex = (_b = (_a = this.levels) === null || _a === void 0 ? void 0 : _a.findIndex((level) => level.id === elevateLevel.id)) !== null && _b !== void 0 ? _b : -1;
|
|
293
293
|
requestAnimationFrame(() => {
|
|
@@ -303,10 +303,10 @@ const ElevateLevelList = class {
|
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
305
|
const currentLevelIndex = this.levels.findIndex((item) => {
|
|
306
|
-
return this.selectedLevelId === item.id;
|
|
306
|
+
return this.selectedLevelId === String(item.id);
|
|
307
307
|
});
|
|
308
308
|
if (currentLevelIndex === -1 && this.levels[0]) {
|
|
309
|
-
this.selectedLevelId = this.levels[0].id;
|
|
309
|
+
this.selectedLevelId = String(this.levels[0].id);
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
if (this.levels.length <= 1) {
|
|
@@ -317,7 +317,7 @@ const ElevateLevelList = class {
|
|
|
317
317
|
requestAnimationFrame(() => {
|
|
318
318
|
var _a;
|
|
319
319
|
if (this.isMobile) {
|
|
320
|
-
this.
|
|
320
|
+
this.centerLevelItem(targetIndex);
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
323
|
const wrapper = (_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
@@ -462,17 +462,18 @@ const ElevateLevelList = class {
|
|
|
462
462
|
}
|
|
463
463
|
render() {
|
|
464
464
|
var _a;
|
|
465
|
-
return (index.h(index.Host, { key: '
|
|
466
|
-
index.h("div", { key: '
|
|
467
|
-
index.h("div", { key: '
|
|
468
|
-
return (index.h("div", { class: `Item ${this.selectedLevelId
|
|
465
|
+
return (index.h(index.Host, { key: 'a05bed04ea468e866bc9df6c498fca11d9f4403d' }, this.levels && [
|
|
466
|
+
index.h("div", { key: '03645566f555f37f1e3ed413fbca2d6c7787b6e7', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, index.h("svg", { key: '1e5924a4a3ac2c2e9086f2c97d56fd03c484c94c', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '05b99dc69d70705fa688c2e1093f20e56e421129', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
|
|
467
|
+
index.h("div", { key: '712dfb9307283503be5950fe63068817a8d5c84f', class: 'LevelItemsWrapper' }, index.h("div", { key: 'a2d158dd5bb5dd14ce3690771b91fa499588d005', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''} ${this.isMobile && ((_a = this.levels) === null || _a === void 0 ? void 0 : _a.length) === 1 ? 'SingleItem' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
|
|
468
|
+
return (index.h("div", { class: `Item ${this.selectedLevelId === String(level.id) ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, index.h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), index.h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), index.h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', this.convertNumberToCompactForm(level.firstEntryPoints), ' ', translate('points', this.language))));
|
|
469
469
|
}))),
|
|
470
|
-
index.h("div", { key: '
|
|
470
|
+
index.h("div", { key: 'c161b946c15a55f7e97646d39d7bf897a906abdb', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, index.h("svg", { key: 'b6dd2bf96aa83941eb0cd8fdff3862c7618fd1d0', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '56f6094b35782e8d6257c7d0ce44fa01a944338d', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
|
|
471
471
|
]));
|
|
472
472
|
}
|
|
473
473
|
get host() { return index.getElement(this); }
|
|
474
474
|
static get watchers() { return {
|
|
475
|
-
"selectedLevelId": ["levelsChangedHandler"]
|
|
475
|
+
"selectedLevelId": ["levelsChangedHandler"],
|
|
476
|
+
"levels": ["levelsChangedHandler"]
|
|
476
477
|
}; }
|
|
477
478
|
};
|
|
478
479
|
ElevateLevelList.style = ElevateLevelListStyle0;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["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"],[1,"touchend","onTouchEnd"],[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"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"],"levels":["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;
|
|
@@ -23,7 +23,7 @@ export class BonusElevateLevels {
|
|
|
23
23
|
selectedLevelIdChangedHandler() {
|
|
24
24
|
if (this.selectedLevelId && this.elevateLevels) {
|
|
25
25
|
const currentLevel = this.elevateLevels.filter((item) => {
|
|
26
|
-
return item.id
|
|
26
|
+
return String(item.id) === this.selectedLevelId;
|
|
27
27
|
})[0];
|
|
28
28
|
this.currentLevel = Object.assign({}, currentLevel);
|
|
29
29
|
}
|
|
@@ -67,9 +67,9 @@ export class BonusElevateLevels {
|
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
69
|
var _a;
|
|
70
|
-
return (h("div", { key: '
|
|
70
|
+
return (h("div", { key: '7aa388e84c7a9e59348b6e45361c4919741b9624', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: 'b76f32e406048ad419df1530d3bff5a4a255b653', scopeParams: this.elevateLevelParamProxy }), h("div", { key: 'cc3ba085a59f88dbcb1ca4f3ddff4c8485ab6bfe', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
71
71
|
h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
|
|
72
|
-
h("elevate-level-presentation", { key: '
|
|
72
|
+
h("elevate-level-presentation", { key: 'e6b3cd07ba039a3150ef49cc3c19060bdca962f3', elevateLevel: this.currentLevel })), this.errorMessage && h("div", { key: '16174771432e7d6f8e8d81a9fbe5f23241233905' }, this.errorMessage), h("general-styling-wrapper", { key: 'ae82134e983be2852f1475f731cd568146dc6d2e', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
|
|
73
73
|
}
|
|
74
74
|
static get is() { return "bonus-elevate-levels"; }
|
|
75
75
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,7 +100,7 @@ export class ElevateLevelList {
|
|
|
100
100
|
onLevelClicked(elevateLevel) {
|
|
101
101
|
var _a, _b;
|
|
102
102
|
this.selectedLevelChanged.emit({ level: elevateLevel });
|
|
103
|
-
this.selectedLevelId = elevateLevel.id;
|
|
103
|
+
this.selectedLevelId = String(elevateLevel.id);
|
|
104
104
|
if (this.isMobile) {
|
|
105
105
|
const levelIndex = (_b = (_a = this.levels) === null || _a === void 0 ? void 0 : _a.findIndex((level) => level.id === elevateLevel.id)) !== null && _b !== void 0 ? _b : -1;
|
|
106
106
|
requestAnimationFrame(() => {
|
|
@@ -116,10 +116,10 @@ export class ElevateLevelList {
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
const currentLevelIndex = this.levels.findIndex((item) => {
|
|
119
|
-
return this.selectedLevelId === item.id;
|
|
119
|
+
return this.selectedLevelId === String(item.id);
|
|
120
120
|
});
|
|
121
121
|
if (currentLevelIndex === -1 && this.levels[0]) {
|
|
122
|
-
this.selectedLevelId = this.levels[0].id;
|
|
122
|
+
this.selectedLevelId = String(this.levels[0].id);
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
if (this.levels.length <= 1) {
|
|
@@ -130,7 +130,7 @@ export class ElevateLevelList {
|
|
|
130
130
|
requestAnimationFrame(() => {
|
|
131
131
|
var _a;
|
|
132
132
|
if (this.isMobile) {
|
|
133
|
-
this.
|
|
133
|
+
this.centerLevelItem(targetIndex);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
const wrapper = (_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
@@ -275,12 +275,12 @@ export class ElevateLevelList {
|
|
|
275
275
|
}
|
|
276
276
|
render() {
|
|
277
277
|
var _a;
|
|
278
|
-
return (h(Host, { key: '
|
|
279
|
-
h("div", { key: '
|
|
280
|
-
h("div", { key: '
|
|
281
|
-
return (h("div", { class: `Item ${this.selectedLevelId
|
|
278
|
+
return (h(Host, { key: 'a05bed04ea468e866bc9df6c498fca11d9f4403d' }, this.levels && [
|
|
279
|
+
h("div", { key: '03645566f555f37f1e3ed413fbca2d6c7787b6e7', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, h("svg", { key: '1e5924a4a3ac2c2e9086f2c97d56fd03c484c94c', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '05b99dc69d70705fa688c2e1093f20e56e421129', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
|
|
280
|
+
h("div", { key: '712dfb9307283503be5950fe63068817a8d5c84f', class: 'LevelItemsWrapper' }, h("div", { key: 'a2d158dd5bb5dd14ce3690771b91fa499588d005', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''} ${this.isMobile && ((_a = this.levels) === null || _a === void 0 ? void 0 : _a.length) === 1 ? 'SingleItem' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
|
|
281
|
+
return (h("div", { class: `Item ${this.selectedLevelId === String(level.id) ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', this.convertNumberToCompactForm(level.firstEntryPoints), ' ', translate('points', this.language))));
|
|
282
282
|
}))),
|
|
283
|
-
h("div", { key: '
|
|
283
|
+
h("div", { key: 'c161b946c15a55f7e97646d39d7bf897a906abdb', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, h("svg", { key: 'b6dd2bf96aa83941eb0cd8fdff3862c7618fd1d0', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '56f6094b35782e8d6257c7d0ce44fa01a944338d', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
|
|
284
284
|
]));
|
|
285
285
|
}
|
|
286
286
|
static get is() { return "elevate-level-list"; }
|
|
@@ -388,6 +388,9 @@ export class ElevateLevelList {
|
|
|
388
388
|
return [{
|
|
389
389
|
"propName": "selectedLevelId",
|
|
390
390
|
"methodName": "levelsChangedHandler"
|
|
391
|
+
}, {
|
|
392
|
+
"propName": "levels",
|
|
393
|
+
"methodName": "levelsChangedHandler"
|
|
391
394
|
}];
|
|
392
395
|
}
|
|
393
396
|
static get listeners() {
|
|
@@ -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"],"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"],[1,"touchend","onTouchEnd"],[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"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"],"levels":["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
|
});
|
|
@@ -103,7 +103,7 @@ const BonusElevateLevels = class {
|
|
|
103
103
|
selectedLevelIdChangedHandler() {
|
|
104
104
|
if (this.selectedLevelId && this.elevateLevels) {
|
|
105
105
|
const currentLevel = this.elevateLevels.filter((item) => {
|
|
106
|
-
return item.id
|
|
106
|
+
return String(item.id) === this.selectedLevelId;
|
|
107
107
|
})[0];
|
|
108
108
|
this.currentLevel = Object.assign({}, currentLevel);
|
|
109
109
|
}
|
|
@@ -147,9 +147,9 @@ const BonusElevateLevels = class {
|
|
|
147
147
|
}
|
|
148
148
|
render() {
|
|
149
149
|
var _a;
|
|
150
|
-
return (h("div", { key: '
|
|
150
|
+
return (h("div", { key: '7aa388e84c7a9e59348b6e45361c4919741b9624', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: 'b76f32e406048ad419df1530d3bff5a4a255b653', scopeParams: this.elevateLevelParamProxy }), h("div", { key: 'cc3ba085a59f88dbcb1ca4f3ddff4c8485ab6bfe', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
151
151
|
h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
|
|
152
|
-
h("elevate-level-presentation", { key: '
|
|
152
|
+
h("elevate-level-presentation", { key: 'e6b3cd07ba039a3150ef49cc3c19060bdca962f3', elevateLevel: this.currentLevel })), this.errorMessage && h("div", { key: '16174771432e7d6f8e8d81a9fbe5f23241233905' }, this.errorMessage), h("general-styling-wrapper", { key: 'ae82134e983be2852f1475f731cd568146dc6d2e', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
|
|
153
153
|
}
|
|
154
154
|
static get watchers() { return {
|
|
155
155
|
"selectedLevelId": ["selectedLevelIdChangedHandler"],
|
|
@@ -283,7 +283,7 @@ const ElevateLevelList = class {
|
|
|
283
283
|
onLevelClicked(elevateLevel) {
|
|
284
284
|
var _a, _b;
|
|
285
285
|
this.selectedLevelChanged.emit({ level: elevateLevel });
|
|
286
|
-
this.selectedLevelId = elevateLevel.id;
|
|
286
|
+
this.selectedLevelId = String(elevateLevel.id);
|
|
287
287
|
if (this.isMobile) {
|
|
288
288
|
const levelIndex = (_b = (_a = this.levels) === null || _a === void 0 ? void 0 : _a.findIndex((level) => level.id === elevateLevel.id)) !== null && _b !== void 0 ? _b : -1;
|
|
289
289
|
requestAnimationFrame(() => {
|
|
@@ -299,10 +299,10 @@ const ElevateLevelList = class {
|
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
301
|
const currentLevelIndex = this.levels.findIndex((item) => {
|
|
302
|
-
return this.selectedLevelId === item.id;
|
|
302
|
+
return this.selectedLevelId === String(item.id);
|
|
303
303
|
});
|
|
304
304
|
if (currentLevelIndex === -1 && this.levels[0]) {
|
|
305
|
-
this.selectedLevelId = this.levels[0].id;
|
|
305
|
+
this.selectedLevelId = String(this.levels[0].id);
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
308
|
if (this.levels.length <= 1) {
|
|
@@ -313,7 +313,7 @@ const ElevateLevelList = class {
|
|
|
313
313
|
requestAnimationFrame(() => {
|
|
314
314
|
var _a;
|
|
315
315
|
if (this.isMobile) {
|
|
316
|
-
this.
|
|
316
|
+
this.centerLevelItem(targetIndex);
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
319
|
const wrapper = (_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
@@ -458,17 +458,18 @@ const ElevateLevelList = class {
|
|
|
458
458
|
}
|
|
459
459
|
render() {
|
|
460
460
|
var _a;
|
|
461
|
-
return (h(Host, { key: '
|
|
462
|
-
h("div", { key: '
|
|
463
|
-
h("div", { key: '
|
|
464
|
-
return (h("div", { class: `Item ${this.selectedLevelId
|
|
461
|
+
return (h(Host, { key: 'a05bed04ea468e866bc9df6c498fca11d9f4403d' }, this.levels && [
|
|
462
|
+
h("div", { key: '03645566f555f37f1e3ed413fbca2d6c7787b6e7', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, h("svg", { key: '1e5924a4a3ac2c2e9086f2c97d56fd03c484c94c', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '05b99dc69d70705fa688c2e1093f20e56e421129', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
|
|
463
|
+
h("div", { key: '712dfb9307283503be5950fe63068817a8d5c84f', class: 'LevelItemsWrapper' }, h("div", { key: 'a2d158dd5bb5dd14ce3690771b91fa499588d005', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''} ${this.isMobile && ((_a = this.levels) === null || _a === void 0 ? void 0 : _a.length) === 1 ? 'SingleItem' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
|
|
464
|
+
return (h("div", { class: `Item ${this.selectedLevelId === String(level.id) ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', this.convertNumberToCompactForm(level.firstEntryPoints), ' ', translate('points', this.language))));
|
|
465
465
|
}))),
|
|
466
|
-
h("div", { key: '
|
|
466
|
+
h("div", { key: 'c161b946c15a55f7e97646d39d7bf897a906abdb', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, h("svg", { key: 'b6dd2bf96aa83941eb0cd8fdff3862c7618fd1d0', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '56f6094b35782e8d6257c7d0ce44fa01a944338d', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
|
|
467
467
|
]));
|
|
468
468
|
}
|
|
469
469
|
get host() { return getElement(this); }
|
|
470
470
|
static get watchers() { return {
|
|
471
|
-
"selectedLevelId": ["levelsChangedHandler"]
|
|
471
|
+
"selectedLevelId": ["levelsChangedHandler"],
|
|
472
|
+
"levels": ["levelsChangedHandler"]
|
|
472
473
|
}; }
|
|
473
474
|
};
|
|
474
475
|
ElevateLevelList.style = ElevateLevelListStyle0;
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["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"],[1,"touchend","onTouchEnd"],[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"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"],"levels":["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 };
|