@everymatrix/bonus-elevate-shop 1.0.69

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 (76) hide show
  1. package/dist/bonus-elevate-shop/bonus-elevate-shop.esm.js +1 -0
  2. package/dist/bonus-elevate-shop/index.esm.js +0 -0
  3. package/dist/bonus-elevate-shop/p-0b8ef56a.entry.js +1 -0
  4. package/dist/bonus-elevate-shop/p-248310cb.js +2 -0
  5. package/dist/bonus-elevate-shop/p-3feb3345.entry.js +1 -0
  6. package/dist/bonus-elevate-shop/p-5048c470.entry.js +1 -0
  7. package/dist/bonus-elevate-shop/p-e1255160.js +1 -0
  8. package/dist/bonus-elevate-shop/p-e5a4fd7f.js +1 -0
  9. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  10. package/dist/cjs/bonus-elevate-shop.cjs.js +25 -0
  11. package/dist/cjs/bonus-elevate-shop_4.cjs.entry.js +730 -0
  12. package/dist/cjs/index-950597be.js +1650 -0
  13. package/dist/cjs/index.cjs.js +2 -0
  14. package/dist/cjs/loader.cjs.js +15 -0
  15. package/dist/cjs/player-elevate-card-items-94136a9c.js +2364 -0
  16. package/dist/cjs/player-elevate-card.cjs.entry.js +74 -0
  17. package/dist/cjs/player-elevate-loyaltycard.cjs.entry.js +81 -0
  18. package/dist/collection/collection-manifest.json +28 -0
  19. package/dist/collection/components/bonus-elevate-shop/bonus-elevate-shop.css +92 -0
  20. package/dist/collection/components/bonus-elevate-shop/bonus-elevate-shop.js +247 -0
  21. package/dist/collection/components/bonus-elevate-shop/index.js +1 -0
  22. package/dist/collection/index.js +1 -0
  23. package/dist/collection/renders/renderGifts.js +30 -0
  24. package/dist/collection/static/avaliable.false.svg +47 -0
  25. package/dist/collection/static/avaliable.true.svg +47 -0
  26. package/dist/collection/utils/fetch.js +29 -0
  27. package/dist/collection/utils/translation.js +7 -0
  28. package/dist/collection/utils/types.js +1 -0
  29. package/dist/collection/utils/utils.js +3 -0
  30. package/dist/esm/app-globals-0f993ce5.js +3 -0
  31. package/dist/esm/bonus-elevate-shop.js +20 -0
  32. package/dist/esm/bonus-elevate-shop_4.entry.js +723 -0
  33. package/dist/esm/index-a343bbd8.js +1620 -0
  34. package/dist/esm/index.js +1 -0
  35. package/dist/esm/loader.js +11 -0
  36. package/dist/esm/player-elevate-card-items-ea0abf0a.js +2351 -0
  37. package/dist/esm/player-elevate-card.entry.js +70 -0
  38. package/dist/esm/player-elevate-loyaltycard.entry.js +77 -0
  39. package/dist/index.cjs.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/static/button-default.svg +42 -0
  42. package/dist/static/button-disabled.svg +4 -0
  43. package/dist/static/button-hover.svg +4 -0
  44. package/dist/static/button-level.svg +27 -0
  45. package/dist/static/button-pressed.svg +18 -0
  46. package/dist/static/button-redeem.svg +36 -0
  47. package/dist/static/card-ground-over.png +0 -0
  48. package/dist/static/card-ground-over.svg +903 -0
  49. package/dist/static/card-ground.png +0 -0
  50. package/dist/static/card-ground.svg +34 -0
  51. package/dist/static/info.svg +4 -0
  52. package/dist/static/level-badge.png +0 -0
  53. package/dist/static/level-percent.svg +80 -0
  54. package/dist/static/tips-info.svg +21 -0
  55. package/dist/static/user.svg +3 -0
  56. package/dist/stencil.config.dev.js +17 -0
  57. package/dist/stencil.config.js +17 -0
  58. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-shop/.stencil/packages/stencil/bonus-elevate-shop/stencil.config.d.ts +2 -0
  59. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-shop/.stencil/packages/stencil/bonus-elevate-shop/stencil.config.dev.d.ts +2 -0
  60. package/dist/types/components/bonus-elevate-shop/bonus-elevate-shop.d.ts +45 -0
  61. package/dist/types/components/bonus-elevate-shop/index.d.ts +1 -0
  62. package/dist/types/components.d.ts +101 -0
  63. package/dist/types/index.d.ts +1 -0
  64. package/dist/types/renders/renderGifts.d.ts +3 -0
  65. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  66. package/dist/types/utils/fetch.d.ts +3 -0
  67. package/dist/types/utils/translation.d.ts +8 -0
  68. package/dist/types/utils/types.d.ts +12 -0
  69. package/dist/types/utils/utils.d.ts +1 -0
  70. package/loader/cdn.js +1 -0
  71. package/loader/index.cjs.js +1 -0
  72. package/loader/index.d.ts +24 -0
  73. package/loader/index.es2017.js +1 -0
  74. package/loader/index.js +2 -0
  75. package/loader/package.json +11 -0
  76. package/package.json +31 -0
@@ -0,0 +1,723 @@
1
+ import { h, r as registerInstance, c as createEvent, g as getElement, a as getAssetPath, F as Fragment } from './index-a343bbd8.js';
2
+ import { r as requiredArgs, t as toDate, g as getTimezoneOffsetInMilliseconds, a as translateWithParams, T as TRANSLATIONS, P as PlayerAvatar, b as translate, c as PlayerPoints } from './player-elevate-card-items-ea0abf0a.js';
3
+
4
+ const getUrl = (path, params = {}) => {
5
+ return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
6
+ };
7
+ const fetcher = async (input, init = {}) => {
8
+ let res;
9
+ // @ts-ignore
10
+ res = await fetch(input, init);
11
+ res = await res.text();
12
+ try {
13
+ res = JSON.parse(res);
14
+ }
15
+ catch (e) {
16
+ console.error(e);
17
+ }
18
+ return res;
19
+ };
20
+ async function fetchNorwayApi(path, params = {}, init = {}) {
21
+ const { endpoint, language, session } = this;
22
+ const fetchParams = params;
23
+ if (!init.method || init.method === 'GET') {
24
+ fetchParams.language = language;
25
+ }
26
+ const url = getUrl(`${endpoint}${path}`, fetchParams);
27
+ if (!init.headers)
28
+ init.headers = {};
29
+ init.headers['x-SessionId'] = session;
30
+ const res = await fetcher(url, init);
31
+ return res;
32
+ }
33
+
34
+ const translation = {
35
+ en: {
36
+ Points: 'Points',
37
+ Point: 'Point',
38
+ noContent: 'No Content',
39
+ }
40
+ };
41
+
42
+ const avaliableTrueSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDYiIGhlaWd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+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl8xODNfNjQ5NyIgeDE9IjQyIiB5MT0iMzgiIHgyPSIyNy4wNTU4IiB5Mj0iMzQuMzE1NiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwLjUiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg==';
45
+
46
+ const getStatusData = (gift, redeem) => {
47
+ switch (gift.available) {
48
+ case "true":
49
+ return {
50
+ extraClass: ' active',
51
+ onClick: () => redeem(gift.id),
52
+ icon: avaliableTrueSvg
53
+ };
54
+ case "false":
55
+ return {
56
+ extraClass: ' deactive',
57
+ onClick: () => { },
58
+ icon: avaliableFalseSvg
59
+ };
60
+ }
61
+ };
62
+ const renderGifts = (gifts, locale, redeem) => {
63
+ return (h("div", { class: "Gifts FlexLayout" }, gifts.map(gift => {
64
+ var _a;
65
+ const statusData = getStatusData(gift, redeem);
66
+ const presentation = gift.presentation;
67
+ const getPropForBackgroundImage = (asset) => asset ?
68
+ { backgroundImage: `url('${asset}')` } :
69
+ {};
70
+ return (h("div", { class: "Gift" },
71
+ h("div", { class: "ImgContainer", onClick: () => window.postMessage({ type: 'BEEShopImgClicked', itemId: gift.id }, window.location.href), style: Object.assign({}, getPropForBackgroundImage(((_a = presentation.assets) === null || _a === void 0 ? void 0 : _a.length) > 0 ? presentation.assets[0] : '')) }),
72
+ h("div", { class: "InfoContainer" },
73
+ h("div", null,
74
+ h("div", { class: "Point" },
75
+ gift.points,
76
+ " ",
77
+ gift.points === 1 ? locale.Point : locale.Points),
78
+ h("div", { class: "Title" }, (presentation === null || presentation === void 0 ? void 0 : presentation.displayName) || gift.displayName),
79
+ h("div", { class: "Description" }, (presentation === null || presentation === void 0 ? void 0 : presentation.description) || '')),
80
+ h("div", { class: "AvaliableWrap" + statusData.extraClass, onClick: () => statusData.onClick() },
81
+ h("span", { innerHTML: statusData.icon })))));
82
+ })));
83
+ };
84
+
85
+ var GeneralAnimationLoadingVIKkNY2X = {};
86
+
87
+ (function (exports) {
88
+ var V=Object.defineProperty,z=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var v=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))G.call(t,n)&&v(e,n,t[n]);if(N)for(var n of N(t))q.call(t,n)&&v(e,n,t[n]);return e},M=(e,t)=>z(e,F(t));var $=(e,t,n)=>v(e,typeof t!="symbol"?t+"":t,n);var T=(e,t,n)=>new Promise((i,l)=>{var s=o=>{try{u(n.next(o));}catch(r){l(r);}},c=o=>{try{u(n.throw(o));}catch(r){l(r);}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(s,c);u((n=n.apply(e,t)).next());});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(){}function H(e){return e()}function B(){return Object.create(null)}function b(e){e.forEach(H);}function I(e){return typeof e=="function"}function K(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Q(e){return Object.keys(e).length===0}function W(e,t){e.appendChild(t);}function X(e,t,n){const i=Y(e);if(!i.getElementById(t)){const l=L("style");l.id=t,l.textContent=n,Z(i,l);}}function Y(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function Z(e,t){return W(e.head||e,t),t.sheet}function U(e,t,n){e.insertBefore(t,n||null);}function C(e){e.parentNode&&e.parentNode.removeChild(e);}function L(e){return document.createElement(e)}function tt(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n);}function et(e){return Array.from(e.childNodes)}function nt(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0;}),t}let j;function _(e){j=e;}const h=[],w=[];let m=[];const R=[],st=Promise.resolve();let k=!1;function it(){k||(k=!0,st.then(y));}function E(e){m.push(e);}const x=new Set;let a=0;function y(){if(a!==0)return;const e=j;do{try{for(;a<h.length;){const t=h[a];a++,_(t),rt(t.$$);}}catch(t){throw h.length=0,a=0,t}for(_(null),h.length=0,a=0;w.length;)w.pop()();for(let t=0;t<m.length;t+=1){const n=m[t];x.has(n)||(x.add(n),n());}m.length=0;}while(h.length);for(;R.length;)R.pop()();k=!1,x.clear(),_(e);}function rt(e){if(e.fragment!==null){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(E);}}function lt(e){const t=[],n=[];m.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),m=t;}const ct=new Set;function ot(e,t){e&&e.i&&(ct.delete(e),e.i(t));}function ut(e,t,n){const{fragment:i,after_update:l}=e.$$;i&&i.m(t,n),E(()=>{const s=e.$$.on_mount.map(H).filter(I);e.$$.on_destroy?e.$$.on_destroy.push(...s):b(s),e.$$.on_mount=[];}),l.forEach(E);}function dt(e,t){const n=e.$$;n.fragment!==null&&(lt(n.after_update),b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[]);}function $t(e,t){e.$$.dirty[0]===-1&&(h.push(e),it(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31;}function ft(e,t,n,i,l,s,c=null,u=[-1]){const o=j;_(e);const r=e.$$={fragment:null,ctx:[],props:s,update:g,not_equal:l,bound:B(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(o?o.$$.context:[])),callbacks:B(),dirty:u,skip_bound:!1,root:t.target||o.$$.root};c&&c(r.root);let f=!1;if(r.ctx=n?n(e,t.props||{},(d,O,...S)=>{const A=S.length?S[0]:O;return r.ctx&&l(r.ctx[d],r.ctx[d]=A)&&(!r.skip_bound&&r.bound[d]&&r.bound[d](A),f&&$t(e,d)),O}):[],r.update(),f=!0,b(r.before_update),r.fragment=i?i(r.ctx):!1,t.target){if(t.hydrate){const d=et(t.target);r.fragment&&r.fragment.l(d),d.forEach(C);}else r.fragment&&r.fragment.c();t.intro&&ot(e.$$.fragment),ut(e,t.target,t.anchor),y();}_(o);}let D;typeof HTMLElement=="function"&&(D=class extends HTMLElement{constructor(t,n,i){super();$(this,"$$ctor");$(this,"$$s");$(this,"$$c");$(this,"$$cn",!1);$(this,"$$d",{});$(this,"$$r",!1);$(this,"$$p_d",{});$(this,"$$l",{});$(this,"$$l_u",new Map);this.$$ctor=t,this.$$s=n,i&&this.attachShadow({mode:"open"});}addEventListener(t,n,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const l=this.$$c.$on(t,n);this.$$l_u.set(n,l);}super.addEventListener(t,n,i);}removeEventListener(t,n,i){if(super.removeEventListener(t,n,i),this.$$c){const l=this.$$l_u.get(n);l&&(l(),this.$$l_u.delete(n));}}connectedCallback(){return T(this,null,function*(){if(this.$$cn=!0,!this.$$c){let t=function(s){return ()=>{let c;return {c:function(){c=L("slot"),s!=="default"&&tt(c,"name",s);},m:function(r,f){U(r,c,f);},d:function(r){r&&C(c);}}}};if(yield Promise.resolve(),!this.$$cn||this.$$c)return;const n={},i=nt(this);for(const s of this.$$s)s in i&&(n[s]=[t(s)]);for(const s of this.attributes){const c=this.$$g_p(s.name);c in this.$$d||(this.$$d[c]=p(c,s.value,this.$$p_d,"toProp"));}for(const s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:M(P({},this.$$d),{$$slots:n,$$scope:{ctx:[]}})});const l=()=>{this.$$r=!0;for(const s in this.$$p_d)if(this.$$d[s]=this.$$c.$$.ctx[this.$$c.$$.props[s]],this.$$p_d[s].reflect){const c=p(s,this.$$d[s],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,c);}this.$$r=!1;};this.$$c.$$.after_update.push(l),l();for(const s in this.$$l)for(const c of this.$$l[s]){const u=this.$$c.$on(s,c);this.$$l_u.set(c,u);}this.$$l={};}})}attributeChangedCallback(t,n,i){var l;this.$$r||(t=this.$$g_p(t),this.$$d[t]=p(t,i,this.$$p_d,"toProp"),(l=this.$$c)==null||l.$set({[t]:this.$$d[t]}));}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0);});}$$g_p(t){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function p(e,t,n,i){var s;const l=(s=n[e])==null?void 0:s.type;if(t=l==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(l){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t==null?null:t;default:return t}else switch(l){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function at(e,t,n,i,l,s){let c=class extends D{constructor(){super(e,n,l),this.$$p_d=t;}static get observedAttributes(){return Object.keys(t).map(u=>(t[u].attribute||u).toLowerCase())}};return Object.keys(t).forEach(u=>{Object.defineProperty(c.prototype,u,{get(){return this.$$c&&u in this.$$c?this.$$c[u]:this.$$d[u]},set(o){var r;o=p(u,o,t),this.$$d[u]=o,(r=this.$$c)==null||r.$set({[u]:o});}});}),i.forEach(u=>{Object.defineProperty(c.prototype,u,{get(){var o;return (o=this.$$c)==null?void 0:o[u]}});}),e.element=c,c}class ht{constructor(){$(this,"$$");$(this,"$$set");}$destroy(){dt(this,1),this.$destroy=g;}$on(t,n){if(!I(n))return g;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1);}}$set(t){this.$$set&&!Q(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1);}}const gt="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gt);function mt(e){X(e,"svelte-g6m3er",".LoaderContainer.svelte-g6m3er.svelte-g6m3er{display:flex;justify-content:center}.lds-ellipsis.svelte-g6m3er.svelte-g6m3er{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(1){left:8px;animation:svelte-g6m3er-lds-ellipsis1 0.6s infinite}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(2){left:8px;animation:svelte-g6m3er-lds-ellipsis2 0.6s infinite}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(3){left:32px;animation:svelte-g6m3er-lds-ellipsis2 0.6s infinite}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(4){left:56px;animation:svelte-g6m3er-lds-ellipsis3 0.6s infinite}@keyframes svelte-g6m3er-lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes svelte-g6m3er-lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes svelte-g6m3er-lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}");}function _t(e){let t;return {c(){t=L("div"),t.innerHTML='<section class="LoaderContainer svelte-g6m3er" part="LoaderContainer"><div class="lds-ellipsis svelte-g6m3er"><div class="svelte-g6m3er"></div><div class="svelte-g6m3er"></div><div class="svelte-g6m3er"></div><div class="svelte-g6m3er"></div></div></section>';},m(n,i){U(n,t,i),e[3](t);},p:g,i:g,o:g,d(n){n&&C(t),e[3](null);}}}function pt(e,t,n){let{clientstyling:i=""}=t,{clientstylingurl:l=""}=t,s;const c=()=>{let r=document.createElement("style");r.innerHTML=i,s.appendChild(r);},u=()=>{let r=new URL(l),f=document.createElement("style");fetch(r.href).then(d=>d.text()).then(d=>{f.innerHTML=d,setTimeout(()=>{s.appendChild(f);},1),setTimeout(()=>{},500);});};function o(r){w[r?"unshift":"push"](()=>{s=r,n(0,s);});}return e.$$set=r=>{"clientstyling"in r&&n(1,i=r.clientstyling),"clientstylingurl"in r&&n(2,l=r.clientstylingurl);},e.$$.update=()=>{e.$$.dirty&3&&i&&s&&c(),e.$$.dirty&5&&l&&s&&u();},[s,i,l,o]}class J extends ht{constructor(t){super(),ft(this,t,pt,_t,K,{clientstyling:1,clientstylingurl:2},mt);}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),y();}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),y();}}at(J,{clientstyling:{},clientstylingurl:{}},[],[],!0);exports.default=J;
89
+ }(GeneralAnimationLoadingVIKkNY2X));
90
+
91
+ if(typeof window!="undefined"){let n=function(t){return function(...i){try{return t.apply(this,i)}catch(e){if(e instanceof DOMException&&e.message.includes("has already been used with this registry")||e.message.includes("Cannot define multiple custom elements with the same tag name"))return !1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>GeneralAnimationLoadingVIKkNY2X).then(({default:t})=>{!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",t.element);});}
92
+
93
+ const bonusElevateShopCss = ":host{display:block}svg circle{shape-rendering:crispEdges}.MainContainer{max-width:420px}.MainContainer player-elevate-pointcard{width:100%;height:220px}.Gifts{display:flex;justify-content:space-between;padding:15px;padding-left:-8px;padding-right:-8px;flex:0 0 45.1282051282%;flex-wrap:wrap;justify-content:flex-start;background:var(--emfe-w-color-white, #FFFFFF);color:var(--emfe-w-color-black-150, #000000);font-weight:500;gap:10px;margin-top:-100px;position:relative;min-height:200px}.InfoContainer{display:flex;margin-top:17px;justify-content:space-between}.Gift{display:block;margin-bottom:10px;padding:8px;box-shadow:0px 18px 45px 0px var(--emfe-w-color-black-150, rgba(167, 167, 167, 0.2));border-radius:11px;background:var(--emfe-w-color-white, #FFFFFF)}.Gift .ImgContainer{width:160px;height:107px;border-radius:11px;box-shadow:0px 2px 6px 0px var(--emfe-w-color-black-200, rgba(0, 0, 0, 0.2509803922));cursor:pointer;background-size:cover;background-position:center center;background-repeat:no-repeat}.Gift .Point{font-size:20px}.Gift .Title,.Gift .Description{padding-left:3px}.Gift .Title{font-size:14px;margin-top:10px}.Gift .Description{font-size:12px;color:var(--emfe-w-color-black-100, #767171)}.Gift .AvaliableWrap{align-self:self-end}.Gift .AvaliableWrap.active{cursor:pointer}.Gift .AvaliableWrap.deactive{cursor:not-allowed}.Gift .AvaliableWrap span svg{width:var(--emfe-w-elevate-avaliable-button-size, 46px)}.NoContent{font-size:16px;color:var(--emfe-w-color-black-100, #afafaf);text-align:center;height:120px;line-height:120px}";
94
+ const BonusElevateShopStyle0 = bonusElevateShopCss;
95
+
96
+ const BonusElevateShop = class {
97
+ constructor(hostRef) {
98
+ registerInstance(this, hostRef);
99
+ this.redeemGiftButton = createEvent(this, "redeemGiftButton", 7);
100
+ this.bindedHandler = this.handleMessage.bind(this);
101
+ this.session = undefined;
102
+ this.endpoint = undefined;
103
+ this.language = 'en';
104
+ this.clientStyling = '';
105
+ this.clientStylingUrl = '';
106
+ this.translationUrl = '';
107
+ this.locale = translation['en'];
108
+ this.gifts = [];
109
+ this.isLoading = true;
110
+ }
111
+ async updateGifts() {
112
+ this.isLoading = true;
113
+ if (this.session) {
114
+ const res = await fetchNorwayApi.bind(this, '/v1/elevate/shop', {}).call();
115
+ this.gifts = res.data || [];
116
+ }
117
+ else {
118
+ this.gifts = [];
119
+ }
120
+ this.isLoading = false;
121
+ }
122
+ redeemGiftConfirm(id) {
123
+ const shopItem = this.gifts.filter((gift) => {
124
+ return gift.id === id;
125
+ })[0];
126
+ window.postMessage({ type: 'BEERedeemConfirm', shopItem }, window.location.href);
127
+ }
128
+ disconnectedCallback() {
129
+ window.removeEventListener('message', this.bindedHandler, false);
130
+ }
131
+ async redeemGift(id) {
132
+ const res = await fetchNorwayApi.bind(this, '/v1/elevate/redeem', {}, {
133
+ method: 'PUT',
134
+ body: JSON.stringify({ giftID: id }),
135
+ headers: {
136
+ 'Content-Type': 'application/json-patch+json',
137
+ }
138
+ }).call();
139
+ if (res.success) {
140
+ this.redeemGiftButton.emit();
141
+ window.postMessage({ type: 'BEEGiftRedeem', itemId: id }, window.location.href);
142
+ }
143
+ else {
144
+ window.postMessage({ type: 'BEEGiftRedeemFailed', itemId: id, err: res }, window.location.href);
145
+ }
146
+ }
147
+ loadGifts(renderer) {
148
+ if (this.isLoading) {
149
+ return h("general-animation-loading", null);
150
+ }
151
+ else {
152
+ if (this.gifts.length === 0) {
153
+ return (h("div", { class: "NoContent" }, this.locale.noContent));
154
+ }
155
+ else {
156
+ return renderer();
157
+ }
158
+ }
159
+ }
160
+ render() {
161
+ return (h("main", { key: 'd659585662c983efd2eeb69a3880ec8328ad8351', class: "MainContainer" }, h("general-styling-wrapper", { key: 'a9b2650455ecd27849e55553eb1679dddce7b7cd', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: translation, translationUrl: this.translationUrl }), h("player-elevate-pointcard", { key: 'f042fb5c3fcb5d5c03059507a1201d1e56dfd5d4', endpoint: this.endpoint, session: this.session, language: this.language, clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling, translationUrl: this.translationUrl }), this.loadGifts(renderGifts.bind(this, this.gifts, this.locale, this.redeemGiftConfirm.bind(this)))));
162
+ }
163
+ handleMessage(message) {
164
+ if (message.data.type === "bee-redeem-confirmed" && message.data.id) {
165
+ this.redeemGift(message.data.id);
166
+ }
167
+ }
168
+ async componentDidLoad() {
169
+ this.updateGifts();
170
+ window.addEventListener('message', this.bindedHandler, false);
171
+ }
172
+ static get assetsDirs() { return ["static"]; }
173
+ static get watchers() { return {
174
+ "endpoint": ["updateGifts"],
175
+ "language": ["updateGifts"],
176
+ "session": ["updateGifts"]
177
+ }; }
178
+ };
179
+ BonusElevateShop.style = BonusElevateShopStyle0;
180
+
181
+ const mergeTranslations = (url, target) => {
182
+ return new Promise((resolve) => {
183
+ fetch(url)
184
+ .then((res) => res.json())
185
+ .then((data) => {
186
+ Object.keys(data).forEach((item) => {
187
+ target[item] = target[item] ? target[item] : {};
188
+ for (let key in data[item]) {
189
+ target[item][key] = data[item][key];
190
+ }
191
+ });
192
+ resolve(true);
193
+ });
194
+ });
195
+ };
196
+
197
+ const generalStylingWrapperCss = ":host{display:block}";
198
+ const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
199
+
200
+ const GeneralStylingWrapper = class {
201
+ constructor(hostRef) {
202
+ registerInstance(this, hostRef);
203
+ this.stylingAppends = false;
204
+ this.setClientStyling = () => {
205
+ let sheet = document.createElement('style');
206
+ sheet.innerHTML = this.clientStyling;
207
+ this.el.prepend(sheet);
208
+ };
209
+ this.setClientStylingURL = () => {
210
+ let url = new URL(this.clientStylingUrl);
211
+ let cssFile = document.createElement('style');
212
+ fetch(url.href)
213
+ .then((res) => res.text())
214
+ .then((data) => {
215
+ cssFile.innerHTML = data;
216
+ setTimeout(() => {
217
+ this.el.prepend(cssFile);
218
+ }, 1);
219
+ })
220
+ .catch((err) => {
221
+ console.log('error ', err);
222
+ });
223
+ };
224
+ this.clientStyling = '';
225
+ this.clientStylingUrl = '';
226
+ this.translationUrl = '';
227
+ this.targetTranslations = undefined;
228
+ }
229
+ componentDidRender() {
230
+ // start custom styling area
231
+ if (!this.stylingAppends) {
232
+ if (this.clientStyling)
233
+ this.setClientStyling();
234
+ if (this.clientStylingUrl)
235
+ this.setClientStylingURL();
236
+ this.stylingAppends = true;
237
+ }
238
+ // end custom styling area
239
+ }
240
+ async componentWillLoad() {
241
+ const promises = [];
242
+ if (this.translationUrl) {
243
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
244
+ promises.push(translationPromise);
245
+ }
246
+ return await Promise.all(promises);
247
+ }
248
+ render() {
249
+ return (h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
250
+ }
251
+ get el() { return getElement(this); }
252
+ };
253
+ GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
254
+
255
+ /**
256
+ * @name startOfDay
257
+ * @category Day Helpers
258
+ * @summary Return the start of a day for the given date.
259
+ *
260
+ * @description
261
+ * Return the start of a day for the given date.
262
+ * The result will be in the local timezone.
263
+ *
264
+ * @param {Date|Number} date - the original date
265
+ * @returns {Date} the start of a day
266
+ * @throws {TypeError} 1 argument required
267
+ *
268
+ * @example
269
+ * // The start of a day for 2 September 2014 11:55:00:
270
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
271
+ * //=> Tue Sep 02 2014 00:00:00
272
+ */
273
+ function startOfDay(dirtyDate) {
274
+ requiredArgs(1, arguments);
275
+ var date = toDate(dirtyDate);
276
+ date.setHours(0, 0, 0, 0);
277
+ return date;
278
+ }
279
+
280
+ var MILLISECONDS_IN_DAY = 86400000;
281
+
282
+ /**
283
+ * @name differenceInCalendarDays
284
+ * @category Day Helpers
285
+ * @summary Get the number of calendar days between the given dates.
286
+ *
287
+ * @description
288
+ * Get the number of calendar days between the given dates. This means that the times are removed
289
+ * from the dates and then the difference in days is calculated.
290
+ *
291
+ * @param {Date|Number} dateLeft - the later date
292
+ * @param {Date|Number} dateRight - the earlier date
293
+ * @returns {Number} the number of calendar days
294
+ * @throws {TypeError} 2 arguments required
295
+ *
296
+ * @example
297
+ * // How many calendar days are between
298
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
299
+ * const result = differenceInCalendarDays(
300
+ * new Date(2012, 6, 2, 0, 0),
301
+ * new Date(2011, 6, 2, 23, 0)
302
+ * )
303
+ * //=> 366
304
+ * // How many calendar days are between
305
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
306
+ * const result = differenceInCalendarDays(
307
+ * new Date(2011, 6, 3, 0, 1),
308
+ * new Date(2011, 6, 2, 23, 59)
309
+ * )
310
+ * //=> 1
311
+ */
312
+ function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
313
+ requiredArgs(2, arguments);
314
+ var startOfDayLeft = startOfDay(dirtyDateLeft);
315
+ var startOfDayRight = startOfDay(dirtyDateRight);
316
+ var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
317
+ var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
318
+
319
+ // Round the number of days to the nearest integer
320
+ // because the number of milliseconds in a day is not constant
321
+ // (e.g. it's different in the day of the daylight saving time clock shift)
322
+ return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
323
+ }
324
+
325
+ /**
326
+ * Days in 1 week.
327
+ *
328
+ * @name daysInWeek
329
+ * @constant
330
+ * @type {number}
331
+ * @default
332
+ */
333
+
334
+ /**
335
+ * Milliseconds in 1 hour
336
+ *
337
+ * @name millisecondsInHour
338
+ * @constant
339
+ * @type {number}
340
+ * @default
341
+ */
342
+ var millisecondsInHour = 3600000;
343
+
344
+ /**
345
+ * @name differenceInMilliseconds
346
+ * @category Millisecond Helpers
347
+ * @summary Get the number of milliseconds between the given dates.
348
+ *
349
+ * @description
350
+ * Get the number of milliseconds between the given dates.
351
+ *
352
+ * @param {Date|Number} dateLeft - the later date
353
+ * @param {Date|Number} dateRight - the earlier date
354
+ * @returns {Number} the number of milliseconds
355
+ * @throws {TypeError} 2 arguments required
356
+ *
357
+ * @example
358
+ * // How many milliseconds are between
359
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
360
+ * const result = differenceInMilliseconds(
361
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
362
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
363
+ * )
364
+ * //=> 1100
365
+ */
366
+ function differenceInMilliseconds(dateLeft, dateRight) {
367
+ requiredArgs(2, arguments);
368
+ return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
369
+ }
370
+
371
+ var roundingMap = {
372
+ ceil: Math.ceil,
373
+ round: Math.round,
374
+ floor: Math.floor,
375
+ trunc: function trunc(value) {
376
+ return value < 0 ? Math.ceil(value) : Math.floor(value);
377
+ } // Math.trunc is not supported by IE
378
+ };
379
+
380
+ var defaultRoundingMethod = 'trunc';
381
+ function getRoundingMethod(method) {
382
+ return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
383
+ }
384
+
385
+ /**
386
+ * @name differenceInHours
387
+ * @category Hour Helpers
388
+ * @summary Get the number of hours between the given dates.
389
+ *
390
+ * @description
391
+ * Get the number of hours between the given dates.
392
+ *
393
+ * @param {Date|Number} dateLeft - the later date
394
+ * @param {Date|Number} dateRight - the earlier date
395
+ * @param {Object} [options] - an object with options.
396
+ * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
397
+ * @returns {Number} the number of hours
398
+ * @throws {TypeError} 2 arguments required
399
+ *
400
+ * @example
401
+ * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
402
+ * const result = differenceInHours(
403
+ * new Date(2014, 6, 2, 19, 0),
404
+ * new Date(2014, 6, 2, 6, 50)
405
+ * )
406
+ * //=> 12
407
+ */
408
+ function differenceInHours(dateLeft, dateRight, options) {
409
+ requiredArgs(2, arguments);
410
+ var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
411
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
412
+ }
413
+
414
+ /**
415
+ * @name isBefore
416
+ * @category Common Helpers
417
+ * @summary Is the first date before the second one?
418
+ *
419
+ * @description
420
+ * Is the first date before the second one?
421
+ *
422
+ * @param {Date|Number} date - the date that should be before the other one to return true
423
+ * @param {Date|Number} dateToCompare - the date to compare with
424
+ * @returns {Boolean} the first date is before the second date
425
+ * @throws {TypeError} 2 arguments required
426
+ *
427
+ * @example
428
+ * // Is 10 July 1989 before 11 February 1987?
429
+ * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
430
+ * //=> false
431
+ */
432
+ function isBefore(dirtyDate, dirtyDateToCompare) {
433
+ requiredArgs(2, arguments);
434
+ var date = toDate(dirtyDate);
435
+ var dateToCompare = toDate(dirtyDateToCompare);
436
+ return date.getTime() < dateToCompare.getTime();
437
+ }
438
+
439
+ function updateProgressSvg(progressElementRef, percent) {
440
+ const svgElement = progressElementRef.querySelector('#total_level');
441
+ const endLockWidth = 17, pointR = 6.5;
442
+ //Total Widget of the progress
443
+ const barWidth = svgElement.getBBox().width;
444
+ //The filled width according to current progress
445
+ const levelPercent = percent > 1 ? 1 : percent;
446
+ const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
447
+ //update bar's width, widthOnBar
448
+ const levelBar = progressElementRef.querySelector('#current_level');
449
+ //update filters, x = widthOnBar
450
+ const levelFilter = progressElementRef.querySelector('#filter_current_level');
451
+ //update circle, widthOnBar+10
452
+ const levelCircle = progressElementRef.querySelector('#circle_current_level');
453
+ svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
454
+ levelBar.setAttribute('width', `${widthOnBar}`);
455
+ levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
456
+ levelFilter.setAttribute('x', `${widthOnBar - 8}`);
457
+ //update lock location
458
+ const endLockElement = progressElementRef.querySelector('#lock');
459
+ // wrapper of endLock, include ball and heatfilter1_d_305_23
460
+ const filter1 = progressElementRef.querySelector('#filter_heart_ball');
461
+ // ball in endlockfilter2_i_305_23
462
+ const filter2 = progressElementRef.querySelector('#filter_ball');
463
+ // heart in endlockfilter3_d_305_23
464
+ const filter3 = progressElementRef.querySelector('#filter_heart');
465
+ //wrapper of lockfilter4_d_305_23
466
+ const filterLock = progressElementRef.querySelector('#filter_lock');
467
+ // shadow of ball paint0_linear_305_23
468
+ const paint0 = progressElementRef.querySelector('#paint0_linear_ball');
469
+ //paint in lockpaint1_linear_305_23
470
+ const paint1 = progressElementRef.querySelector('#paint1_linear_lock');
471
+ // box of lock and heart, for move position dynamically
472
+ const lockBox = progressElementRef.querySelector('#lock_box');
473
+ const heartBox = progressElementRef.querySelector('#heart_box');
474
+ const rightPaddingOfLockWidth = 10, cxOfEndLockEle = barWidth - rightPaddingOfLockWidth;
475
+ //set cx of lockElement
476
+ endLockElement.setAttribute('cx', `${cxOfEndLockEle}`);
477
+ //set cx of sub Elements
478
+ paint1.setAttribute('x1', `${cxOfEndLockEle}`);
479
+ paint1.setAttribute('x2', `${cxOfEndLockEle}`);
480
+ paint0.setAttribute('x1', `${cxOfEndLockEle - 6}`);
481
+ paint0.setAttribute('x2', `${cxOfEndLockEle - 6 + 11.2}`);
482
+ filterLock.setAttribute('x', `${cxOfEndLockEle - 6}`);
483
+ filter3.setAttribute('x', `${cxOfEndLockEle - 6 - 2}`);
484
+ filter2.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2}`);
485
+ filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
486
+ lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
487
+ heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
488
+ svgElement.parentElement.style.opacity = '1';
489
+ }
490
+
491
+ const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
492
+ const PlayerElevateCardDataStyle0 = playerElevateCardDataCss;
493
+
494
+ const PlayerElevateCardData = class {
495
+ constructor(hostRef) {
496
+ registerInstance(this, hostRef);
497
+ this.playerElevateLeveLoaded = createEvent(this, "playerElevateLeveLoaded", 7);
498
+ this.params = undefined;
499
+ this.playerElevateLevel = undefined;
500
+ this.pointExpireString = undefined;
501
+ }
502
+ handleWindowResizs() {
503
+ this.initLevelProgressbar();
504
+ }
505
+ onParamsChanged() {
506
+ this.loadElevateInfo();
507
+ }
508
+ onRedeemClick() {
509
+ window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
510
+ }
511
+ loadLevels() {
512
+ let url = new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);
513
+ return new Promise((resolve, reject) => {
514
+ return fetch(url.href, {
515
+ method: 'GET',
516
+ })
517
+ .then((res) => res.json())
518
+ .then((res) => {
519
+ this.levels = res.data;
520
+ resolve(true);
521
+ })
522
+ .catch((err) => {
523
+ reject(err);
524
+ });
525
+ });
526
+ }
527
+ calcuatePointsToBeExpired(walletTotalInfo) {
528
+ let pointExpireInfoAsString = '';
529
+ if (!walletTotalInfo || !walletTotalInfo.aboutToExpire ||
530
+ walletTotalInfo.aboutToExpire.length == 0 ||
531
+ walletTotalInfo.aboutToExpire[0].points <= 0) {
532
+ return pointExpireInfoAsString;
533
+ }
534
+ walletTotalInfo.aboutToExpire.sort((expire1, expire2) => {
535
+ return isBefore(new Date(expire1.expireTime), new Date(expire2.expireTime))
536
+ ? -1
537
+ : 1;
538
+ });
539
+ const aboutToExpire = walletTotalInfo.aboutToExpire[0];
540
+ const daysToExpried = differenceInCalendarDays(new Date(aboutToExpire.expireTime), new Date());
541
+ let hoursToExpired = 0, expiredTranslationKey = daysToExpried === 0 ? 'pointsToBeExpiredDay' : 'pointsToBeExpired';
542
+ if (daysToExpried == 0) {
543
+ hoursToExpired = differenceInHours(new Date(aboutToExpire.expireTime), new Date());
544
+ expiredTranslationKey = hoursToExpired > 1 ? 'pointsToBeExpiredHours' : 'pointsToBeExpiredHour';
545
+ }
546
+ pointExpireInfoAsString = translateWithParams(expiredTranslationKey, {
547
+ expirationPoints: aboutToExpire.points,
548
+ expireDay: daysToExpried,
549
+ });
550
+ return pointExpireInfoAsString;
551
+ }
552
+ loadPlayerLevelInfo() {
553
+ let url = new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);
554
+ return new Promise((resolve, reject) => {
555
+ return fetch(url.href, {
556
+ method: 'GET',
557
+ headers: {
558
+ 'X-Sessionid': this.params.session,
559
+ 'Content-Type': 'application/json',
560
+ },
561
+ })
562
+ .then((res) => res.json())
563
+ .then((res) => {
564
+ var _a, _b, _c;
565
+ if (!res.success) {
566
+ console.error('Exception when fetch user elevateinfo, ', res.errorCode, res.errorMessage);
567
+ reject(true);
568
+ return;
569
+ }
570
+ let playerElevateInfo = res.data;
571
+ this.playerElevateLevel = playerElevateInfo.level;
572
+ this.playerElevateLevel.name = this.playerElevateLevel.presentation.displayName || this.playerElevateLevel.name;
573
+ this.playerElevateLevel.spendablePoints = ((_a = playerElevateInfo.spendableWallet) === null || _a === void 0 ? void 0 : _a.total.points) || 0;
574
+ this.playerElevateLeveLoaded.emit({ elevateLevel: this.playerElevateLevel });
575
+ const spendableTotal = (_b = res.data.spendableWallet) === null || _b === void 0 ? void 0 : _b.total;
576
+ const loyaltyWalletTotal = (_c = res.data.loyaltyWallet) === null || _c === void 0 ? void 0 : _c.total;
577
+ this.playerElevateLeveLoaded.emit({
578
+ elevateLevelWalletTotal: spendableTotal,
579
+ loyaltyWalletTotal
580
+ });
581
+ let spExpireInfoAsString = this.calcuatePointsToBeExpired(spendableTotal);
582
+ let xpExpireInfoAsString = this.calcuatePointsToBeExpired(loyaltyWalletTotal);
583
+ if (spExpireInfoAsString || xpExpireInfoAsString) {
584
+ this.playerElevateLeveLoaded.emit({
585
+ pointExpireString: spExpireInfoAsString,
586
+ xpExpireString: xpExpireInfoAsString
587
+ });
588
+ }
589
+ resolve(this.playerElevateLevel);
590
+ })
591
+ .catch((err) => {
592
+ console.log('error ', err);
593
+ reject(true);
594
+ });
595
+ });
596
+ }
597
+ setLoyaltyProgress(percent) {
598
+ updateProgressSvg(this.loyaltyProgressEle, percent);
599
+ }
600
+ initLevelProgressbar() {
601
+ setTimeout(() => {
602
+ this.loyaltyProgressEle =
603
+ this.elevateCardRef.parentElement.querySelector('#LevelProgress');
604
+ if (!this.loyaltyProgressEle) {
605
+ return;
606
+ }
607
+ this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
608
+ ? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
609
+ this.params['playerElevateLevel'] = this.playerElevateLevel;
610
+ }, 80);
611
+ }
612
+ componentDidRender() {
613
+ this.initLevelProgressbar();
614
+ }
615
+ loadElevateInfo() {
616
+ if (!this.params.endpoint || !this.params.session) {
617
+ return;
618
+ }
619
+ const promises = [];
620
+ promises.push(this.loadPlayerLevelInfo());
621
+ if (this.params.calculateLevelFlag) {
622
+ promises.push(this.loadLevels());
623
+ }
624
+ Promise.all(promises).then((res) => {
625
+ console.log('elevate-init', res);
626
+ this.initLevelProgressbar();
627
+ if (!this.levels) {
628
+ return;
629
+ }
630
+ this.levels.sort((level1, level2) => {
631
+ return level1.firstEntryPoints > level2.firstEntryPoints ? 1 : -1;
632
+ });
633
+ const playerPoints = this.playerElevateLevel.loyaltyPoints;
634
+ let playerLevelNumber = 0;
635
+ this.levels.forEach((elevateLevel, idx) => {
636
+ if (playerPoints > elevateLevel.firstEntryPoints) {
637
+ playerLevelNumber = idx;
638
+ }
639
+ });
640
+ this.playerElevateLeveLoaded.emit({
641
+ calculatedLevelFlag: playerLevelNumber,
642
+ });
643
+ });
644
+ }
645
+ componentWillLoad() {
646
+ this.loadElevateInfo();
647
+ }
648
+ get elevateCardRef() { return getElement(this); }
649
+ static get watchers() { return {
650
+ "params": ["onParamsChanged"]
651
+ }; }
652
+ };
653
+ PlayerElevateCardData.style = PlayerElevateCardDataStyle0;
654
+
655
+ const playerElevatePointcardCss = ":host{display:block}.PointsCard .Inner .Row .ExpirationPoints{text-align:left}.PointsCard .Inner .PlayerAvatar .Avatar{display:none}.PointsCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%;position:inherit}.PointsCard .Inner .PointsTxt{display:flex;flex-direction:row;justify-content:space-between}.PointsCard .Inner .DetailButton{background:linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%), linear-gradient(0deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6));border-radius:5px;box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25);border:2px solid;font-size:11px;width:108px;padding:4px;cursor:pointer;margin-top:5px;height:16px;min-width:45px;text-align:center}.PointsCard .Inner .DetailButton span{color:var(--emfe-w-color-gray-150, #6D6D6D)}.PointsCard .Inner .DetailButton span{display:inline-block;vertical-align:middle}.PointsCard .Inner .DetailButton:hover span{color:var(--emfe-w-color-gray-150, #6D6D6D)}.PointsCard .Inner .LevelInfo{gap:15px;width:70%}.PointsCard .Inner .LevelInfo .PointsTxt{font-size:15px}.PointsCard .Inner .LevelInfo .PointsTxt.Label{display:none}.PointsCard .Inner .LevelInfo .PointsTxt.SPPoints{padding-top:15px}.PointsCard .Inner .LevelInfo .PointsTxt .TC{font-size:x-small;color:var(--emw--color-gray-300, #58586B);display:flex;align-content:center;height:100%;flex-wrap:wrap;text-decoration:underline;cursor:pointer;display:none}";
656
+ const PlayerElevatePointcardStyle0 = playerElevatePointcardCss;
657
+
658
+ const PlayerElevatePointcard = class {
659
+ constructor(hostRef) {
660
+ registerInstance(this, hostRef);
661
+ this.isPointDetailCard = this.buttonType === 'earningRule';
662
+ this.endpoint = undefined;
663
+ this.theme = 'Dark';
664
+ this.session = undefined;
665
+ this.playerAvatarUrl = undefined;
666
+ this.language = 'en';
667
+ this.playerName = undefined;
668
+ this.cardTitle = undefined;
669
+ this.buttonType = 'earningRule';
670
+ this.dateFormat = 'yyyy-MM-dd';
671
+ this.clientStyling = '';
672
+ this.clientStylingUrl = '';
673
+ this.translationUrl = '';
674
+ this.pointExpireString = undefined;
675
+ this.playerElevateLevel = undefined;
676
+ this.elevateWalletTotal = undefined;
677
+ this.elevateSPTotal = undefined;
678
+ }
679
+ onSessionOrEndpointChange() {
680
+ this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
681
+ }
682
+ playerElevateLeveLoadedHandler(event) {
683
+ if (!event.detail) {
684
+ return;
685
+ }
686
+ if (event.detail['elevateLevelWalletTotal']) {
687
+ this.elevateWalletTotal = event.detail['elevateLevelWalletTotal'];
688
+ this.elevateSPTotal = event.detail['loyaltyWalletTotal'];
689
+ }
690
+ if (event.detail['elevateLevel']) {
691
+ this.playerElevateLevel = event.detail['elevateLevel'];
692
+ }
693
+ if (event.detail['pointExpireString']) {
694
+ this.pointExpireString = event.detail.pointExpireString;
695
+ }
696
+ }
697
+ onDetailsClick() {
698
+ window.postMessage({ type: this.isPointDetailCard ? 'BEEPointRulesClicked' : 'BEEDetailsClicked',
699
+ path: this.isPointDetailCard ? 'player-elevate-level' : 'player-elevate-point-details' }, window.location.href);
700
+ }
701
+ componentWillLoad() {
702
+ this.paramProxy = {
703
+ endpoint: this.endpoint,
704
+ session: this.session,
705
+ language: this.language,
706
+ };
707
+ }
708
+ render() {
709
+ const backgroundOuterImagePath = getAssetPath('../static/card-ground.svg');
710
+ const backgroundInnerImagePath = getAssetPath('../static/card-ground-over.svg');
711
+ return (h("div", { key: '13461fc9cf8b777337a539c15da4bb2781f5a837', class: `ElevateCardWrapper ${this.theme}` }, h("div", { key: '526e72c0ada871f74ba4a07f0a125bc25840c09c', class: "PointsCard Outer ", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } }, h("general-styling-wrapper", { key: '95e358ceb8fa3c247660f7ca15a4684b132874be', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), h("player-elevate-card-data", { key: '24c765d743446ac597a9dcc9cd22515e7e39e6db', params: this.paramProxy }), h("div", { key: '309db4bbfc244a7fb97827774d9d4383109ca0d7', class: 'OuterCover Inner', style: { 'backgroundImage': `url(${backgroundInnerImagePath}` } }, h("div", { key: '9d5614ded2f73b505e60900675a7d95b3cfbcbc6', class: 'Content Row' }, this.playerElevateLevel && (h(Fragment, { key: '9a17e809083e61aad19f7ffef5d5ee5885ae8b4d' }, h("div", { key: '47068df3c0070ee2785b0d0201b08766fe0d71e8', class: "PlayerImg" }, h(PlayerAvatar, { key: '40115f8b190d871c85f9531fbf0bafb8fbd739e2', onlyBadge: true, loyaltyIconUrl: this.playerElevateLevel.presentation.asset })), h("div", { key: '278cd70c23ecb48655e90810af570ce5366d13d5', class: `LevelInfo ${this.playerElevateLevel.name}` }, h("div", { key: 'ce682ff881c5b12ed0b736ffcc67ad07b3713999', class: "PointsTxt Label" }, this.cardTitle ? this.cardTitle : translate('spendablePoints')), h("div", { key: 'eeebc5c468cf6e3d566f708fd47a19956ad9defe', class: 'PointsTxt SPPoints' }, h(PlayerPoints, { key: 'ad58990b7fa789cf2d5c524191447196e97c8a16', spendablePoints: this.playerElevateLevel.spendablePoints, language: this.language }), h("a", { key: '0dbdd6cd84e1cb43dac4485f4e3eec3130d6c65c', class: "TC", onClick: () => {
712
+ this.onDetailsClick();
713
+ } }, translate('termAndConditions', this.language))), this.pointExpireString && (h("div", { key: '45c3267d390995fabe34974913adf97b112cf8c2', class: 'ExpirationPoints' }, this.pointExpireString, " "))))))))));
714
+ }
715
+ static get watchers() { return {
716
+ "session": ["onSessionOrEndpointChange"],
717
+ "endpoint": ["onSessionOrEndpointChange"],
718
+ "language": ["onSessionOrEndpointChange"]
719
+ }; }
720
+ };
721
+ PlayerElevatePointcard.style = PlayerElevatePointcardStyle0;
722
+
723
+ export { BonusElevateShop as bonus_elevate_shop, GeneralStylingWrapper as general_styling_wrapper, PlayerElevateCardData as player_elevate_card_data, PlayerElevatePointcard as player_elevate_pointcard };