@everymatrix/casino-header-controller 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 (47) hide show
  1. package/components/{CasinoHamburgerMenu-fismkdau.js → CasinoHamburgerMenu-C9GuaD4v.js} +1 -1
  2. package/components/{CasinoHamburgerMenu-k-boVZsL.js → CasinoHamburgerMenu-g3l0YzHX.js} +1 -1
  3. package/components/{CasinoHamburgerMenu-CyIzkhVi.cjs → CasinoHamburgerMenu-pHxRcuBA.cjs} +1 -1
  4. package/components/{CasinoHeaderController-BTbv6PRt.js → CasinoHeaderController-CQOrKeos.js} +5 -5
  5. package/components/{CasinoHeaderController-D4KAmxFI.cjs → CasinoHeaderController-D2c7JEtL.cjs} +2 -2
  6. package/components/{CasinoHeaderController-CcDnOW9o.js → CasinoHeaderController-DNwYHRy3.js} +5 -5
  7. package/components/{CasinoSlider-BJvakN0F.cjs → CasinoSlider-C7P3oUIG.cjs} +1 -1
  8. package/components/{CasinoSlider-CsbTlp8y.js → CasinoSlider-CnE5z57a.js} +1 -1
  9. package/components/{CasinoSlider-BFwkdnqh.js → CasinoSlider-UXV0gEAr.js} +1 -1
  10. package/components/{PlayerAccountBalanceModal-LaTWiI-_.cjs → PlayerAccountBalanceModal-B1cikVIG.cjs} +1 -1
  11. package/components/{PlayerAccountBalanceModal-8Aq_ZvMf.js → PlayerAccountBalanceModal-CbsUq7rq.js} +1 -1
  12. package/components/{PlayerAccountBalanceModal-KHpUDBdo.js → PlayerAccountBalanceModal-DwO_gQvc.js} +1 -1
  13. package/components/{PlayerDeposit-DxUj-MUx.js → PlayerDeposit-BDOBJhsg.js} +1 -1
  14. package/components/{PlayerDeposit-Dw8NUQjq.cjs → PlayerDeposit-CNzBVttP.cjs} +1 -1
  15. package/components/{PlayerDeposit-lpIyUObM.js → PlayerDeposit-m8ra2HrL.js} +1 -1
  16. package/es2015/casino-header-controller.cjs +1 -1
  17. package/es2015/casino-header-controller.js +1 -1
  18. package/esnext/casino-header-controller.js +1 -1
  19. package/package.json +1 -1
  20. package/stencil/gamification-dropdown-B0-sq6tf.js +25 -0
  21. package/stencil/gamification-dropdown-D0vJGodz.js +7 -0
  22. package/stencil/gamification-dropdown-DQIpj1Ke.cjs +1 -0
  23. package/stencil/{gamification-dropdown-f0760153-BkUs6mft.js → gamification-dropdown-f420baf5-BGd94a6s.js} +54 -50
  24. package/stencil/{gamification-dropdown-f0760153-B9QlSnQa.js → gamification-dropdown-f420baf5-CsmB-nIA.js} +23 -19
  25. package/stencil/gamification-dropdown-f420baf5-DQ5lV6ZZ.cjs +1 -0
  26. package/stencil/{gamification-dropdown_4-U3Z1mU81.js → gamification-dropdown_4-2KkDA98L.js} +29 -25
  27. package/stencil/{gamification-dropdown_4-DsqXxOmE.cjs → gamification-dropdown_4-D6qTQVk2.cjs} +2 -2
  28. package/stencil/{gamification-dropdown_4--8vkMs3l.js → gamification-dropdown_4-DkPsr1Er.js} +30 -26
  29. package/stencil/{index-71b1bdfa-BOdOb_jA.cjs → index-71b1bdfa-BEl1AYIA.cjs} +1 -1
  30. package/stencil/{index-71b1bdfa-DVFSNs3m.js → index-71b1bdfa-B_9jVwPK.js} +4 -4
  31. package/stencil/{index-71b1bdfa-V1LBXDRS.js → index-71b1bdfa-C4fXNmHD.js} +4 -4
  32. package/stencil/{player-elevate-card-CoIStSGn.cjs → player-elevate-card-4qkJaOJp.cjs} +1 -1
  33. package/stencil/{player-elevate-card-C8WX7E7W.js → player-elevate-card-B5xc0XOp.js} +2 -2
  34. package/stencil/{player-elevate-card-DmkJZYmF.js → player-elevate-card-DXX4Wr23.js} +2 -2
  35. package/stencil/{player-elevate-card-items-a0f9711e-LuvcDuiF.js → player-elevate-card-items-a0f9711e-CTMyeyPT.js} +1 -1
  36. package/stencil/{player-elevate-card-items-a0f9711e-DYncEppV.cjs → player-elevate-card-items-a0f9711e-CZHU08Qb.cjs} +1 -1
  37. package/stencil/{player-elevate-card-items-a0f9711e-DlOlTLYh.js → player-elevate-card-items-a0f9711e-DoPt1L8d.js} +1 -1
  38. package/stencil/{player-elevate-pointcard-B-zPCJW0.js → player-elevate-pointcard-B3UqJtgE.js} +2 -2
  39. package/stencil/{player-elevate-pointcard-DDQRyZWe.cjs → player-elevate-pointcard-B7an8aLM.cjs} +1 -1
  40. package/stencil/{player-elevate-pointcard-OEzMMYG3.js → player-elevate-pointcard-DFBoTWXf.js} +2 -2
  41. package/stencil/{player-rakeback-card-D9FPkUDz.cjs → player-rakeback-card-CKbWMvC7.cjs} +1 -1
  42. package/stencil/{player-rakeback-card-C_8JN4MR.js → player-rakeback-card-CpZaOvj9.js} +1 -1
  43. package/stencil/{player-rakeback-card-xEloPnuy.js → player-rakeback-card-Cxv-ln3r.js} +1 -1
  44. package/stencil/gamification-dropdown-CYbV6TXt.cjs +0 -1
  45. package/stencil/gamification-dropdown-DMjxk-Tj.js +0 -25
  46. package/stencil/gamification-dropdown-f0760153-BMkDGrO2.cjs +0 -1
  47. package/stencil/gamification-dropdown-jGhHm7cW.js +0 -7
@@ -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 "./index-71b1bdfa-V1LBXDRS.js";
18
- const S = "en";
17
+ import { r as w, h as c, a as S } from "./index-71b1bdfa-C4fXNmHD.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
  };
@@ -0,0 +1 @@
1
+ "use strict";var y=(e,t,i)=>new Promise((n,s)=>{var o=c=>{try{a(i.next(c))}catch(f){s(f)}},l=c=>{try{a(i.throw(c))}catch(f){s(f)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,l);a((i=i.apply(e,t)).next())});const r=require("./index-71b1bdfa-BEl1AYIA.cjs"),S="en";let d={en:{gamificationNoPoints:"No points"},de:{gamificationNoPoints:"No points"},ro:{gamificationNoPoints:"No points"},fr:{gamificationNoPoints:"No points"},ar:{gamificationNoPoints:"No points"},hr:{gamificationNoPoints:"No points"}};const w=e=>new Promise(t=>{fetch(e).then(i=>i.json()).then(i=>{Object.keys(i).forEach(n=>{d[n]||(d[n]={});for(let s in i[n])d[n][s]=i[n][s]}),t(!0)})}),b=(e,t)=>{const i=t;return d[i!==void 0&&i in d?i:S][e]},h="__WIDGET_GLOBAL_STYLE_CACHE__";function p(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function g(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then(n=>n.text()).then(n=>{const s=document.createElement("style");s.innerHTML=n,e&&e.appendChild(s)}).catch(n=>{console.error("There was an error while trying to load client styling from URL",n)})}function u(e,t,i,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return i=v(e,t),i;window[h]||(window[h]={}),i=C(e,t);const o=i.unsubscribe.bind(i),l=()=>{if(window[h][t]){const a=window[h][t];a.refCount>1?a.refCount=a.refCount-1:delete window[h][t]}o()};return i.unsubscribe=l,i}function v(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,n=>{e&&(i.innerHTML=n,e.appendChild(i))})}function C(e,t){return window.emMessageBus.subscribe(t,i=>{if(!e)return;const n=e.getRootNode(),s=window[h];let o=s[t]&&s[t].sheet;o?s[t].refCount=s[t].refCount+1:(o=new CSSStyleSheet,o.replaceSync(i),s[t]={sheet:o,refCount:1});const l=n.adoptedStyleSheets||[];l.includes(o)||(n.adoptedStyleSheets=[...l,o])})}const L=":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=L,m=class{constructor(e){r.registerInstance(this,e),this.messageHandler=t=>{t.data&&t.data.type==="UpdateGamificationXp"&&(this.loyaltyPoints=t.data.points)},this.navigateToGamification=()=>{window.postMessage({type:"NavigateToGamification"},window.location.href),this.isOpen=!1},this.handleOutsideClick=t=>{t.composedPath().includes(this.el)||(this.isOpen=!1,document.removeEventListener("click",this.handleOutsideClick))},this.handleDropdownClick=t=>{t.stopPropagation(),this.isOpen=!this.isOpen,this.isOpen?document.addEventListener("click",this.handleOutsideClick):document.removeEventListener("click",this.handleOutsideClick)},this.endpoint=void 0,this.language="en",this.session="",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.isOpen=!1,this.isLoading=!1,this.loyaltyPoints=void 0}handleNewTranslations(){this.isLoading=!0,w(this.translationUrl).then(()=>{this.isLoading=!1})}handleMbSourceChange(e,t){e!=t&&u(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleClientStylingChange(e,t){e!=t&&p(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(e,t){e!=t&&this.clientStylingUrl&&g(this.stylingContainer,this.clientStylingUrl)}componentWillLoad(){return y(this,null,function*(){if(this.translationUrl.length>2&&(yield w(this.translationUrl)),this.endpoint&&this.language)return this.fetchPointsData()})}componentDidLoad(){window.addEventListener("message",this.messageHandler),this.stylingContainer&&(this.mbSource&&u(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&p(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&g(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("message",this.messageHandler)}fetchPointsData(){let e=new URL(`${this.endpoint}/v1/elevate/playerInfo`);e.searchParams.append("language",this.language);const t=new Headers;t.append("X-SessionId",this.session);const i={method:"GET",headers:t};return new Promise((n,s)=>{this.isLoading=!0,fetch(e.href,i).then(o=>o.json()).then(o=>{var l,a;this.loyaltyPoints=(a=(l=o==null?void 0:o.data)===null||l===void 0?void 0:l.level)===null||a===void 0?void 0:a.loyaltyPoints,n(!0)}).catch(o=>{console.error(o),s(o)}).finally(()=>{this.isLoading=!1})})}render(){return r.h("div",{key:"448b39e62a6a892fd271ca508053cf390ecec5ef",ref:e=>this.stylingContainer=e,class:"GamificationDropdownContainer"},!this.isLoading&&r.h("button",{key:"fe29d2a1eed374dbc755bb7577974c6eb52b93e6",class:`GamificationDropdownButton ${this.isOpen?"IsOpen":""}`,type:"button",onClick:e=>this.handleDropdownClick(e),title:typeof this.loyaltyPoints=="number"?String(this.loyaltyPoints):b("gamificationNoPoints",this.language)},typeof this.loyaltyPoints=="number"?`${this.loyaltyPoints} XP`:"...",r.h("span",{key:"3afb5438ae618972372fc5a94c1e6a4e142c2bd9",class:this.isOpen?"TriangleActive":"TriangleInactive"},r.h("svg",{key:"d46d7b63558e8d3fa2295e14cdb5d581c5050dc2",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"6.835",viewBox:"0 0 14 6.835"},r.h("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.h("div",{key:"a40ff1a96319446ff6c8dae3ea5c54ea6ac8fe6d",class:"GamificationDropdown",onClick:this.navigateToGamification},r.h("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})))}get el(){return r.getElement(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};m.style=D;exports.GamificationDropdown=m;exports.setClientStyling=p;exports.setClientStylingURL=g;exports.setStreamStyling=u;
@@ -1,8 +1,8 @@
1
- import { b as R, s as x, a as b } from "./gamification-dropdown-f0760153-BkUs6mft.js";
2
- import { G as ye } from "./gamification-dropdown-f0760153-BkUs6mft.js";
3
- import { r as m, h as i, a as k, c as N, g as E, F as U } from "./index-71b1bdfa-DVFSNs3m.js";
4
- import { a as T, T as W } from "./locale-BrU0BSZM.js";
5
- import { P as z, e as I, c as q, L as F, r as p, t as h, g as P } from "./player-elevate-card-items-a0f9711e-DlOlTLYh.js";
1
+ import { b as w, s as x, a as b } from "./gamification-dropdown-f420baf5-BGd94a6s.js";
2
+ import { G as ye } from "./gamification-dropdown-f420baf5-BGd94a6s.js";
3
+ import { r as m, h as i, a as T, c as N, g as I, F as U } from "./index-71b1bdfa-B_9jVwPK.js";
4
+ import { a as A, T as W } from "./locale-BrU0BSZM.js";
5
+ import { P as z, e as S, c as q, L as F, r as p, t as h, g as P } from "./player-elevate-card-items-a0f9711e-DoPt1L8d.js";
6
6
  const j = (e, t) => new Promise((a) => {
7
7
  fetch(e).then((n) => n.json()).then((n) => {
8
8
  Object.keys(n).forEach((r) => {
@@ -23,11 +23,14 @@ const j = (e, t) => new Promise((a) => {
23
23
  m(this, e), this.stylingAppends = !1, this.clientStyling = "", this.clientStylingUrl = "", this.mbSource = void 0, this.translationUrl = "", this.targetTranslations = void 0;
24
24
  }
25
25
  componentDidLoad() {
26
- this.el && (window.emMessageBus != null ? R(this.el, `${this.mbSource}.Style`, this.stylingSubscription) : (this.clientStyling && x(this.el, this.clientStyling), this.clientStylingUrl && b(this.el, this.clientStylingUrl), this.stylingAppends = !0));
26
+ this.el && (this.mbSource && w(this.el, `${this.mbSource}.Style`, this.stylingSubscription), this.clientStyling && x(this.el, this.clientStyling), this.clientStylingUrl && b(this.el, this.clientStylingUrl), this.stylingAppends = !0);
27
27
  }
28
28
  disconnectedCallback() {
29
29
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
30
30
  }
31
+ handleMbSourceChange(e, t) {
32
+ e != t && w(this.el, `${this.mbSource}.Style`, this.stylingSubscription);
33
+ }
31
34
  handleClientStylingChange(e, t) {
32
35
  e != t && x(this.el, this.clientStyling);
33
36
  }
@@ -46,20 +49,21 @@ const j = (e, t) => new Promise((a) => {
46
49
  return await Promise.all(e);
47
50
  }
48
51
  render() {
49
- return i("div", { key: "09ad83748bbad518743c8671b986c541c52bf3f0", class: "StyleShell" }, i("slot", { key: "3b28b776d3944410c717b002b70946d274a4e8e7", name: "mainContent" }));
52
+ return i("div", { key: "e660ceb69f5e848c788c3924fc814c0fa7a777a2", class: "StyleShell" }, i("slot", { key: "35014b6c0c32532af11e6a629ba9b13942504d21", name: "mainContent" }));
50
53
  }
51
54
  get el() {
52
- return k(this);
55
+ return T(this);
53
56
  }
54
57
  static get watchers() {
55
58
  return {
59
+ mbSource: ["handleMbSourceChange"],
56
60
  clientStyling: ["handleClientStylingChange"],
57
61
  clientStylingUrl: ["handleClientStylingUrlChange"]
58
62
  };
59
63
  }
60
64
  };
61
65
  X.style = H;
62
- function S(e) {
66
+ function C(e) {
63
67
  p(1, arguments);
64
68
  var t = h(e);
65
69
  return t.setHours(0, 0, 0, 0), t;
@@ -67,14 +71,14 @@ function S(e) {
67
71
  var Y = 864e5;
68
72
  function J(e, t) {
69
73
  p(2, arguments);
70
- var a = S(e), n = S(t), r = a.getTime() - P(a), l = n.getTime() - P(n);
74
+ var a = C(e), n = C(t), r = a.getTime() - P(a), l = n.getTime() - P(n);
71
75
  return Math.round((r - l) / Y);
72
76
  }
73
77
  var K = 6e4, Q = 36e5;
74
- function A(e, t) {
78
+ function D(e, t) {
75
79
  return p(2, arguments), h(e).getTime() - h(t).getTime();
76
80
  }
77
- var C = {
81
+ var k = {
78
82
  ceil: Math.ceil,
79
83
  round: Math.round,
80
84
  floor: Math.floor,
@@ -83,18 +87,18 @@ var C = {
83
87
  }
84
88
  // Math.trunc is not supported by IE
85
89
  }, V = "trunc";
86
- function D(e) {
87
- return e ? C[e] : C[V];
90
+ function _(e) {
91
+ return e ? k[e] : k[V];
88
92
  }
89
93
  function Z(e, t, a) {
90
94
  p(2, arguments);
91
- var n = A(e, t) / Q;
92
- return D(a?.roundingMethod)(n);
95
+ var n = D(e, t) / Q;
96
+ return _(a?.roundingMethod)(n);
93
97
  }
94
98
  function ee(e, t, a) {
95
99
  p(2, arguments);
96
- var n = A(e, t) / K;
97
- return D(a?.roundingMethod)(n);
100
+ var n = D(e, t) / K;
101
+ return _(a?.roundingMethod)(n);
98
102
  }
99
103
  function te(e, t) {
100
104
  p(2, arguments);
@@ -104,8 +108,8 @@ function te(e, t) {
104
108
  function ne(e, t) {
105
109
  const a = e.querySelector("#total_level"), n = 17, r = 6.5, l = a.getBBox().width, s = t > 1 ? 1 : t, o = s * l - n < 0 ? 0 : s * l - n, c = e.querySelector("#current_level"), v = e.querySelector("#filter_current_level"), g = e.querySelector("#circle_current_level");
106
110
  a.setAttribute("viewbox", `0 0 ${o} 28`), c.setAttribute("width", `${o}`), g.setAttribute("cx", `${o < r ? r : o}`), v.setAttribute("x", `${o - 8}`);
107
- const y = e.querySelector("#lock"), u = e.querySelector("#filter_heart_ball"), f = e.querySelector("#filter_ball"), _ = e.querySelector("#filter_heart"), B = e.querySelector("#filter_lock"), L = e.querySelector("#paint0_linear_ball"), w = e.querySelector("#paint1_linear_lock"), O = e.querySelector("#lock_box"), $ = e.querySelector("#heart_box"), M = 10, d = l - M;
108
- y.setAttribute("cx", `${d}`), w.setAttribute("x1", `${d}`), w.setAttribute("x2", `${d}`), L.setAttribute("x1", `${d - 6}`), L.setAttribute("x2", `${d - 6 + 11.2}`), B.setAttribute("x", `${d - 6}`), _.setAttribute("x", `${d - 6 - 2}`), f.setAttribute("x", `${d - 6 - 2 - 2}`), u.setAttribute("x", `${d - 6 - 2 - 2 - 4}`), O.setAttribute("x", `${d - 6}`), $.setAttribute("x", `${d - 6}`), a.parentElement.style.opacity = "1";
111
+ const y = e.querySelector("#lock"), u = e.querySelector("#filter_heart_ball"), f = e.querySelector("#filter_ball"), B = e.querySelector("#filter_heart"), $ = e.querySelector("#filter_lock"), L = e.querySelector("#paint0_linear_ball"), E = e.querySelector("#paint1_linear_lock"), M = e.querySelector("#lock_box"), O = e.querySelector("#heart_box"), R = 10, d = l - R;
112
+ y.setAttribute("cx", `${d}`), E.setAttribute("x1", `${d}`), E.setAttribute("x2", `${d}`), L.setAttribute("x1", `${d - 6}`), L.setAttribute("x2", `${d - 6 + 11.2}`), $.setAttribute("x", `${d - 6}`), B.setAttribute("x", `${d - 6 - 2}`), f.setAttribute("x", `${d - 6 - 2 - 2}`), u.setAttribute("x", `${d - 6 - 2 - 2 - 4}`), M.setAttribute("x", `${d - 6}`), O.setAttribute("x", `${d - 6}`), a.parentElement.style.opacity = "1";
109
113
  }
110
114
  const ae = `:host {
111
115
  display: block;
@@ -331,7 +335,7 @@ const ae = `:host {
331
335
  e.aboutToExpire.sort((c, v) => te(new Date(c.expireTime), new Date(v.expireTime)) ? -1 : 1);
332
336
  const n = e.aboutToExpire[0], r = J(new Date(n.expireTime), /* @__PURE__ */ new Date());
333
337
  let l = 0, s = 0, o = r === 0 ? `${t}Day` : t;
334
- return r <= 0 && (l = Z(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = l > 1 ? `${t}Hours` : `${t}Hour`, l <= 0 && (s = ee(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = s > 1 ? `${t}Minutes` : `${t}Minute`)), a = T(o, {
338
+ return r <= 0 && (l = Z(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = l > 1 ? `${t}Hours` : `${t}Hour`, l <= 0 && (s = ee(new Date(n.expireTime), /* @__PURE__ */ new Date(), { roundingMethod: "floor" }), o = s > 1 ? `${t}Minutes` : `${t}Minute`)), a = A(o, {
335
339
  expirationPoints: n.points,
336
340
  expireDay: Math.max(r, l, s),
337
341
  lang: this.params.language
@@ -400,7 +404,7 @@ const ae = `:host {
400
404
  this.loadElevateInfo();
401
405
  }
402
406
  get elevateCardRef() {
403
- return k(this);
407
+ return T(this);
404
408
  }
405
409
  static get watchers() {
406
410
  return {
@@ -438,7 +442,7 @@ const ie = ":host{display:block}@media screen and (min-width: 501px){.LoyaltyCar
438
442
  let t = (e = this.playerElevateLevel) === null || e === void 0 ? void 0 : e.nextLevel;
439
443
  if (this.playerElevateLevel && t) {
440
444
  const a = (t.entryPoints - this.playerElevateLevel.loyaltyPoints).toFixed(2);
441
- return T("tipsForNextLevel", {
445
+ return A("tipsForNextLevel", {
442
446
  pointsToReach: a,
443
447
  levelName: t.name,
444
448
  lang: this.language
@@ -447,8 +451,8 @@ const ie = ":host{display:block}@media screen and (min-width: 501px){.LoyaltyCar
447
451
  return "";
448
452
  }
449
453
  render() {
450
- const e = E("../static/card-ground.svg"), t = E("../static/card-ground-over.svg");
451
- 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: W, 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(U, { key: "d365971e66cbdc81d4b1758c045a76ad50a68729" }, i("div", { key: "2e017a95d80098565d17807c6f8dae51a6b89090", class: "PlayerImg" }, i(z, { 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(I, { key: "c794dc4acd33555811187df5b2748b012af77cbf", loyaltyPoints: this.playerElevateLevel.loyaltyPoints <= 0 ? 0 : this.playerElevateLevel.loyaltyPoints, language: this.language }), i(I, { key: "b88eb09ad61ea38214df4877976c6481626ae005", loyaltyPoints: this.getNextLevelPoints(), language: this.language })), i(q, { 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(F, { key: "db5824c90848a51566ff2a158ff6dc6a292009b2", expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat, language: this.language })))))));
454
+ const e = I("../static/card-ground.svg"), t = I("../static/card-ground-over.svg");
455
+ 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: W, 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(U, { key: "d365971e66cbdc81d4b1758c045a76ad50a68729" }, i("div", { key: "2e017a95d80098565d17807c6f8dae51a6b89090", class: "PlayerImg" }, i(z, { 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(S, { key: "c794dc4acd33555811187df5b2748b012af77cbf", loyaltyPoints: this.playerElevateLevel.loyaltyPoints <= 0 ? 0 : this.playerElevateLevel.loyaltyPoints, language: this.language }), i(S, { key: "b88eb09ad61ea38214df4877976c6481626ae005", loyaltyPoints: this.getNextLevelPoints(), language: this.language })), i(q, { 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(F, { key: "db5824c90848a51566ff2a158ff6dc6a292009b2", expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat, language: this.language })))))));
452
456
  }
453
457
  static get watchers() {
454
458
  return {
@@ -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-BMkDGrO2.cjs"),r=require("./index-71b1bdfa-BOdOb_jA.cjs"),x=require("./locale-Bby4w57M.cjs"),s=require("./player-elevate-card-items-a0f9711e-DYncEppV.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-DQ5lV6ZZ.cjs"),r=require("./index-71b1bdfa-BEl1AYIA.cjs"),b=require("./locale-Bby4w57M.cjs"),s=require("./player-elevate-card-items-a0f9711e-CZHU08Qb.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 E(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=E(e),n=E(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 w={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?w[e]:w[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;
@@ -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-B9QlSnQa.js";
18
- import { G as fe } from "./gamification-dropdown-f0760153-B9QlSnQa.js";
19
- import { r as m, h as i, a as T, c as U, g as I, F as W } from "./index-71b1bdfa-V1LBXDRS.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-LuvcDuiF.js";
17
+ import { b as I, s as x, a as b } from "./gamification-dropdown-f420baf5-CsmB-nIA.js";
18
+ import { G as fe } from "./gamification-dropdown-f420baf5-CsmB-nIA.js";
19
+ import { r as m, h as i, a as A, c as U, g as S, F as W } from "./index-71b1bdfa-C4fXNmHD.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-CTMyeyPT.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() {