@everymatrix/casino-engagement-suite-tournament 1.44.0 → 1.45.5

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 (71) hide show
  1. package/dist/casino-engagement-suite-tournament/casino-engagement-suite-tournament.esm.js +1 -1
  2. package/dist/casino-engagement-suite-tournament/index.esm.js +1 -0
  3. package/dist/casino-engagement-suite-tournament/p-0f4e94ab.entry.js +1 -0
  4. package/dist/casino-engagement-suite-tournament/p-1bf11325.js +2 -0
  5. package/dist/casino-engagement-suite-tournament/p-5df3ac81.js +1 -0
  6. package/dist/casino-engagement-suite-tournament/p-e1255160.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/casino-engagement-suite-progress-bar_3.cjs.entry.js +119 -807
  9. package/dist/cjs/casino-engagement-suite-tournament-1b738bb2.js +560 -0
  10. package/dist/cjs/casino-engagement-suite-tournament.cjs.js +16 -10
  11. package/dist/cjs/index-16d5d7c3.js +1642 -0
  12. package/dist/cjs/index.cjs.js +8 -0
  13. package/dist/cjs/loader.cjs.js +6 -12
  14. package/dist/collection/collection-manifest.json +3 -3
  15. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +17 -17
  16. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +492 -582
  17. package/dist/collection/components/casino-engagement-suite-tournament/index.js +1 -0
  18. package/dist/collection/index.js +1 -1
  19. package/dist/collection/shared/GradientRoundedButton.js +6 -7
  20. package/dist/collection/shared/renderBar.js +11 -11
  21. package/dist/collection/utils/api.apdater.js +30 -30
  22. package/dist/collection/utils/translations.js +19 -19
  23. package/dist/collection/utils/types.js +9 -9
  24. package/dist/collection/utils/util.date.js +26 -26
  25. package/dist/collection/utils/utils.js +16 -16
  26. package/dist/esm/app-globals-0f993ce5.js +3 -0
  27. package/dist/esm/casino-engagement-suite-progress-bar_3.entry.js +119 -807
  28. package/dist/esm/casino-engagement-suite-tournament-d8471680.js +558 -0
  29. package/dist/esm/casino-engagement-suite-tournament.js +13 -10
  30. package/dist/esm/index-3962add4.js +1612 -0
  31. package/dist/esm/index.js +2 -1
  32. package/dist/esm/loader.js +6 -12
  33. package/dist/stencil.config.dev.js +14 -0
  34. package/dist/stencil.config.js +14 -19
  35. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.d.ts +2 -0
  36. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.dev.d.ts +2 -0
  37. package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +120 -123
  38. package/dist/types/components/casino-engagement-suite-tournament/index.d.ts +1 -0
  39. package/dist/types/components.d.ts +17 -1
  40. package/dist/types/index.d.ts +1 -1
  41. package/dist/types/shared/GradientRoundedButton.d.ts +3 -3
  42. package/dist/types/stencil-public-runtime.d.ts +142 -33
  43. package/dist/types/utils/api.apdater.d.ts +2 -30
  44. package/dist/types/utils/translations.d.ts +35 -35
  45. package/dist/types/utils/types.d.ts +77 -77
  46. package/loader/cdn.js +1 -3
  47. package/loader/index.cjs.js +1 -3
  48. package/loader/index.d.ts +13 -1
  49. package/loader/index.es2017.js +1 -3
  50. package/loader/index.js +1 -3
  51. package/loader/package.json +1 -0
  52. package/package.json +8 -8
  53. package/dist/casino-engagement-suite-tournament/p-023f3dc7.entry.js +0 -1
  54. package/dist/casino-engagement-suite-tournament/p-86ce7485.js +0 -1
  55. package/dist/cjs/index-e778ddd2.js +0 -1733
  56. package/dist/components/casino-engagement-suite-progress-bar.js +0 -6
  57. package/dist/components/casino-engagement-suite-progress-bar2.js +0 -107
  58. package/dist/components/casino-engagement-suite-tournament.d.ts +0 -11
  59. package/dist/components/casino-engagement-suite-tournament.js +0 -716
  60. package/dist/components/general-styling-wrapper.js +0 -6
  61. package/dist/components/general-styling-wrapper2.js +0 -103
  62. package/dist/components/index.d.ts +0 -26
  63. package/dist/components/index.js +0 -1
  64. package/dist/esm/index-4e611d33.js +0 -1704
  65. package/dist/esm/polyfills/core-js.js +0 -11
  66. package/dist/esm/polyfills/css-shim.js +0 -1
  67. package/dist/esm/polyfills/dom.js +0 -79
  68. package/dist/esm/polyfills/es5-html-element.js +0 -1
  69. package/dist/esm/polyfills/index.js +0 -34
  70. package/dist/esm/polyfills/system.js +0 -6
  71. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-tournament/.stencil/packages/casino-engagement-suite-tournament/stencil.config.d.ts +0 -2
@@ -1,716 +0,0 @@
1
- import { h, proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, Host, Fragment } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$3 } from './casino-engagement-suite-progress-bar2.js';
3
- import { d as defineCustomElement$2 } from './general-styling-wrapper2.js';
4
-
5
- /******************************************************************************
6
- Copyright (c) Microsoft Corporation.
7
-
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */
19
-
20
- function __rest(s, e) {
21
- var t = {};
22
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
23
- t[p] = s[p];
24
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
25
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
26
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
27
- t[p[i]] = s[p[i]];
28
- }
29
- return t;
30
- }
31
-
32
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
33
- var e = new Error(message);
34
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
35
- };
36
-
37
- var Tab;
38
- (function (Tab) {
39
- Tab["Info"] = "Info";
40
- Tab["Leaderboard"] = "Leaderboard";
41
- Tab["Games"] = "Games";
42
- })(Tab || (Tab = {}));
43
- var Time;
44
- (function (Time) {
45
- Time["Starts"] = "Starts";
46
- Time["Ends"] = "Ends";
47
- })(Time || (Time = {}));
48
- const localePostprocess = (translationText, props) => {
49
- Object.keys(props).map(key => {
50
- translationText = translationText.replace(`{${key}}`, props[key]);
51
- });
52
- return translationText;
53
- };
54
- const TRANSLATIONS = Object.assign(Object.assign(Object.assign({ Join: 'Join', Unjoin: 'Unjoin' }, Tab), Time), { TC: 'Terms & Conditions', ScoreCriteria: 'Score Criteria', MinimumBetCriteria: 'Minimum bet criteria', Place: 'place', Prizes: 'Rewards', LeaderboardDetails: 'Leaderboard Details', UnjoinDialog: {
55
- Title: 'Quit Leaderboard?',
56
- Description: 'Any progress on the current Leaderboard won’t be kept and you can not rejoin the Leaderboard any more. <br /><br />Would you still like to quit?',
57
- ButtonYes: 'Yes, I want to quit leaderboard',
58
- ButtonNo: 'No, Stay on the leaderboard',
59
- }, JoinDialog: {
60
- Tile: 'Congratulations!',
61
- Description: 'You have unlocked <span>{tournamentName}</span>! <br />Would you like to join?',
62
- ButtonYes: 'Join',
63
- ButtonNo: 'Not interested',
64
- }, NoLeaderboards: 'No Leaderboards yet', NoLeaderboardsTip: 'Try winning tickets to Leaderboards as rewards or launching other booster games', Leaderboards: 'Leaderboards', TipPrize: 'You took <span>{place}</span> place and win <span>{prize}</span>', Tip: 'Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward.' });
65
-
66
- const classnames = (...args) => {
67
- let classnameArray = [];
68
- args.map(arg => {
69
- switch (typeof arg) {
70
- case 'string':
71
- classnameArray.push(arg);
72
- break;
73
- case 'object':
74
- Object.keys(arg).map(k => {
75
- if (arg[k]) {
76
- classnameArray.push(k);
77
- }
78
- });
79
- break;
80
- }
81
- });
82
- return classnameArray.join(' ');
83
- };
84
-
85
- var LeaderboardPage;
86
- (function (LeaderboardPage) {
87
- LeaderboardPage["Confirm"] = "Confirm";
88
- LeaderboardPage["List"] = "List";
89
- LeaderboardPage["Item"] = "Item";
90
- })(LeaderboardPage || (LeaderboardPage = {}));
91
- var TournamentState;
92
- (function (TournamentState) {
93
- TournamentState["Running"] = "Running";
94
- TournamentState["Unstarted"] = "Unstarted";
95
- TournamentState["Closed"] = "Closed";
96
- TournamentState["Closing"] = "Closing";
97
- })(TournamentState || (TournamentState = {}));
98
- var DialogType;
99
- (function (DialogType) {
100
- DialogType["Unjoin"] = "Unjoin";
101
- DialogType["Tip"] = "Tip";
102
- })(DialogType || (DialogType = {}));
103
-
104
- const GradientRoundedButton = (_a) => {
105
- var { statedClasses, innerHTML } = _a, props = __rest(_a, ["statedClasses", "innerHTML"]);
106
- const { isHollow, isPending } = statedClasses;
107
- return (h("button", Object.assign({}, Object.assign({ class: classnames('GradientRoundedButton', 'GradientRounded', {
108
- Hollow: isHollow || false,
109
- Pending: isPending || false,
110
- }) }, props)),
111
- h("span", null, innerHTML)));
112
- };
113
-
114
- const iconClose = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg" });
115
- const iconQuestion = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg" });
116
- const iconEyeOpen = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg" });
117
- const iconEyeClose = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg" });
118
- const iconBack = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg" });
119
- const iconReward = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg" });
120
- const iconTrophy = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg" });
121
-
122
- const CloseBar = (props) => {
123
- const { left, middle, right } = props;
124
- const slots = {
125
- left,
126
- middle,
127
- right,
128
- };
129
- const getFirstLetterUppercase = (str) => str
130
- .split('')
131
- .map((letter, index) => index === 0 ? letter.toUpperCase() : letter)
132
- .join('');
133
- return (h("div", { class: "WrapperBar" }, Object.keys(slots).map(slotKey => (h("div", { class: "WrapperBar" + getFirstLetterUppercase(slotKey) }, slots[slotKey] || '')))));
134
- };
135
-
136
- function formatDate(date) {
137
- const options = {
138
- year: 'numeric',
139
- month: 'long',
140
- day: 'numeric',
141
- hour: '2-digit',
142
- minute: '2-digit',
143
- hour12: false
144
- };
145
- return date.toLocaleDateString('en-US', options).replace(' at', ',');
146
- }
147
- function addSeconds(date, seconds) {
148
- const result = new Date(date);
149
- result.setSeconds(result.getSeconds() + seconds);
150
- return result;
151
- }
152
- function getDifference(startDate, endDate) {
153
- const diffMs = Math.abs(endDate.getTime() - startDate.getTime()); // Difference in milliseconds
154
- const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24)); // Difference in days
155
- const diffHours = Math.floor((diffMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); // Remaining hours
156
- const diffMinutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60)); // Remaining minutes
157
- // Format the output
158
- const formattedDiff = `${String(diffDays).padStart(2, '0')}d:${String(diffHours).padStart(2, '0')}h:${String(diffMinutes).padStart(2, '0')}m`;
159
- return formattedDiff;
160
- }
161
- function getProgress(startDate, endDate) {
162
- return (100 * (new Date().getTime() - startDate.getTime()) / (endDate.getTime() - startDate.getTime())).toFixed(0);
163
- }
164
-
165
- const tournamentAdapter = (tournamentApi) => {
166
- const keysTime = [
167
- 'startTime',
168
- 'endTime',
169
- 'closeTime',
170
- 'exhibitionStartTime',
171
- 'exhibitionEndTime',
172
- ];
173
- const tournament = {};
174
- Object.keys(tournamentApi).map((key) => {
175
- const value = tournamentApi[key];
176
- switch (key) {
177
- case 'games':
178
- tournament[key] = value.items;
179
- break;
180
- default:
181
- tournament[key] = keysTime.includes(key) ? new Date(value) : value;
182
- }
183
- });
184
- return tournament;
185
- };
186
- const leaderboardsAdapter = (leaderboardRes) => {
187
- let { item, items: leaderboards } = leaderboardRes;
188
- if (!item) {
189
- return leaderboards;
190
- }
191
- return leaderboards.map(leaderboard => {
192
- if (item && item.userID === leaderboard.userID) {
193
- return Object.assign(Object.assign({}, leaderboard), { isMe: true });
194
- }
195
- else {
196
- return leaderboard;
197
- }
198
- });
199
- };
200
-
201
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
202
-
203
- function createCommonjsModule(fn, basedir, module) {
204
- return module = {
205
- path: basedir,
206
- exports: {},
207
- require: function (path, base) {
208
- return commonjsRequire();
209
- }
210
- }, fn(module, module.exports), module.exports;
211
- }
212
-
213
- function commonjsRequire () {
214
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
215
- }
216
-
217
- createCommonjsModule(function (module, exports) {
218
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e);}function s(t){return "function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e,n){t.insertBefore(e,n||null);}function r(t){t.parentNode&&t.parentNode.removeChild(t);}function c(t){const e={};for(const n of t)e[n.name]=n.value;return e}let a;function d(t){a=t;}const u=[],f=[];let p=[];const h=[],$=Promise.resolve();let m=!1;function g(t){p.push(t);}
219
- // flush() calls callbacks in this order:
220
- // 1. All beforeUpdate callbacks, in order: parents before children
221
- // 2. All bind:this callbacks, in reverse order: children before parents.
222
- // 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
223
- // for afterUpdates called during the initial onMount, which are called in
224
- // reverse order: children before parents.
225
- // Since callbacks might update component values, which could trigger another
226
- // call to flush(), the following steps guard against this:
227
- // 1. During beforeUpdate, any updated components will be added to the
228
- // dirty_components array and will cause a reentrant call to flush(). Because
229
- // the flush index is kept outside the function, the reentrant call will pick
230
- // up where the earlier call left off and go through all dirty components. The
231
- // current_component value is saved and restored so that the reentrant call will
232
- // not interfere with the "parent" flush() call.
233
- // 2. bind:this callbacks cannot trigger new flush() calls.
234
- // 3. During afterUpdate, any updated components will NOT have their afterUpdate
235
- // callback called a second time; the seen_callbacks set, outside the flush()
236
- // function, guarantees this behavior.
237
- const y=new Set;let b=0;// Do *not* move this inside the flush() function
238
- function x(){
239
- // Do not reenter flush while dirty components are updated, as this can
240
- // result in an infinite loop. Instead, let the inner flush handle it.
241
- // Reentrancy is ok afterwards for bindings etc.
242
- if(0!==b)return;const t=a;do{
243
- // first, call beforeUpdate functions
244
- // and update components
245
- try{for(;b<u.length;){const t=u[b];b++,d(t),v(t.$$);}}catch(t){
246
- // reset dirty state to not end up in a deadlocked state and then rethrow
247
- throw u.length=0,b=0,t}for(d(null),u.length=0,b=0;f.length;)f.pop()();
248
- // then, once components are updated, call
249
- // afterUpdate functions. This may cause
250
- // subsequent updates...
251
- for(let t=0;t<p.length;t+=1){const e=p[t];y.has(e)||(
252
- // ...so guard against infinite loops
253
- y.add(e),e());}p.length=0;}while(u.length);for(;h.length;)h.pop()();m=!1,y.clear(),d(t);}function v(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(g);}}
254
- /**
255
- * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
256
- */const _=new Set;function k(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];p.forEach((i=>-1===t.indexOf(i)?e.push(i):n.push(i))),n.forEach((t=>t())),p=e;}(n.after_update),i(n.on_destroy),n.fragment&&n.fragment.d(e),
257
- // TODO null out other refs, including component.$$ (but need to
258
- // preserve final state?)
259
- n.on_destroy=n.fragment=null,n.ctx=[]);}function E(t,e){-1===t.$$.dirty[0]&&(u.push(t),m||(m=!0,$.then(x)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31;}function C(o,l,c,u,f,p,h,$=[-1]){const m=a;d(o);const y=o.$$={fragment:null,ctx:[],
260
- // state
261
- props:p,update:t,not_equal:f,bound:n(),
262
- // lifecycle
263
- on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l.context||(m?m.$$.context:[])),
264
- // everything else
265
- callbacks:n(),dirty:$,skip_bound:!1,root:l.target||m.$$.root};h&&h(y.root);let b=!1;if(y.ctx=c?c(o,l.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return y.ctx&&f(y.ctx[t],y.ctx[t]=i)&&(!y.skip_bound&&y.bound[t]&&y.bound[t](i),b&&E(o,t)),e})):[],y.update(),b=!0,i(y.before_update),
266
- // `false` as a special case of no DOM component
267
- y.fragment=!!u&&u(y.ctx),l.target){if(l.hydrate){const t=function(t){return Array.from(t.childNodes)}(l.target);
268
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
269
- y.fragment&&y.fragment.l(t),t.forEach(r);}else
270
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
271
- y.fragment&&y.fragment.c();l.intro&&((v=o.$$.fragment)&&v.i&&(_.delete(v),v.i(k))),function(t,n,o,l){const{fragment:r,after_update:c}=t.$$;r&&r.m(n,o),l||
272
- // onMount happens before the initial afterUpdate
273
- g((()=>{const n=t.$$.on_mount.map(e).filter(s);
274
- // if the component was destroyed immediately
275
- // it will update the `$$.on_destroy` reference to `null`.
276
- // the destructured on_destroy may still reference to the old array
277
- t.$$.on_destroy?t.$$.on_destroy.push(...n):
278
- // Edge case - component was destroyed immediately,
279
- // most likely as a result of a binding initialising
280
- i(n),t.$$.on_mount=[];})),c.forEach(g);}(o,l.target,l.anchor,l.customElement),x();}var v,k;d(m);}let w;
281
- /* src/GeneralAnimationLoading.svelte generated by Svelte v3.59.2 */
282
- function L(e){let n;return {c(){var e;e="div",n=document.createElement(e),n.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>',this.c=t;},m(t,i){l(t,n,i),
283
- /*div5_binding*/e[3](n);},p:t,i:t,o:t,d(t){t&&r(n)
284
- /*div5_binding*/,e[3](null);}}}function T(t,e,n){let i,{clientstyling:s=""}=e,{clientstylingurl:o=""}=e;return t.$$set=t=>{"clientstyling"in t&&n(1,s=t.clientstyling),"clientstylingurl"in t&&n(2,o=t.clientstylingurl);},t.$$.update=()=>{/*clientstyling, customStylingContainer*/3&t.$$.dirty&&s&&i&&(()=>{let t=document.createElement("style");t.innerHTML=s,i.appendChild(t);})(),/*clientstylingurl, customStylingContainer*/5&t.$$.dirty&&o&&i&&(()=>{let t=new URL(o),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{i.appendChild(e);}),1),setTimeout((()=>{}),500);}));})();},[i,s,o,function(t){f[t?"unshift":"push"]((()=>{i=t,n(0,i);}));}]}"function"==typeof HTMLElement&&(w=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(s);
285
- // @ts-ignore todo: improve typings
286
- for(const t in this.$$.slotted)
287
- // @ts-ignore todo: improve typings
288
- this.appendChild(this.$$.slotted[t]);}attributeChangedCallback(t,e,n){this[t]=n;}disconnectedCallback(){i(this.$$.on_disconnect);}$destroy(){k(this,1),this.$destroy=t;}$on(e,n){
289
- // TODO should this delegate to addEventListener?
290
- if(!s(n))return t;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1);}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1);}});class M extends w{constructor(t){super();const e=document.createElement("style");e.textContent=".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}",this.shadowRoot.appendChild(e),C(this,{target:this.shadowRoot,props:c(this.attributes),customElement:!0},T,L,o,{clientstyling:1,clientstylingurl:2},null),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),x()));}static get observedAttributes(){return ["clientstyling","clientstylingurl"]}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),x();}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),x();}}return !customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",M),M}));
291
- //# sourceMappingURL=general-animation-loading.js.map
292
- });
293
-
294
- const casinoEngagementSuiteTournamentCss = ".GradientRounded {\n display: block;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);\n color: rgba(30, 22, 56, 1);\n \n position: relative;\n border-radius: 16px;\n\n &.Hollow {\n background: rgba(30, 22, 56, 1);\n color: #FFFFFF;\n &::before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: 15px;\n border: 1px solid transparent;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;\n -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n -webkit-mask-composite: destination-out;\n mask-composite: exclude;\n }\n\n }\n}\n\n.GradientRoundedButton {\n border: none;\n padding: 7px;\n \n height: 32px;\n width: 100%;\n \n font-size: 14px;\n font-weight: 700;\n line-height: 17.07px;\n text-align: center;\n \n transition: .5s opacity;\n\n cursor: pointer;\n &.Pending {\n cursor: not-allowed;\n opacity: .3;\n }\n\n &.Hollow {\n \n span {\n background: -webkit-linear-gradient(98.25deg, rgb(255, 148, 0) 22.48%, rgb(254, 247, 70) 131.02%, rgb(255, 226, 74) 131.9%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n }\n }\n}\n.Wrapper {\n height: 100%;\n position: relative;\n color: var(--emw--color-typography, #FFFFFF);\n display: flex;\n background-color: var(--emw--color-background, #1d1537);\n flex-direction: column;\n border-radius: 8px;\n overflow: hidden;\n}\n\n.WrapperContent {\n padding-bottom: 20px;\n transition: 0.5s filter;\n}\n.WrapperContent.faded {\n filter: brightness(53.3333333333%);\n}\n\n.WrapperBar {\n display: flex;\n width: 100%;\n padding: 12px 8px 8px;\n}\n\n.WrapperBarLeft, .WrapperBarRight {\n cursor: pointer;\n}\n\n.WrapperBarMiddle {\n flex-grow: 1;\n text-align: center;\n font-size: 16px;\n line-height: 16px;\n font-weight: 500;\n color: var(--emw--color-secondary, #bbb9c3);\n}\n\n:host {\n display: block;\n font-size: 12px;\n font-family: Inter;\n}\n\n.Row {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.LeaderboardsItem {\n margin: 10px 0;\n border: 1px solid #403956;\n border-radius: 16px;\n}\n.LeaderboardsItem.Hollow {\n border-color: transparent;\n}\n\n.LeaderboardsItemContainer {\n padding-top: 16px;\n}\n\n.Info {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.TimeContainer {\n margin: 24px 0;\n padding: 0 20px;\n}\n.TimeContainer .Time {\n display: flex;\n justify-content: space-between;\n font-size: 11px;\n align-items: center;\n color: var(--emw--color-secondary, #bbb9c3);\n}\n.TimeContainer .Time button {\n font-size: 12px;\n height: 20px;\n padding: 0;\n}\n.TimeContainer .Time button::before {\n inset: inherit;\n border: 0;\n}\n\n.ShowInfo {\n margin: 24px 0;\n padding: 0 20px;\n cursor: pointer;\n color: #666178;\n}\n.ShowInfo p {\n display: flex;\n gap: 4px;\n}\n\n.TitleContainer {\n display: flex;\n justify-content: space-between;\n margin: 24px 0;\n padding: 0 20px;\n margin-top: 0;\n gap: 10px;\n font-family: Montserrat;\n}\n.TitleContainer .GradientRoundedButton {\n width: 120px;\n}\n\n.TabsContainer {\n margin: 24px 0;\n padding: 0 20px;\n margin: 0 20px;\n padding: 0;\n border-bottom: 1px solid #575757;\n}\n\n.Tabs {\n display: flex;\n justify-content: space-between;\n justify-content: start;\n font-size: 12px;\n margin-bottom: -1px;\n}\n.Tabs > div {\n padding: 10px;\n color: #666178;\n cursor: pointer;\n}\n.Tabs > div.active {\n color: var(--emw--color-typography, #FFF);\n border-bottom: 2px solid var(--emw--color-typography, #FFF);\n}\n\n.Title {\n font-size: 16px;\n font-weight: 700;\n line-height: 19.5px;\n text-align: left;\n word-break: break-word;\n}\n\n.TC {\n margin-top: 12px;\n}\n.TC a {\n color: #59d1ff;\n}\n\n.Criterias {\n margin: 12px 0;\n}\n.Criterias span {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n.ResultPrize {\n margin: 24px 0;\n padding: 0 20px;\n}\n.ResultPrize span {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n.Prizes {\n margin: 24px 0;\n padding: 0 20px;\n}\n.Prizes .PrizesText {\n margin-left: 3px;\n font-weight: 600;\n}\n.Prizes .PrizesHeader {\n align-items: center;\n display: flex;\n}\n.Prizes .PrizesHeader img {\n width: 12px;\n}\n.Prizes .Prize {\n margin: 8px 0;\n}\n.Prizes .Prize .PrizeText {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n* {\n box-sizing: border-box;\n}\n\n.Leaderboards {\n width: 100%;\n text-align: center;\n border-collapse: collapse;\n}\n.Leaderboards td {\n opacity: 0.6;\n padding: 20px 5px;\n}\n.Leaderboards td:first-child {\n padding-left: 20px;\n}\n.Leaderboards td:last-child {\n padding-right: 20px;\n}\n.Leaderboards .LeaderboardName {\n color: var(--emw--color-typography, #FFF);\n opacity: 1;\n}\n.Leaderboards tr.isMe {\n background: rgba(0, 0, 0, 0.2);\n}\n.Leaderboards tr.isMe .LeaderboardRank span {\n padding: 0px 3px;\n opacity: 1;\n border: 1px solid var(--emw--color-primary, #ffd62f);\n border-radius: 11px;\n}\n.Leaderboards tr.isMe td {\n color: var(--emw--color-primary, #ffd62f);\n}\n\n.Games {\n margin: 24px 0;\n padding: 0 20px;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-evenly;\n gap: 4px 7.25px;\n}\n.Games img {\n width: 60px;\n}\n\ndialog {\n position: absolute;\n top: 30px;\n width: 100%;\n height: 100%;\n background: transparent;\n border: 0;\n padding: 0;\n color: var(--emw--color-typography, #FFFFFF);\n}\ndialog > div {\n margin: 32px;\n border-radius: 8px;\n background: var(--emw--color-background, #1d1537);\n border: 1px solid #403956;\n align-items: center;\n}\n\n.DialogContentUnjoin {\n padding: 32px;\n padding-top: 10px;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.DialogContentUnjoinTitle {\n font-family: Montserrat;\n font-size: 20px;\n font-weight: 600;\n line-height: 24.38px;\n text-align: center;\n}\n\n.DialogContentUnjoinDescription {\n color: var(--emw--color-secondary, #bbb9c3);\n margin-bottom: 30px;\n}\n\n.Tip {\n padding: 32px;\n padding-top: 10px;\n color: var(--emw--color-secondary, #bbb9c3);\n font-size: 14px;\n}\n\n.PageConfirmContainer {\n text-align: center;\n width: 80%;\n margin: 0 auto;\n}\n\n.PageConfirm {\n padding: 40px 32px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n.PageConfirm .Title {\n font-size: 20px;\n text-align: center;\n}\n.PageConfirm .Description {\n color: var(--emw--color-secondary, #bbb9c3);\n font-weight: 400;\n}\n.PageConfirm .Description span {\n color: var(--emw--color-typography, #FFF);\n font-weight: 600;\n}\n\n.PageConfirmButtonsGroup {\n width: 150px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}";
295
-
296
- const CasinoEngagementSuiteTournament$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
297
- constructor() {
298
- super();
299
- this.__registerHost();
300
- this.__attachShadow();
301
- this.close = createEvent(this, "close", 7);
302
- /**
303
- * Language
304
- */
305
- this.language = 'en';
306
- /**
307
- * Client custom styling via string
308
- */
309
- this.clientStyling = '';
310
- /**
311
- * Client custom styling via url
312
- */
313
- this.clientStylingUrl = '';
314
- /**
315
- * Translation via url
316
- */
317
- this.translationUrl = '';
318
- this.tab = Tab.Info;
319
- this.locale = TRANSLATIONS;
320
- this.tournamentItem = undefined;
321
- this.tournamentList = undefined;
322
- this.leaderboards = [];
323
- this.isActionJoinPending = false;
324
- this.isDialogOpen = false;
325
- this.isShowInfo = false;
326
- this.page = LeaderboardPage.List;
327
- this.tournamentInDialog = undefined;
328
- this.dialog = {
329
- isOpen: false,
330
- type: undefined,
331
- data: undefined,
332
- };
333
- this.time = 0;
334
- this.onClickConfirmJoin = () => {
335
- this.actionJoin(this.tournamentItem);
336
- this.nextPage = LeaderboardPage.List;
337
- };
338
- this.onClickConfirmUnjoin = () => {
339
- this.close.emit();
340
- };
341
- this.onClickDialogUnjoin = () => {
342
- this.actionJoin(this.dialog.data);
343
- this.closeDialog();
344
- };
345
- this.onClickDialogJoin = () => {
346
- this.closeDialog();
347
- };
348
- this.onClickBarInLayout = () => {
349
- this.close.emit();
350
- };
351
- this.onClickBarInLayoutDialog = () => {
352
- this.closeDialog();
353
- };
354
- this.onClickShowInfo = () => {
355
- this.isShowInfo = !this.isShowInfo;
356
- };
357
- this.onClickBarTip = () => {
358
- this.openDialog(DialogType.Tip);
359
- };
360
- this.onClickBarBack = () => {
361
- this.setPage(LeaderboardPage.List);
362
- };
363
- }
364
- setTimeInterval() {
365
- this.timeHolder = setInterval(() => {
366
- if (this.tournamentList || this.tournamentItem) {
367
- this.time += 1;
368
- }
369
- else {
370
- this.time = 0;
371
- }
372
- }, 1000);
373
- }
374
- updateTournamentListByItem(tournament) {
375
- this.tournamentList = this.tournamentList.map((_tournament) => {
376
- if (_tournament.id === tournament.id) {
377
- return tournamentAdapter(tournament);
378
- }
379
- else {
380
- return _tournament;
381
- }
382
- });
383
- }
384
- handleEvent(e) {
385
- const _a = e.data, { type } = _a, rest = __rest(_a, ["type"]);
386
- switch (type) {
387
- case 'ShowLeaderboardRewardModal': {
388
- const { tournament } = rest;
389
- this.setPage(LeaderboardPage.Confirm, { tournament: tournamentAdapter(tournament) });
390
- postMessage({ type: 'BarLeaderboardsClick' });
391
- break;
392
- }
393
- case 'UpdateTournamentsItemRes': {
394
- const tournamentNew = tournamentAdapter(rest.data.item);
395
- this.tournamentItem = tournamentNew;
396
- this.updateTournamentListByItem(tournamentNew);
397
- break;
398
- }
399
- case 'UpdateLeaderboardsRes': {
400
- this.leaderboards = leaderboardsAdapter(rest.data);
401
- break;
402
- }
403
- case 'JoinTournamentRes':
404
- case 'UnjoinTournamentRes':
405
- const { success } = rest;
406
- if (success) {
407
- this.tournamentItem = Object.assign(Object.assign({}, this.tournamentItem), { playerEnrolled: !!!this.tournamentItem.playerEnrolled });
408
- switch (this.page) {
409
- case LeaderboardPage.Item: {
410
- break;
411
- }
412
- case LeaderboardPage.List: {
413
- this.updateTournamentListByItem(this.tournamentItem);
414
- break;
415
- }
416
- }
417
- }
418
- if (this.nextPage) {
419
- this.setPage(this.nextPage);
420
- this.nextPage = undefined;
421
- }
422
- this.isActionJoinPending = false;
423
- break;
424
- }
425
- }
426
- get messageSender() {
427
- return {
428
- JoinTournamentReq: (tournament) => { var _a; return window.postMessage({ type: 'JoinTournamentReq', bonusCode: (_a = tournament.wallets[0]) === null || _a === void 0 ? void 0 : _a.code }); },
429
- UnjoinTournamentReq: (tournament) => window.postMessage({ type: 'UnjoinTournamentReq', id: tournament.id }),
430
- UpdateTournamentsItemReq: (tournament) => window.postMessage({ type: 'UpdateTournamentsItemReq', id: tournament.id }),
431
- UpdateLeaderboardsReq: (tournament) => window.postMessage({ type: 'UpdateLeaderboardsReq', id: tournament.id }),
432
- };
433
- }
434
- connectedCallback() {
435
- this.setTimeInterval();
436
- }
437
- disconnectedCallback() {
438
- clearInterval(this.timeHolder);
439
- }
440
- actionJoin(tournament) {
441
- if (this.isActionJoinPending)
442
- return;
443
- this.isActionJoinPending = true;
444
- try {
445
- if (tournament.playerEnrolled) {
446
- this.messageSender.UnjoinTournamentReq(tournament);
447
- }
448
- else {
449
- this.messageSender.JoinTournamentReq(tournament);
450
- }
451
- }
452
- catch (e) {
453
- console.log('error', e);
454
- return;
455
- }
456
- }
457
- isTournamentClosed(tournament) {
458
- return [
459
- TournamentState.Closed,
460
- TournamentState.Closing
461
- ].includes(tournament.state);
462
- }
463
- setPage(page, metaData) {
464
- switch (page) {
465
- case LeaderboardPage.Confirm:
466
- case LeaderboardPage.Item:
467
- this.tournamentItem = metaData.tournament;
468
- if (!this.tournamentItem) {
469
- this.messageSender.UpdateTournamentsItemReq(metaData.tournament);
470
- }
471
- if (this.isTournamentClosed(this.tournamentItem)) {
472
- this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);
473
- }
474
- break;
475
- }
476
- this.tab = Tab.Info;
477
- this.page = page;
478
- }
479
- renderPage() {
480
- switch (this.page) {
481
- case LeaderboardPage.Confirm: return this.renderPageConfirm();
482
- case LeaderboardPage.Item: return this.renderPageLeaderboardItem();
483
- case LeaderboardPage.List: return this.renderPageLeaderboardList();
484
- }
485
- }
486
- render() {
487
- return (h(Host, null, h("general-styling-wrapper", { clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling,
488
- // @ts-ignore
489
- targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renderPage()));
490
- }
491
- onClickListItemChangePage(tournament) {
492
- this.setPage(LeaderboardPage.Item, { tournament });
493
- }
494
- onClickItemJoin(tournament, e) {
495
- e.stopPropagation();
496
- if (tournament.playerEnrolled) {
497
- this.openDialog(DialogType.Unjoin, tournament);
498
- }
499
- else {
500
- this.actionJoin(tournament);
501
- this.tournamentItem = tournament;
502
- }
503
- }
504
- onClickTab(tab) {
505
- this.tab = tab;
506
- switch (tab) {
507
- case Tab.Leaderboard:
508
- this.leaderboards = undefined;
509
- this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);
510
- break;
511
- case Tab.Games:
512
- this.messageSender.UpdateTournamentsItemReq(this.tournamentItem);
513
- break;
514
- }
515
- }
516
- renderPageLeaderboardList() {
517
- var _a;
518
- if (!this.tournamentList) {
519
- this.tournamentList = (_a = this.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map(item => tournamentAdapter(item));
520
- return h("general-animation-loading", null);
521
- }
522
- const { locale } = this;
523
- if (this.tournamentList.length) {
524
- return this.renderLeaderboardContainer(h(Fragment, null, h("div", { class: "Leaderboards Row" }, this.tournamentList.map(_tournament => (h("div", { class: classnames("LeaderboardsItem", _tournament.playerEnrolled ? ' GradientRounded Hollow' : ''), onClick: this.onClickListItemChangePage.bind(this, _tournament) }, h("div", { class: "LeaderboardsItemContainer" }, this.renderTitleContainer(_tournament), this.renderTimeBar(_tournament))))))));
525
- }
526
- else {
527
- return (h("div", { class: "NoLeaderboards Row" }, h("div", null, locale.NoLeaderboards), h("div", null, locale.NoLeaderboardsTip)));
528
- }
529
- }
530
- renderPageConfirm() {
531
- if (!this.tournamentItem)
532
- return h("general-animation-loading", null);
533
- const tournamentName = this.tournamentItem.nameOrTitle;
534
- const { locale } = this;
535
- return (h("div", { class: "PageConfirmContainer" }, h("div", { class: "GradientRounded Hollow PageConfirm" }, h("div", null, iconTrophy), h("div", { class: "Title" }, locale.JoinDialog.Tile), h("div", { class: "Description", innerHTML: localePostprocess(locale.JoinDialog.Description, { tournamentName }) }), h("div", { class: "PageConfirmButtonsGroup" }, h(GradientRoundedButton, Object.assign({}, {
536
- statedClasses: {
537
- isPending: this.isActionJoinPending,
538
- },
539
- onClick: this.onClickConfirmJoin,
540
- innerHTML: locale.JoinDialog.ButtonYes,
541
- })), h(GradientRoundedButton, Object.assign({}, {
542
- statedClasses: {
543
- isPending: this.isActionJoinPending,
544
- isHollow: true,
545
- },
546
- onClick: this.onClickConfirmUnjoin,
547
- innerHTML: locale.JoinDialog.ButtonNo,
548
- }))))));
549
- }
550
- renderPageLeaderboardItem() {
551
- if (!this.tournamentItem)
552
- return h("general-animation-loading", null);
553
- return this.renderLeaderboardContainer(h(Fragment, null, this.renderTitleContainer(this.tournamentItem), this.renderTabs(), this.renderTabbedContent()));
554
- }
555
- renderDialogContent() {
556
- switch (this.dialog.type) {
557
- case DialogType.Unjoin:
558
- return this.renderDialogContentUnjoin();
559
- case DialogType.Tip:
560
- return (h("div", { class: "Tip" }, this.locale.Tip));
561
- }
562
- }
563
- renderDialogContentUnjoin() {
564
- const { locale } = this;
565
- return (h("div", { class: "DialogContentUnjoin" }, h("div", { class: "DialogContentUnjoinTitle" }, locale.UnjoinDialog.Title), h("div", { class: "DialogContentUnjoinDescription", innerHTML: locale.UnjoinDialog.Description }), h(GradientRoundedButton, Object.assign({}, {
566
- statedClasses: {
567
- isPending: this.isActionJoinPending,
568
- },
569
- onClick: this.onClickDialogUnjoin,
570
- innerHTML: locale.UnjoinDialog.ButtonYes,
571
- })), h(GradientRoundedButton, Object.assign({}, {
572
- statedClasses: {
573
- isHollow: true,
574
- isPending: this.isActionJoinPending,
575
- },
576
- onClick: this.onClickDialogJoin,
577
- innerHTML: locale.UnjoinDialog.ButtonNo,
578
- }))));
579
- }
580
- renderTitleContainer(tournament) {
581
- const { locale } = this;
582
- return (h("div", { class: "TitleContainer" }, h("div", { class: "Title" }, tournament.nameOrTitle), tournament.state !== TournamentState.Closed && (h("div", null, h(GradientRoundedButton, Object.assign({}, {
583
- statedClasses: {
584
- isHollow: tournament.playerEnrolled,
585
- isPending: this.isActionJoinPending,
586
- },
587
- onClick: this.onClickItemJoin.bind(this, tournament),
588
- innerHTML: tournament.playerEnrolled ? locale.Unjoin : locale.Join,
589
- }))))));
590
- }
591
- renderTabbedContent() {
592
- switch (this.tab) {
593
- case Tab.Info: return this.renderInfo();
594
- case Tab.Leaderboard: return this.renderLeaderboard();
595
- case Tab.Games: return this.renderGames();
596
- }
597
- }
598
- renderGames() {
599
- var _a;
600
- return (h("div", { class: "Games" }, (_a = this.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map(game => (h("div", null, h("img", { src: game.defaultThumbnail, alt: "" }))))));
601
- }
602
- renderLeaderboard() {
603
- if (!this.leaderboards)
604
- return h("general-animation-loading", null);
605
- if (!this.leaderboards.length)
606
- return '';
607
- return (h("table", { class: "Leaderboards" }, this.leaderboards.map(leaderboard => (h("tr", { class: classnames({ isMe: leaderboard.isMe }) }, h("td", { class: "LeaderboardRank" }, h("span", null, leaderboard.rank)), h("td", { class: "LeaderboardName" }, leaderboard.shortName), h("td", { class: "LeaderboardScore" }, leaderboard.score), h("td", { class: "LeaderboardPrize" }, leaderboard.prizeName))))));
608
- }
609
- renderTabs() {
610
- const { locale, tab } = this;
611
- return (h("div", { class: "TabsContainer" }, h("div", { class: "Tabs" }, Object.keys(Tab).map((_tab) => (h("div", Object.assign({}, {
612
- class: classnames({ active: tab === _tab }),
613
- onClick: this.onClickTab.bind(this, _tab)
614
- }), locale[_tab]))))));
615
- }
616
- renderTimeBar(tournament) {
617
- return (h("section", { class: "TimeContainer" }, h("div", { class: 'Time' }, tournament.playerEnrolled ? (h(Fragment, null, h("div", null, getDifference(addSeconds(tournament.startTime, this.time), tournament.endTime)), h("div", null, h(GradientRoundedButton, { statedClasses: {
618
- isHollow: true,
619
- isPendding: false,
620
- }, innerHTML: `${getProgress(tournament.startTime, tournament.endTime)}%` })))) : (h(Fragment, null, h("div", null, formatDate(tournament.startTime)), h("div", null, formatDate(tournament.endTime))))), h("casino-engagement-suite-progress-bar", { value: Number(getProgress(tournament.startTime, tournament.endTime)), "hide-percent": true })));
621
- }
622
- renderInfo() {
623
- var _a, _b;
624
- const { locale, tournamentItem: tournament, isShowInfo } = this;
625
- return (h("div", { class: "InfoContainer" }, this.renderTimeBar(tournament), (h("section", { class: "ShowInfo", onClick: this.onClickShowInfo }, h("p", null, h("span", null, isShowInfo ? iconEyeClose : iconEyeOpen), h("span", null, locale.LeaderboardDetails)))), isShowInfo && (h("section", { class: "Info" }, h("div", null, tournament.description), h("div", { class: "Criterias" }, h("div", null, locale.ScoreCriteria, ": ", h("span", null, tournament.scoreCriteria)), h("div", null, locale.MinimumBetCriteria, ": ", h("span", null, tournament.minBetCount))), h("div", { class: "TC" }, h("a", { href: tournament.termsUrl, target: '_blank' }, locale.TC)))), this.isTournamentClosed(this.tournamentItem) && ((_a = this.leaderboards) === null || _a === void 0 ? void 0 : _a.find(l => l.isMe)) && (h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, this.getResultPrize((_b = this.leaderboards) === null || _b === void 0 ? void 0 : _b.find(l => l.isMe))) })), h("section", { class: "Prizes" }, h("div", { class: "PrizesHeader" }, iconReward, h("span", { class: "PrizesText" }, locale.Prizes)), tournament.prizes.map((prize, index) => (h("div", { class: "Prize" }, index + 1, " ", locale.Place, ": ", h("span", { class: "PrizeText" }, prize.name)))))));
626
- }
627
- getResultPrize(leaderboard) {
628
- return {
629
- prize: leaderboard.prizeName,
630
- place: leaderboard.rank,
631
- };
632
- }
633
- renderCloseBarInLayout() {
634
- const { left, middle } = this.getWrapperBarData();
635
- return (h(CloseBar, Object.assign({}, { left, middle,
636
- right: (h("span", Object.assign({}, { onClick: this.onClickBarInLayout }), iconClose))
637
- })));
638
- }
639
- renderCloseBarInLayoutDialog() {
640
- return (h(CloseBar, Object.assign({}, {
641
- right: (h("span", Object.assign({}, { onClick: this.onClickBarInLayoutDialog }), iconClose))
642
- })));
643
- }
644
- renderLeaderboardContainer(render) {
645
- const { dialog: { isOpen } } = this;
646
- return (h("div", { class: "Wrapper" }, h("div", { class: classnames("WrapperContent", { faded: isOpen }) }, this.renderCloseBarInLayout(), h("div", { class: "Root" }, h("div", { class: "Main" }, render))), h("div", { class: "WrapperUtil" }, h("dialog", { open: isOpen }, h("div", null, this.renderCloseBarInLayoutDialog(), isOpen && this.renderDialogContent())))));
647
- }
648
- getWrapperBarData() {
649
- const { page, locale } = this;
650
- switch (page) {
651
- case LeaderboardPage.List:
652
- return {
653
- left: h("span", { onClick: this.onClickBarTip }, iconQuestion),
654
- middle: locale.Leaderboards
655
- };
656
- case LeaderboardPage.Item:
657
- return {
658
- left: (h("span", { onClick: this.onClickBarBack }, iconBack)),
659
- middle: '',
660
- };
661
- }
662
- }
663
- openDialog(type, data = undefined) {
664
- this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: true, type, data });
665
- }
666
- closeDialog() {
667
- this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: false });
668
- }
669
- static get style() { return casinoEngagementSuiteTournamentCss; }
670
- }, [1, "casino-engagement-suite-tournament", {
671
- "language": [1],
672
- "clientStyling": [513, "client-styling"],
673
- "clientStylingUrl": [513, "client-styling-url"],
674
- "translationUrl": [513, "translation-url"],
675
- "leaderboardsInit": [16],
676
- "tab": [32],
677
- "locale": [32],
678
- "tournamentItem": [32],
679
- "tournamentList": [32],
680
- "leaderboards": [32],
681
- "isActionJoinPending": [32],
682
- "isDialogOpen": [32],
683
- "isShowInfo": [32],
684
- "page": [32],
685
- "tournamentInDialog": [32],
686
- "dialog": [32],
687
- "time": [32]
688
- }, [[8, "message", "handleEvent"]]]);
689
- function defineCustomElement$1() {
690
- if (typeof customElements === "undefined") {
691
- return;
692
- }
693
- const components = ["casino-engagement-suite-tournament", "casino-engagement-suite-progress-bar", "general-styling-wrapper"];
694
- components.forEach(tagName => { switch (tagName) {
695
- case "casino-engagement-suite-tournament":
696
- if (!customElements.get(tagName)) {
697
- customElements.define(tagName, CasinoEngagementSuiteTournament$1);
698
- }
699
- break;
700
- case "casino-engagement-suite-progress-bar":
701
- if (!customElements.get(tagName)) {
702
- defineCustomElement$3();
703
- }
704
- break;
705
- case "general-styling-wrapper":
706
- if (!customElements.get(tagName)) {
707
- defineCustomElement$2();
708
- }
709
- break;
710
- } });
711
- }
712
-
713
- const CasinoEngagementSuiteTournament = CasinoEngagementSuiteTournament$1;
714
- const defineCustomElement = defineCustomElement$1;
715
-
716
- export { CasinoEngagementSuiteTournament, defineCustomElement };