@everymatrix/casino-header-controller-nd 1.54.4 → 1.54.8
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/{CasinoHamburgerMenuNd-CkPg6ouB.js → CasinoHamburgerMenuNd-BN4YipjD.js} +829 -837
- package/components/CasinoHamburgerMenuNd-BRXAq9EB.js +5463 -0
- package/components/CasinoHamburgerMenuNd-DWivJdEW.cjs +5 -0
- package/components/CasinoHeaderControllerNd-Bcge1xWm.cjs +1 -0
- package/components/{CasinoHeaderControllerNd-BX0AvD48.js → CasinoHeaderControllerNd-DB6p0pM9.js} +85 -85
- package/components/CasinoHeaderControllerNd-y-KHL_bQ.js +2168 -0
- package/components/{PlayerAccountBalanceModalNd-K5u0ko-m.js → PlayerAccountBalanceModalNd-Cx1wys48.js} +93 -93
- package/components/PlayerAccountBalanceModalNd-DijTlCAM.js +1586 -0
- package/components/PlayerAccountBalanceModalNd-LPAeUZ5O.cjs +13 -0
- package/components/{PlayerDeposit-DsOspOgB.js → PlayerDeposit-DJtyV372.js} +46 -46
- package/components/PlayerDeposit-Dlc74zh3.js +395 -0
- package/components/PlayerDeposit-oYFoY9mr.cjs +1 -0
- package/es2015/casino-header-controller-nd.cjs +1 -0
- package/es2015/casino-header-controller-nd.js +16 -0
- package/esnext/casino-header-controller-nd.js +1 -1
- package/package.json +4 -1
- package/stencil/app-globals-0f993ce5-sCt45RkC.cjs +1 -0
- package/stencil/{gamification-dropdown-Rl66gqyp.js → gamification-dropdown-DSXwe6wL.js} +1 -1
- package/stencil/gamification-dropdown-DXwjfRK6.js +25 -0
- package/stencil/gamification-dropdown-DxQYaq9A.cjs +1 -0
- package/stencil/gamification-dropdown-dc081799-DhEx3oAW.js +121 -0
- package/stencil/{gamification-dropdown-ae7b7c69-C61VnAKy.js → gamification-dropdown-dc081799-DwwONu50.js} +1 -1
- package/stencil/gamification-dropdown-dc081799-grwre2mR.cjs +1 -0
- package/stencil/gamification-dropdown_4-DMyo0Cai.js +468 -0
- package/stencil/gamification-dropdown_4-Js76nmRP.cjs +192 -0
- package/stencil/{gamification-dropdown_4-AbKMnPZ5.js → gamification-dropdown_4-xIuhYShe.js} +3 -3
- package/stencil/index-5e36ea65-BYsPysDo.cjs +1 -0
- package/stencil/index-5e36ea65-COdY7Qod.js +859 -0
- package/stencil/index-5e36ea65-DT7tZRpo.js +832 -0
- package/stencil/{player-elevate-card-B4AMnqub.js → player-elevate-card-BcvihY18.js} +2 -2
- package/stencil/player-elevate-card-Ci_xja9l.js +105 -0
- package/stencil/player-elevate-card-DOMKpcd1.cjs +64 -0
- package/stencil/player-elevate-card-items-2a1dc5b5-B3hUJxjm.cjs +1 -0
- package/stencil/{player-elevate-card-items-9d490a3b-BxciIvXh.js → player-elevate-card-items-2a1dc5b5-R0FZQK7I.js} +1 -3
- package/stencil/player-elevate-card-items-2a1dc5b5-e_chraGM.js +1439 -0
- package/stencil/{player-elevate-pointcard-BeXukLE-.js → player-elevate-pointcard-BLdrrwJF.js} +2 -2
- package/stencil/player-elevate-pointcard-CZiVmETE.js +43 -0
- package/stencil/player-elevate-pointcard-DdN-6RUK.cjs +1 -0
- package/stencil/index-ea7720e4-FqoOOnHW.js +0 -826
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
var b = (e, t, a) => new Promise((n, r) => {
|
|
2
|
+
var l = (s) => {
|
|
3
|
+
try {
|
|
4
|
+
o(a.next(s));
|
|
5
|
+
} catch (v) {
|
|
6
|
+
r(v);
|
|
7
|
+
}
|
|
8
|
+
}, d = (s) => {
|
|
9
|
+
try {
|
|
10
|
+
o(a.throw(s));
|
|
11
|
+
} catch (v) {
|
|
12
|
+
r(v);
|
|
13
|
+
}
|
|
14
|
+
}, o = (s) => s.done ? n(s.value) : Promise.resolve(s.value).then(l, d);
|
|
15
|
+
o((a = a.apply(e, t)).next());
|
|
16
|
+
});
|
|
17
|
+
import { G as pe } from "./gamification-dropdown-dc081799-DhEx3oAW.js";
|
|
18
|
+
import { r as u, h as i, g as P, c as O, a as m, F as N } from "./index-5e36ea65-COdY7Qod.js";
|
|
19
|
+
import { t as k, T as $, P as W, a as z, b as L, c as U, r as p, d as h, g as E } from "./player-elevate-card-items-2a1dc5b5-e_chraGM.js";
|
|
20
|
+
const q = (e, t) => new Promise((a) => {
|
|
21
|
+
fetch(e).then((n) => n.json()).then((n) => {
|
|
22
|
+
Object.keys(n).forEach((r) => {
|
|
23
|
+
t[r] = t[r] ? t[r] : {};
|
|
24
|
+
for (let l in n[r])
|
|
25
|
+
t[r][l] = n[r][l];
|
|
26
|
+
}), a(!0);
|
|
27
|
+
});
|
|
28
|
+
}), F = ":host{display:block}", H = F, j = class {
|
|
29
|
+
constructor(e) {
|
|
30
|
+
u(this, e), this.clientStyling = "", this.clientStylingUrl = "", this.translationUrl = "", this.stylingAppends = !1, this.setClientStyling = () => {
|
|
31
|
+
let t = document.createElement("style");
|
|
32
|
+
t.innerHTML = this.clientStyling, this.el.prepend(t);
|
|
33
|
+
}, this.setClientStylingURL = () => {
|
|
34
|
+
let t = new URL(this.clientStylingUrl), a = document.createElement("style");
|
|
35
|
+
fetch(t.href).then((n) => n.text()).then((n) => {
|
|
36
|
+
a.innerHTML = n, setTimeout(() => {
|
|
37
|
+
this.el.prepend(a);
|
|
38
|
+
}, 1);
|
|
39
|
+
}).catch((n) => {
|
|
40
|
+
console.log("error ", n);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
componentDidRender() {
|
|
45
|
+
this.stylingAppends || (this.clientStyling && this.setClientStyling(), this.clientStylingUrl && this.setClientStylingURL(), this.stylingAppends = !0);
|
|
46
|
+
}
|
|
47
|
+
componentWillLoad() {
|
|
48
|
+
return b(this, null, function* () {
|
|
49
|
+
const e = [];
|
|
50
|
+
if (this.translationUrl) {
|
|
51
|
+
const t = q(this.translationUrl, this.targetTranslations);
|
|
52
|
+
e.push(t);
|
|
53
|
+
}
|
|
54
|
+
return yield Promise.all(e);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return i("div", { key: "4d3414408c7662f88331dbe655966237f74d6958", class: "StyleShell" }, i("slot", { key: "1d004644d84602c4314bdf5dfc26b55b160f57df", name: "mainContent" }));
|
|
59
|
+
}
|
|
60
|
+
get el() {
|
|
61
|
+
return P(this);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
j.style = H;
|
|
65
|
+
function w(e) {
|
|
66
|
+
p(1, arguments);
|
|
67
|
+
var t = h(e);
|
|
68
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
69
|
+
}
|
|
70
|
+
var G = 864e5;
|
|
71
|
+
function X(e, t) {
|
|
72
|
+
p(2, arguments);
|
|
73
|
+
var a = w(e), n = w(t), r = a.getTime() - E(a), l = n.getTime() - E(n);
|
|
74
|
+
return Math.round((r - l) / G);
|
|
75
|
+
}
|
|
76
|
+
var K = 6e4, Y = 36e5;
|
|
77
|
+
function C(e, t) {
|
|
78
|
+
return p(2, arguments), h(e).getTime() - h(t).getTime();
|
|
79
|
+
}
|
|
80
|
+
var I = {
|
|
81
|
+
ceil: Math.ceil,
|
|
82
|
+
round: Math.round,
|
|
83
|
+
floor: Math.floor,
|
|
84
|
+
trunc: function(t) {
|
|
85
|
+
return t < 0 ? Math.ceil(t) : Math.floor(t);
|
|
86
|
+
}
|
|
87
|
+
// Math.trunc is not supported by IE
|
|
88
|
+
}, J = "trunc";
|
|
89
|
+
function S(e) {
|
|
90
|
+
return e ? I[e] : I[J];
|
|
91
|
+
}
|
|
92
|
+
function Q(e, t, a) {
|
|
93
|
+
p(2, arguments);
|
|
94
|
+
var n = C(e, t) / Y;
|
|
95
|
+
return S(a == null ? void 0 : a.roundingMethod)(n);
|
|
96
|
+
}
|
|
97
|
+
function V(e, t, a) {
|
|
98
|
+
p(2, arguments);
|
|
99
|
+
var n = C(e, t) / K;
|
|
100
|
+
return S(a == null ? void 0 : a.roundingMethod)(n);
|
|
101
|
+
}
|
|
102
|
+
function Z(e, t) {
|
|
103
|
+
p(2, arguments);
|
|
104
|
+
var a = h(e), n = h(t);
|
|
105
|
+
return a.getTime() < n.getTime();
|
|
106
|
+
}
|
|
107
|
+
function ee(e, t) {
|
|
108
|
+
const a = e.querySelector("#total_level"), n = 17, r = 6.5, l = a.getBBox().width, d = t > 1 ? 1 : t, o = d * l - n < 0 ? 0 : d * l - n, s = e.querySelector("#current_level"), v = e.querySelector("#filter_current_level"), g = e.querySelector("#circle_current_level");
|
|
109
|
+
a.setAttribute("viewbox", `0 0 ${o} 28`), s.setAttribute("width", `${o}`), g.setAttribute("cx", `${o < r ? r : o}`), v.setAttribute("x", `${o - 8}`);
|
|
110
|
+
const y = e.querySelector("#lock"), T = e.querySelector("#filter_heart_ball"), A = e.querySelector("#filter_ball"), B = 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"), R = e.querySelector("#heart_box"), M = 10, c = l - M;
|
|
111
|
+
y.setAttribute("cx", `${c}`), x.setAttribute("x1", `${c}`), x.setAttribute("x2", `${c}`), f.setAttribute("x1", `${c - 6}`), f.setAttribute("x2", `${c - 6 + 11.2}`), D.setAttribute("x", `${c - 6}`), B.setAttribute("x", `${c - 6 - 2}`), A.setAttribute("x", `${c - 6 - 2 - 2}`), T.setAttribute("x", `${c - 6 - 2 - 2 - 4}`), _.setAttribute("x", `${c - 6}`), R.setAttribute("x", `${c - 6}`), a.parentElement.style.opacity = "1";
|
|
112
|
+
}
|
|
113
|
+
const te = `:host {
|
|
114
|
+
display: block;
|
|
115
|
+
width: 360px;
|
|
116
|
+
height: 230px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ElevateCardWrapper {
|
|
120
|
+
contain: layout inline-size;
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: fit-content;
|
|
123
|
+
min-height: 218px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.Outer {
|
|
127
|
+
container-type: inline-size;
|
|
128
|
+
font-size: 12px;
|
|
129
|
+
background-size: cover;
|
|
130
|
+
background-repeat: no-repeat;
|
|
131
|
+
line-height: initial;
|
|
132
|
+
width: 100%;
|
|
133
|
+
height: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.Dark {
|
|
137
|
+
color: var(--emw--color-gray150, #efefef);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.Light {
|
|
141
|
+
color: var(--emw--color-black, #0e0e0e);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@container (min-width: 381px) {
|
|
145
|
+
.Outer {
|
|
146
|
+
background-size: cover;
|
|
147
|
+
}
|
|
148
|
+
.Outer .OuterCover {
|
|
149
|
+
min-height: 190px;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
@container (min-width: 260px) {
|
|
153
|
+
.Outer {
|
|
154
|
+
background-size: contain;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
.OuterCover {
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 100%;
|
|
160
|
+
content: "";
|
|
161
|
+
background-repeat: no-repeat;
|
|
162
|
+
background-size: cover;
|
|
163
|
+
border-radius: 15px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.Inner {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
min-height: 158px;
|
|
170
|
+
}
|
|
171
|
+
.Inner .Content {
|
|
172
|
+
padding: 15px;
|
|
173
|
+
flex-wrap: wrap;
|
|
174
|
+
gap: 8px;
|
|
175
|
+
}
|
|
176
|
+
.Inner .Row {
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: row;
|
|
179
|
+
}
|
|
180
|
+
.Inner .CardCell {
|
|
181
|
+
display: flex;
|
|
182
|
+
}
|
|
183
|
+
.Inner .LevelProgress svg {
|
|
184
|
+
transition: opacity 0.4s;
|
|
185
|
+
}
|
|
186
|
+
.Inner .LevelInfo {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
}
|
|
190
|
+
.Inner .LevelInfo .ElevateLevel .LevelName {
|
|
191
|
+
height: 28px;
|
|
192
|
+
border-radius: 5px;
|
|
193
|
+
line-height: 28px;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
text-overflow: ellipsis;
|
|
196
|
+
white-space: nowrap;
|
|
197
|
+
}
|
|
198
|
+
.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {
|
|
199
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));
|
|
200
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level0-bg0, #E2792C) 0%, var(--emw--elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);
|
|
201
|
+
}
|
|
202
|
+
.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {
|
|
203
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));
|
|
204
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level1-bg0, #BEBFED) 0%, var(--emw--elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);
|
|
205
|
+
}
|
|
206
|
+
.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {
|
|
207
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));
|
|
208
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level2-bg0, #FCC410) 0%, var(--emw--elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);
|
|
209
|
+
}
|
|
210
|
+
.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {
|
|
211
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));
|
|
212
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level3-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);
|
|
213
|
+
}
|
|
214
|
+
.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {
|
|
215
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));
|
|
216
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level4-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);
|
|
217
|
+
}
|
|
218
|
+
.Inner .LevelInfo .ElevateLevel {
|
|
219
|
+
display: flex;
|
|
220
|
+
}
|
|
221
|
+
.Inner .LevelInfo {
|
|
222
|
+
flex: 1;
|
|
223
|
+
flex-grow: 1;
|
|
224
|
+
min-width: 150px;
|
|
225
|
+
}
|
|
226
|
+
.Inner .PlayerImg {
|
|
227
|
+
width: 29%;
|
|
228
|
+
margin: auto;
|
|
229
|
+
max-width: 100px;
|
|
230
|
+
min-width: 30px;
|
|
231
|
+
order: 0;
|
|
232
|
+
}
|
|
233
|
+
.Inner .PlayerAvatar {
|
|
234
|
+
max-width: 100px;
|
|
235
|
+
flex-basis: 100px;
|
|
236
|
+
height: auto;
|
|
237
|
+
margin: auto;
|
|
238
|
+
padding-top: 10px;
|
|
239
|
+
}
|
|
240
|
+
.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 100%;
|
|
243
|
+
}
|
|
244
|
+
.Inner .PlayerAvatar .Avatar {
|
|
245
|
+
border-radius: 50%;
|
|
246
|
+
background-size: contain;
|
|
247
|
+
background-repeat: no-repeat;
|
|
248
|
+
}
|
|
249
|
+
.Inner .ElevateLevel .ExpirationDate {
|
|
250
|
+
max-width: 138px;
|
|
251
|
+
min-width: 118px;
|
|
252
|
+
}
|
|
253
|
+
.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {
|
|
254
|
+
text-transform: capitalize;
|
|
255
|
+
width: 100%;
|
|
256
|
+
}
|
|
257
|
+
.Inner .PlayerName {
|
|
258
|
+
font-size: 16px;
|
|
259
|
+
}
|
|
260
|
+
.Inner .Row .PointsInfo {
|
|
261
|
+
display: table;
|
|
262
|
+
font-weight: 600;
|
|
263
|
+
}
|
|
264
|
+
.Inner .Row .Redeem {
|
|
265
|
+
justify-content: flex-end;
|
|
266
|
+
margin-left: auto;
|
|
267
|
+
}
|
|
268
|
+
.Inner .Row .Redeem:hover {
|
|
269
|
+
color: var(--emw--elevate-color-redeem-hover, #00ABA4);
|
|
270
|
+
cursor: pointer;
|
|
271
|
+
}
|
|
272
|
+
.Inner .Row .RedeemButton:hover span {
|
|
273
|
+
color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);
|
|
274
|
+
font-weight: bold;
|
|
275
|
+
}
|
|
276
|
+
.Inner .Row .RedeemButton {
|
|
277
|
+
width: 95px;
|
|
278
|
+
height: 35px;
|
|
279
|
+
display: flex;
|
|
280
|
+
align-items: center;
|
|
281
|
+
border-radius: 10px;
|
|
282
|
+
background: var(--emw--elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);
|
|
283
|
+
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);
|
|
284
|
+
}
|
|
285
|
+
.Inner .Row .RedeemButton span {
|
|
286
|
+
color: var(--emw--color-white, #fff);
|
|
287
|
+
line-height: 18px;
|
|
288
|
+
font-size: 15px;
|
|
289
|
+
text-align: center;
|
|
290
|
+
width: 100%;
|
|
291
|
+
}
|
|
292
|
+
.Inner .Row .Points {
|
|
293
|
+
font-size: large;
|
|
294
|
+
vertical-align: middle;
|
|
295
|
+
}
|
|
296
|
+
.Inner .Row .Points .XP {
|
|
297
|
+
font-size: x-small;
|
|
298
|
+
}
|
|
299
|
+
.Inner .Row .ExpirationPoints {
|
|
300
|
+
font-size: small;
|
|
301
|
+
text-align: right;
|
|
302
|
+
font-weight: bold;
|
|
303
|
+
color: var(--emw--color-red, #9e595f);
|
|
304
|
+
}`, ne = te, ae = class {
|
|
305
|
+
constructor(e) {
|
|
306
|
+
u(this, e), this.playerElevateLeveLoaded = O(this, "playerElevateLeveLoaded");
|
|
307
|
+
}
|
|
308
|
+
handleWindowResizs() {
|
|
309
|
+
this.initLevelProgressbar();
|
|
310
|
+
}
|
|
311
|
+
onParamsChanged() {
|
|
312
|
+
this.loadElevateInfo();
|
|
313
|
+
}
|
|
314
|
+
redeemGiftButtonHandler() {
|
|
315
|
+
this.loadElevateInfo();
|
|
316
|
+
}
|
|
317
|
+
onRedeemClick() {
|
|
318
|
+
window.postMessage({ type: "BEERedeemClicked" }, window.location.href);
|
|
319
|
+
}
|
|
320
|
+
loadLevels() {
|
|
321
|
+
let e = new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);
|
|
322
|
+
return new Promise((t, a) => fetch(e.href, {
|
|
323
|
+
method: "GET"
|
|
324
|
+
}).then((n) => n.json()).then((n) => {
|
|
325
|
+
this.levels = n.data, t(!0);
|
|
326
|
+
}).catch((n) => {
|
|
327
|
+
a(n);
|
|
328
|
+
}));
|
|
329
|
+
}
|
|
330
|
+
calcuatePointsToBeExpired(e) {
|
|
331
|
+
let t = "";
|
|
332
|
+
if (!e || !e.aboutToExpire || e.aboutToExpire.length == 0 || e.aboutToExpire[0].points <= 0)
|
|
333
|
+
return t;
|
|
334
|
+
e.aboutToExpire.sort((o, s) => Z(new Date(o.expireTime), new Date(s.expireTime)) ? -1 : 1);
|
|
335
|
+
const a = e.aboutToExpire[0], n = X(new Date(a.expireTime), /* @__PURE__ */ new Date());
|
|
336
|
+
let r = 0, l = 0, d = n === 0 ? "pointsToBeExpiredDay" : "pointsToBeExpired";
|
|
337
|
+
return n <= 0 && (r = Q(new Date(a.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), d = r > 1 ? "pointsToBeExpiredHours" : "pointsToBeExpiredHour", r <= 0 && (l = V(new Date(a.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), d = l > 1 ? "pointsToBeExpiredMinutes" : "pointsToBeExpiredMinute")), t = k(d, {
|
|
338
|
+
expirationPoints: a.points,
|
|
339
|
+
expireDay: Math.max(n, r, l)
|
|
340
|
+
}), t;
|
|
341
|
+
}
|
|
342
|
+
loadPlayerLevelInfo() {
|
|
343
|
+
let e = new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);
|
|
344
|
+
return new Promise((t, a) => fetch(e.href, {
|
|
345
|
+
method: "GET",
|
|
346
|
+
headers: {
|
|
347
|
+
"X-Sessionid": this.params.session,
|
|
348
|
+
"Content-Type": "application/json"
|
|
349
|
+
}
|
|
350
|
+
}).then((n) => n.json()).then((n) => {
|
|
351
|
+
var r, l, d;
|
|
352
|
+
if (!n.success) {
|
|
353
|
+
console.error("Exception when fetch user elevateinfo, ", n.errorCode, n.errorMessage), a(!0);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
let o = n.data;
|
|
357
|
+
this.playerElevateLevel = o.level, this.playerElevateLevel.name = this.playerElevateLevel.presentation.displayName || this.playerElevateLevel.name, this.playerElevateLevel.spendablePoints = ((r = o.spendableWallet) === null || r === void 0 ? void 0 : r.total.points) || 0, this.playerElevateLeveLoaded.emit({ elevateLevel: this.playerElevateLevel });
|
|
358
|
+
const s = (l = n.data.spendableWallet) === null || l === void 0 ? void 0 : l.total, v = (d = n.data.loyaltyWallet) === null || d === void 0 ? void 0 : d.total;
|
|
359
|
+
this.playerElevateLeveLoaded.emit({
|
|
360
|
+
elevateLevelWalletTotal: s,
|
|
361
|
+
loyaltyWalletTotal: v
|
|
362
|
+
});
|
|
363
|
+
let g = this.calcuatePointsToBeExpired(s), y = this.calcuatePointsToBeExpired(v);
|
|
364
|
+
(g || y) && this.playerElevateLeveLoaded.emit({
|
|
365
|
+
pointExpireString: g,
|
|
366
|
+
xpExpireString: y
|
|
367
|
+
}), t(this.playerElevateLevel);
|
|
368
|
+
}).catch((n) => {
|
|
369
|
+
console.log("error ", n), a(!0);
|
|
370
|
+
}));
|
|
371
|
+
}
|
|
372
|
+
setLoyaltyProgress(e) {
|
|
373
|
+
ee(this.loyaltyProgressEle, e);
|
|
374
|
+
}
|
|
375
|
+
initLevelProgressbar() {
|
|
376
|
+
setTimeout(() => {
|
|
377
|
+
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);
|
|
378
|
+
}, 80);
|
|
379
|
+
}
|
|
380
|
+
componentDidRender() {
|
|
381
|
+
this.initLevelProgressbar();
|
|
382
|
+
}
|
|
383
|
+
loadElevateInfo() {
|
|
384
|
+
if (!this.params.endpoint || !this.params.session)
|
|
385
|
+
return;
|
|
386
|
+
const e = [];
|
|
387
|
+
e.push(this.loadPlayerLevelInfo()), this.params.calculateLevelFlag && e.push(this.loadLevels()), Promise.all(e).then((t) => {
|
|
388
|
+
if (console.log("elevate-init", t), this.initLevelProgressbar(), !this.levels)
|
|
389
|
+
return;
|
|
390
|
+
this.levels.sort((r, l) => r.firstEntryPoints > l.firstEntryPoints ? 1 : -1);
|
|
391
|
+
const a = this.playerElevateLevel.loyaltyPoints;
|
|
392
|
+
let n = 0;
|
|
393
|
+
this.levels.forEach((r, l) => {
|
|
394
|
+
a > r.firstEntryPoints && (n = l);
|
|
395
|
+
}), this.playerElevateLeveLoaded.emit({
|
|
396
|
+
calculatedLevelFlag: n
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
componentWillLoad() {
|
|
401
|
+
this.loadElevateInfo();
|
|
402
|
+
}
|
|
403
|
+
get elevateCardRef() {
|
|
404
|
+
return P(this);
|
|
405
|
+
}
|
|
406
|
+
static get watchers() {
|
|
407
|
+
return {
|
|
408
|
+
params: ["onParamsChanged"]
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
ae.style = ne;
|
|
413
|
+
const re = ":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 = re, ie = class {
|
|
414
|
+
constructor(e) {
|
|
415
|
+
u(this, e), this.theme = "Dark", this.language = "en", this.dateFormat = "yyyy-MM-dd", this.clientStyling = "", this.clientStylingUrl = "", this.translationUrl = "";
|
|
416
|
+
}
|
|
417
|
+
onSessionOrEndpointChange() {
|
|
418
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
419
|
+
}
|
|
420
|
+
playerElevateLeveLoadedHandler(e) {
|
|
421
|
+
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));
|
|
422
|
+
}
|
|
423
|
+
onRedeemClick() {
|
|
424
|
+
window.postMessage({ type: "BEERedeemClicked" }, window.location.href);
|
|
425
|
+
}
|
|
426
|
+
componentWillLoad() {
|
|
427
|
+
this.paramProxy = {
|
|
428
|
+
endpoint: this.endpoint,
|
|
429
|
+
session: this.session,
|
|
430
|
+
language: this.language
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
getNextLevelPoints() {
|
|
434
|
+
var e, t;
|
|
435
|
+
return !((e = this.playerElevateLevel) === null || e === void 0) && e.nextLevel ? (t = this.playerElevateLevel) === null || t === void 0 ? void 0 : t.nextLevel.entryPoints : -1;
|
|
436
|
+
}
|
|
437
|
+
getNextLevelTips() {
|
|
438
|
+
var e;
|
|
439
|
+
let t = (e = this.playerElevateLevel) === null || e === void 0 ? void 0 : e.nextLevel;
|
|
440
|
+
if (this.playerElevateLevel && t) {
|
|
441
|
+
const a = (t.entryPoints - this.playerElevateLevel.loyaltyPoints).toFixed(2);
|
|
442
|
+
return k("tipsForNextLevel", {
|
|
443
|
+
pointsToReach: a,
|
|
444
|
+
levelName: t.name,
|
|
445
|
+
lang: this.language
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
return "";
|
|
449
|
+
}
|
|
450
|
+
render() {
|
|
451
|
+
const e = m("../static/card-ground.svg"), t = m("../static/card-ground-over.svg");
|
|
452
|
+
return i("div", { key: "2b0944f8317a94621e1bc65bbbb3726654b8963b", class: `ElevateCardWrapper ${this.theme}` }, i("div", { key: "c6d4dbba143435b4485d7fde91ab0a48a2f6688b", class: "LoyaltyCard Outer", style: { backgroundImage: `url(${e}` } }, i("general-styling-wrapper", { key: "e47a4efe925eb35d4449c6ff33a0afef9d284e55", clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: $, translationUrl: this.translationUrl }), i("player-elevate-card-data", { key: "a560991893305894ddd41756cd7b3c32d0ef9e03", params: this.paramProxy }), i("div", { key: "ceb8b71386f84f54518a3694535aa16c2c3d3951", class: "OuterCover Inner", style: { backgroundImage: `url(${t}` } }, i("div", { key: "1df9647c3de42e74adee0f8895511442118ae381", class: "Content Row" }, this.playerElevateLevel && i(N, { key: "569bcd5fc3c578d2e6cc7442d28444e29688660c" }, i("div", { key: "aa40032bff99c5462b906e4427232ca2d4019017", class: "PlayerImg" }, i(W, { key: "7a2d535b0c2029c90b9f1c123f9feebafca6bdde", onlyBadge: !0, loyaltyIconUrl: this.playerElevateLevel.presentation.asset })), i("div", { key: "90999da8fc2a3102eac235fcbc8afbec2a2bbdf8", class: `LevelInfo ${this.playerElevateLevel.name}` }, i(z, { key: "67e8bf370b1b77e776fb6d955ae63928fd1338d8", hideInfo: !0, level: this.playerElevateLevel.name, expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat }), i("div", { key: "1e0fefc6a23f4aeeef5e19828399fe1229a3fc81", class: "PointsRange" }, i(L, { key: "dd176e624cde3b6f517101d7702a15465305174d", loyaltyPoints: this.playerElevateLevel.loyaltyPoints, language: this.language }), i(L, { key: "6cddb64c92545803d08fbbc513cc951b2691a42e", loyaltyPoints: this.getNextLevelPoints(), language: this.language })), i(U, { key: "08817ca979ea784aeb735579b0d52e5150eb0852" }), i("div", { key: "be9a1b40a8145d5e6d329d8e9f047296e84dd24b", class: "NextLevelTip" }, this.getNextLevelTips()), this.pointExpireString && i("div", { key: "f9cbb7d06e34717cb9f74cb8d2e506e49969e775", class: "PointsInfo ExpirationPoints" }, this.pointExpireString, " ")))))));
|
|
453
|
+
}
|
|
454
|
+
static get watchers() {
|
|
455
|
+
return {
|
|
456
|
+
session: ["onSessionOrEndpointChange"],
|
|
457
|
+
endpoint: ["onSessionOrEndpointChange"],
|
|
458
|
+
language: ["onSessionOrEndpointChange"]
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
ie.style = le;
|
|
463
|
+
export {
|
|
464
|
+
pe as gamification_dropdown,
|
|
465
|
+
j as general_styling_wrapper,
|
|
466
|
+
ae as player_elevate_card_data,
|
|
467
|
+
ie as player_elevate_loyaltycard
|
|
468
|
+
};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";var f=(e,t,a)=>new Promise((n,l)=>{var i=d=>{try{s(a.next(d))}catch(p){l(p)}},c=d=>{try{s(a.throw(d))}catch(p){l(p)}},s=d=>d.done?n(d.value):Promise.resolve(d.value).then(i,c);s((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./gamification-dropdown-dc081799-grwre2mR.cjs"),r=require("./index-5e36ea65-BYsPysDo.cjs"),o=require("./player-elevate-card-items-2a1dc5b5-B3hUJxjm.cjs"),B=(e,t)=>new Promise(a=>{fetch(e).then(n=>n.json()).then(n=>{Object.keys(n).forEach(l=>{t[l]=t[l]?t[l]:{};for(let i in n[l])t[l][i]=n[l][i]}),a(!0)})}),M=":host{display:block}",R=M,m=class{constructor(e){r.registerInstance(this,e),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",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)})}}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}componentWillLoad(){return f(this,null,function*(){const e=[];if(this.translationUrl){const t=B(this.translationUrl,this.targetTranslations);e.push(t)}return yield Promise.all(e)})}render(){return r.h("div",{key:"4d3414408c7662f88331dbe655966237f74d6958",class:"StyleShell"},r.h("slot",{key:"1d004644d84602c4314bdf5dfc26b55b160f57df",name:"mainContent"}))}get el(){return r.getElement(this)}};m.style=R;function x(e){o.requiredArgs(1,arguments);var t=o.toDate(e);return t.setHours(0,0,0,0),t}var O=864e5;function q(e,t){o.requiredArgs(2,arguments);var a=x(e),n=x(t),l=a.getTime()-o.getTimezoneOffsetInMilliseconds(a),i=n.getTime()-o.getTimezoneOffsetInMilliseconds(n);return Math.round((l-i)/O)}var N=6e4,$=36e5;function L(e,t){return o.requiredArgs(2,arguments),o.toDate(e).getTime()-o.toDate(t).getTime()}var b={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},W="trunc";function E(e){return e?b[e]:b[W]}function z(e,t,a){o.requiredArgs(2,arguments);var n=L(e,t)/$;return E(a==null?void 0:a.roundingMethod)(n)}function U(e,t,a){o.requiredArgs(2,arguments);var n=L(e,t)/N;return E(a==null?void 0:a.roundingMethod)(n)}function F(e,t){o.requiredArgs(2,arguments);var a=o.toDate(e),n=o.toDate(t);return a.getTime()<n.getTime()}function j(e,t){const a=e.querySelector("#total_level"),n=17,l=6.5,i=a.getBBox().width,c=t>1?1:t,s=c*i-n<0?0:c*i-n,d=e.querySelector("#current_level"),p=e.querySelector("#filter_current_level"),h=e.querySelector("#circle_current_level");a.setAttribute("viewbox",`0 0 ${s} 28`),d.setAttribute("width",`${s}`),h.setAttribute("cx",`${s<l?l:s}`),p.setAttribute("x",`${s-8}`);const g=e.querySelector("#lock"),P=e.querySelector("#filter_heart_ball"),C=e.querySelector("#filter_ball"),k=e.querySelector("#filter_heart"),S=e.querySelector("#filter_lock"),y=e.querySelector("#paint0_linear_ball"),u=e.querySelector("#paint1_linear_lock"),T=e.querySelector("#lock_box"),A=e.querySelector("#heart_box"),D=10,v=i-D;g.setAttribute("cx",`${v}`),u.setAttribute("x1",`${v}`),u.setAttribute("x2",`${v}`),y.setAttribute("x1",`${v-6}`),y.setAttribute("x2",`${v-6+11.2}`),S.setAttribute("x",`${v-6}`),k.setAttribute("x",`${v-6-2}`),C.setAttribute("x",`${v-6-2-2}`),P.setAttribute("x",`${v-6-2-2-4}`),T.setAttribute("x",`${v-6}`),A.setAttribute("x",`${v-6}`),a.parentElement.style.opacity="1"}const H=`:host {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 360px;
|
|
4
|
+
height: 230px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ElevateCardWrapper {
|
|
8
|
+
contain: layout inline-size;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: fit-content;
|
|
11
|
+
min-height: 218px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.Outer {
|
|
15
|
+
container-type: inline-size;
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
background-size: cover;
|
|
18
|
+
background-repeat: no-repeat;
|
|
19
|
+
line-height: initial;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.Dark {
|
|
25
|
+
color: var(--emw--color-gray150, #efefef);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.Light {
|
|
29
|
+
color: var(--emw--color-black, #0e0e0e);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@container (min-width: 381px) {
|
|
33
|
+
.Outer {
|
|
34
|
+
background-size: cover;
|
|
35
|
+
}
|
|
36
|
+
.Outer .OuterCover {
|
|
37
|
+
min-height: 190px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
@container (min-width: 260px) {
|
|
41
|
+
.Outer {
|
|
42
|
+
background-size: contain;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.OuterCover {
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
content: "";
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
background-size: cover;
|
|
51
|
+
border-radius: 15px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.Inner {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
min-height: 158px;
|
|
58
|
+
}
|
|
59
|
+
.Inner .Content {
|
|
60
|
+
padding: 15px;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
gap: 8px;
|
|
63
|
+
}
|
|
64
|
+
.Inner .Row {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
}
|
|
68
|
+
.Inner .CardCell {
|
|
69
|
+
display: flex;
|
|
70
|
+
}
|
|
71
|
+
.Inner .LevelProgress svg {
|
|
72
|
+
transition: opacity 0.4s;
|
|
73
|
+
}
|
|
74
|
+
.Inner .LevelInfo {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
}
|
|
78
|
+
.Inner .LevelInfo .ElevateLevel .LevelName {
|
|
79
|
+
height: 28px;
|
|
80
|
+
border-radius: 5px;
|
|
81
|
+
line-height: 28px;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
}
|
|
86
|
+
.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {
|
|
87
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));
|
|
88
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level0-bg0, #E2792C) 0%, var(--emw--elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);
|
|
89
|
+
}
|
|
90
|
+
.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {
|
|
91
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));
|
|
92
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level1-bg0, #BEBFED) 0%, var(--emw--elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);
|
|
93
|
+
}
|
|
94
|
+
.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {
|
|
95
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));
|
|
96
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level2-bg0, #FCC410) 0%, var(--emw--elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);
|
|
97
|
+
}
|
|
98
|
+
.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {
|
|
99
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));
|
|
100
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level3-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);
|
|
101
|
+
}
|
|
102
|
+
.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {
|
|
103
|
+
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));
|
|
104
|
+
background: linear-gradient(180deg, var(--emw--elevate-color-level4-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);
|
|
105
|
+
}
|
|
106
|
+
.Inner .LevelInfo .ElevateLevel {
|
|
107
|
+
display: flex;
|
|
108
|
+
}
|
|
109
|
+
.Inner .LevelInfo {
|
|
110
|
+
flex: 1;
|
|
111
|
+
flex-grow: 1;
|
|
112
|
+
min-width: 150px;
|
|
113
|
+
}
|
|
114
|
+
.Inner .PlayerImg {
|
|
115
|
+
width: 29%;
|
|
116
|
+
margin: auto;
|
|
117
|
+
max-width: 100px;
|
|
118
|
+
min-width: 30px;
|
|
119
|
+
order: 0;
|
|
120
|
+
}
|
|
121
|
+
.Inner .PlayerAvatar {
|
|
122
|
+
max-width: 100px;
|
|
123
|
+
flex-basis: 100px;
|
|
124
|
+
height: auto;
|
|
125
|
+
margin: auto;
|
|
126
|
+
padding-top: 10px;
|
|
127
|
+
}
|
|
128
|
+
.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 100%;
|
|
131
|
+
}
|
|
132
|
+
.Inner .PlayerAvatar .Avatar {
|
|
133
|
+
border-radius: 50%;
|
|
134
|
+
background-size: contain;
|
|
135
|
+
background-repeat: no-repeat;
|
|
136
|
+
}
|
|
137
|
+
.Inner .ElevateLevel .ExpirationDate {
|
|
138
|
+
max-width: 138px;
|
|
139
|
+
min-width: 118px;
|
|
140
|
+
}
|
|
141
|
+
.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {
|
|
142
|
+
text-transform: capitalize;
|
|
143
|
+
width: 100%;
|
|
144
|
+
}
|
|
145
|
+
.Inner .PlayerName {
|
|
146
|
+
font-size: 16px;
|
|
147
|
+
}
|
|
148
|
+
.Inner .Row .PointsInfo {
|
|
149
|
+
display: table;
|
|
150
|
+
font-weight: 600;
|
|
151
|
+
}
|
|
152
|
+
.Inner .Row .Redeem {
|
|
153
|
+
justify-content: flex-end;
|
|
154
|
+
margin-left: auto;
|
|
155
|
+
}
|
|
156
|
+
.Inner .Row .Redeem:hover {
|
|
157
|
+
color: var(--emw--elevate-color-redeem-hover, #00ABA4);
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
}
|
|
160
|
+
.Inner .Row .RedeemButton:hover span {
|
|
161
|
+
color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);
|
|
162
|
+
font-weight: bold;
|
|
163
|
+
}
|
|
164
|
+
.Inner .Row .RedeemButton {
|
|
165
|
+
width: 95px;
|
|
166
|
+
height: 35px;
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
border-radius: 10px;
|
|
170
|
+
background: var(--emw--elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);
|
|
171
|
+
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);
|
|
172
|
+
}
|
|
173
|
+
.Inner .Row .RedeemButton span {
|
|
174
|
+
color: var(--emw--color-white, #fff);
|
|
175
|
+
line-height: 18px;
|
|
176
|
+
font-size: 15px;
|
|
177
|
+
text-align: center;
|
|
178
|
+
width: 100%;
|
|
179
|
+
}
|
|
180
|
+
.Inner .Row .Points {
|
|
181
|
+
font-size: large;
|
|
182
|
+
vertical-align: middle;
|
|
183
|
+
}
|
|
184
|
+
.Inner .Row .Points .XP {
|
|
185
|
+
font-size: x-small;
|
|
186
|
+
}
|
|
187
|
+
.Inner .Row .ExpirationPoints {
|
|
188
|
+
font-size: small;
|
|
189
|
+
text-align: right;
|
|
190
|
+
font-weight: bold;
|
|
191
|
+
color: var(--emw--color-red, #9e595f);
|
|
192
|
+
}`,G=H,w=class{constructor(e){r.registerInstance(this,e),this.playerElevateLeveLoaded=r.createEvent(this,"playerElevateLeveLoaded")}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){let t="";if(!e||!e.aboutToExpire||e.aboutToExpire.length==0||e.aboutToExpire[0].points<=0)return t;e.aboutToExpire.sort((s,d)=>F(new Date(s.expireTime),new Date(d.expireTime))?-1:1);const a=e.aboutToExpire[0],n=q(new Date(a.expireTime),new Date);let l=0,i=0,c=n===0?"pointsToBeExpiredDay":"pointsToBeExpired";return n<=0&&(l=z(new Date(a.expireTime),new Date,{roundingMethod:"floor"}),c=l>1?"pointsToBeExpiredHours":"pointsToBeExpiredHour",l<=0&&(i=U(new Date(a.expireTime),new Date,{roundingMethod:"floor"}),c=i>1?"pointsToBeExpiredMinutes":"pointsToBeExpiredMinute")),t=o.translateWithParams(c,{expirationPoints:a.points,expireDay:Math.max(n,l,i)}),t}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 l,i,c;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=((l=s.spendableWallet)===null||l===void 0?void 0:l.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const d=(i=n.data.spendableWallet)===null||i===void 0?void 0:i.total,p=(c=n.data.loyaltyWallet)===null||c===void 0?void 0:c.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:d,loyaltyWalletTotal:p});let h=this.calcuatePointsToBeExpired(d),g=this.calcuatePointsToBeExpired(p);(h||g)&&this.playerElevateLeveLoaded.emit({pointExpireString:h,xpExpireString:g}),t(this.playerElevateLevel)}).catch(n=>{console.log("error ",n),a(!0)}))}setLoyaltyProgress(e){j(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((l,i)=>l.firstEntryPoints>i.firstEntryPoints?1:-1);const a=this.playerElevateLevel.loyaltyPoints;let n=0;this.levels.forEach((l,i)=>{a>l.firstEntryPoints&&(n=i)}),this.playerElevateLeveLoaded.emit({calculatedLevelFlag:n})})}componentWillLoad(){this.loadElevateInfo()}get elevateCardRef(){return r.getElement(this)}static get watchers(){return{params:["onParamsChanged"]}}};w.style=G;const X=":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}",K=X,I=class{constructor(e){r.registerInstance(this,e),this.theme="Dark",this.language="en",this.dateFormat="yyyy-MM-dd",this.clientStyling="",this.clientStylingUrl="",this.translationUrl=""}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 o.translateWithParams("tipsForNextLevel",{pointsToReach:a,levelName:t.name,lang:this.language})}return""}render(){const e=r.getAssetPath("../static/card-ground.svg"),t=r.getAssetPath("../static/card-ground-over.svg");return r.h("div",{key:"2b0944f8317a94621e1bc65bbbb3726654b8963b",class:`ElevateCardWrapper ${this.theme}`},r.h("div",{key:"c6d4dbba143435b4485d7fde91ab0a48a2f6688b",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},r.h("general-styling-wrapper",{key:"e47a4efe925eb35d4449c6ff33a0afef9d284e55",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:o.TRANSLATIONS,translationUrl:this.translationUrl}),r.h("player-elevate-card-data",{key:"a560991893305894ddd41756cd7b3c32d0ef9e03",params:this.paramProxy}),r.h("div",{key:"ceb8b71386f84f54518a3694535aa16c2c3d3951",class:"OuterCover Inner",style:{backgroundImage:`url(${t}`}},r.h("div",{key:"1df9647c3de42e74adee0f8895511442118ae381",class:"Content Row"},this.playerElevateLevel&&r.h(r.Fragment,{key:"569bcd5fc3c578d2e6cc7442d28444e29688660c"},r.h("div",{key:"aa40032bff99c5462b906e4427232ca2d4019017",class:"PlayerImg"},r.h(o.PlayerAvatar,{key:"7a2d535b0c2029c90b9f1c123f9feebafca6bdde",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),r.h("div",{key:"90999da8fc2a3102eac235fcbc8afbec2a2bbdf8",class:`LevelInfo ${this.playerElevateLevel.name}`},r.h(o.PlayerElevateLoyaltyLevel,{key:"67e8bf370b1b77e776fb6d955ae63928fd1338d8",hideInfo:!0,level:this.playerElevateLevel.name,expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat}),r.h("div",{key:"1e0fefc6a23f4aeeef5e19828399fe1229a3fc81",class:"PointsRange"},r.h(o.PlayerPoints,{key:"dd176e624cde3b6f517101d7702a15465305174d",loyaltyPoints:this.playerElevateLevel.loyaltyPoints,language:this.language}),r.h(o.PlayerPoints,{key:"6cddb64c92545803d08fbbc513cc951b2691a42e",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),r.h(o.PlayerLoyaltyProcess,{key:"08817ca979ea784aeb735579b0d52e5150eb0852"}),r.h("div",{key:"be9a1b40a8145d5e6d329d8e9f047296e84dd24b",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&r.h("div",{key:"f9cbb7d06e34717cb9f74cb8d2e506e49969e775",class:"PointsInfo ExpirationPoints"},this.pointExpireString," ")))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};I.style=K;exports.gamification_dropdown=_.GamificationDropdown;exports.general_styling_wrapper=m;exports.player_elevate_card_data=w;exports.player_elevate_loyaltycard=I;
|