@everymatrix/bonus-elevate-levels-jojogroup 1.85.17 → 1.85.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as i,c as s,g as n}from"./index-88ecbb5b.js";import{t as l,T as a}from"./locale.utils-3a9c8e78.js";const o=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.errorMessage=void 0}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=l("loadElevateLevelErrorMessage",this.language)))}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language: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:"3cdca540038915c73a99cca214d1d8091a928cb8",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"1e1a73074ceb36ce5554b7796ca07c2efb4f73ce",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"a1c66508053cac8549d23fabb291ff273079786c",class:"LevelContent"},(null===(e=this.elevateLevels)||void 0===e?void 0:e.length)?this.elevateLevels.map((e=>t("elevate-level-presentation",{elevateLevel:e}))):t("div",null,l("noLevelsSet",this.language))),this.errorMessage&&t("div",{key:"ed47949b39a95528d1a7f5acb9fe5ea1b596d6aa",class:"ErrorMessage"},this.errorMessage),t("general-styling-wrapper",{key:"c033776c424e2bc697f23a5a7abe34746fd6af7f",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:a,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};o.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}";const c=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(i,{key:"c02f0c4ca19226058b810f279273affa7b3398cc"},t("div",{key:"da5e3ce17167447ee462b1318f7d407f48781062",class:"Row Desc"},t("h3",{key:"6f811514d8f72b7484795e8a181c8e18446a52fe"},this.elevateLevel.presentation.displayName),t("p",{key:"fd0f78d172f027c79d542d630467e0f24099328f"},t("span",{key:"5eec8c85f146739d7e01b7112e1b1cf886c83310",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 r,h,d,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v={exports:{}};r=v,h=v.exports,d=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")}(),r.exports=h=d.fetch,d.fetch&&(h.default=d.fetch.bind(d)),h.Headers=d.Headers,h.Request=d.Request,h.Response=d.Response;const g=v.exports,p=class{constructor(t){e(this,t),this.elevateLevelsDataChange=s(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 b(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function
|
|
1
|
+
import{r as e,h as t,H as i,c as s,g as n}from"./index-88ecbb5b.js";import{t as l,T as a}from"./locale.utils-3a9c8e78.js";const o=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.errorMessage=void 0}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=l("loadElevateLevelErrorMessage",this.language)))}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language: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:"3cdca540038915c73a99cca214d1d8091a928cb8",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"1e1a73074ceb36ce5554b7796ca07c2efb4f73ce",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"a1c66508053cac8549d23fabb291ff273079786c",class:"LevelContent"},(null===(e=this.elevateLevels)||void 0===e?void 0:e.length)?this.elevateLevels.map((e=>t("elevate-level-presentation",{elevateLevel:e}))):t("div",null,l("noLevelsSet",this.language))),this.errorMessage&&t("div",{key:"ed47949b39a95528d1a7f5acb9fe5ea1b596d6aa",class:"ErrorMessage"},this.errorMessage),t("general-styling-wrapper",{key:"c033776c424e2bc697f23a5a7abe34746fd6af7f",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:a,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};o.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}";const c=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(i,{key:"c02f0c4ca19226058b810f279273affa7b3398cc"},t("div",{key:"da5e3ce17167447ee462b1318f7d407f48781062",class:"Row Desc"},t("h3",{key:"6f811514d8f72b7484795e8a181c8e18446a52fe"},this.elevateLevel.presentation.displayName),t("p",{key:"fd0f78d172f027c79d542d630467e0f24099328f"},t("span",{key:"5eec8c85f146739d7e01b7112e1b1cf886c83310",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 r,h,d,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v={exports:{}};r=v,h=v.exports,d=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")}(),r.exports=h=d.fetch,d.fetch&&(h.default=d.fetch.bind(d)),h.Headers=d.Headers,h.Request=d.Request,h.Response=d.Response;const g=v.exports,p=class{constructor(t){e(this,t),this.elevateLevelsDataChange=s(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 b(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function u(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)}))}p.style=":host{display:block}";const y=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&&b(this.el,this.clientStyling),this.clientStylingUrl&&u(this.el,this.clientStylingUrl),this.stylingAppends=!0))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClientStylingChange(e,t){e!=t&&b(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&u(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&b(this.el,this.clientStyling),this.clientStylingUrl&&u(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:"09ad83748bbad518743c8671b986c541c52bf3f0",class:"StyleShell"},t("slot",{key:"3b28b776d3944410c717b002b70946d274a4e8e7",name:"mainContent"}))}get el(){return n(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};y.style=":host{display:block}";export{o as bonus_elevate_levels_jojogroup,c as elevate_level_presentation,p as elevate_levels_data,y as general_styling_wrapper}
|
|
@@ -209,6 +209,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
209
209
|
* @param {string} clientStylingUrl The URL of the style content
|
|
210
210
|
*/
|
|
211
211
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
212
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
213
|
+
|
|
212
214
|
const url = new URL(clientStylingUrl);
|
|
213
215
|
|
|
214
216
|
fetch(url.href)
|
|
@@ -205,6 +205,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
205
205
|
* @param {string} clientStylingUrl The URL of the style content
|
|
206
206
|
*/
|
|
207
207
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
208
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
209
|
+
|
|
208
210
|
const url = new URL(clientStylingUrl);
|
|
209
211
|
|
|
210
212
|
fetch(url.href)
|