@everymatrix/casino-header-controller 1.67.0 → 1.67.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/components/CasinoHamburgerMenu-B3SEVofS.cjs +21 -0
- package/components/{CasinoHamburgerMenu-CTVc2-UF.js → CasinoHamburgerMenu-F30AIdQa.js} +1050 -1085
- package/components/{CasinoHamburgerMenu-BMkeLxFw.js → CasinoHamburgerMenu-qJFMD0lY.js} +1056 -1091
- package/components/{CasinoHeaderController-BzaGYtip.cjs → CasinoHeaderController-DBUFDWMM.cjs} +1 -1
- package/components/{CasinoHeaderController-BYTEYxGI.js → CasinoHeaderController-pekvzXc8.js} +88 -88
- package/components/{CasinoHeaderController-kkZt2jZV.js → CasinoHeaderController-s3bKI18l.js} +90 -90
- package/components/{CasinoSlider-DqTtsMWh.cjs → CasinoSlider-C8ldNewd.cjs} +1 -1
- package/components/{CasinoSlider-Deb0x84t.js → CasinoSlider-CEn9AAOB.js} +81 -81
- package/components/{CasinoSlider-CTcAOyCp.js → CasinoSlider-xtEu7BaK.js} +49 -49
- package/components/{PlayerAccountBalanceModal-CNXuqjqU.js → PlayerAccountBalanceModal-Bonu08VK.js} +61 -61
- package/components/{PlayerAccountBalanceModal-DbULiu-f.js → PlayerAccountBalanceModal-CJNc-yX5.js} +61 -61
- package/components/{PlayerAccountBalanceModal-BFDpI9Sy.cjs → PlayerAccountBalanceModal-DAI5HzZi.cjs} +1 -1
- package/components/{PlayerDeposit-BZuTQSyp.js → PlayerDeposit-BsOgrGtE.js} +28 -28
- package/components/{PlayerDeposit-eY_YGhMJ.js → PlayerDeposit-Cs0q3VJJ.js} +28 -28
- package/components/{PlayerDeposit-BXwT7NVp.cjs → PlayerDeposit-DmuFu2rX.cjs} +1 -1
- package/es2015/casino-header-controller.cjs +1 -1
- package/es2015/casino-header-controller.js +1 -1
- package/esnext/casino-header-controller.js +1 -1
- package/package.json +1 -1
- package/stencil/{gamification-dropdown-8eb8a896-BuRX-qSf.cjs → gamification-dropdown-8eb8a896-DfTzIl57.cjs} +1 -1
- package/stencil/{gamification-dropdown-8eb8a896-CUQH8OTh.js → gamification-dropdown-8eb8a896-DwjOP8LM.js} +7 -7
- package/stencil/{gamification-dropdown-8eb8a896-B9e-F_sU.js → gamification-dropdown-8eb8a896-OGii9GZC.js} +3 -3
- package/stencil/{gamification-dropdown-THR6gHxH.cjs → gamification-dropdown-Bl2Q7k92.cjs} +1 -1
- package/stencil/{gamification-dropdown-_AcmHdpt.js → gamification-dropdown-DTjKmeqH.js} +1 -1
- package/stencil/{gamification-dropdown-Bx4mQksP.js → gamification-dropdown-eYU0kMX0.js} +1 -1
- package/stencil/{gamification-dropdown_4-O3BiUHNc.js → gamification-dropdown_4-B46ceyMH.js} +24 -27
- package/stencil/{gamification-dropdown_4-BVPzYu2a.js → gamification-dropdown_4-C8FoQ9bl.js} +21 -24
- package/stencil/{gamification-dropdown_4-DLCXlou3.cjs → gamification-dropdown_4-EqEecNER.cjs} +2 -2
- package/stencil/{index-1ef3a64c-AMSfdX4B.js → index-1ef3a64c-DfFwTbOB.js} +185 -185
- package/stencil/{index-1ef3a64c-CTdxbgr0.js → index-1ef3a64c-Y2S-mzZE.js} +192 -192
- package/stencil/index-1ef3a64c-eLYHaH-f.cjs +1 -0
- package/stencil/{index-71b1bdfa-BL9t5VwE.js → index-71b1bdfa-C8dE0ofS.js} +226 -226
- package/stencil/index-71b1bdfa-MzSkzwf_.cjs +1 -0
- package/stencil/{index-71b1bdfa-CWdlWpzQ.js → index-71b1bdfa-_-dhHLGN.js} +235 -235
- package/stencil/{player-elevate-card-Du4res_Z.js → player-elevate-card-CESlrbxs.js} +2 -2
- package/stencil/{player-elevate-card-By9TEmm_.js → player-elevate-card-DAXoDLIH.js} +2 -2
- package/stencil/{player-elevate-card-DK5w6ocN.cjs → player-elevate-card-DORq6Wij.cjs} +1 -1
- package/stencil/player-elevate-card-items-5071deed-C6i7ZlHD.cjs +102 -0
- package/stencil/{player-elevate-card-items-5071deed-DCirzDCm.js → player-elevate-card-items-5071deed-C9dANr1l.js} +81 -79
- package/stencil/{player-elevate-card-items-5071deed-GrfHmJnI.js → player-elevate-card-items-5071deed-DjG8kMBd.js} +81 -79
- package/stencil/{player-elevate-pointcard-Bkry322P.cjs → player-elevate-pointcard-CjdTzOoF.cjs} +1 -1
- package/stencil/{player-elevate-pointcard-BWqI3IpR.js → player-elevate-pointcard-DQXpvq40.js} +2 -2
- package/stencil/{player-elevate-pointcard-Bc7oeher.js → player-elevate-pointcard-Do6iv014.js} +2 -2
- package/stencil/{player-rakeback-card-AbhM_zFo.js → player-rakeback-card-BNSkyLB0.js} +1 -1
- package/stencil/{player-rakeback-card-D7x0EA9y.cjs → player-rakeback-card-BoT6EgM7.cjs} +1 -1
- package/stencil/{player-rakeback-card-BbrVU4P1.js → player-rakeback-card-Bx_vN42o.js} +1 -1
- package/stencil/{user-deposit-withdrawal-c_bH3eje.js → user-deposit-withdrawal-BJyawJS_.js} +45 -45
- package/stencil/{user-deposit-withdrawal-BRpNiBnR.cjs → user-deposit-withdrawal-CC0ZAC_k.cjs} +2 -2
- package/stencil/{user-deposit-withdrawal-Dy3WkB23.js → user-deposit-withdrawal-DKTq5kc3.js} +45 -45
- package/components/CasinoHamburgerMenu-CrZ5l9tM.cjs +0 -21
- package/stencil/index-1ef3a64c-BlUWL6ud.cjs +0 -1
- package/stencil/index-71b1bdfa-DXo3J8vm.cjs +0 -1
- package/stencil/player-elevate-card-items-5071deed-BgtHd6Jj.cjs +0 -102
@@ -1,23 +1,20 @@
|
|
1
|
-
import { G as ve } from "./gamification-dropdown-8eb8a896-
|
2
|
-
import { r as
|
1
|
+
import { G as ve } from "./gamification-dropdown-8eb8a896-OGii9GZC.js";
|
2
|
+
import { r as y, h as i, g as I, c as M, a as m, F as $ } from "./index-71b1bdfa-C8dE0ofS.js";
|
3
3
|
import { t as P, T as O } from "./locale-TxlOHoKi.js";
|
4
|
-
import { P as N, a as W, b, c as z, r as p,
|
4
|
+
import { P as N, a as W, b, c as z, r as p, g as L, t as h } from "./player-elevate-card-items-5071deed-DjG8kMBd.js";
|
5
5
|
const U = (e, t) => new Promise((a) => {
|
6
6
|
fetch(e).then((n) => n.json()).then((n) => {
|
7
7
|
Object.keys(n).forEach((r) => {
|
8
|
-
t[r] = t[r] || t.en
|
9
|
-
|
10
|
-
if (!t.en[l])
|
11
|
-
return;
|
12
|
-
t[r][l] = t[r][l] || t.en[l], typeof n[r][l] == "object" ? Object.keys(n[r][l]).forEach((o) => {
|
8
|
+
t[r] = t[r] || t.en, Object.keys(n[r]).forEach((l) => {
|
9
|
+
t.en[l] && (t[r][l] = t[r][l] || t.en[l], typeof n[r][l] == "object" ? Object.keys(n[r][l]).forEach((o) => {
|
13
10
|
t[r][l][o] = n[r][l][o];
|
14
|
-
}) : t[r][l] = n[r][l];
|
15
|
-
}
|
11
|
+
}) : t[r][l] = n[r][l]);
|
12
|
+
});
|
16
13
|
}), a(!0);
|
17
14
|
});
|
18
15
|
}), q = ":host{display:block}", F = q, j = class {
|
19
16
|
constructor(e) {
|
20
|
-
|
17
|
+
y(this, e), this.stylingAppends = !1, this.setClientStyling = () => {
|
21
18
|
let t = document.createElement("style");
|
22
19
|
t.innerHTML = this.clientStyling, this.el.prepend(t);
|
23
20
|
}, this.setClientStylingURL = () => {
|
@@ -62,7 +59,7 @@ function G(e, t) {
|
|
62
59
|
return Math.round((r - l) / H);
|
63
60
|
}
|
64
61
|
var X = 6e4, Y = 36e5;
|
65
|
-
function
|
62
|
+
function C(e, t) {
|
66
63
|
return p(2, arguments), h(e).getTime() - h(t).getTime();
|
67
64
|
}
|
68
65
|
var w = {
|
@@ -74,18 +71,18 @@ var w = {
|
|
74
71
|
}
|
75
72
|
// Math.trunc is not supported by IE
|
76
73
|
}, J = "trunc";
|
77
|
-
function
|
74
|
+
function S(e) {
|
78
75
|
return e ? w[e] : w[J];
|
79
76
|
}
|
80
77
|
function K(e, t, a) {
|
81
78
|
p(2, arguments);
|
82
|
-
var n =
|
83
|
-
return
|
79
|
+
var n = C(e, t) / Y;
|
80
|
+
return S(a?.roundingMethod)(n);
|
84
81
|
}
|
85
82
|
function Q(e, t, a) {
|
86
83
|
p(2, arguments);
|
87
|
-
var n =
|
88
|
-
return
|
84
|
+
var n = C(e, t) / X;
|
85
|
+
return S(a?.roundingMethod)(n);
|
89
86
|
}
|
90
87
|
function V(e, t) {
|
91
88
|
p(2, arguments);
|
@@ -95,8 +92,8 @@ function V(e, t) {
|
|
95
92
|
function Z(e, t) {
|
96
93
|
const a = e.querySelector("#total_level"), n = 17, r = 6.5, l = a.getBBox().width, o = t > 1 ? 1 : t, s = o * l - n < 0 ? 0 : o * l - n, c = e.querySelector("#current_level"), v = e.querySelector("#filter_current_level"), g = e.querySelector("#circle_current_level");
|
97
94
|
a.setAttribute("viewbox", `0 0 ${s} 28`), c.setAttribute("width", `${s}`), g.setAttribute("cx", `${s < r ? r : s}`), v.setAttribute("x", `${s - 8}`);
|
98
|
-
const
|
99
|
-
|
95
|
+
const u = e.querySelector("#lock"), k = e.querySelector("#filter_heart_ball"), T = e.querySelector("#filter_ball"), A = e.querySelector("#filter_heart"), D = e.querySelector("#filter_lock"), f = e.querySelector("#paint0_linear_ball"), x = e.querySelector("#paint1_linear_lock"), _ = e.querySelector("#lock_box"), B = e.querySelector("#heart_box"), R = 10, d = l - R;
|
96
|
+
u.setAttribute("cx", `${d}`), x.setAttribute("x1", `${d}`), x.setAttribute("x2", `${d}`), f.setAttribute("x1", `${d - 6}`), f.setAttribute("x2", `${d - 6 + 11.2}`), D.setAttribute("x", `${d - 6}`), A.setAttribute("x", `${d - 6 - 2}`), T.setAttribute("x", `${d - 6 - 2 - 2}`), k.setAttribute("x", `${d - 6 - 2 - 2 - 4}`), _.setAttribute("x", `${d - 6}`), B.setAttribute("x", `${d - 6}`), a.parentElement.style.opacity = "1";
|
100
97
|
}
|
101
98
|
const ee = `:host {
|
102
99
|
display: block;
|
@@ -291,7 +288,7 @@ const ee = `:host {
|
|
291
288
|
color: var(--emw--color-red, #9e595f);
|
292
289
|
}`, te = ee, ne = class {
|
293
290
|
constructor(e) {
|
294
|
-
|
291
|
+
y(this, e), this.playerElevateLeveLoaded = M(this, "playerElevateLeveLoaded"), this.params = void 0, this.playerElevateLevel = void 0, this.pointExpireString = void 0;
|
295
292
|
}
|
296
293
|
handleWindowResizs() {
|
297
294
|
this.initLevelProgressbar();
|
@@ -349,10 +346,10 @@ const ee = `:host {
|
|
349
346
|
elevateLevelWalletTotal: c,
|
350
347
|
loyaltyWalletTotal: v
|
351
348
|
});
|
352
|
-
let g = this.calcuatePointsToBeExpired(c, "coinsToBeExpired"),
|
353
|
-
(g ||
|
349
|
+
let g = this.calcuatePointsToBeExpired(c, "coinsToBeExpired"), u = this.calcuatePointsToBeExpired(v, "pointsToBeExpired");
|
350
|
+
(g || u) && this.playerElevateLeveLoaded.emit({
|
354
351
|
pointExpireString: g,
|
355
|
-
xpExpireString:
|
352
|
+
xpExpireString: u
|
356
353
|
}), t(this.playerElevateLevel);
|
357
354
|
}).catch((n) => {
|
358
355
|
console.log("error ", n), a(!0);
|
@@ -401,7 +398,7 @@ const ee = `:host {
|
|
401
398
|
ne.style = te;
|
402
399
|
const ae = ":host{display:block}@media screen and (min-width: 501px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:nowrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:11px;margin-left:5px}}@media screen and (max-width: 500px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:wrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:0px;margin-left:0px}}.LoyaltyCard .Inner .LevelProgress{margin-left:0px}.LoyaltyCard .Inner .Row .PointsInfo.ExpirationPoints{text-align:left;color:var(--emw--color-red-50, red)}.LoyaltyCard .Inner .PlayerAvatar .Avatar{display:none}.LoyaltyCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%}.LoyaltyCard .Inner .LevelInfo .ElevateLevel{display:flex;flex:1;align-items:center}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{position:relative;padding-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate .ExpireTime{margin-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .LevelName{padding-left:0;font-size:var(--emw--elevate-fontsize-2xlarge, 21px);position:relative;width:auto;color:var(--emw--elevate-color-levelname, #FFBD2B);font-weight:bold}.LoyaltyCard .PointsRange{display:flex;justify-content:space-between}.LoyaltyCard .PointsRange .PointsInfo{width:auto}.LoyaltyCard .NextLevelTip{text-align:right;font-size:11px;color:var(--emw--color-black, #000);opacity:0.8;font-weight:bold}", le = ae, re = class {
|
403
400
|
constructor(e) {
|
404
|
-
|
401
|
+
y(this, e), this.endpoint = void 0, this.theme = "Dark", this.session = void 0, this.playerAvatarUrl = void 0, this.language = "en", this.playerName = void 0, this.dateFormat = "yyyy-MM-dd", this.mbSource = void 0, this.clientStyling = "", this.clientStylingUrl = "", this.translationUrl = "", this.pointExpireString = void 0, this.playerElevateLevel = void 0, this.elevateWalletTotal = void 0;
|
405
402
|
}
|
406
403
|
onSessionOrEndpointChange() {
|
407
404
|
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
package/stencil/{gamification-dropdown_4-DLCXlou3.cjs → gamification-dropdown_4-EqEecNER.cjs}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var x=(e,t,a)=>new Promise((n,r)=>{var l=c=>{try{s(a.next(c))}catch(h){r(h)}},d=c=>{try{s(a.throw(c))}catch(h){r(h)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(l,d);s((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./gamification-dropdown-8eb8a896-
|
1
|
+
"use strict";var x=(e,t,a)=>new Promise((n,r)=>{var l=c=>{try{s(a.next(c))}catch(h){r(h)}},d=c=>{try{s(a.throw(c))}catch(h){r(h)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(l,d);s((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./gamification-dropdown-8eb8a896-DfTzIl57.cjs"),i=require("./index-71b1bdfa-MzSkzwf_.cjs"),u=require("./locale-B_6Rn5-v.cjs"),o=require("./player-elevate-card-items-5071deed-C6i7ZlHD.cjs"),M=(e,t)=>new Promise(a=>{fetch(e).then(n=>n.json()).then(n=>{Object.keys(n).forEach(r=>{t[r]=t[r]||t.en,Object.keys(n[r]).forEach(l=>{t.en[l]&&(t[r][l]=t[r][l]||t.en[l],typeof n[r][l]=="object"?Object.keys(n[r][l]).forEach(d=>{t[r][l][d]=n[r][l][d]}):t[r][l]=n[r][l])})}),a(!0)})}),R=":host{display:block}",O=R,L=class{constructor(e){i.registerInstance(this,e),this.stylingAppends=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.el.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),a=document.createElement("style");fetch(t.href).then(n=>n.text()).then(n=>{a.innerHTML=n,setTimeout(()=>{this.el.prepend(a)},1)}).catch(n=>{console.log("error ",n)})},this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.targetTranslations=void 0}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}componentWillLoad(){return x(this,null,function*(){const e=[];if(this.translationUrl){const t=M(this.translationUrl,this.targetTranslations);e.push(t)}return yield Promise.all(e)})}render(){return i.h("div",{key:"4d3414408c7662f88331dbe655966237f74d6958",class:"StyleShell"},i.h("slot",{key:"1d004644d84602c4314bdf5dfc26b55b160f57df",name:"mainContent"}))}get el(){return i.getElement(this)}};L.style=O;function b(e){o.requiredArgs(1,arguments);var t=o.toDate(e);return t.setHours(0,0,0,0),t}var $=864e5;function q(e,t){o.requiredArgs(2,arguments);var a=b(e),n=b(t),r=a.getTime()-o.getTimezoneOffsetInMilliseconds(a),l=n.getTime()-o.getTimezoneOffsetInMilliseconds(n);return Math.round((r-l)/$)}var N=6e4,W=36e5;function E(e,t){return o.requiredArgs(2,arguments),o.toDate(e).getTime()-o.toDate(t).getTime()}var m={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},z="trunc";function w(e){return e?m[e]:m[z]}function U(e,t,a){o.requiredArgs(2,arguments);var n=E(e,t)/W;return w(a==null?void 0:a.roundingMethod)(n)}function F(e,t,a){o.requiredArgs(2,arguments);var n=E(e,t)/N;return w(a==null?void 0:a.roundingMethod)(n)}function j(e,t){o.requiredArgs(2,arguments);var a=o.toDate(e),n=o.toDate(t);return a.getTime()<n.getTime()}function H(e,t){const a=e.querySelector("#total_level"),n=17,r=6.5,l=a.getBBox().width,d=t>1?1:t,s=d*l-n<0?0:d*l-n,c=e.querySelector("#current_level"),h=e.querySelector("#filter_current_level"),p=e.querySelector("#circle_current_level");a.setAttribute("viewbox",`0 0 ${s} 28`),c.setAttribute("width",`${s}`),p.setAttribute("cx",`${s<r?r:s}`),h.setAttribute("x",`${s-8}`);const g=e.querySelector("#lock"),S=e.querySelector("#filter_heart_ball"),C=e.querySelector("#filter_ball"),k=e.querySelector("#filter_heart"),T=e.querySelector("#filter_lock"),y=e.querySelector("#paint0_linear_ball"),f=e.querySelector("#paint1_linear_lock"),A=e.querySelector("#lock_box"),D=e.querySelector("#heart_box"),_=10,v=l-_;g.setAttribute("cx",`${v}`),f.setAttribute("x1",`${v}`),f.setAttribute("x2",`${v}`),y.setAttribute("x1",`${v-6}`),y.setAttribute("x2",`${v-6+11.2}`),T.setAttribute("x",`${v-6}`),k.setAttribute("x",`${v-6-2}`),C.setAttribute("x",`${v-6-2-2}`),S.setAttribute("x",`${v-6-2-2-4}`),A.setAttribute("x",`${v-6}`),D.setAttribute("x",`${v-6}`),a.parentElement.style.opacity="1"}const G=`:host {
|
2
2
|
display: block;
|
3
3
|
width: 360px;
|
4
4
|
height: 230px;
|
@@ -189,4 +189,4 @@
|
|
189
189
|
text-align: right;
|
190
190
|
font-weight: bold;
|
191
191
|
color: var(--emw--color-red, #9e595f);
|
192
|
-
}`,X=G,I=class{constructor(e){i.registerInstance(this,e),this.playerElevateLeveLoaded=i.createEvent(this,"playerElevateLeveLoaded"),this.params=void 0,this.playerElevateLevel=void 0,this.pointExpireString=void 0}handleWindowResizs(){this.initLevelProgressbar()}onParamsChanged(){this.loadElevateInfo()}redeemGiftButtonHandler(){this.loadElevateInfo()}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}loadLevels(){let e=new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);return new Promise((t,a)=>fetch(e.href,{method:"GET"}).then(n=>n.json()).then(n=>{this.levels=n.data,t(!0)}).catch(n=>{a(n)}))}calcuatePointsToBeExpired(e,t){let a="";if(!e||!e.aboutToExpire||e.aboutToExpire.length==0||e.aboutToExpire[0].points<=0)return a;e.aboutToExpire.sort((c,h)=>j(new Date(c.expireTime),new Date(h.expireTime))?-1:1);const n=e.aboutToExpire[0],r=q(new Date(n.expireTime),new Date);let l=0,d=0,s=r===0?`${t}Day`:t;return r<=0&&(l=U(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),s=l>1?`${t}Hours`:`${t}Hour`,l<=0&&(d=F(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),s=d>1?`${t}Minutes`:`${t}Minute`)),a=
|
192
|
+
}`,X=G,I=class{constructor(e){i.registerInstance(this,e),this.playerElevateLeveLoaded=i.createEvent(this,"playerElevateLeveLoaded"),this.params=void 0,this.playerElevateLevel=void 0,this.pointExpireString=void 0}handleWindowResizs(){this.initLevelProgressbar()}onParamsChanged(){this.loadElevateInfo()}redeemGiftButtonHandler(){this.loadElevateInfo()}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}loadLevels(){let e=new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);return new Promise((t,a)=>fetch(e.href,{method:"GET"}).then(n=>n.json()).then(n=>{this.levels=n.data,t(!0)}).catch(n=>{a(n)}))}calcuatePointsToBeExpired(e,t){let a="";if(!e||!e.aboutToExpire||e.aboutToExpire.length==0||e.aboutToExpire[0].points<=0)return a;e.aboutToExpire.sort((c,h)=>j(new Date(c.expireTime),new Date(h.expireTime))?-1:1);const n=e.aboutToExpire[0],r=q(new Date(n.expireTime),new Date);let l=0,d=0,s=r===0?`${t}Day`:t;return r<=0&&(l=U(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),s=l>1?`${t}Hours`:`${t}Hour`,l<=0&&(d=F(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),s=d>1?`${t}Minutes`:`${t}Minute`)),a=u.translateWithParams(s,{expirationPoints:n.points,expireDay:Math.max(r,l,d),lang:this.params.language}),a}loadPlayerLevelInfo(){let e=new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);return new Promise((t,a)=>fetch(e.href,{method:"GET",headers:{"X-Sessionid":this.params.session,"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{var r,l,d;if(!n.success){console.error("Exception when fetch user elevateinfo, ",n.errorCode,n.errorMessage),a(!0);return}let s=n.data;this.playerElevateLevel=s.level,this.playerElevateLevel.name=this.playerElevateLevel.presentation.displayName||this.playerElevateLevel.name,this.playerElevateLevel.spendablePoints=((r=s.spendableWallet)===null||r===void 0?void 0:r.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const c=(l=n.data.spendableWallet)===null||l===void 0?void 0:l.total,h=(d=n.data.loyaltyWallet)===null||d===void 0?void 0:d.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:c,loyaltyWalletTotal:h});let p=this.calcuatePointsToBeExpired(c,"coinsToBeExpired"),g=this.calcuatePointsToBeExpired(h,"pointsToBeExpired");(p||g)&&this.playerElevateLeveLoaded.emit({pointExpireString:p,xpExpireString:g}),t(this.playerElevateLevel)}).catch(n=>{console.log("error ",n),a(!0)}))}setLoyaltyProgress(e){H(this.loyaltyProgressEle,e)}initLevelProgressbar(){setTimeout(()=>{this.loyaltyProgressEle=this.elevateCardRef.parentElement.querySelector("#LevelProgress"),this.loyaltyProgressEle&&(this.setLoyaltyProgress(this.playerElevateLevel.nextLevel?this.playerElevateLevel.loyaltyPoints/this.playerElevateLevel.nextLevel.entryPoints:1),this.params.playerElevateLevel=this.playerElevateLevel)},80)}componentDidRender(){this.initLevelProgressbar()}loadElevateInfo(){if(!this.params.endpoint||!this.params.session)return;const e=[];e.push(this.loadPlayerLevelInfo()),this.params.calculateLevelFlag&&e.push(this.loadLevels()),Promise.all(e).then(t=>{if(console.log("elevate-init",t),this.initLevelProgressbar(),!this.levels)return;this.levels.sort((r,l)=>r.firstEntryPoints>l.firstEntryPoints?1:-1);const a=this.playerElevateLevel.loyaltyPoints;let n=0;this.levels.forEach((r,l)=>{a>r.firstEntryPoints&&(n=l)}),this.playerElevateLeveLoaded.emit({calculatedLevelFlag:n})})}componentWillLoad(){this.loadElevateInfo()}get elevateCardRef(){return i.getElement(this)}static get watchers(){return{params:["onParamsChanged"]}}};I.style=X;const Y=":host{display:block}@media screen and (min-width: 501px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:nowrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:11px;margin-left:5px}}@media screen and (max-width: 500px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:wrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:0px;margin-left:0px}}.LoyaltyCard .Inner .LevelProgress{margin-left:0px}.LoyaltyCard .Inner .Row .PointsInfo.ExpirationPoints{text-align:left;color:var(--emw--color-red-50, red)}.LoyaltyCard .Inner .PlayerAvatar .Avatar{display:none}.LoyaltyCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%}.LoyaltyCard .Inner .LevelInfo .ElevateLevel{display:flex;flex:1;align-items:center}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{position:relative;padding-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate .ExpireTime{margin-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .LevelName{padding-left:0;font-size:var(--emw--elevate-fontsize-2xlarge, 21px);position:relative;width:auto;color:var(--emw--elevate-color-levelname, #FFBD2B);font-weight:bold}.LoyaltyCard .PointsRange{display:flex;justify-content:space-between}.LoyaltyCard .PointsRange .PointsInfo{width:auto}.LoyaltyCard .NextLevelTip{text-align:right;font-size:11px;color:var(--emw--color-black, #000);opacity:0.8;font-weight:bold}",J=Y,P=class{constructor(e){i.registerInstance(this,e),this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.playerAvatarUrl=void 0,this.language="en",this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.pointExpireString=void 0,this.playerElevateLevel=void 0,this.elevateWalletTotal=void 0}onSessionOrEndpointChange(){this.paramProxy=Object.assign(Object.assign({},this.paramProxy),{session:this.session,endpoint:this.endpoint,language:this.language})}playerElevateLeveLoadedHandler(e){e.detail&&(e.detail.elevateLevelWalletTotal&&(this.elevateWalletTotal=e.detail.elevateLevelWalletTotal),e.detail.elevateLevel&&(this.playerElevateLevel=e.detail.elevateLevel),e.detail.pointExpireString&&(this.pointExpireString=e.detail.xpExpireString))}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}componentWillLoad(){this.paramProxy={endpoint:this.endpoint,session:this.session,language:this.language}}getNextLevelPoints(){var e,t;return!((e=this.playerElevateLevel)===null||e===void 0)&&e.nextLevel?(t=this.playerElevateLevel)===null||t===void 0?void 0:t.nextLevel.entryPoints:-1}getNextLevelTips(){var e;let t=(e=this.playerElevateLevel)===null||e===void 0?void 0:e.nextLevel;if(this.playerElevateLevel&&t){const a=(t.entryPoints-this.playerElevateLevel.loyaltyPoints).toFixed(2);return u.translateWithParams("tipsForNextLevel",{pointsToReach:a,levelName:t.name,lang:this.language})}return""}render(){const e=i.getAssetPath("../static/card-ground.svg"),t=i.getAssetPath("../static/card-ground-over.svg");return i.h("div",{key:"39295a651da66747a20554699bba5f96b8ad5c35",class:`ElevateCardWrapper ${this.theme}`},i.h("div",{key:"78c34fe054fc2459f8af3354116cd21a68ce01be",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},i.h("general-styling-wrapper",{key:"be6efc6da4c3ccf4cc3ece8ecc73561bae75aa20",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:u.TRANSLATIONS,translationUrl:this.translationUrl}),i.h("player-elevate-card-data",{key:"b53e4b59d4ee55a2f567efa09afab3d72969e6e4",params:this.paramProxy}),i.h("div",{key:"1f3e504440bab2df3a181058fad7149c85c48c14",class:"OuterCover Inner",style:{backgroundImage:`url(${t}`}},i.h("div",{key:"a07c6cd95770dc1bfd3da78b1c7cc8e1367321b1",class:"Content Row"},this.playerElevateLevel&&i.h(i.Fragment,{key:"5c104f5ba1a018219c6ed5f6e50af99b035a0344"},i.h("div",{key:"bd94591e6ab9298ab7c769fa48efaf314dc1a63b",class:"PlayerImg"},i.h(o.PlayerAvatar,{key:"928849ce86d8c7a483eba7850efc83f8149bae43",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),i.h("div",{key:"37192c9b8502eb3c7d93914369df2d784c17e9f7",class:`LevelInfo ${this.playerElevateLevel.name}`},i.h(o.PlayerElevateLoyaltyLevel,{key:"2684a177f4bb1053c4587fd4158666fb35ca23f4",hideInfo:!0,level:this.playerElevateLevel.name,expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat}),i.h("div",{key:"173a37c63868f2d900c12af3ffc2d9a4a57550e4",class:"PointsRange"},i.h(o.PlayerPoints,{key:"a7111154f7dc547e0b05c70d24508bdd75c5d882",loyaltyPoints:this.playerElevateLevel.loyaltyPoints,language:this.language}),i.h(o.PlayerPoints,{key:"ad31574e7db81a7ecb7a06b28b1d4968cbcab93e",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),i.h(o.PlayerLoyaltyProcess,{key:"88ddfdb326edfb1de9519da6b3d0e5b514725e27"}),i.h("div",{key:"b9c79555a8001bd2c754d7573df04016da235c84",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&i.h("div",{key:"02da725060c9db4a8c1c2e8bad3426894d7f8f2c",class:"PointsInfo ExpirationPoints"},this.pointExpireString," ")))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};P.style=J;exports.gamification_dropdown=B.GamificationDropdown;exports.general_styling_wrapper=L;exports.player_elevate_card_data=I;exports.player_elevate_loyaltycard=P;
|