@everymatrix/casino-engagement-suite-challenges-list 1.37.0 → 1.37.3
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/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js +1 -1
- package/dist/casino-engagement-suite-challenges-list/p-dc1fea86.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-challenges-list_2.cjs.entry.js +3 -3
- package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.js +5 -5
- package/dist/components/casino-engagement-suite-challenges-list.js +3 -3
- package/dist/esm/casino-engagement-suite-challenges-list_2.entry.js +3 -3
- package/dist/types/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.d.ts +4 -4
- package/dist/types/components.d.ts +2 -2
- package/dist/types/models/challenge.d.ts +5 -1
- package/package.json +1 -1
- package/dist/casino-engagement-suite-challenges-list/p-26d7de05.entry.js +0 -1
- /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-stencil/packages/casino-engagement-suite-challenges-list/.stencil/packages/casino-engagement-suite-challenges-list/stencil.config.d.ts +0 -0
package/dist/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as n}from"./p-fad4589e.js";(()=>{const n=import.meta.url,l={};return""!==n&&(l.resourcesUrl=new URL(".",n).href),e(l)})().then((e=>n([["p-
|
|
1
|
+
import{p as e,b as n}from"./p-fad4589e.js";(()=>{const n=import.meta.url,l={};return""!==n&&(l.resourcesUrl=new URL(".",n).href),e(l)})().then((e=>n([["p-dc1fea86",[[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],isJoiningToChallenge:[1028,"is-joining-to-challenge"],inProgressChallenges:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32],newChallengeIds:[32],pausedChallengeIds:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as s,g as o}from"./p-fad4589e.js";var n,i;!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(n||(n={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(i||(i={}));const a=["en"],l={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},r=(e,t)=>{const s=t;return l[void 0!==s&&a.includes(s)?s:"en"][e]};function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function g(e){p(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===h(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function d(e,t){return p(2,arguments),g(e).getTime()-g(t).getTime()}var c={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function u(e){return e?c[e]:c.trunc}const C=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newChallengeIds=[],this.pausedChallengeIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newChallengeIds=[]},this.handleChallengeClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t}),this.newChallengeIds=this.newChallengeIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,s;e.stopPropagation();const o=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(o))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:o}):(null===(s=this.inProgressChallenges)||void 0===s?void 0:s.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:o,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:o}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){switch(e.data.type){case"ChallengeGrant":{const t=e.data.data.challengeProgressData[0],s=this.challenges.findIndex((e=>function(e,t,s){p(2,arguments);var o=d(e,t)/1e3;return u(null==s?void 0:s.roundingMethod)(o)}(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));s>-1?this.challenges.splice(s,0,t):this.challenges.unshift(t),this.challenges=[...this.challenges],this.newChallengeIds.push(t.Id),window.postMessage({type:"UpdateChallenges"});break}case"ChallengeChangeStatusNotification":{const t=e.data.data.ChallengeId;e.data.data.IsEnabled?this.pausedChallengeIds=this.pausedChallengeIds.filter((e=>e!==t)):this.pausedChallengeIds.push(t);break}}}componentWillLoad(){var e;this.challengesPropHandler(this.challenges),(null===(e=this.challenges)||void 0===e?void 0:e.length)&&(this.newChallengeIds=this.challenges.filter((e=>e.IsNew)).map((e=>e.Id)))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==i.Expired)).reduce(((t,s)=>{const o=new Date(s.ExpirationTime).getTime()-e;let n="00h:00m:00s";if(o<1)this.removeChallenge(s.Id);else{const{days:e,hours:t,minutes:s,seconds:i}={days:String(Math.floor(o/864e5)).padStart(2,"0"),hours:String(Math.floor(o%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(o%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(o%6e4/1e3)).padStart(2,"0")};n="00"===e?`${t}h:${s}m:${i}s`:`${e}d:${t}h:${s}m`}return Object.assign(Object.assign({},t),{[s.Id]:n})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===i.InProgress&&!this.pausedChallengeIds.includes(e.Id),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===i.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.Id)}isChallengeCompleted(e){return e.Status===i.Completed||e.Status===i.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===i.Completed)return 100;if(this.isChallengePaused(e)||e.Status===i.PendingLevelReward||e.Status===i.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===n.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:t}=e;return s("div",{class:"ChallengeCardHeader"},s("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),s("button",{class:`${e.Status===i.InProgress?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":t},r(e.Status===i.InProgress?"unjoin":"join",this.language)))}getChallengeTemplate(e){const t=this.getChallengeProgress(e),o=this.timers[e.Id],n=this.newChallengeIds.includes(e.Id),i=t>-1?s("casino-engagement-suite-progress-bar",{class:this.device,value:t,disabled:this.isChallengePaused(e)},s("span",{slot:"Title",class:"ChallengeCountdown"},o)):s("span",{class:"ChallengeCountdown"},o);return s("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),i,s("div",{class:"ChallengeLabel "+(n?"ShowChallengeLabel":"")},s("span",null,r("new",this.language))))}getHeaderTemplate(){return s("header",{class:"ChallengesListPopupHeader"},s("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),s("div",{class:"ChallengesListPopupHeaderName"},r("challenges",this.language)),s("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?s("div",{class:"ChallengesListWrapper"},s("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):s("div",{class:"ChallengesListEmpty"},s("h2",null,r("noChallenges",this.language)),s("p",null,r("tryOtherGames",this.language)))}getTooltipTemplate(){return s("div",{class:"ChallengesTooltipBackdrop"},s("div",{class:"ChallengesTooltip"},s("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),r("tooltip",this.language)))}render(){return s("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return o(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};C.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}';const b=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return s("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},s("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},s("slot",{name:"Title"},s("div",null)),s("slot",{name:"Percent"},s("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),s("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},s("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return o(this)}};b.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";export{C as casino_engagement_suite_challenges_list,b as casino_engagement_suite_progress_bar}
|
|
@@ -231,7 +231,7 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
231
231
|
this.newChallengeIds = [];
|
|
232
232
|
};
|
|
233
233
|
this.handleChallengeClick = (ev) => {
|
|
234
|
-
const id =
|
|
234
|
+
const id = ev.currentTarget.getAttribute('data-id');
|
|
235
235
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
236
236
|
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
237
237
|
};
|
|
@@ -244,7 +244,7 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
244
244
|
this.changeChallengeStatus = (e) => {
|
|
245
245
|
var _a, _b;
|
|
246
246
|
e.stopPropagation();
|
|
247
|
-
const id =
|
|
247
|
+
const id = e.currentTarget.getAttribute('data-id');
|
|
248
248
|
if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
|
|
249
249
|
window.postMessage({
|
|
250
250
|
type: 'ShowConfirmationModal',
|
|
@@ -281,7 +281,7 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
281
281
|
const type = e.data.type;
|
|
282
282
|
switch (type) {
|
|
283
283
|
case 'ChallengeGrant': {
|
|
284
|
-
const newChallenge = e.data.data;
|
|
284
|
+
const newChallenge = e.data.data.challengeProgressData[0];
|
|
285
285
|
const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
|
|
286
286
|
if (index > -1) {
|
|
287
287
|
this.challenges.splice(index, 0, newChallenge);
|
|
@@ -54,7 +54,7 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
54
54
|
this.newChallengeIds = [];
|
|
55
55
|
};
|
|
56
56
|
this.handleChallengeClick = (ev) => {
|
|
57
|
-
const id =
|
|
57
|
+
const id = ev.currentTarget.getAttribute('data-id');
|
|
58
58
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
59
59
|
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
60
60
|
};
|
|
@@ -67,7 +67,7 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
67
67
|
this.changeChallengeStatus = (e) => {
|
|
68
68
|
var _a, _b;
|
|
69
69
|
e.stopPropagation();
|
|
70
|
-
const id =
|
|
70
|
+
const id = e.currentTarget.getAttribute('data-id');
|
|
71
71
|
if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
|
|
72
72
|
window.postMessage({
|
|
73
73
|
type: 'ShowConfirmationModal',
|
|
@@ -104,7 +104,7 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
104
104
|
const type = e.data.type;
|
|
105
105
|
switch (type) {
|
|
106
106
|
case 'ChallengeGrant': {
|
|
107
|
-
const newChallenge = e.data.data;
|
|
107
|
+
const newChallenge = e.data.data.challengeProgressData[0];
|
|
108
108
|
const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
|
|
109
109
|
if (index > -1) {
|
|
110
110
|
this.challenges.splice(index, 0, newChallenge);
|
|
@@ -404,8 +404,8 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
404
404
|
"type": "unknown",
|
|
405
405
|
"mutable": true,
|
|
406
406
|
"complexType": {
|
|
407
|
-
"original": "Array<
|
|
408
|
-
"resolved": "
|
|
407
|
+
"original": "Array<string>",
|
|
408
|
+
"resolved": "string[]",
|
|
409
409
|
"references": {
|
|
410
410
|
"Array": {
|
|
411
411
|
"location": "global"
|
|
@@ -230,7 +230,7 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
230
230
|
this.newChallengeIds = [];
|
|
231
231
|
};
|
|
232
232
|
this.handleChallengeClick = (ev) => {
|
|
233
|
-
const id =
|
|
233
|
+
const id = ev.currentTarget.getAttribute('data-id');
|
|
234
234
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
235
235
|
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
236
236
|
};
|
|
@@ -243,7 +243,7 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
243
243
|
this.changeChallengeStatus = (e) => {
|
|
244
244
|
var _a, _b;
|
|
245
245
|
e.stopPropagation();
|
|
246
|
-
const id =
|
|
246
|
+
const id = e.currentTarget.getAttribute('data-id');
|
|
247
247
|
if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
|
|
248
248
|
window.postMessage({
|
|
249
249
|
type: 'ShowConfirmationModal',
|
|
@@ -280,7 +280,7 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
280
280
|
const type = e.data.type;
|
|
281
281
|
switch (type) {
|
|
282
282
|
case 'ChallengeGrant': {
|
|
283
|
-
const newChallenge = e.data.data;
|
|
283
|
+
const newChallenge = e.data.data.challengeProgressData[0];
|
|
284
284
|
const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
|
|
285
285
|
if (index > -1) {
|
|
286
286
|
this.challenges.splice(index, 0, newChallenge);
|
|
@@ -227,7 +227,7 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
227
227
|
this.newChallengeIds = [];
|
|
228
228
|
};
|
|
229
229
|
this.handleChallengeClick = (ev) => {
|
|
230
|
-
const id =
|
|
230
|
+
const id = ev.currentTarget.getAttribute('data-id');
|
|
231
231
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
232
232
|
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
233
233
|
};
|
|
@@ -240,7 +240,7 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
240
240
|
this.changeChallengeStatus = (e) => {
|
|
241
241
|
var _a, _b;
|
|
242
242
|
e.stopPropagation();
|
|
243
|
-
const id =
|
|
243
|
+
const id = e.currentTarget.getAttribute('data-id');
|
|
244
244
|
if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
|
|
245
245
|
window.postMessage({
|
|
246
246
|
type: 'ShowConfirmationModal',
|
|
@@ -277,7 +277,7 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
277
277
|
const type = e.data.type;
|
|
278
278
|
switch (type) {
|
|
279
279
|
case 'ChallengeGrant': {
|
|
280
|
-
const newChallenge = e.data.data;
|
|
280
|
+
const newChallenge = e.data.data.challengeProgressData[0];
|
|
281
281
|
const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
|
|
282
282
|
if (index > -1) {
|
|
283
283
|
this.challenges.splice(index, 0, newChallenge);
|
|
@@ -29,13 +29,13 @@ export declare class CasinoEngagementSuiteChallengesList {
|
|
|
29
29
|
/**
|
|
30
30
|
*Active challenges
|
|
31
31
|
*/
|
|
32
|
-
inProgressChallenges: Array<
|
|
32
|
+
inProgressChallenges: Array<string>;
|
|
33
33
|
close: EventEmitter<void>;
|
|
34
34
|
tooltip: boolean;
|
|
35
35
|
timers: Record<string, string>;
|
|
36
36
|
private limitStylingAppends;
|
|
37
|
-
newChallengeIds:
|
|
38
|
-
pausedChallengeIds:
|
|
37
|
+
newChallengeIds: string[];
|
|
38
|
+
pausedChallengeIds: string[];
|
|
39
39
|
host: HTMLElement;
|
|
40
40
|
challengesPropHandler(value: Array<Challenge>): void;
|
|
41
41
|
handleEvent(e: any): void;
|
|
@@ -51,7 +51,7 @@ export declare class CasinoEngagementSuiteChallengesList {
|
|
|
51
51
|
handleChallengeClick: (ev: MouseEvent) => void;
|
|
52
52
|
showTooltip: () => void;
|
|
53
53
|
hideTooltip: () => void;
|
|
54
|
-
removeChallenge(id:
|
|
54
|
+
removeChallenge(id: string): void;
|
|
55
55
|
getChallengeClasses(challenge: Challenge): {
|
|
56
56
|
ChallengeCard: boolean;
|
|
57
57
|
InProgress: boolean;
|
|
@@ -27,7 +27,7 @@ export namespace Components {
|
|
|
27
27
|
/**
|
|
28
28
|
* Active challenges
|
|
29
29
|
*/
|
|
30
|
-
"inProgressChallenges": Array<
|
|
30
|
+
"inProgressChallenges": Array<string>;
|
|
31
31
|
/**
|
|
32
32
|
* Is joining to challenge
|
|
33
33
|
*/
|
|
@@ -70,7 +70,7 @@ declare namespace LocalJSX {
|
|
|
70
70
|
/**
|
|
71
71
|
* Active challenges
|
|
72
72
|
*/
|
|
73
|
-
"inProgressChallenges"?: Array<
|
|
73
|
+
"inProgressChallenges"?: Array<string>;
|
|
74
74
|
/**
|
|
75
75
|
* Is joining to challenge
|
|
76
76
|
*/
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export interface ChallengeGrantMessage {
|
|
2
|
+
challengeProgressData: Array<Challenge>;
|
|
3
|
+
errorMessage?: string;
|
|
4
|
+
}
|
|
1
5
|
export interface ChallengePresentation {
|
|
2
6
|
Description: string;
|
|
3
7
|
PresentationName: string;
|
|
@@ -53,7 +57,7 @@ export interface Challenge {
|
|
|
53
57
|
DomainId: number;
|
|
54
58
|
ExpirationTime: string;
|
|
55
59
|
Games: Array<Game>;
|
|
56
|
-
Id:
|
|
60
|
+
Id: string;
|
|
57
61
|
LevelProgresses: Array<LevelProgress>;
|
|
58
62
|
Status: ChallengeProgressStatus;
|
|
59
63
|
IsNew: boolean;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as s,g as o}from"./p-fad4589e.js";var n,i;!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(n||(n={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(i||(i={}));const a=["en"],l={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},r=(e,t)=>{const s=t;return l[void 0!==s&&a.includes(s)?s:"en"][e]};function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function g(e){p(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===h(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function d(e,t){return p(2,arguments),g(e).getTime()-g(t).getTime()}var c={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function u(e){return e?c[e]:c.trunc}const C=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newChallengeIds=[],this.pausedChallengeIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newChallengeIds=[]},this.handleChallengeClick=e=>{const t=+e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t}),this.newChallengeIds=this.newChallengeIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,s;e.stopPropagation();const o=+e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(o))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:o}):(null===(s=this.inProgressChallenges)||void 0===s?void 0:s.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:o,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:o}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){switch(e.data.type){case"ChallengeGrant":{const t=e.data.data,s=this.challenges.findIndex((e=>function(e,t,s){p(2,arguments);var o=d(e,t)/1e3;return u(null==s?void 0:s.roundingMethod)(o)}(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));s>-1?this.challenges.splice(s,0,t):this.challenges.unshift(t),this.challenges=[...this.challenges],this.newChallengeIds.push(t.Id),window.postMessage({type:"UpdateChallenges"});break}case"ChallengeChangeStatusNotification":{const t=e.data.data.ChallengeId;e.data.data.IsEnabled?this.pausedChallengeIds=this.pausedChallengeIds.filter((e=>e!==t)):this.pausedChallengeIds.push(t);break}}}componentWillLoad(){var e;this.challengesPropHandler(this.challenges),(null===(e=this.challenges)||void 0===e?void 0:e.length)&&(this.newChallengeIds=this.challenges.filter((e=>e.IsNew)).map((e=>e.Id)))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==i.Expired)).reduce(((t,s)=>{const o=new Date(s.ExpirationTime).getTime()-e;let n="00h:00m:00s";if(o<1)this.removeChallenge(s.Id);else{const{days:e,hours:t,minutes:s,seconds:i}={days:String(Math.floor(o/864e5)).padStart(2,"0"),hours:String(Math.floor(o%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(o%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(o%6e4/1e3)).padStart(2,"0")};n="00"===e?`${t}h:${s}m:${i}s`:`${e}d:${t}h:${s}m`}return Object.assign(Object.assign({},t),{[s.Id]:n})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===i.InProgress&&!this.pausedChallengeIds.includes(e.Id),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===i.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.Id)}isChallengeCompleted(e){return e.Status===i.Completed||e.Status===i.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===i.Completed)return 100;if(this.isChallengePaused(e)||e.Status===i.PendingLevelReward||e.Status===i.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===n.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:t}=e;return s("div",{class:"ChallengeCardHeader"},s("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),s("button",{class:`${e.Status===i.InProgress?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":t},r(e.Status===i.InProgress?"unjoin":"join",this.language)))}getChallengeTemplate(e){const t=this.getChallengeProgress(e),o=this.timers[e.Id],n=this.newChallengeIds.includes(e.Id),i=t>-1?s("casino-engagement-suite-progress-bar",{class:this.device,value:t,disabled:this.isChallengePaused(e)},s("span",{slot:"Title",class:"ChallengeCountdown"},o)):s("span",{class:"ChallengeCountdown"},o);return s("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),i,s("div",{class:"ChallengeLabel "+(n?"ShowChallengeLabel":"")},s("span",null,r("new",this.language))))}getHeaderTemplate(){return s("header",{class:"ChallengesListPopupHeader"},s("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),s("div",{class:"ChallengesListPopupHeaderName"},r("challenges",this.language)),s("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?s("div",{class:"ChallengesListWrapper"},s("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):s("div",{class:"ChallengesListEmpty"},s("h2",null,r("noChallenges",this.language)),s("p",null,r("tryOtherGames",this.language)))}getTooltipTemplate(){return s("div",{class:"ChallengesTooltipBackdrop"},s("div",{class:"ChallengesTooltip"},s("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),r("tooltip",this.language)))}render(){return s("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return o(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};C.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}';const b=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return s("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},s("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},s("slot",{name:"Title"},s("div",null)),s("slot",{name:"Percent"},s("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),s("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},s("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return o(this)}};b.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";export{C as casino_engagement_suite_challenges_list,b as casino_engagement_suite_progress_bar}
|