@everymatrix/casino-engagement-suite-tournament 1.60.1 → 1.61.0

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 (51) 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 -1
  3. package/dist/casino-engagement-suite-tournament/{p-10e1f844.entry.js → p-2dd35709.entry.js} +1 -1
  4. package/dist/casino-engagement-suite-tournament/p-2de8ee45.js +15 -0
  5. package/dist/casino-engagement-suite-tournament/{p-7dd52ef4.js → p-bfca9e2a.js} +2 -2
  6. package/dist/cjs/casino-engagement-suite-progress-bar_3.cjs.entry.js +2 -2
  7. package/dist/cjs/{casino-engagement-suite-tournament-9276045b.js → casino-engagement-suite-tournament-49cebf14.js} +163 -55
  8. package/dist/cjs/casino-engagement-suite-tournament.cjs.js +2 -2
  9. package/dist/cjs/{index-9b5a5304.js → index-982cd594.js} +5 -1
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/assets/reward.svg +11 -0
  13. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +135 -32
  14. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +67 -9
  15. package/dist/collection/shared/icons.js +2 -1
  16. package/dist/collection/shared/renders.dialog.js +2 -2
  17. package/dist/collection/shared/renders.page.js +11 -9
  18. package/dist/collection/shared/renders.tab.js +4 -2
  19. package/dist/collection/shared/renders.util.js +3 -4
  20. package/dist/collection/utils/api.apdater.js +1 -1
  21. package/dist/collection/utils/bussiness.js +15 -0
  22. package/dist/collection/utils/message.js +37 -20
  23. package/dist/collection/utils/translations.js +1 -1
  24. package/dist/collection/utils/types.js +1 -0
  25. package/dist/collection/utils/utils.js +38 -1
  26. package/dist/esm/casino-engagement-suite-progress-bar_3.entry.js +2 -2
  27. package/dist/esm/{casino-engagement-suite-tournament-e9186545.js → casino-engagement-suite-tournament-bd7c9cdd.js} +163 -55
  28. package/dist/esm/casino-engagement-suite-tournament.js +3 -3
  29. package/dist/esm/{index-e8e1e68e.js → index-ac437a77.js} +5 -1
  30. package/dist/esm/index.js +2 -2
  31. package/dist/esm/loader.js +3 -3
  32. 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
  33. 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
  34. package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +24 -9
  35. package/dist/types/utils/api.apdater.d.ts +3 -1
  36. package/dist/types/utils/bussiness.d.ts +15 -1
  37. package/dist/types/utils/message.d.ts +4 -1
  38. package/dist/types/utils/translations.d.ts +2 -0
  39. package/dist/types/utils/types.d.ts +21 -3
  40. package/dist/types/utils/utils.d.ts +6 -0
  41. package/package.json +1 -1
  42. package/dist/casino-engagement-suite-tournament/p-94a5935e.js +0 -15
  43. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.d.ts +0 -2
  44. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.dev.d.ts +0 -2
  45. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  46. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/storybook/main.d.ts +0 -0
  47. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/storybook/preview.d.ts +0 -0
  48. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/index.d.ts +0 -0
  49. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  50. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  51. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,16 +1,54 @@
1
- .Wrapper {
1
+ .Leaderboards {
2
2
  height: 100%;
3
+ overflow-y: auto;
4
+ transition: 0.5s ease;
5
+ transition-property: all, transform;
6
+ }
7
+ .Leaderboards.list, .Leaderboards.item {
8
+ opacity: 0;
9
+ }
10
+ .Leaderboards.list.Active, .Leaderboards.item.Active {
11
+ opacity: 1;
12
+ }
13
+ .Leaderboards.list.Hidden, .Leaderboards.item.Hidden {
14
+ display: none;
15
+ }
16
+ .Leaderboards .question__tooltip {
17
+ position: absolute;
18
+ top: 0;
19
+ left: 20px;
20
+ width: 320px;
21
+ text-align: left;
22
+ background-color: var(--emw--color-typography, rgba(255, 255, 255, 0.6));
23
+ border: 1px solid var(--emw--color-typography, rgba(255, 255, 255, 0.8));
24
+ color: var(var(--emw--color-primary, rgb(255, 214, 47)), rgb(255, 214, 47));
25
+ padding: 10px;
26
+ border-radius: 5px;
27
+ opacity: 0;
28
+ fill-opacity: 0.5;
29
+ transition: opacity 0.3s ease-in-out;
30
+ z-index: 10;
31
+ }
32
+ .Leaderboards .question__tooltip.visible {
33
+ opacity: 0.8;
34
+ }
35
+
36
+ .Wrapper {
3
37
  position: relative;
38
+ min-height: 100%;
4
39
  color: var(--emw--color-typography, #FFFFFF);
5
40
  display: flex;
6
41
  background-color: var(--emw--color-background, hsl(254, 44%, 15%));
7
42
  flex-direction: column;
8
43
  border-radius: 24px;
9
- overflow-y: auto;
10
44
  }
11
45
  .Wrapper.Mobile {
12
46
  border-radius: 16px;
13
47
  }
48
+ .Wrapper.Mobile .WrapperContent .TableContentWrapper {
49
+ height: calc(100vh - 278px);
50
+ overflow-y: auto;
51
+ }
14
52
 
15
53
  .WrapperContent {
16
54
  padding-bottom: 20px;
@@ -19,6 +57,13 @@
19
57
  .WrapperContent.faded {
20
58
  filter: brightness(53.3333333333%);
21
59
  }
60
+ .WrapperContent .NoLeaderboards h3.Title {
61
+ text-align: center;
62
+ }
63
+ .WrapperContent .NoLeaderboards div.message {
64
+ color: var(--emw--color-secondary, rgb(187, 185, 195));
65
+ text-align: left;
66
+ }
22
67
 
23
68
  .Wrapper.Mobile .WrapperBar {
24
69
  padding: 20px 8px 8px;
@@ -31,6 +76,9 @@
31
76
  padding: 32px 20px 20px;
32
77
  margin-bottom: 20px;
33
78
  }
79
+ .WrapperBar .WrapperBarLeft span {
80
+ position: relative;
81
+ }
34
82
 
35
83
  .WrapperBarLeft,
36
84
  .WrapperBarRight {
@@ -54,7 +102,7 @@
54
102
  }
55
103
 
56
104
  .Row {
57
- margin: 24px 0;
105
+ margin: 10px 0;
58
106
  padding: 0 20px;
59
107
  }
60
108
  .Row:first-child {
@@ -62,11 +110,19 @@
62
110
  }
63
111
 
64
112
  .LeaderboardsItem {
113
+ opacity: 1;
114
+ transition: 1s opacity ease;
65
115
  position: relative;
66
116
  margin: 10px 0;
67
117
  border: 1px solid rgb(64, 57, 86);
68
118
  border-radius: 16px;
69
119
  }
120
+ .LeaderboardsItem.Unjoined {
121
+ opacity: 0;
122
+ margin: 0;
123
+ border: 0 none;
124
+ animation: slideOut 1s forwards;
125
+ }
70
126
  .LeaderboardsItem.Hollow {
71
127
  border-color: transparent;
72
128
  }
@@ -78,14 +134,16 @@
78
134
  padding-top: 16px;
79
135
  }
80
136
 
81
- .Info {
82
- margin: 24px 0;
137
+ .ShowInfo {
138
+ margin: 10px 0;
83
139
  padding: 0 20px;
140
+ transition: 0.5s all ease;
84
141
  }
85
142
 
86
143
  .TimeContainer {
87
- margin: 24px 0;
144
+ margin: 10px 0;
88
145
  padding: 0 20px;
146
+ transition: 0.5s all ease;
89
147
  }
90
148
  .TimeContainer .Time {
91
149
  display: flex;
@@ -104,21 +162,10 @@
104
162
  border: 0;
105
163
  }
106
164
 
107
- .ShowInfo {
108
- margin: 24px 0;
109
- padding: 0 20px;
110
- cursor: pointer;
111
- color: rgb(102, 97, 120);
112
- }
113
- .ShowInfo p {
114
- display: flex;
115
- gap: 4px;
116
- }
117
-
118
165
  .TitleContainer {
119
166
  display: flex;
120
167
  justify-content: space-between;
121
- margin: 24px 0;
168
+ margin: 10px 0;
122
169
  padding: 0 20px;
123
170
  margin-top: 0;
124
171
  gap: 10px;
@@ -129,7 +176,7 @@
129
176
  }
130
177
 
131
178
  .TabsContainer {
132
- margin: 24px 0;
179
+ margin: 10px 0;
133
180
  padding: 0 20px;
134
181
  margin: 0 20px;
135
182
  padding: 0;
@@ -143,6 +190,9 @@
143
190
  font-size: var(--emw--font-size-x-small, 12px);
144
191
  margin-bottom: -1px;
145
192
  }
193
+ .Tabs .Tab {
194
+ text-transform: capitalize;
195
+ }
146
196
  .Tabs > div {
147
197
  padding: 10px;
148
198
  color: rgb(102, 97, 120);
@@ -177,8 +227,10 @@
177
227
  }
178
228
 
179
229
  .ResultPrize {
180
- margin: 24px 0;
230
+ margin: 10px 0;
181
231
  padding: 0 20px;
232
+ padding-left: 30px;
233
+ text-align: left;
182
234
  }
183
235
  .ResultPrize span {
184
236
  color: var(--emw--color-primary, rgb(255, 214, 47));
@@ -214,7 +266,7 @@
214
266
  max-height: calc(100% - 20px);
215
267
  }
216
268
 
217
- .PrizesHeader {
269
+ .PrizesHeader, .DetailHeader {
218
270
  align-items: center;
219
271
  display: flex;
220
272
  background-color: var(--emw--color-background, hsl(254, 44%, 15%));
@@ -222,17 +274,23 @@
222
274
  z-index: 1;
223
275
  margin: 0 20px;
224
276
  }
225
- .PrizesHeader img {
277
+ .PrizesHeader img, .DetailHeader img {
226
278
  width: 12px;
227
279
  }
228
- .PrizesHeader .PrizesText {
280
+ .PrizesHeader .PrizesText, .DetailHeader .PrizesText {
229
281
  margin-left: 3px;
230
282
  font-weight: 600;
231
283
  }
232
284
 
285
+ .DetailHeader {
286
+ margin: 0;
287
+ }
288
+
233
289
  .Prizes {
234
- margin: 24px 0;
290
+ margin: 10px 0;
235
291
  padding: 0 20px;
292
+ padding-left: 30px;
293
+ text-align: left;
236
294
  flex: 1;
237
295
  overflow-y: auto;
238
296
  margin-bottom: 0;
@@ -261,6 +319,12 @@
261
319
 
262
320
  .InfoContainer section.Info {
263
321
  margin-bottom: 12px;
322
+ text-align: left;
323
+ padding-left: 15px;
324
+ }
325
+ .InfoContainer section.Info .Criterias, .InfoContainer section.Info .Description {
326
+ padding-left: 15px;
327
+ margin-top: 10px;
264
328
  }
265
329
 
266
330
  * {
@@ -274,7 +338,7 @@
274
338
  }
275
339
  .Leaderboards td {
276
340
  opacity: 0.6;
277
- padding: 20px 5px;
341
+ padding: 12px 5px;
278
342
  }
279
343
  .Leaderboards td:first-child {
280
344
  padding-left: 20px;
@@ -288,6 +352,7 @@
288
352
  }
289
353
  .Leaderboards tr.isMe {
290
354
  background: rgba(0, 0, 0, 0.2);
355
+ border: 1px solid var(--emw--color-primary, rgb(255, 214, 47));
291
356
  }
292
357
  .Leaderboards tr.isMe .LeaderboardRank span {
293
358
  padding: 0px 3px;
@@ -296,7 +361,7 @@
296
361
  border-radius: 11px;
297
362
  }
298
363
  .Leaderboards tr.isMe td {
299
- color: #FFD029;
364
+ color: var(--emw--color-primary, rgb(255, 214, 47));
300
365
  font-weight: var(--emw--font-weight-semibold, 500);
301
366
  }
302
367
 
@@ -329,33 +394,46 @@
329
394
  }
330
395
 
331
396
  .LeaderboardUnstarted {
332
- margin: 24px 0;
397
+ margin: 10px 0;
333
398
  padding: 0 20px;
334
399
  color: var(--emw--color-secondary, rgb(187, 185, 195));
335
400
  font-size: var(--emw--font-size-medium, 16px);
336
401
  }
337
402
 
338
403
  .Games {
339
- margin: 24px 0;
404
+ margin: 10px 0;
405
+ padding: 0 20px;
340
406
  padding: 0 20px;
341
407
  display: flex;
342
408
  flex-wrap: wrap;
343
- justify-content: space-evenly;
344
- gap: 4px 7.25px;
409
+ justify-content: start;
410
+ margin: 20px auto;
411
+ }
412
+ .Games .Game {
413
+ cursor: pointer;
414
+ width: 25%;
415
+ display: flex;
416
+ padding: 5px;
417
+ }
418
+ .Games .Game:hover {
419
+ filter: brightness(var(--emw--hover-brightness, 1.25));
345
420
  }
346
421
  .Games img {
347
- width: 60px;
422
+ width: 100%;
423
+ height: fit-content;
348
424
  }
349
425
 
350
426
  dialog {
351
427
  position: absolute;
352
428
  top: 30px;
353
429
  width: 100%;
354
- height: 100%;
430
+ height: max-content;
355
431
  background: transparent;
356
432
  border: 0;
357
433
  padding: 0;
358
434
  color: var(--emw--color-typography, #FFFFFF);
435
+ transition: all 0.2s;
436
+ transition-timing-function: ease-in-out;
359
437
  }
360
438
  dialog > div {
361
439
  margin: 32px;
@@ -392,6 +470,10 @@ dialog > div {
392
470
  color: var(--emw--color-secondary, rgb(187, 185, 195));
393
471
  font-size: var(--emw--font-size-small, 14px);
394
472
  }
473
+ .Tip.Error {
474
+ color: var(--emw--color-error, var(--emw--color-red, #ed0909));
475
+ font-weight: var(--emw--font-weight-normal, 500);
476
+ }
395
477
 
396
478
  .PageConfirmContainer {
397
479
  text-align: center;
@@ -483,4 +565,25 @@ dialog > div {
483
565
 
484
566
  .LeaderboardsItem .LeaderboardsItemContainer .TitleContainer {
485
567
  margin-bottom: 16px;
568
+ }
569
+
570
+ @keyframes slideOut {
571
+ 0% {
572
+ display: block;
573
+ opacity: 1;
574
+ height: max-content;
575
+ }
576
+ 50% {
577
+ display: block;
578
+ opacity: 0.5;
579
+ }
580
+ 80% {
581
+ display: none;
582
+ opacity: 0;
583
+ }
584
+ 100% {
585
+ display: none;
586
+ opacity: 0;
587
+ height: 0;
588
+ }
486
589
  }
@@ -1,8 +1,8 @@
1
1
  import { __rest } from "tslib";
2
2
  import { h, Host } from "@stencil/core";
3
- import { TRANSLATIONS, Tab } from "../../utils/translations";
4
- import { getNewItems } from "../../utils/utils";
5
- import { LeaderboardPage, DialogType } from "../../utils/types";
3
+ import { Tab, TRANSLATIONS } from "../../utils/translations";
4
+ import { getDevicePlatform, getNewItems } from "../../utils/utils";
5
+ import { DialogType, LeaderboardPage } from "../../utils/types";
6
6
  import { isTournamentClosed } from "../../utils/bussiness";
7
7
  import { renders } from "../../shared/renders";
8
8
  import { messageReceiver, messageSender } from "../../utils/message";
@@ -74,17 +74,57 @@ export class CasinoEngagementSuiteTournament {
74
74
  this.removeLabel('win');
75
75
  }
76
76
  }
77
+ getContainerScrollTop() {
78
+ return this.page === LeaderboardPage.list ? this.containerScrollTop : this.detailElement.clientHeight / 2 - 250;
79
+ }
80
+ handleClickOutside(event) {
81
+ if (event.composedPath()[0] === this.tooltipIconReference)
82
+ return;
83
+ if (event.composedPath()[0] !== this.tooltipReference)
84
+ this.showTooltip = false;
85
+ }
86
+ componentDidLoad() {
87
+ this.pageElement.addEventListener('scroll', (event) => {
88
+ this.containerScrollTop = event.target.scrollTop + event.target.clientHeight / 2 - 250;
89
+ });
90
+ }
91
+ renderTooltip() {
92
+ if (this.showTooltip) {
93
+ return (h("div", { class: `question__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.locale.Tip }));
94
+ }
95
+ return null;
96
+ }
77
97
  connectedCallback() {
78
98
  this.setTimeInterval();
79
99
  messageSender.UpdateLeaderboardsPlayerReq();
80
100
  }
101
+ scrollToMyRankLine() {
102
+ if (!this.detailElement.querySelectorAll('.isMe').length) {
103
+ return;
104
+ }
105
+ (this.detailElement.querySelectorAll('.TableContentWrapper.leaderboard')[0]).scrollTo({ top: this.detailElement.querySelectorAll('.isMe')[0].offsetTop, behavior: 'smooth' });
106
+ this.scrolledToMyLine = true;
107
+ }
108
+ componentDidRender() {
109
+ if (this.page === LeaderboardPage.item && this.tab === Tab.leaderboard && !this.scrolledToMyLine) {
110
+ if (this.currentPlyerRank > this.maxPlyerRank) {
111
+ this.scrollToMyRankLine();
112
+ }
113
+ }
114
+ else {
115
+ this.scrolledToMyLine = false;
116
+ }
117
+ }
81
118
  disconnectedCallback() {
82
119
  clearInterval(this.timeHolder);
83
120
  }
121
+ onGameClick(game) {
122
+ messageSender.GameClickReq(game);
123
+ }
84
124
  actionJoin(tournament) {
85
- if (this.isActionJoinPending)
125
+ if (tournament.isActionJoinPending)
86
126
  return;
87
- this.isActionJoinPending = true;
127
+ tournament.isActionJoinPending = true;
88
128
  try {
89
129
  if (tournament.isPlayerAcknowledged) {
90
130
  messageSender.UnjoinTournamentReq(tournament);
@@ -102,6 +142,17 @@ export class CasinoEngagementSuiteTournament {
102
142
  if (page == LeaderboardPage.item) {
103
143
  this.tournamentItem = metaData.tournament;
104
144
  if (!this.tournamentItem) {
145
+ messageSender.post({
146
+ type: 'GetTournamentGamesById',
147
+ pathParams: { id: metaData.tournament.id },
148
+ payload: {
149
+ expand: 'games',
150
+ pagination: 'games(limit=50,offset=0)',
151
+ fields: 'games(id,name,thumbnail,launchUrl)',
152
+ platform: getDevicePlatform(),
153
+ language: this.language
154
+ }
155
+ });
105
156
  messageSender.UpdateTournamentsItemReq(metaData.tournament);
106
157
  }
107
158
  if (isTournamentClosed(this.tournamentItem)) {
@@ -112,9 +163,9 @@ export class CasinoEngagementSuiteTournament {
112
163
  this.page = page;
113
164
  }
114
165
  render() {
115
- return (h(Host, { key: 'b070d8a83bcd801d5daeb4edfe87ad0159da4e7c' }, h("general-styling-wrapper", { key: '7454fdab7ee55ab95a39adb3c8b51aed0b78f534', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling,
166
+ return (h(Host, { key: '5a65900ecb503dd01f8f39774b92a6e95048dbf3' }, h("general-styling-wrapper", { key: '58cee35cf4142512e9b49566787b48cbc2761a4a', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling,
116
167
  // @ts-ignore
117
- targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renders.page[this.page]()));
168
+ targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), h("div", { key: '1848e193e8c61fe6bc9d3e123b7651cb1b97981b', class: `Leaderboards ${this.page} ${this.page === 'list' ? 'Active' : 'Hidden'}`, ref: el => this.pageElement = el }, this.renders.page.list()), h("div", { key: 'f865edc80013565981b76df146e99ebf1d5d4721', class: `Leaderboards ${this.page} ${this.page === 'item' ? 'Active' : 'Hidden'} `, ref: el => this.detailElement = el }, this.renders.page.item())));
118
169
  }
119
170
  openDialog(type, data = undefined, onClose = undefined) {
120
171
  this.dialog = Object.assign(Object.assign({}, this.dialog), { isOpen: true, onClose,
@@ -129,6 +180,9 @@ export class CasinoEngagementSuiteTournament {
129
180
  constructor() {
130
181
  this.gifts = [];
131
182
  this.labels = [];
183
+ this.showTooltip = false;
184
+ this.maxPlyerRank = 30;
185
+ this.scrolledToMyLine = false;
132
186
  this.language = 'en';
133
187
  this.show = false;
134
188
  this.clientStyling = '';
@@ -141,7 +195,6 @@ export class CasinoEngagementSuiteTournament {
141
195
  this.tournamentItem = undefined;
142
196
  this.tournamentList = undefined;
143
197
  this.leaderboards = [];
144
- this.isActionJoinPending = false;
145
198
  this.isDialogOpen = false;
146
199
  this.isShowInfo = false;
147
200
  this.page = LeaderboardPage.list;
@@ -315,7 +368,6 @@ export class CasinoEngagementSuiteTournament {
315
368
  "tournamentItem": {},
316
369
  "tournamentList": {},
317
370
  "leaderboards": {},
318
- "isActionJoinPending": {},
319
371
  "isDialogOpen": {},
320
372
  "isShowInfo": {},
321
373
  "page": {},
@@ -362,6 +414,12 @@ export class CasinoEngagementSuiteTournament {
362
414
  "target": "window",
363
415
  "capture": false,
364
416
  "passive": false
417
+ }, {
418
+ "name": "click",
419
+ "method": "handleClickOutside",
420
+ "target": "document",
421
+ "capture": false,
422
+ "passive": false
365
423
  }];
366
424
  }
367
425
  }
@@ -1,8 +1,9 @@
1
1
  import { h } from "@stencil/core";
2
+ import reward from "../assets/reward.svg";
2
3
  export const iconClose = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg" });
3
4
  export const iconQuestion = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg" });
4
5
  export const iconEyeOpen = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg" });
5
6
  export const iconEyeClose = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg" });
6
7
  export const iconBack = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg" });
7
- export const iconReward = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg" });
8
+ export const iconReward = h("img", { src: reward, alt: "reward", class: "Reward" });
8
9
  export const iconTrophy = h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg" });
@@ -8,7 +8,7 @@ var GradientButton;
8
8
  GradientButton["unjoinYes"] = "unjoinYes";
9
9
  GradientButton["unjoinNo"] = "unjoinNo";
10
10
  })(GradientButton || (GradientButton = {}));
11
- const renderButton = (instance, buttonType) => {
11
+ const renderButton = (instance, buttonType, isActionJoinPending = false) => {
12
12
  const { locale } = instance;
13
13
  const buttonCollector = {
14
14
  normal: {
@@ -27,7 +27,7 @@ const renderButton = (instance, buttonType) => {
27
27
  };
28
28
  const props = buttonCollector[buttonType];
29
29
  return renderGradientRoundedButton({
30
- statedClasses: Object.assign({ isPending: instance.isActionJoinPending }, props.statedClasses),
30
+ statedClasses: Object.assign({ isPending: isActionJoinPending }, props.statedClasses),
31
31
  onClick: () => {
32
32
  var _a;
33
33
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call();
@@ -11,7 +11,7 @@ import { messageSender } from "../utils/message";
11
11
  export const page = {
12
12
  list(instance) {
13
13
  var _a;
14
- if (!instance.tournamentList) {
14
+ if (!(instance === null || instance === void 0 ? void 0 : instance.tournamentList)) {
15
15
  instance.tournamentList = (_a = instance.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map((item) => tournamentAdapter(item));
16
16
  return h("general-animation-loading", null);
17
17
  }
@@ -21,10 +21,10 @@ export const page = {
21
21
  instance.setPage(LeaderboardPage.item, { tournament });
22
22
  instance.newIdList = instance.newIdList.filter((id) => id !== tournament.id);
23
23
  };
24
- return renderLeaderboardContainer(instance, h("div", { class: "Leaderboards Row" }, instance.tournamentList.map((_tournament) => (h("div", { class: classnames('LeaderboardsItem', _tournament.isPlayerAcknowledged ? ' GradientRounded Hollow' : ''), onClick: () => onClickListItemChangePage(_tournament) }, h("div", { class: "LeaderboardsItemContainer" }, renderTitleContainer(instance, _tournament), renderTimeBar(_tournament)), h("div", { class: "LeaderboardLabels" }, instance.newIdList.includes(_tournament.id) && (h("div", { class: "LeaderboardLabel" }, h("span", null, "new")))))))));
24
+ return renderLeaderboardContainer(instance, h("div", { class: 'Leaderboards Row' }, instance.tournamentList.map((_tournament) => (h("div", { class: classnames('LeaderboardsItem', _tournament.isPlayerAcknowledged ? ' GradientRounded Hollow' : '', _tournament.isUnjoined ? 'Unjoined' : ''), onClick: () => onClickListItemChangePage(_tournament) }, h("div", { class: "LeaderboardsItemContainer" }, renderTitleContainer(instance, _tournament), renderTimeBar(_tournament)), h("div", { class: "LeaderboardLabels" }, instance.newIdList.includes(_tournament.id) && (h("div", { class: "LeaderboardLabel" }, h("span", null, "new")))))))));
25
25
  }
26
26
  else {
27
- return renderLeaderboardContainer(instance, h("div", { class: "NoLeaderboards Row" }, h("div", null, locale.NoLeaderboards), h("div", null, locale.NoLeaderboardsTip)));
27
+ return renderLeaderboardContainer(instance, h("div", { class: "NoLeaderboards Row" }, h("h3", { class: 'Title' }, locale.NoLeaderboards), h("div", { class: 'message' }, locale.NoLeaderboardsTip)));
28
28
  }
29
29
  },
30
30
  item(instance) {
@@ -50,7 +50,7 @@ export const page = {
50
50
  return renderLeaderboardContainer(instance, [
51
51
  renderTitleContainer(instance, instance.tournamentItem),
52
52
  renderTabs(),
53
- instance.renders.tab[instance.tab]()
53
+ h("div", { class: `TableContentWrapper ${instance.tab}` }, instance.renders.tab[instance.tab]())
54
54
  ]);
55
55
  }
56
56
  };
@@ -68,11 +68,11 @@ const renderTitleContainer = (instance, tournament) => {
68
68
  return (h("div", { class: "TitleContainer" }, h("div", { class: "Title" }, tournament.nameOrTitle), tournament.state !== TournamentState.Closed && (h("div", null, renderGradientRoundedButton({
69
69
  statedClasses: {
70
70
  isHollow: tournament.isPlayerAcknowledged,
71
- isPending: instance.isActionJoinPending
71
+ isPending: tournament.isActionJoinPending
72
72
  },
73
73
  onClick: (e) => {
74
74
  e.stopPropagation();
75
- if (!instance.isActionJoinPending) {
75
+ if (!tournament.isActionJoinPending) {
76
76
  onClickItemJoin(tournament);
77
77
  }
78
78
  },
@@ -87,9 +87,11 @@ const renderLeaderboardContainer = (instance, render) => {
87
87
  const renderDialogContent = () => {
88
88
  switch (instance.dialog.type) {
89
89
  case DialogType.unjoin:
90
- return instance.renders.dialog.unjoin(); //renderDialogContentUnjoin()
90
+ return instance.renders.dialog.unjoin();
91
91
  case DialogType.tip:
92
92
  return h("div", { class: "Tip" }, instance.locale.Tip);
93
+ case DialogType.error:
94
+ return h("div", { class: "Tip Error" }, instance.locale.FailedToJoin);
93
95
  case DialogType.gift:
94
96
  return instance.renders.dialog.gift();
95
97
  }
@@ -99,7 +101,7 @@ const renderLeaderboardContainer = (instance, render) => {
99
101
  switch (page) {
100
102
  case LeaderboardPage.list:
101
103
  return {
102
- left: h("span", { onClick: () => instance.openDialog(DialogType.tip) }, iconQuestion),
104
+ left: h("span", { onClick: () => instance.openDialog(DialogType.tip), onMouseEnter: () => { instance.showTooltip = true; }, onMouseLeave: () => { instance.showTooltip = false; }, ref: (el) => instance.tooltipIconReference = el }, iconQuestion, instance.renderTooltip()),
103
105
  middle: locale.Leaderboards
104
106
  };
105
107
  case LeaderboardPage.item:
@@ -117,5 +119,5 @@ const renderLeaderboardContainer = (instance, render) => {
117
119
  right: h("span", { onClick: () => instance.close.emit() }, iconClose)
118
120
  });
119
121
  };
120
- return (h("div", { class: `Wrapper ${instance.device}` }, h("div", { class: classnames('WrapperContent', { faded: isOpen }) }, renderCloseBarInLayout(), h("div", { class: "Root" }, h("div", { class: "Main" }, render))), h("div", { class: "WrapperUtil" }, h("dialog", { open: isOpen }, h("div", { class: "GradientRounded Hollow" }, renderBar, isOpen && renderDialogContent())))));
122
+ return (h("div", { class: `Wrapper ${instance.device}` }, h("div", { class: classnames('WrapperContent', { faded: isOpen }) }, renderCloseBarInLayout(), h("div", { class: "Root" }, h("div", { class: "Main" }, render))), h("div", { class: "WrapperUtil" }, h("dialog", { open: isOpen, style: { 'top': instance.getContainerScrollTop() + 'px' } }, h("div", { class: "GradientRounded Hollow" }, renderBar, isOpen && renderDialogContent())))));
121
123
  };
@@ -9,7 +9,7 @@ export const tab = {
9
9
  info(instance) {
10
10
  var _a, _b;
11
11
  const { locale, tournamentItem: tournament, isShowInfo } = instance;
12
- return (h("div", { class: "InfoContainer" }, renderTimeBar(tournament), h("section", { class: "ShowInfo", onClick: () => (instance.isShowInfo = !instance.isShowInfo) }, h("p", null, h("span", null, isShowInfo ? iconEyeClose : iconEyeOpen), h("span", null, locale.LeaderboardDetails))), h("div", { class: `ContentScrollContainer ${isShowInfo ? 'expanded' : ''}` }, 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))), !!tournament.termsUrl && (h("div", { class: "TC" }, h("a", { href: tournament.termsUrl, target: "_blank" }, locale.TC))))), isTournamentClosed(instance.tournamentItem) && ((_a = instance.leaderboards) === null || _a === void 0 ? void 0 : _a.find((l) => l.isMe)) && (h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, getResultPrize((_b = instance.leaderboards) === null || _b === void 0 ? void 0 : _b.find((l) => l.isMe))) })), h("section", { class: "PrizesContainer" }, h("div", { class: "PrizesHeader" }, iconReward, h("span", { class: "PrizesText" }, locale.Prizes)), h("div", { class: "Prizes" }, tournament.prizes.map((prize, index) => (h("div", { class: "Prize" }, index + 1, " ", locale.Place, ": ", h("span", { class: "PrizeText" }, prize.name)))))))));
12
+ return (h("div", { class: "InfoContainer" }, renderTimeBar(tournament), h("section", { class: "ShowInfo", onClick: () => (instance.isShowInfo = !instance.isShowInfo) }, h("div", { class: 'DetailHeader' }, h("span", null, isShowInfo ? iconEyeOpen : iconEyeClose), h("span", null, locale.LeaderboardDetails))), h("div", { class: `ContentScrollContainer ${isShowInfo ? 'expanded' : ''}` }, isShowInfo && (h("section", { class: "Info" }, h("div", { class: 'Description' }, 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))), !!tournament.termsUrl && (h("div", { class: "TC" }, h("a", { href: tournament.termsUrl, target: "_blank" }, locale.TC))))), isTournamentClosed(instance.tournamentItem) && ((_a = instance.leaderboards) === null || _a === void 0 ? void 0 : _a.find((l) => l.isMe)) && (h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, getResultPrize((_b = instance.leaderboards) === null || _b === void 0 ? void 0 : _b.find((l) => l.isMe))) })), h("section", { class: "PrizesContainer" }, h("div", { class: "PrizesHeader" }, iconReward, h("span", { class: "PrizesText" }, locale.Prizes)), h("div", { class: "Prizes" }, tournament.prizes.map((prize, index) => (h("div", { class: "Prize" }, index + 1, " ", locale.Place, ": ", h("span", { class: "PrizeText" }, prize.name)))))))));
13
13
  },
14
14
  leaderboard(instance) {
15
15
  const { locale, tournamentItem } = instance;
@@ -26,7 +26,9 @@ export const tab = {
26
26
  },
27
27
  games(instance) {
28
28
  var _a;
29
- return (h("div", { class: "Games" }, (_a = instance.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map((game) => (h("div", null, h("img", { src: game.defaultThumbnail, alt: "" }))))));
29
+ return (h("div", { class: "Games" }, (_a = instance.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map((game) => (h("div", { class: 'Game', onClick: () => {
30
+ instance.onGameClick(game);
31
+ } }, h("img", { src: game.defaultThumbnail, alt: "" }))))));
30
32
  }
31
33
  };
32
34
  const getResultPrize = (leaderboard) => {
@@ -4,14 +4,13 @@ import { renderGradientRoundedButton } from "./GradientRoundedButton";
4
4
  export const renderTimeBar = (tournament) => {
5
5
  return (h("section", { class: "TimeContainer" }, h("div", { class: "Time" }, tournament.state === 'Running'
6
6
  ? [
7
- h("div", null, getTimeDifference(new Date(), tournament.endTime)),
8
- h("div", null, renderGradientRoundedButton({
7
+ h("div", { class: 'Running' }, h("div", null, getTimeDifference(new Date(), tournament.endTime)), ",", h("div", null, renderGradientRoundedButton({
9
8
  statedClasses: {
10
9
  isHollow: true,
11
10
  isPendding: false
12
11
  },
13
12
  innerHTML: `${getProgress(tournament.startTime, tournament.endTime)}%`
14
- }))
13
+ })))
15
14
  ]
16
- : [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 })));
15
+ : [h("div", { class: 'NotRunning' }, 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 })));
17
16
  };
@@ -25,7 +25,7 @@ export const leaderboardsAdapter = (leaderboardRes) => {
25
25
  return leaderboards;
26
26
  }
27
27
  return leaderboards.map((leaderboard) => {
28
- if (item && item.userID === leaderboard.userID) {
28
+ if ((item === null || item === void 0 ? void 0 : item.userId) && item.userId === leaderboard.userId) {
29
29
  return Object.assign(Object.assign({}, leaderboard), { isMe: true });
30
30
  }
31
31
  else {
@@ -1,4 +1,5 @@
1
1
  import { TournamentState } from "./types";
2
+ import dateFnsFormat from "date-fns/format";
2
3
  export const getMaxRankStr = (list) => {
3
4
  let itemHaveMaxRank;
4
5
  list.map((item) => {
@@ -36,3 +37,17 @@ export const getTournamentListByItem = (tournamentList, tournament) => {
36
37
  }
37
38
  });
38
39
  };
40
+ export const getTournamentListParams = (language) => {
41
+ return {
42
+ 'type': 'InitTournamentList',
43
+ 'messageType': 'apiCall',
44
+ 'method': 'GET',
45
+ 'queryParams': {
46
+ 'filter': `PlayerEnrolled=true,ExhibitionEndTime=${dateFnsFormat(new Date(), 'yyyy-MM-ddThh:mm:ssZ')},TicketStatus=active|closed|completed|released`,
47
+ 'sortField': 'StartTime',
48
+ 'sortOrder': 'asc',
49
+ 'pagination': 'limit=50,offset=0',
50
+ language
51
+ }
52
+ };
53
+ };