@everymatrix/bonus-elevate-levels 1.75.1 → 1.76.1
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_5.entry.js +1 -1
- package/dist/cjs/bonus-elevate-levels_5.cjs.entry.js +8 -10
- package/dist/esm/bonus-elevate-levels_5.entry.js +8 -10
- package/package.json +1 -1
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.dev.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -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.isShowSliderButton=!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.isShowSliderButton=!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)}}}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){return t(s,{key:"d88d3434af89a0f8fd20a97735121fdf297905ab"},this.levels&&[t("div",{key:"cff36ba584e2474a65a1b95545b00937ecd06c8c",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.isShowSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"640b4dd9b26b4097d15623f3e9c6b14b9a60b37e",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"0a50ffc9319ad33ed61e4696c37a0bfe6090518c","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"314c5b4c5bbc0d50041a66fdf474441ea418345a",class:"LevelItemsWrapper"},t("div",{key:"ff1fb084aeb20319c36a3420e9eb8693ea81b144",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?"":">",e.firstEntryPoints," ",a("points",this.language))))))),t("div",{key:"8dae638ca436c7e747a0f737028588ee5d040edd",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.isShowSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"bba16b49668567aaa41beedd9ea461d256c6812d",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"36a0b6f3ffe8b50ebea9a4ec1c01e3341c440949","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,b="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!==b)return b;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=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 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)}))}};function w(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function y(e,t){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)}))}m.style=":host{display:block}";const L=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&&(null!=window.emMessageBus?function(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}(this.el,`${this.mbSource}.Style`):(this.clientStyling&&w(this.el,this.clientStyling),this.clientStylingUrl&&y(this.el,this.clientStylingUrl),this.stylingAppends=!0))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClientStylingChange(e,t){e!=t&&w(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&y(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&w(this.el,this.clientStyling),this.clientStylingUrl&&y(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:"09ad83748bbad518743c8671b986c541c52bf3f0",class:"StyleShell"},t("slot",{key:"3b28b776d3944410c717b002b70946d274a4e8e7",name:"mainContent"}))}get el(){return l(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};L.style=":host{display:block}";export{r as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,m as elevate_levels_data,L 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=["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.isShowSliderButton=!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.isShowSliderButton=!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)}}}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){return t(s,{key:"d88d3434af89a0f8fd20a97735121fdf297905ab"},this.levels&&[t("div",{key:"cff36ba584e2474a65a1b95545b00937ecd06c8c",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.isShowSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"640b4dd9b26b4097d15623f3e9c6b14b9a60b37e",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"0a50ffc9319ad33ed61e4696c37a0bfe6090518c","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"314c5b4c5bbc0d50041a66fdf474441ea418345a",class:"LevelItemsWrapper"},t("div",{key:"ff1fb084aeb20319c36a3420e9eb8693ea81b144",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?"":">",e.firstEntryPoints," ",a("points",this.language))))))),t("div",{key:"8dae638ca436c7e747a0f737028588ee5d040edd",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.isShowSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"bba16b49668567aaa41beedd9ea461d256c6812d",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"36a0b6f3ffe8b50ebea9a4ec1c01e3341c440949","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,p,f,b={exports:{}};v=b,p=b.exports,f=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==f)return f;throw new Error("unable to locate global object")}(),v.exports=p=f.fetch,f.fetch&&(p.default=f.fetch.bind(f)),p.Headers=f.Headers,p.Request=f.Request,p.Response=f.Response;const g=b.exports,u=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 g(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)}))}};function m(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function w(e,t){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)}))}u.style=":host{display:block}";const L=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&&(null!=window.emMessageBus?function(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}(this.el,`${this.mbSource}.Style`):(this.clientStyling&&m(this.el,this.clientStyling),this.clientStylingUrl&&w(this.el,this.clientStylingUrl),this.stylingAppends=!0))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClientStylingChange(e,t){e!=t&&m(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&w(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&m(this.el,this.clientStyling),this.clientStylingUrl&&w(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:"09ad83748bbad518743c8671b986c541c52bf3f0",class:"StyleShell"},t("slot",{key:"3b28b776d3944410c717b002b70946d274a4e8e7",name:"mainContent"}))}get el(){return l(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};L.style=":host{display:block}";export{r as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,u as elevate_levels_data,L as general_styling_wrapper}
|
|
@@ -275,8 +275,6 @@ const ElevateLevelPresentation = class {
|
|
|
275
275
|
};
|
|
276
276
|
ElevateLevelPresentation.style = ElevateLevelPresentationStyle0;
|
|
277
277
|
|
|
278
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
279
|
-
|
|
280
278
|
var browser = {exports: {}};
|
|
281
279
|
|
|
282
280
|
(function (module, exports) {
|
|
@@ -288,22 +286,22 @@ var getGlobal = function () {
|
|
|
288
286
|
// However, this causes CSP violations in Chrome apps.
|
|
289
287
|
if (typeof self !== 'undefined') { return self; }
|
|
290
288
|
if (typeof window !== 'undefined') { return window; }
|
|
291
|
-
if (typeof
|
|
289
|
+
if (typeof global !== 'undefined') { return global; }
|
|
292
290
|
throw new Error('unable to locate global object');
|
|
293
291
|
};
|
|
294
292
|
|
|
295
|
-
var
|
|
293
|
+
var global = getGlobal();
|
|
296
294
|
|
|
297
|
-
module.exports = exports =
|
|
295
|
+
module.exports = exports = global.fetch;
|
|
298
296
|
|
|
299
297
|
// Needed for TypeScript and Webpack.
|
|
300
|
-
if (
|
|
301
|
-
exports.default =
|
|
298
|
+
if (global.fetch) {
|
|
299
|
+
exports.default = global.fetch.bind(global);
|
|
302
300
|
}
|
|
303
301
|
|
|
304
|
-
exports.Headers =
|
|
305
|
-
exports.Request =
|
|
306
|
-
exports.Response =
|
|
302
|
+
exports.Headers = global.Headers;
|
|
303
|
+
exports.Request = global.Request;
|
|
304
|
+
exports.Response = global.Response;
|
|
307
305
|
}(browser, browser.exports));
|
|
308
306
|
|
|
309
307
|
const fetch$1 = browser.exports;
|
|
@@ -271,8 +271,6 @@ const ElevateLevelPresentation = class {
|
|
|
271
271
|
};
|
|
272
272
|
ElevateLevelPresentation.style = ElevateLevelPresentationStyle0;
|
|
273
273
|
|
|
274
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
275
|
-
|
|
276
274
|
var browser = {exports: {}};
|
|
277
275
|
|
|
278
276
|
(function (module, exports) {
|
|
@@ -284,22 +282,22 @@ var getGlobal = function () {
|
|
|
284
282
|
// However, this causes CSP violations in Chrome apps.
|
|
285
283
|
if (typeof self !== 'undefined') { return self; }
|
|
286
284
|
if (typeof window !== 'undefined') { return window; }
|
|
287
|
-
if (typeof
|
|
285
|
+
if (typeof global !== 'undefined') { return global; }
|
|
288
286
|
throw new Error('unable to locate global object');
|
|
289
287
|
};
|
|
290
288
|
|
|
291
|
-
var
|
|
289
|
+
var global = getGlobal();
|
|
292
290
|
|
|
293
|
-
module.exports = exports =
|
|
291
|
+
module.exports = exports = global.fetch;
|
|
294
292
|
|
|
295
293
|
// Needed for TypeScript and Webpack.
|
|
296
|
-
if (
|
|
297
|
-
exports.default =
|
|
294
|
+
if (global.fetch) {
|
|
295
|
+
exports.default = global.fetch.bind(global);
|
|
298
296
|
}
|
|
299
297
|
|
|
300
|
-
exports.Headers =
|
|
301
|
-
exports.Request =
|
|
302
|
-
exports.Response =
|
|
298
|
+
exports.Headers = global.Headers;
|
|
299
|
+
exports.Request = global.Request;
|
|
300
|
+
exports.Response = global.Response;
|
|
303
301
|
}(browser, browser.exports));
|
|
304
302
|
|
|
305
303
|
const fetch$1 = browser.exports;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|