@everymatrix/casino-header-controller-nd 1.94.18 → 1.94.19

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.
Files changed (53) hide show
  1. package/components/{CasinoHamburgerMenuNd-DWDm1vVk.js → CasinoHamburgerMenuNd-Bjs8OrSg.js} +1 -1
  2. package/components/{CasinoHamburgerMenuNd-iwNCIJmA.js → CasinoHamburgerMenuNd-DghgYwAW.js} +1 -1
  3. package/components/{CasinoHamburgerMenuNd-CSbl7CoD.cjs → CasinoHamburgerMenuNd-DxVp8qmB.cjs} +1 -1
  4. package/components/{CasinoHeaderControllerNd-DjUBMrpK.js → CasinoHeaderControllerNd-BzkAPe1u.js} +4 -4
  5. package/components/{CasinoHeaderControllerNd-7abTaOHM.js → CasinoHeaderControllerNd-Ku8TIerA.js} +4 -4
  6. package/components/{CasinoHeaderControllerNd-R014aSHw.cjs → CasinoHeaderControllerNd-SusNQ9vF.cjs} +1 -1
  7. package/components/{PlayerAccountBalanceModalNd-CW0LcTe1.js → PlayerAccountBalanceModalNd-CY0-Gpjg.js} +1 -1
  8. package/components/{PlayerAccountBalanceModalNd-BRPhP2Kj.js → PlayerAccountBalanceModalNd-DqxTWp0c.js} +1 -1
  9. package/components/{PlayerAccountBalanceModalNd-xrGpymtI.cjs → PlayerAccountBalanceModalNd-Dy0J1BNv.cjs} +1 -1
  10. package/components/{PlayerDeposit-BtP4vS0V.cjs → PlayerDeposit-CHdUIP9F.cjs} +1 -1
  11. package/components/{PlayerDeposit-Caex9Crt.js → PlayerDeposit-CgBwJSzN.js} +1 -1
  12. package/components/{PlayerDeposit-Dx7hpReE.js → PlayerDeposit-DUSFU7W3.js} +1 -1
  13. package/es2015/casino-header-controller-nd.cjs +1 -1
  14. package/es2015/casino-header-controller-nd.js +1 -1
  15. package/esnext/casino-header-controller-nd.js +1 -1
  16. package/lazy/{casino-hamburger-menu-nd-C9mR3-Vs.cjs → casino-hamburger-menu-nd-BdVs0jn_.cjs} +1 -1
  17. package/lazy/{casino-hamburger-menu-nd-DZOPUnuI.js → casino-hamburger-menu-nd-C78M5SJq.js} +1 -1
  18. package/lazy/{casino-hamburger-menu-nd-yy0ndx6_.js → casino-hamburger-menu-nd-DQeXu4pZ.js} +1 -1
  19. package/lazy/{gamification-dropdown-CC9WEy9m.cjs → gamification-dropdown-1FoOgZ8Q.cjs} +1 -1
  20. package/lazy/{gamification-dropdown-D9wYSCWh.js → gamification-dropdown-BOTZfUj9.js} +4 -4
  21. package/lazy/{gamification-dropdown-w1DrybKv.js → gamification-dropdown-C6jvURdo.js} +4 -4
  22. package/lazy/{player-account-balance-modal-nd-crPv-smv.js → player-account-balance-modal-nd-C7V97kR2.js} +1 -1
  23. package/lazy/{player-account-balance-modal-nd-Cr4D_ueb.js → player-account-balance-modal-nd-CISYN2WC.js} +1 -1
  24. package/lazy/{player-account-balance-modal-nd-D_nZxosy.cjs → player-account-balance-modal-nd-QdasMpeP.cjs} +1 -1
  25. package/lazy/{player-deposit-D_eycdoi.js → player-deposit-BdY9FeSl.js} +1 -1
  26. package/lazy/{player-deposit-BO-HzTSg.cjs → player-deposit-CjjMmByX.cjs} +1 -1
  27. package/lazy/{player-deposit-BwczqUSi.js → player-deposit-QN-QcEDc.js} +1 -1
  28. package/package.json +1 -1
  29. package/stencil/gamification-dropdown-C0KSnS-f.cjs +1 -0
  30. package/stencil/gamification-dropdown-Cjr1bobv.js +29 -0
  31. package/stencil/gamification-dropdown-Dr7emsS9.js +11 -0
  32. package/stencil/gamification-dropdown-f420baf5-CXS6ttXg.cjs +1 -0
  33. package/stencil/{gamification-dropdown-f0760153-DysjODzh.js → gamification-dropdown-f420baf5-Cd7I0I0F.js} +54 -50
  34. package/stencil/{gamification-dropdown-f0760153-BNi1BCSK.js → gamification-dropdown-f420baf5-Yn1TwmHs.js} +23 -19
  35. package/stencil/{gamification-dropdown_4-CKdgGcAa.js → gamification-dropdown_4-7nnEjJNh.js} +30 -26
  36. package/stencil/{gamification-dropdown_4-Bgr8y242.cjs → gamification-dropdown_4-DYrDHhuq.cjs} +2 -2
  37. package/stencil/{gamification-dropdown_4-C3HCFJ02.js → gamification-dropdown_4-Fl3dC19B.js} +29 -25
  38. package/stencil/{player-elevate-card-CtSlq6rw.js → player-elevate-card-C8cmBOgI.js} +2 -2
  39. package/stencil/{player-elevate-card-CrB4Rycd.js → player-elevate-card-Cub7Yexa.js} +2 -2
  40. package/stencil/{player-elevate-card-8CeAmBcc.cjs → player-elevate-card-D4DBOUoV.cjs} +1 -1
  41. package/stencil/{player-elevate-card-items-a0f9711e-D-HJCZ-4.cjs → player-elevate-card-items-a0f9711e-BcCKrobp.cjs} +1 -1
  42. package/stencil/{player-elevate-card-items-a0f9711e-2wxf2bQS.js → player-elevate-card-items-a0f9711e-C5gdymkr.js} +1 -1
  43. package/stencil/{player-elevate-card-items-a0f9711e-B6SIxC10.js → player-elevate-card-items-a0f9711e-D4hQq8eO.js} +1 -1
  44. package/stencil/{player-elevate-pointcard-S_nBLiFP.js → player-elevate-pointcard-CBE-WkII.js} +2 -2
  45. package/stencil/{player-elevate-pointcard-DqQmT8M0.js → player-elevate-pointcard-D2zbRTcX.js} +2 -2
  46. package/stencil/{player-elevate-pointcard-BzOBMPWm.cjs → player-elevate-pointcard-DdkpqBvL.cjs} +1 -1
  47. package/stencil/{player-rakeback-card-xFfBUked.cjs → player-rakeback-card-BG3ZIhV3.cjs} +1 -1
  48. package/stencil/{player-rakeback-card-DOfXavss.js → player-rakeback-card-C8zAEwvz.js} +1 -1
  49. package/stencil/{player-rakeback-card-DrfLGio2.js → player-rakeback-card-CVd4qXYX.js} +1 -1
  50. package/stencil/gamification-dropdown-C89mFZDR.cjs +0 -1
  51. package/stencil/gamification-dropdown-DFnrjTD-.js +0 -11
  52. package/stencil/gamification-dropdown-f0760153-DBhYvhv1.cjs +0 -1
  53. package/stencil/gamification-dropdown-oHavdEUT.js +0 -29
@@ -1,5 +1,5 @@
1
- import { r as g, h as r, a as u } from "../lazy/gamification-dropdown-D9wYSCWh.js";
2
- const y = "en";
1
+ import { r as u, h as r, a as y } from "../lazy/gamification-dropdown-BOTZfUj9.js";
2
+ const m = "en";
3
3
  let h = {
4
4
  en: {
5
5
  gamificationNoPoints: "No points"
@@ -20,63 +20,63 @@ let h = {
20
20
  gamificationNoPoints: "No points"
21
21
  }
22
22
  };
23
- const d = (i) => new Promise((t) => {
24
- fetch(i).then((e) => e.json()).then((e) => {
25
- Object.keys(e).forEach((n) => {
23
+ const d = (e) => new Promise((t) => {
24
+ fetch(e).then((i) => i.json()).then((i) => {
25
+ Object.keys(i).forEach((n) => {
26
26
  h[n] || (h[n] = {});
27
- for (let s in e[n])
28
- h[n][s] = e[n][s];
27
+ for (let s in i[n])
28
+ h[n][s] = i[n][s];
29
29
  }), t(!0);
30
30
  });
31
- }), w = (i, t) => {
32
- const e = t;
33
- return h[e !== void 0 && e in h ? e : y][i];
31
+ }), w = (e, t) => {
32
+ const i = t;
33
+ return h[i !== void 0 && i in h ? i : m][e];
34
34
  }, c = "__WIDGET_GLOBAL_STYLE_CACHE__";
35
- function p(i, t) {
36
- if (i) {
37
- const e = document.createElement("style");
38
- e.innerHTML = t, i.appendChild(e);
35
+ function f(e, t) {
36
+ if (e) {
37
+ const i = document.createElement("style");
38
+ i.innerHTML = t, e.appendChild(i);
39
39
  }
40
40
  }
41
- function f(i, t) {
42
- if (!i || !t)
41
+ function p(e, t) {
42
+ if (!e || !t)
43
43
  return;
44
- const e = new URL(t);
45
- fetch(e.href).then((n) => n.text()).then((n) => {
44
+ const i = new URL(t);
45
+ fetch(i.href).then((n) => n.text()).then((n) => {
46
46
  const s = document.createElement("style");
47
- s.innerHTML = n, i && i.appendChild(s);
47
+ s.innerHTML = n, e && e.appendChild(s);
48
48
  }).catch((n) => {
49
49
  console.error("There was an error while trying to load client styling from URL", n);
50
50
  });
51
51
  }
52
- function m(i, t, e, n = !1) {
52
+ function g(e, t, i, n = !1) {
53
53
  if (!window.emMessageBus)
54
54
  return;
55
55
  if (!("adoptedStyleSheets" in Document.prototype) || !n)
56
- return e = S(i, t), e;
57
- window[c] || (window[c] = {}), e = v(i, t);
58
- const o = e.unsubscribe.bind(e), a = () => {
56
+ return i = S(e, t), i;
57
+ window[c] || (window[c] = {}), i = b(e, t);
58
+ const o = i.unsubscribe.bind(i), a = () => {
59
59
  if (window[c][t]) {
60
60
  const l = window[c][t];
61
61
  l.refCount > 1 ? l.refCount = l.refCount - 1 : delete window[c][t];
62
62
  }
63
63
  o();
64
64
  };
65
- return e.unsubscribe = a, e;
65
+ return i.unsubscribe = a, i;
66
66
  }
67
- function S(i, t) {
68
- const e = document.createElement("style");
67
+ function S(e, t) {
68
+ const i = document.createElement("style");
69
69
  return window.emMessageBus.subscribe(t, (n) => {
70
- i && (e.innerHTML = n, i.appendChild(e));
70
+ e && (i.innerHTML = n, e.appendChild(i));
71
71
  });
72
72
  }
73
- function v(i, t) {
74
- return window.emMessageBus.subscribe(t, (e) => {
75
- if (!i)
73
+ function b(e, t) {
74
+ return window.emMessageBus.subscribe(t, (i) => {
75
+ if (!e)
76
76
  return;
77
- const n = i.getRootNode(), s = window[c];
77
+ const n = e.getRootNode(), s = window[c];
78
78
  let o = s[t] && s[t].sheet;
79
- o ? s[t].refCount = s[t].refCount + 1 : (o = new CSSStyleSheet(), o.replaceSync(e), s[t] = {
79
+ o ? s[t].refCount = s[t].refCount + 1 : (o = new CSSStyleSheet(), o.replaceSync(i), s[t] = {
80
80
  sheet: o,
81
81
  refCount: 1
82
82
  });
@@ -84,9 +84,9 @@ function v(i, t) {
84
84
  a.includes(o) || (n.adoptedStyleSheets = [...a, o]);
85
85
  });
86
86
  }
87
- const C = ":host{display:block}.GamificationDropdownContainer{position:relative}.GamificationDropdownContainer .GamificationDropdown{position:absolute;left:0;z-index:200;overflow:hidden;cursor:pointer}.GamificationDropdownButton{cursor:pointer;font-size:14px;height:20px;background-color:unset;color:var(--emw--color-typography, #FFFFFF);padding:0;border:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:center;line-height:0}.GamificationDropdownButton:hover{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton:hover svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton .TriangleActive,.GamificationDropdownButton .TriangleInactive{display:block;transition:all 0.2s}.GamificationDropdownButton .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px);fill:var(--emw--color-primary, #52d004);margin-top:4px}.GamificationDropdownButton svg{fill:var(--emw--color-typography, #FFFFFF);margin-left:8px;width:16px}", b = C, L = class {
88
- constructor(i) {
89
- g(this, i), this.messageHandler = (t) => {
87
+ const v = ":host{display:block}.GamificationDropdownContainer{position:relative}.GamificationDropdownContainer .GamificationDropdown{position:absolute;left:0;z-index:200;overflow:hidden;cursor:pointer}.GamificationDropdownButton{cursor:pointer;font-size:14px;height:20px;background-color:unset;color:var(--emw--color-typography, #FFFFFF);padding:0;border:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:center;line-height:0}.GamificationDropdownButton:hover{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton:hover svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton .TriangleActive,.GamificationDropdownButton .TriangleInactive{display:block;transition:all 0.2s}.GamificationDropdownButton .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px);fill:var(--emw--color-primary, #52d004);margin-top:4px}.GamificationDropdownButton svg{fill:var(--emw--color-typography, #FFFFFF);margin-left:8px;width:16px}", C = v, L = class {
88
+ constructor(e) {
89
+ u(this, e), this.messageHandler = (t) => {
90
90
  t.data && t.data.type === "UpdateGamificationXp" && (this.loyaltyPoints = t.data.points);
91
91
  }, this.navigateToGamification = () => {
92
92
  window.postMessage({ type: "NavigateToGamification" }, window.location.href), this.isOpen = !1;
@@ -101,33 +101,36 @@ const C = ":host{display:block}.GamificationDropdownContainer{position:relative}
101
101
  this.isLoading = !1;
102
102
  });
103
103
  }
104
- handleClientStylingChange(i, t) {
105
- i != t && p(this.stylingContainer, this.clientStyling);
104
+ handleMbSourceChange(e, t) {
105
+ e != t && g(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
106
106
  }
107
- handleClientStylingChangeURL(i, t) {
108
- i != t && this.clientStylingUrl && f(this.stylingContainer, this.clientStylingUrl);
107
+ handleClientStylingChange(e, t) {
108
+ e != t && f(this.stylingContainer, this.clientStyling);
109
+ }
110
+ handleClientStylingChangeURL(e, t) {
111
+ e != t && this.clientStylingUrl && p(this.stylingContainer, this.clientStylingUrl);
109
112
  }
110
113
  async componentWillLoad() {
111
114
  if (this.translationUrl.length > 2 && await d(this.translationUrl), this.endpoint && this.language)
112
115
  return this.fetchPointsData();
113
116
  }
114
117
  componentDidLoad() {
115
- window.addEventListener("message", this.messageHandler), this.stylingContainer && (window.emMessageBus != null ? m(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription) : (this.clientStyling && p(this.stylingContainer, this.clientStyling), this.clientStylingUrl && f(this.stylingContainer, this.clientStylingUrl)));
118
+ window.addEventListener("message", this.messageHandler), this.stylingContainer && (this.mbSource && g(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription), this.clientStyling && f(this.stylingContainer, this.clientStyling), this.clientStylingUrl && p(this.stylingContainer, this.clientStylingUrl));
116
119
  }
117
120
  disconnectedCallback() {
118
121
  this.stylingSubscription && this.stylingSubscription.unsubscribe(), window.removeEventListener("message", this.messageHandler);
119
122
  }
120
123
  fetchPointsData() {
121
- let i = new URL(`${this.endpoint}/v1/elevate/playerInfo`);
122
- i.searchParams.append("language", this.language);
124
+ let e = new URL(`${this.endpoint}/v1/elevate/playerInfo`);
125
+ e.searchParams.append("language", this.language);
123
126
  const t = new Headers();
124
127
  t.append("X-SessionId", this.session);
125
- const e = {
128
+ const i = {
126
129
  method: "GET",
127
130
  headers: t
128
131
  };
129
132
  return new Promise((n, s) => {
130
- this.isLoading = !0, fetch(i.href, e).then((o) => o.json()).then((o) => {
133
+ this.isLoading = !0, fetch(e.href, i).then((o) => o.json()).then((o) => {
131
134
  var a, l;
132
135
  this.loyaltyPoints = (l = (a = o?.data) === null || a === void 0 ? void 0 : a.level) === null || l === void 0 ? void 0 : l.loyaltyPoints, n(!0);
133
136
  }).catch((o) => {
@@ -138,23 +141,24 @@ const C = ":host{display:block}.GamificationDropdownContainer{position:relative}
138
141
  });
139
142
  }
140
143
  render() {
141
- return this.isLoading ? null : r("div", { ref: (i) => this.stylingContainer = i, class: "GamificationDropdownContainer" }, r("button", { class: `GamificationDropdownButton ${this.isOpen ? "IsOpen" : ""}`, type: "button", onClick: (i) => this.handleDropdownClick(i), title: typeof this.loyaltyPoints == "number" ? String(this.loyaltyPoints) : w("gamificationNoPoints", this.language) }, typeof this.loyaltyPoints == "number" ? `${this.loyaltyPoints} XP` : "...", r("span", { class: this.isOpen ? "TriangleActive" : "TriangleInactive" }, r("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, r("path", { id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)" })))), this.isOpen && r("div", { class: "GamificationDropdown", onClick: this.navigateToGamification }, r("player-elevate-loyaltycard", { endpoint: this.endpoint, session: this.session, language: this.language, "client-styling-url": this.clientStylingUrl, "client-styling": this.clientStyling, "mb-source": this.mbSource })));
144
+ return r("div", { key: "448b39e62a6a892fd271ca508053cf390ecec5ef", ref: (e) => this.stylingContainer = e, class: "GamificationDropdownContainer" }, !this.isLoading && r("button", { key: "fe29d2a1eed374dbc755bb7577974c6eb52b93e6", class: `GamificationDropdownButton ${this.isOpen ? "IsOpen" : ""}`, type: "button", onClick: (e) => this.handleDropdownClick(e), title: typeof this.loyaltyPoints == "number" ? String(this.loyaltyPoints) : w("gamificationNoPoints", this.language) }, typeof this.loyaltyPoints == "number" ? `${this.loyaltyPoints} XP` : "...", r("span", { key: "3afb5438ae618972372fc5a94c1e6a4e142c2bd9", class: this.isOpen ? "TriangleActive" : "TriangleInactive" }, r("svg", { key: "d46d7b63558e8d3fa2295e14cdb5d581c5050dc2", xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, r("path", { key: "c8cf74e8d68cff297ea0343f6972b19deb4180e1", id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)" })))), !this.isLoading && this.isOpen && r("div", { key: "a40ff1a96319446ff6c8dae3ea5c54ea6ac8fe6d", class: "GamificationDropdown", onClick: this.navigateToGamification }, r("player-elevate-loyaltycard", { key: "eec1d17711483f558e06b75b3a58c68c276edb44", endpoint: this.endpoint, session: this.session, language: this.language, "client-styling-url": this.clientStylingUrl, "client-styling": this.clientStyling, "mb-source": this.mbSource })));
142
145
  }
143
146
  get el() {
144
- return u(this);
147
+ return y(this);
145
148
  }
146
149
  static get watchers() {
147
150
  return {
148
151
  translationUrl: ["handleNewTranslations"],
152
+ mbSource: ["handleMbSourceChange"],
149
153
  clientStyling: ["handleClientStylingChange"],
150
154
  clientStylingUrl: ["handleClientStylingChangeURL"]
151
155
  };
152
156
  }
153
157
  };
154
- L.style = b;
158
+ L.style = C;
155
159
  export {
156
160
  L as G,
157
- f as a,
158
- m as b,
159
- p as s
161
+ p as a,
162
+ g as b,
163
+ f as s
160
164
  };
@@ -1,21 +1,21 @@
1
- var f = (e, t, i) => new Promise((n, s) => {
1
+ var p = (e, t, i) => new Promise((n, s) => {
2
2
  var o = (r) => {
3
3
  try {
4
4
  a(i.next(r));
5
- } catch (p) {
6
- s(p);
5
+ } catch (f) {
6
+ s(f);
7
7
  }
8
8
  }, l = (r) => {
9
9
  try {
10
10
  a(i.throw(r));
11
- } catch (p) {
12
- s(p);
11
+ } catch (f) {
12
+ s(f);
13
13
  }
14
14
  }, a = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(o, l);
15
15
  a((i = i.apply(e, t)).next());
16
16
  });
17
- import { r as w, h as c, a as m } from "../lazy/gamification-dropdown-w1DrybKv.js";
18
- const S = "en";
17
+ import { r as w, h as c, a as S } from "../lazy/gamification-dropdown-C6jvURdo.js";
18
+ const b = "en";
19
19
  let d = {
20
20
  en: {
21
21
  gamificationNoPoints: "No points"
@@ -46,7 +46,7 @@ const g = (e) => new Promise((t) => {
46
46
  });
47
47
  }), v = (e, t) => {
48
48
  const i = t;
49
- return d[i !== void 0 && i in d ? i : S][e];
49
+ return d[i !== void 0 && i in d ? i : b][e];
50
50
  }, h = "__WIDGET_GLOBAL_STYLE_CACHE__";
51
51
  function u(e, t) {
52
52
  if (e) {
@@ -65,11 +65,11 @@ function y(e, t) {
65
65
  console.error("There was an error while trying to load client styling from URL", n);
66
66
  });
67
67
  }
68
- function C(e, t, i, n = !1) {
68
+ function m(e, t, i, n = !1) {
69
69
  if (!window.emMessageBus)
70
70
  return;
71
71
  if (!("adoptedStyleSheets" in Document.prototype) || !n)
72
- return i = b(e, t), i;
72
+ return i = C(e, t), i;
73
73
  window[h] || (window[h] = {}), i = L(e, t);
74
74
  const o = i.unsubscribe.bind(i), l = () => {
75
75
  if (window[h][t]) {
@@ -80,7 +80,7 @@ function C(e, t, i, n = !1) {
80
80
  };
81
81
  return i.unsubscribe = l, i;
82
82
  }
83
- function b(e, t) {
83
+ function C(e, t) {
84
84
  const i = document.createElement("style");
85
85
  return window.emMessageBus.subscribe(t, (n) => {
86
86
  e && (i.innerHTML = n, e.appendChild(i));
@@ -100,7 +100,7 @@ function L(e, t) {
100
100
  l.includes(o) || (n.adoptedStyleSheets = [...l, o]);
101
101
  });
102
102
  }
103
- const G = ":host{display:block}.GamificationDropdownContainer{position:relative}.GamificationDropdownContainer .GamificationDropdown{position:absolute;left:0;z-index:200;overflow:hidden;cursor:pointer}.GamificationDropdownButton{cursor:pointer;font-size:14px;height:20px;background-color:unset;color:var(--emw--color-typography, #FFFFFF);padding:0;border:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:center;line-height:0}.GamificationDropdownButton:hover{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton:hover svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton .TriangleActive,.GamificationDropdownButton .TriangleInactive{display:block;transition:all 0.2s}.GamificationDropdownButton .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px);fill:var(--emw--color-primary, #52d004);margin-top:4px}.GamificationDropdownButton svg{fill:var(--emw--color-typography, #FFFFFF);margin-left:8px;width:16px}", D = G, P = class {
103
+ const G = ":host{display:block}.GamificationDropdownContainer{position:relative}.GamificationDropdownContainer .GamificationDropdown{position:absolute;left:0;z-index:200;overflow:hidden;cursor:pointer}.GamificationDropdownButton{cursor:pointer;font-size:14px;height:20px;background-color:unset;color:var(--emw--color-typography, #FFFFFF);padding:0;border:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:center;line-height:0}.GamificationDropdownButton:hover{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton:hover svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen{color:var(--emw--color-primary, #52d004)}.GamificationDropdownButton.IsOpen svg{fill:var(--emw--color-primary, #52d004)}.GamificationDropdownButton .TriangleActive,.GamificationDropdownButton .TriangleInactive{display:block;transition:all 0.2s}.GamificationDropdownButton .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px);fill:var(--emw--color-primary, #52d004);margin-top:4px}.GamificationDropdownButton svg{fill:var(--emw--color-typography, #FFFFFF);margin-left:8px;width:16px}", D = G, k = class {
104
104
  constructor(e) {
105
105
  w(this, e), this.messageHandler = (t) => {
106
106
  t.data && t.data.type === "UpdateGamificationXp" && (this.loyaltyPoints = t.data.points);
@@ -117,6 +117,9 @@ const G = ":host{display:block}.GamificationDropdownContainer{position:relative}
117
117
  this.isLoading = !1;
118
118
  });
119
119
  }
120
+ handleMbSourceChange(e, t) {
121
+ e != t && m(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
122
+ }
120
123
  handleClientStylingChange(e, t) {
121
124
  e != t && u(this.stylingContainer, this.clientStyling);
122
125
  }
@@ -124,13 +127,13 @@ const G = ":host{display:block}.GamificationDropdownContainer{position:relative}
124
127
  e != t && this.clientStylingUrl && y(this.stylingContainer, this.clientStylingUrl);
125
128
  }
126
129
  componentWillLoad() {
127
- return f(this, null, function* () {
130
+ return p(this, null, function* () {
128
131
  if (this.translationUrl.length > 2 && (yield g(this.translationUrl)), this.endpoint && this.language)
129
132
  return this.fetchPointsData();
130
133
  });
131
134
  }
132
135
  componentDidLoad() {
133
- window.addEventListener("message", this.messageHandler), this.stylingContainer && (window.emMessageBus != null ? C(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription) : (this.clientStyling && u(this.stylingContainer, this.clientStyling), this.clientStylingUrl && y(this.stylingContainer, this.clientStylingUrl)));
136
+ window.addEventListener("message", this.messageHandler), this.stylingContainer && (this.mbSource && m(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription), this.clientStyling && u(this.stylingContainer, this.clientStyling), this.clientStylingUrl && y(this.stylingContainer, this.clientStylingUrl));
134
137
  }
135
138
  disconnectedCallback() {
136
139
  this.stylingSubscription && this.stylingSubscription.unsubscribe(), window.removeEventListener("message", this.messageHandler);
@@ -156,23 +159,24 @@ const G = ":host{display:block}.GamificationDropdownContainer{position:relative}
156
159
  });
157
160
  }
158
161
  render() {
159
- return this.isLoading ? null : c("div", { ref: (e) => this.stylingContainer = e, class: "GamificationDropdownContainer" }, c("button", { class: `GamificationDropdownButton ${this.isOpen ? "IsOpen" : ""}`, type: "button", onClick: (e) => this.handleDropdownClick(e), title: typeof this.loyaltyPoints == "number" ? String(this.loyaltyPoints) : v("gamificationNoPoints", this.language) }, typeof this.loyaltyPoints == "number" ? `${this.loyaltyPoints} XP` : "...", c("span", { class: this.isOpen ? "TriangleActive" : "TriangleInactive" }, c("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, c("path", { id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)" })))), this.isOpen && c("div", { class: "GamificationDropdown", onClick: this.navigateToGamification }, c("player-elevate-loyaltycard", { endpoint: this.endpoint, session: this.session, language: this.language, "client-styling-url": this.clientStylingUrl, "client-styling": this.clientStyling, "mb-source": this.mbSource })));
162
+ return c("div", { key: "448b39e62a6a892fd271ca508053cf390ecec5ef", ref: (e) => this.stylingContainer = e, class: "GamificationDropdownContainer" }, !this.isLoading && c("button", { key: "fe29d2a1eed374dbc755bb7577974c6eb52b93e6", class: `GamificationDropdownButton ${this.isOpen ? "IsOpen" : ""}`, type: "button", onClick: (e) => this.handleDropdownClick(e), title: typeof this.loyaltyPoints == "number" ? String(this.loyaltyPoints) : v("gamificationNoPoints", this.language) }, typeof this.loyaltyPoints == "number" ? `${this.loyaltyPoints} XP` : "...", c("span", { key: "3afb5438ae618972372fc5a94c1e6a4e142c2bd9", class: this.isOpen ? "TriangleActive" : "TriangleInactive" }, c("svg", { key: "d46d7b63558e8d3fa2295e14cdb5d581c5050dc2", xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, c("path", { key: "c8cf74e8d68cff297ea0343f6972b19deb4180e1", id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)" })))), !this.isLoading && this.isOpen && c("div", { key: "a40ff1a96319446ff6c8dae3ea5c54ea6ac8fe6d", class: "GamificationDropdown", onClick: this.navigateToGamification }, c("player-elevate-loyaltycard", { key: "eec1d17711483f558e06b75b3a58c68c276edb44", endpoint: this.endpoint, session: this.session, language: this.language, "client-styling-url": this.clientStylingUrl, "client-styling": this.clientStyling, "mb-source": this.mbSource })));
160
163
  }
161
164
  get el() {
162
- return m(this);
165
+ return S(this);
163
166
  }
164
167
  static get watchers() {
165
168
  return {
166
169
  translationUrl: ["handleNewTranslations"],
170
+ mbSource: ["handleMbSourceChange"],
167
171
  clientStyling: ["handleClientStylingChange"],
168
172
  clientStylingUrl: ["handleClientStylingChangeURL"]
169
173
  };
170
174
  }
171
175
  };
172
- P.style = D;
176
+ k.style = D;
173
177
  export {
174
- P as G,
178
+ k as G,
175
179
  y as a,
176
- C as b,
180
+ m as b,
177
181
  u as s
178
182
  };
@@ -1,4 +1,4 @@
1
- var E = (e, t, a) => new Promise((n, l) => {
1
+ var w = (e, t, a) => new Promise((n, l) => {
2
2
  var r = (d) => {
3
3
  try {
4
4
  o(a.next(d));
@@ -14,11 +14,11 @@ var E = (e, t, a) => new Promise((n, l) => {
14
14
  }, o = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(r, s);
15
15
  o((a = a.apply(e, t)).next());
16
16
  });
17
- import { b as N, s as x, a as b } from "./gamification-dropdown-f0760153-BNi1BCSK.js";
18
- import { G as fe } from "./gamification-dropdown-f0760153-BNi1BCSK.js";
19
- import { r as m, h as i, a as T, c as U, g as I, F as W } from "../lazy/gamification-dropdown-w1DrybKv.js";
20
- import { a as A, T as z } from "./locale-DbysznUQ.js";
21
- import { P as q, e as P, c as F, L as j, r as p, t as h, g as S } from "./player-elevate-card-items-a0f9711e-B6SIxC10.js";
17
+ import { b as I, s as x, a as b } from "./gamification-dropdown-f420baf5-Yn1TwmHs.js";
18
+ import { G as fe } from "./gamification-dropdown-f420baf5-Yn1TwmHs.js";
19
+ import { r as m, h as i, a as A, c as U, g as S, F as W } from "../lazy/gamification-dropdown-C6jvURdo.js";
20
+ import { a as D, T as z } from "./locale-DbysznUQ.js";
21
+ import { P as q, e as P, c as F, L as j, r as p, t as h, g as C } from "./player-elevate-card-items-a0f9711e-D4hQq8eO.js";
22
22
  const G = (e, t) => new Promise((a) => {
23
23
  fetch(e).then((n) => n.json()).then((n) => {
24
24
  Object.keys(n).forEach((l) => {
@@ -39,11 +39,14 @@ const G = (e, t) => new Promise((a) => {
39
39
  m(this, e), this.stylingAppends = !1, this.clientStyling = "", this.clientStylingUrl = "", this.mbSource = void 0, this.translationUrl = "", this.targetTranslations = void 0;
40
40
  }
41
41
  componentDidLoad() {
42
- this.el && (window.emMessageBus != null ? N(this.el, `${this.mbSource}.Style`, this.stylingSubscription) : (this.clientStyling && x(this.el, this.clientStyling), this.clientStylingUrl && b(this.el, this.clientStylingUrl), this.stylingAppends = !0));
42
+ this.el && (this.mbSource && I(this.el, `${this.mbSource}.Style`, this.stylingSubscription), this.clientStyling && x(this.el, this.clientStyling), this.clientStylingUrl && b(this.el, this.clientStylingUrl), this.stylingAppends = !0);
43
43
  }
44
44
  disconnectedCallback() {
45
45
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
46
46
  }
47
+ handleMbSourceChange(e, t) {
48
+ e != t && I(this.el, `${this.mbSource}.Style`, this.stylingSubscription);
49
+ }
47
50
  handleClientStylingChange(e, t) {
48
51
  e != t && x(this.el, this.clientStyling);
49
52
  }
@@ -54,7 +57,7 @@ const G = (e, t) => new Promise((a) => {
54
57
  this.stylingAppends || (this.clientStyling && x(this.el, this.clientStyling), this.clientStylingUrl && b(this.el, this.clientStylingUrl), this.stylingAppends = !0);
55
58
  }
56
59
  componentWillLoad() {
57
- return E(this, null, function* () {
60
+ return w(this, null, function* () {
58
61
  const e = [];
59
62
  if (this.translationUrl) {
60
63
  const t = G(this.translationUrl, this.targetTranslations);
@@ -64,20 +67,21 @@ const G = (e, t) => new Promise((a) => {
64
67
  });
65
68
  }
66
69
  render() {
67
- return i("div", { key: "09ad83748bbad518743c8671b986c541c52bf3f0", class: "StyleShell" }, i("slot", { key: "3b28b776d3944410c717b002b70946d274a4e8e7", name: "mainContent" }));
70
+ return i("div", { key: "e660ceb69f5e848c788c3924fc814c0fa7a777a2", class: "StyleShell" }, i("slot", { key: "35014b6c0c32532af11e6a629ba9b13942504d21", name: "mainContent" }));
68
71
  }
69
72
  get el() {
70
- return T(this);
73
+ return A(this);
71
74
  }
72
75
  static get watchers() {
73
76
  return {
77
+ mbSource: ["handleMbSourceChange"],
74
78
  clientStyling: ["handleClientStylingChange"],
75
79
  clientStylingUrl: ["handleClientStylingUrlChange"]
76
80
  };
77
81
  }
78
82
  };
79
83
  Y.style = X;
80
- function C(e) {
84
+ function k(e) {
81
85
  p(1, arguments);
82
86
  var t = h(e);
83
87
  return t.setHours(0, 0, 0, 0), t;
@@ -85,14 +89,14 @@ function C(e) {
85
89
  var J = 864e5;
86
90
  function K(e, t) {
87
91
  p(2, arguments);
88
- var a = C(e), n = C(t), l = a.getTime() - S(a), r = n.getTime() - S(n);
92
+ var a = k(e), n = k(t), l = a.getTime() - C(a), r = n.getTime() - C(n);
89
93
  return Math.round((l - r) / J);
90
94
  }
91
95
  var Q = 6e4, V = 36e5;
92
- function D(e, t) {
96
+ function _(e, t) {
93
97
  return p(2, arguments), h(e).getTime() - h(t).getTime();
94
98
  }
95
- var k = {
99
+ var T = {
96
100
  ceil: Math.ceil,
97
101
  round: Math.round,
98
102
  floor: Math.floor,
@@ -101,18 +105,18 @@ var k = {
101
105
  }
102
106
  // Math.trunc is not supported by IE
103
107
  }, Z = "trunc";
104
- function _(e) {
105
- return e ? k[e] : k[Z];
108
+ function B(e) {
109
+ return e ? T[e] : T[Z];
106
110
  }
107
111
  function ee(e, t, a) {
108
112
  p(2, arguments);
109
- var n = D(e, t) / V;
110
- return _(a == null ? void 0 : a.roundingMethod)(n);
113
+ var n = _(e, t) / V;
114
+ return B(a == null ? void 0 : a.roundingMethod)(n);
111
115
  }
112
116
  function te(e, t, a) {
113
117
  p(2, arguments);
114
- var n = D(e, t) / Q;
115
- return _(a == null ? void 0 : a.roundingMethod)(n);
118
+ var n = _(e, t) / Q;
119
+ return B(a == null ? void 0 : a.roundingMethod)(n);
116
120
  }
117
121
  function ne(e, t) {
118
122
  p(2, arguments);
@@ -122,8 +126,8 @@ function ne(e, t) {
122
126
  function ae(e, t) {
123
127
  const a = e.querySelector("#total_level"), n = 17, l = 6.5, r = a.getBBox().width, s = t > 1 ? 1 : t, o = s * r - n < 0 ? 0 : s * r - n, d = e.querySelector("#current_level"), v = e.querySelector("#filter_current_level"), g = e.querySelector("#circle_current_level");
124
128
  a.setAttribute("viewbox", `0 0 ${o} 28`), d.setAttribute("width", `${o}`), g.setAttribute("cx", `${o < l ? l : o}`), v.setAttribute("x", `${o - 8}`);
125
- const y = e.querySelector("#lock"), u = e.querySelector("#filter_heart_ball"), f = e.querySelector("#filter_ball"), B = e.querySelector("#filter_heart"), O = e.querySelector("#filter_lock"), L = e.querySelector("#paint0_linear_ball"), w = e.querySelector("#paint1_linear_lock"), $ = e.querySelector("#lock_box"), M = e.querySelector("#heart_box"), R = 10, c = r - R;
126
- y.setAttribute("cx", `${c}`), w.setAttribute("x1", `${c}`), w.setAttribute("x2", `${c}`), L.setAttribute("x1", `${c - 6}`), L.setAttribute("x2", `${c - 6 + 11.2}`), O.setAttribute("x", `${c - 6}`), B.setAttribute("x", `${c - 6 - 2}`), f.setAttribute("x", `${c - 6 - 2 - 2}`), u.setAttribute("x", `${c - 6 - 2 - 2 - 4}`), $.setAttribute("x", `${c - 6}`), M.setAttribute("x", `${c - 6}`), a.parentElement.style.opacity = "1";
129
+ const y = e.querySelector("#lock"), u = e.querySelector("#filter_heart_ball"), f = e.querySelector("#filter_ball"), $ = e.querySelector("#filter_heart"), M = e.querySelector("#filter_lock"), L = e.querySelector("#paint0_linear_ball"), E = e.querySelector("#paint1_linear_lock"), O = e.querySelector("#lock_box"), R = e.querySelector("#heart_box"), N = 10, c = r - N;
130
+ y.setAttribute("cx", `${c}`), E.setAttribute("x1", `${c}`), E.setAttribute("x2", `${c}`), L.setAttribute("x1", `${c - 6}`), L.setAttribute("x2", `${c - 6 + 11.2}`), M.setAttribute("x", `${c - 6}`), $.setAttribute("x", `${c - 6 - 2}`), f.setAttribute("x", `${c - 6 - 2 - 2}`), u.setAttribute("x", `${c - 6 - 2 - 2 - 4}`), O.setAttribute("x", `${c - 6}`), R.setAttribute("x", `${c - 6}`), a.parentElement.style.opacity = "1";
127
131
  }
128
132
  const le = `:host {
129
133
  display: block;
@@ -349,7 +353,7 @@ const le = `:host {
349
353
  e.aboutToExpire.sort((d, v) => ne(new Date(d.expireTime), new Date(v.expireTime)) ? -1 : 1);
350
354
  const n = e.aboutToExpire[0], l = K(new Date(n.expireTime), /* @__PURE__ */ new Date());
351
355
  let r = 0, s = 0, o = l === 0 ? `${t}Day` : t;
352
- return l <= 0 && (r = ee(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = r > 1 ? `${t}Hours` : `${t}Hour`, r <= 0 && (s = te(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = s > 1 ? `${t}Minutes` : `${t}Minute`)), a = A(o, {
356
+ return l <= 0 && (r = ee(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = r > 1 ? `${t}Hours` : `${t}Hour`, r <= 0 && (s = te(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = s > 1 ? `${t}Minutes` : `${t}Minute`)), a = D(o, {
353
357
  expirationPoints: n.points,
354
358
  expireDay: Math.max(l, r, s),
355
359
  lang: this.params.language
@@ -418,7 +422,7 @@ const le = `:host {
418
422
  this.loadElevateInfo();
419
423
  }
420
424
  get elevateCardRef() {
421
- return T(this);
425
+ return A(this);
422
426
  }
423
427
  static get watchers() {
424
428
  return {
@@ -456,7 +460,7 @@ const oe = ":host{display:block}@media screen and (min-width: 501px){.LoyaltyCar
456
460
  let t = (e = this.playerElevateLevel) === null || e === void 0 ? void 0 : e.nextLevel;
457
461
  if (this.playerElevateLevel && t) {
458
462
  const a = (t.entryPoints - this.playerElevateLevel.loyaltyPoints).toFixed(2);
459
- return A("tipsForNextLevel", {
463
+ return D("tipsForNextLevel", {
460
464
  pointsToReach: a,
461
465
  levelName: t.name,
462
466
  lang: this.language
@@ -465,7 +469,7 @@ const oe = ":host{display:block}@media screen and (min-width: 501px){.LoyaltyCar
465
469
  return "";
466
470
  }
467
471
  render() {
468
- const e = I("../static/card-ground.svg"), t = I("../static/card-ground-over.svg");
472
+ const e = S("../static/card-ground.svg"), t = S("../static/card-ground-over.svg");
469
473
  return i("div", { key: "9f673b8dccc848d11f0836c15f1f5da5e242e3b3", class: `ElevateCardWrapper ${this.theme}` }, i("div", { key: "419c71a612c3cdfebaece1e90345c6324c68348e", class: "LoyaltyCard Outer", style: { backgroundImage: `url(${e}` } }, i("general-styling-wrapper", { key: "04c1098bf16e683f30d211dfb9ebc0b319076258", clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: z, translationUrl: this.translationUrl, mbSource: this.mbSource }), i("player-elevate-card-data", { key: "a9c57ef6c5c3381c7e9bf2f041a190f3de3a0423", params: this.paramProxy }), i("div", { key: "402ceddce75abb2ee6b59db730418efc006e5c60", class: "OuterCover Inner", style: { backgroundImage: `url(${t}` } }, i("div", { key: "844cba8ae40b9dd55129f7b0d52a208ea72e72cf", class: "Content Row" }, this.playerElevateLevel && i(W, { key: "d365971e66cbdc81d4b1758c045a76ad50a68729" }, i("div", { key: "2e017a95d80098565d17807c6f8dae51a6b89090", class: "PlayerImg" }, i(q, { key: "5aaf4b8e2b8ea67fa0fed1a07dde9caf2551a3bd", onlyBadge: !0, loyaltyIconUrl: this.playerElevateLevel.presentation.asset })), i("div", { key: "6e332314f4c4a233dd353130266a4d0368b0de45", class: `LevelInfo ${this.playerElevateLevel.name}` }, i("div", { key: "06311b5920ac4126536760049bf3664d92cc247f", class: "CardCell ElevateLevel" }, i("span", { key: "4538afdef55cd520e2d213e6a97d209234deabe5", class: "LevelName", title: this.playerElevateLevel.name }, this.playerElevateLevel.name)), i("div", { key: "cb2764c587a2fe1719b2ff6e045866ee032d5a66", class: "PointsRange" }, i(P, { key: "c794dc4acd33555811187df5b2748b012af77cbf", loyaltyPoints: this.playerElevateLevel.loyaltyPoints <= 0 ? 0 : this.playerElevateLevel.loyaltyPoints, language: this.language }), i(P, { key: "b88eb09ad61ea38214df4877976c6481626ae005", loyaltyPoints: this.getNextLevelPoints(), language: this.language })), i(F, { key: "91fba9132a54ea109bd17a9844390947cf65b902" }), i("div", { key: "950323f3966e6db2c41e06fe6d7be123d09cc496", class: "NextLevelTip" }, this.getNextLevelTips()), this.pointExpireString && i("div", { key: "2ee3c2b317274fdef1cf1a9b2905d023b7485c22", class: "PointsInfo ExpirationPoints" }, this.pointExpireString, " "), this.playerElevateLevel.expireTime && i(j, { key: "db5824c90848a51566ff2a158ff6dc6a292009b2", expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat, language: this.language })))))));
470
474
  }
471
475
  static get watchers() {
@@ -1,4 +1,4 @@
1
- "use strict";var L=(e,t,a)=>new Promise((n,l)=>{var i=c=>{try{o(a.next(c))}catch(h){l(h)}},d=c=>{try{o(a.throw(c))}catch(h){l(h)}},o=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,d);o((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./gamification-dropdown-f0760153-DBhYvhv1.cjs"),r=require("../lazy/gamification-dropdown-CC9WEy9m.cjs"),x=require("./locale-Bby4w57M.cjs"),s=require("./player-elevate-card-items-a0f9711e-D-HJCZ-4.cjs"),O=(e,t)=>new Promise(a=>{fetch(e).then(n=>n.json()).then(n=>{Object.keys(n).forEach(l=>{t[l]=t[l]||{},Object.keys(n[l]).forEach(i=>{if(!t.en[i])return;const d=t.en[i];typeof n[l][i]=="object"?(t[l][i]=t[l][i]||Object.assign({},d),Object.keys(n[l][i]).forEach(o=>{t[l][i][o]=n[l][i][o]})):t[l][i]=n[l][i]||Object.assign({},d)})}),a(!0)}).catch(n=>{console.error("Failed to load translations:",n),a(!1)})}),M=":host{display:block}",R=M,I=class{constructor(e){r.registerInstance(this,e),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(window.emMessageBus!=null?p.setStreamStyling(this.el,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&p.setClientStyling(this.el,this.clientStyling),this.clientStylingUrl&&p.setClientStylingURL(this.el,this.clientStylingUrl),this.stylingAppends=!0))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClientStylingChange(e,t){e!=t&&p.setClientStyling(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&p.setClientStylingURL(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&p.setClientStyling(this.el,this.clientStyling),this.clientStylingUrl&&p.setClientStylingURL(this.el,this.clientStylingUrl),this.stylingAppends=!0)}componentWillLoad(){return L(this,null,function*(){const e=[];if(this.translationUrl){const t=O(this.translationUrl,this.targetTranslations);e.push(t)}return yield Promise.all(e)})}render(){return r.h("div",{key:"09ad83748bbad518743c8671b986c541c52bf3f0",class:"StyleShell"},r.h("slot",{key:"3b28b776d3944410c717b002b70946d274a4e8e7",name:"mainContent"}))}get el(){return r.getElement(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};I.style=R;function w(e){s.requiredArgs(1,arguments);var t=s.toDate(e);return t.setHours(0,0,0,0),t}var $=864e5;function U(e,t){s.requiredArgs(2,arguments);var a=w(e),n=w(t),l=a.getTime()-s.getTimezoneOffsetInMilliseconds(a),i=n.getTime()-s.getTimezoneOffsetInMilliseconds(n);return Math.round((l-i)/$)}var N=6e4,q=36e5;function S(e,t){return s.requiredArgs(2,arguments),s.toDate(e).getTime()-s.toDate(t).getTime()}var E={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},W="trunc";function P(e){return e?E[e]:E[W]}function z(e,t,a){s.requiredArgs(2,arguments);var n=S(e,t)/q;return P(a==null?void 0:a.roundingMethod)(n)}function F(e,t,a){s.requiredArgs(2,arguments);var n=S(e,t)/N;return P(a==null?void 0:a.roundingMethod)(n)}function j(e,t){s.requiredArgs(2,arguments);var a=s.toDate(e),n=s.toDate(t);return a.getTime()<n.getTime()}function G(e,t){const a=e.querySelector("#total_level"),n=17,l=6.5,i=a.getBBox().width,d=t>1?1:t,o=d*i-n<0?0:d*i-n,c=e.querySelector("#current_level"),h=e.querySelector("#filter_current_level"),g=e.querySelector("#circle_current_level");a.setAttribute("viewbox",`0 0 ${o} 28`),c.setAttribute("width",`${o}`),g.setAttribute("cx",`${o<l?l:o}`),h.setAttribute("x",`${o-8}`);const y=e.querySelector("#lock"),u=e.querySelector("#filter_heart_ball"),f=e.querySelector("#filter_ball"),T=e.querySelector("#filter_heart"),A=e.querySelector("#filter_lock"),b=e.querySelector("#paint0_linear_ball"),m=e.querySelector("#paint1_linear_lock"),D=e.querySelector("#lock_box"),_=e.querySelector("#heart_box"),B=10,v=i-B;y.setAttribute("cx",`${v}`),m.setAttribute("x1",`${v}`),m.setAttribute("x2",`${v}`),b.setAttribute("x1",`${v-6}`),b.setAttribute("x2",`${v-6+11.2}`),A.setAttribute("x",`${v-6}`),T.setAttribute("x",`${v-6-2}`),f.setAttribute("x",`${v-6-2-2}`),u.setAttribute("x",`${v-6-2-2-4}`),D.setAttribute("x",`${v-6}`),_.setAttribute("x",`${v-6}`),a.parentElement.style.opacity="1"}const H=`:host {
1
+ "use strict";var L=(e,t,a)=>new Promise((n,l)=>{var i=c=>{try{o(a.next(c))}catch(h){l(h)}},d=c=>{try{o(a.throw(c))}catch(h){l(h)}},o=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,d);o((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./gamification-dropdown-f420baf5-CXS6ttXg.cjs"),r=require("../lazy/gamification-dropdown-1FoOgZ8Q.cjs"),b=require("./locale-Bby4w57M.cjs"),s=require("./player-elevate-card-items-a0f9711e-BcCKrobp.cjs"),M=(e,t)=>new Promise(a=>{fetch(e).then(n=>n.json()).then(n=>{Object.keys(n).forEach(l=>{t[l]=t[l]||{},Object.keys(n[l]).forEach(i=>{if(!t.en[i])return;const d=t.en[i];typeof n[l][i]=="object"?(t[l][i]=t[l][i]||Object.assign({},d),Object.keys(n[l][i]).forEach(o=>{t[l][i][o]=n[l][i][o]})):t[l][i]=n[l][i]||Object.assign({},d)})}),a(!0)}).catch(n=>{console.error("Failed to load translations:",n),a(!1)})}),O=":host{display:block}",R=O,I=class{constructor(e){r.registerInstance(this,e),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(this.mbSource&&p.setStreamStyling(this.el,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&p.setClientStyling(this.el,this.clientStyling),this.clientStylingUrl&&p.setClientStylingURL(this.el,this.clientStylingUrl),this.stylingAppends=!0)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleMbSourceChange(e,t){e!=t&&p.setStreamStyling(this.el,`${this.mbSource}.Style`,this.stylingSubscription)}handleClientStylingChange(e,t){e!=t&&p.setClientStyling(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&p.setClientStylingURL(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&p.setClientStyling(this.el,this.clientStyling),this.clientStylingUrl&&p.setClientStylingURL(this.el,this.clientStylingUrl),this.stylingAppends=!0)}componentWillLoad(){return L(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 r.h("div",{key:"e660ceb69f5e848c788c3924fc814c0fa7a777a2",class:"StyleShell"},r.h("slot",{key:"35014b6c0c32532af11e6a629ba9b13942504d21",name:"mainContent"}))}get el(){return r.getElement(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};I.style=R;function w(e){s.requiredArgs(1,arguments);var t=s.toDate(e);return t.setHours(0,0,0,0),t}var $=864e5;function U(e,t){s.requiredArgs(2,arguments);var a=w(e),n=w(t),l=a.getTime()-s.getTimezoneOffsetInMilliseconds(a),i=n.getTime()-s.getTimezoneOffsetInMilliseconds(n);return Math.round((l-i)/$)}var N=6e4,q=36e5;function S(e,t){return s.requiredArgs(2,arguments),s.toDate(e).getTime()-s.toDate(t).getTime()}var E={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},W="trunc";function P(e){return e?E[e]:E[W]}function z(e,t,a){s.requiredArgs(2,arguments);var n=S(e,t)/q;return P(a==null?void 0:a.roundingMethod)(n)}function F(e,t,a){s.requiredArgs(2,arguments);var n=S(e,t)/N;return P(a==null?void 0:a.roundingMethod)(n)}function j(e,t){s.requiredArgs(2,arguments);var a=s.toDate(e),n=s.toDate(t);return a.getTime()<n.getTime()}function G(e,t){const a=e.querySelector("#total_level"),n=17,l=6.5,i=a.getBBox().width,d=t>1?1:t,o=d*i-n<0?0:d*i-n,c=e.querySelector("#current_level"),h=e.querySelector("#filter_current_level"),g=e.querySelector("#circle_current_level");a.setAttribute("viewbox",`0 0 ${o} 28`),c.setAttribute("width",`${o}`),g.setAttribute("cx",`${o<l?l:o}`),h.setAttribute("x",`${o-8}`);const y=e.querySelector("#lock"),u=e.querySelector("#filter_heart_ball"),f=e.querySelector("#filter_ball"),T=e.querySelector("#filter_heart"),A=e.querySelector("#filter_lock"),x=e.querySelector("#paint0_linear_ball"),m=e.querySelector("#paint1_linear_lock"),D=e.querySelector("#lock_box"),_=e.querySelector("#heart_box"),B=10,v=i-B;y.setAttribute("cx",`${v}`),m.setAttribute("x1",`${v}`),m.setAttribute("x2",`${v}`),x.setAttribute("x1",`${v-6}`),x.setAttribute("x2",`${v-6+11.2}`),A.setAttribute("x",`${v-6}`),T.setAttribute("x",`${v-6-2}`),f.setAttribute("x",`${v-6-2-2}`),u.setAttribute("x",`${v-6-2-2-4}`),D.setAttribute("x",`${v-6}`),_.setAttribute("x",`${v-6}`),a.parentElement.style.opacity="1"}const H=`: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=H,C=class{constructor(e){r.registerInstance(this,e),this.playerElevateLeveLoaded=r.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],l=U(new Date(n.expireTime),new Date);let i=0,d=0,o=l===0?`${t}Day`:t;return l<=0&&(i=z(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),o=i>1?`${t}Hours`:`${t}Hour`,i<=0&&(d=F(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),o=d>1?`${t}Minutes`:`${t}Minute`)),a=x.translateWithParams(o,{expirationPoints:n.points,expireDay:Math.max(l,i,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 l,i,d,o,c;if(!n.success){console.error("Exception when fetch user elevateinfo, ",n.errorCode,n.errorMessage),a(!0);return}window.postMessage({type:"UpdateGamificationXp",points:(i=(l=n.data)===null||l===void 0?void 0:l.level)===null||i===void 0?void 0:i.loyaltyPoints},window.location.href);let h=n.data;this.playerElevateLevel=h.level,this.playerElevateLevel.name=this.playerElevateLevel.presentation.displayName||this.playerElevateLevel.name,this.playerElevateLevel.spendablePoints=((d=h.spendableWallet)===null||d===void 0?void 0:d.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const g=(o=n.data.spendableWallet)===null||o===void 0?void 0:o.total,y=(c=n.data.loyaltyWallet)===null||c===void 0?void 0:c.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:g,loyaltyWalletTotal:y});let u=this.calcuatePointsToBeExpired(g,"coinsToBeExpired"),f=this.calcuatePointsToBeExpired(y,"pointsToBeExpired");(u||f)&&this.playerElevateLeveLoaded.emit({pointExpireString:u,xpExpireString:f}),t(this.playerElevateLevel)}).catch(n=>{console.log("error ",n),a(!0)}))}setLoyaltyProgress(e){G(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"]}}};C.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:6px;margin-left:0px}}@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:0px}.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,k=class{constructor(e){r.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.xpExpireString&&(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 x.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:"9f673b8dccc848d11f0836c15f1f5da5e242e3b3",class:`ElevateCardWrapper ${this.theme}`},r.h("div",{key:"419c71a612c3cdfebaece1e90345c6324c68348e",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},r.h("general-styling-wrapper",{key:"04c1098bf16e683f30d211dfb9ebc0b319076258",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:x.TRANSLATIONS,translationUrl:this.translationUrl,mbSource:this.mbSource}),r.h("player-elevate-card-data",{key:"a9c57ef6c5c3381c7e9bf2f041a190f3de3a0423",params:this.paramProxy}),r.h("div",{key:"402ceddce75abb2ee6b59db730418efc006e5c60",class:"OuterCover Inner",style:{backgroundImage:`url(${t}`}},r.h("div",{key:"844cba8ae40b9dd55129f7b0d52a208ea72e72cf",class:"Content Row"},this.playerElevateLevel&&r.h(r.Fragment,{key:"d365971e66cbdc81d4b1758c045a76ad50a68729"},r.h("div",{key:"2e017a95d80098565d17807c6f8dae51a6b89090",class:"PlayerImg"},r.h(s.PlayerAvatar,{key:"5aaf4b8e2b8ea67fa0fed1a07dde9caf2551a3bd",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),r.h("div",{key:"6e332314f4c4a233dd353130266a4d0368b0de45",class:`LevelInfo ${this.playerElevateLevel.name}`},r.h("div",{key:"06311b5920ac4126536760049bf3664d92cc247f",class:"CardCell ElevateLevel"},r.h("span",{key:"4538afdef55cd520e2d213e6a97d209234deabe5",class:"LevelName",title:this.playerElevateLevel.name},this.playerElevateLevel.name)),r.h("div",{key:"cb2764c587a2fe1719b2ff6e045866ee032d5a66",class:"PointsRange"},r.h(s.PlayerPoints,{key:"c794dc4acd33555811187df5b2748b012af77cbf",loyaltyPoints:this.playerElevateLevel.loyaltyPoints<=0?0:this.playerElevateLevel.loyaltyPoints,language:this.language}),r.h(s.PlayerPoints,{key:"b88eb09ad61ea38214df4877976c6481626ae005",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),r.h(s.PlayerLoyaltyProcess,{key:"91fba9132a54ea109bd17a9844390947cf65b902"}),r.h("div",{key:"950323f3966e6db2c41e06fe6d7be123d09cc496",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&r.h("div",{key:"2ee3c2b317274fdef1cf1a9b2905d023b7485c22",class:"PointsInfo ExpirationPoints"},this.pointExpireString," "),this.playerElevateLevel.expireTime&&r.h(s.LoyaltyLevelExpireDay,{key:"db5824c90848a51566ff2a158ff6dc6a292009b2",expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat,language:this.language})))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};k.style=J;exports.gamification_dropdown=p.GamificationDropdown;exports.general_styling_wrapper=I;exports.player_elevate_card_data=C;exports.player_elevate_loyaltycard=k;
192
+ }`,X=H,C=class{constructor(e){r.registerInstance(this,e),this.playerElevateLeveLoaded=r.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],l=U(new Date(n.expireTime),new Date);let i=0,d=0,o=l===0?`${t}Day`:t;return l<=0&&(i=z(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),o=i>1?`${t}Hours`:`${t}Hour`,i<=0&&(d=F(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),o=d>1?`${t}Minutes`:`${t}Minute`)),a=b.translateWithParams(o,{expirationPoints:n.points,expireDay:Math.max(l,i,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 l,i,d,o,c;if(!n.success){console.error("Exception when fetch user elevateinfo, ",n.errorCode,n.errorMessage),a(!0);return}window.postMessage({type:"UpdateGamificationXp",points:(i=(l=n.data)===null||l===void 0?void 0:l.level)===null||i===void 0?void 0:i.loyaltyPoints},window.location.href);let h=n.data;this.playerElevateLevel=h.level,this.playerElevateLevel.name=this.playerElevateLevel.presentation.displayName||this.playerElevateLevel.name,this.playerElevateLevel.spendablePoints=((d=h.spendableWallet)===null||d===void 0?void 0:d.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const g=(o=n.data.spendableWallet)===null||o===void 0?void 0:o.total,y=(c=n.data.loyaltyWallet)===null||c===void 0?void 0:c.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:g,loyaltyWalletTotal:y});let u=this.calcuatePointsToBeExpired(g,"coinsToBeExpired"),f=this.calcuatePointsToBeExpired(y,"pointsToBeExpired");(u||f)&&this.playerElevateLeveLoaded.emit({pointExpireString:u,xpExpireString:f}),t(this.playerElevateLevel)}).catch(n=>{console.log("error ",n),a(!0)}))}setLoyaltyProgress(e){G(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"]}}};C.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:6px;margin-left:0px}}@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:0px}.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,k=class{constructor(e){r.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.xpExpireString&&(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 b.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:"9f673b8dccc848d11f0836c15f1f5da5e242e3b3",class:`ElevateCardWrapper ${this.theme}`},r.h("div",{key:"419c71a612c3cdfebaece1e90345c6324c68348e",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},r.h("general-styling-wrapper",{key:"04c1098bf16e683f30d211dfb9ebc0b319076258",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:b.TRANSLATIONS,translationUrl:this.translationUrl,mbSource:this.mbSource}),r.h("player-elevate-card-data",{key:"a9c57ef6c5c3381c7e9bf2f041a190f3de3a0423",params:this.paramProxy}),r.h("div",{key:"402ceddce75abb2ee6b59db730418efc006e5c60",class:"OuterCover Inner",style:{backgroundImage:`url(${t}`}},r.h("div",{key:"844cba8ae40b9dd55129f7b0d52a208ea72e72cf",class:"Content Row"},this.playerElevateLevel&&r.h(r.Fragment,{key:"d365971e66cbdc81d4b1758c045a76ad50a68729"},r.h("div",{key:"2e017a95d80098565d17807c6f8dae51a6b89090",class:"PlayerImg"},r.h(s.PlayerAvatar,{key:"5aaf4b8e2b8ea67fa0fed1a07dde9caf2551a3bd",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),r.h("div",{key:"6e332314f4c4a233dd353130266a4d0368b0de45",class:`LevelInfo ${this.playerElevateLevel.name}`},r.h("div",{key:"06311b5920ac4126536760049bf3664d92cc247f",class:"CardCell ElevateLevel"},r.h("span",{key:"4538afdef55cd520e2d213e6a97d209234deabe5",class:"LevelName",title:this.playerElevateLevel.name},this.playerElevateLevel.name)),r.h("div",{key:"cb2764c587a2fe1719b2ff6e045866ee032d5a66",class:"PointsRange"},r.h(s.PlayerPoints,{key:"c794dc4acd33555811187df5b2748b012af77cbf",loyaltyPoints:this.playerElevateLevel.loyaltyPoints<=0?0:this.playerElevateLevel.loyaltyPoints,language:this.language}),r.h(s.PlayerPoints,{key:"b88eb09ad61ea38214df4877976c6481626ae005",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),r.h(s.PlayerLoyaltyProcess,{key:"91fba9132a54ea109bd17a9844390947cf65b902"}),r.h("div",{key:"950323f3966e6db2c41e06fe6d7be123d09cc496",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&r.h("div",{key:"2ee3c2b317274fdef1cf1a9b2905d023b7485c22",class:"PointsInfo ExpirationPoints"},this.pointExpireString," "),this.playerElevateLevel.expireTime&&r.h(s.LoyaltyLevelExpireDay,{key:"db5824c90848a51566ff2a158ff6dc6a292009b2",expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat,language:this.language})))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};k.style=J;exports.gamification_dropdown=p.GamificationDropdown;exports.general_styling_wrapper=I;exports.player_elevate_card_data=C;exports.player_elevate_loyaltycard=k;