@everymatrix/bonus-powerups-ingame-list 0.0.37 → 0.0.39
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.
- package/dist/assets/clear-search.svg +9 -0
- package/dist/bonus-powerups-ingame-list/active-confirm-modal_3.entry.js +1 -1
- package/dist/bonus-powerups-ingame-list/bonus-powerups-ingame-list-3c160367.js +3 -0
- package/dist/bonus-powerups-ingame-list/bonus-powerups-ingame-list.esm.js +1 -1
- package/dist/bonus-powerups-ingame-list/index.esm.js +1 -1
- package/dist/cjs/active-confirm-modal_3.cjs.entry.js +4 -4
- package/dist/cjs/{bonus-powerups-ingame-list-392f082a.js → bonus-powerups-ingame-list-11e06ea5.js} +116 -49
- package/dist/cjs/bonus-powerups-ingame-list.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/active-confirm-modal/active-confirm-modal.component.js +1 -1
- package/dist/collection/components/assets/clear-search.svg +9 -0
- package/dist/collection/components/bonus-powerups-ingame-list/bonus-powerups-ingame-list.css +72 -0
- package/dist/collection/components/bonus-powerups-ingame-list/bonus-powerups-ingame-list.js +107 -54
- package/dist/collection/components/time-count/time-count.js +2 -2
- package/dist/collection/utils/locale.utils.js +5 -2
- package/dist/collection/utils/utils.js +4 -0
- package/dist/esm/active-confirm-modal_3.entry.js +5 -5
- package/dist/esm/{bonus-powerups-ingame-list-0ec31d98.js → bonus-powerups-ingame-list-3c160367.js} +116 -49
- package/dist/esm/bonus-powerups-ingame-list.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-list/.stencil/libs/common/src/types/casino/powerups.d.ts +5 -0
- package/dist/types/components/bonus-powerups-ingame-list/bonus-powerups-ingame-list.d.ts +6 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/types/utils/utils.d.ts +4 -0
- package/package.json +1 -1
- package/dist/bonus-powerups-ingame-list/bonus-powerups-ingame-list-0ec31d98.js +0 -3
|
@@ -2,14 +2,14 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
3
3
|
import { getTranslations, translate } from "../../utils/locale.utils";
|
|
4
4
|
import { BoostingPeriodMode, MultiplierMode, PowerUpStatus } from "../../../../../../../../libs/common/src/types/casino/powerups";
|
|
5
|
-
import { getActivedExpireTime,
|
|
5
|
+
import { getActivedExpireTime, debounce, powerUpWithoutGamesSearchConditions } from "../../utils/utils";
|
|
6
6
|
import CloseSvg from "../assets/close.svg";
|
|
7
7
|
import EnergySvg from "../assets/energe.svg";
|
|
8
8
|
import FireSvg from "../assets/fire.svg";
|
|
9
9
|
import ClockSvg from "../assets/clock.svg";
|
|
10
10
|
import DetailArrow from "../assets/double-right.svg";
|
|
11
11
|
import InfoSvg from "../assets/Info-circle.svg";
|
|
12
|
-
import
|
|
12
|
+
import ClearSearch from "../assets/clear-search.svg";
|
|
13
13
|
export class BonusPowerupsIngameList {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.mbSource = undefined;
|
|
@@ -21,7 +21,7 @@ export class BonusPowerupsIngameList {
|
|
|
21
21
|
this.endpoint = undefined;
|
|
22
22
|
this.session = undefined;
|
|
23
23
|
this.limit = 30;
|
|
24
|
-
this.
|
|
24
|
+
this.disableCount = false;
|
|
25
25
|
this.isLoading = false;
|
|
26
26
|
this.isActivating = false;
|
|
27
27
|
this.powerups = [];
|
|
@@ -30,46 +30,87 @@ export class BonusPowerupsIngameList {
|
|
|
30
30
|
this.showConfirmModal = false;
|
|
31
31
|
this.currentPowerup = undefined;
|
|
32
32
|
this.validPowerIds = [];
|
|
33
|
+
this.activeMessage = undefined;
|
|
34
|
+
this.showToasting = false;
|
|
33
35
|
this.debouncedReload = debounce(this.reloadPowerups, 100);
|
|
34
36
|
}
|
|
35
37
|
reloadPowerupsHandler(e) {
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
this.validPowerIds = ((_b = e.detail) === null || _b === void 0 ? void 0 : _b.validPowerIds) || [];
|
|
39
|
-
this.reloadPowerups();
|
|
38
|
+
const { onlyGamePowers } = e.detail;
|
|
39
|
+
this.reloadPowerups(!!onlyGamePowers);
|
|
40
40
|
}
|
|
41
41
|
activePowerupHandler(e) {
|
|
42
|
+
if (!this.currentPowerup) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
42
45
|
if (e.detail.id === this.currentPowerup.id) {
|
|
43
46
|
this.activePowerUp(this.currentPowerup);
|
|
44
47
|
}
|
|
45
48
|
this.showConfirmModal = false;
|
|
46
49
|
}
|
|
47
50
|
powerupTimeCountDownHandler(e) {
|
|
51
|
+
if (this.disableCount) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
if (e.detail.timeLeft <= 0) {
|
|
49
55
|
this.reloadPowerups();
|
|
50
56
|
return;
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
|
-
reloadPowerups() {
|
|
59
|
+
async reloadPowerups(onlyGamePowers = false) {
|
|
54
60
|
this.powerups = [];
|
|
55
61
|
this.total = 0;
|
|
56
|
-
this.
|
|
62
|
+
await this.loadGamePowers();
|
|
63
|
+
if (onlyGamePowers) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
await this.loadData();
|
|
57
67
|
}
|
|
58
68
|
handleConfigChange() {
|
|
59
69
|
this.debouncedReload();
|
|
60
70
|
}
|
|
71
|
+
async loadGamePowers() {
|
|
72
|
+
try {
|
|
73
|
+
this.isLoading = true;
|
|
74
|
+
const url = new URL(`${this.endpoint}/v1/elevate/powerups`);
|
|
75
|
+
const options = {
|
|
76
|
+
headers: {
|
|
77
|
+
'Content-Type': 'application/json',
|
|
78
|
+
'x-SessionId': this.session
|
|
79
|
+
},
|
|
80
|
+
method: 'GET',
|
|
81
|
+
};
|
|
82
|
+
url.searchParams.append('filter', `gameId=${this.gameId}`);
|
|
83
|
+
Object.entries(powerUpWithoutGamesSearchConditions).forEach(([key, value]) => {
|
|
84
|
+
url.searchParams.append(key, value);
|
|
85
|
+
});
|
|
86
|
+
const response = await fetch(url, options);
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
window.postMessage({ type: 'errorWhenLoadPowerups', status: response.status });
|
|
89
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
90
|
+
}
|
|
91
|
+
const { data, total } = await response.json();
|
|
92
|
+
this.validPowerIds = data.map(e => e.powerUpID);
|
|
93
|
+
this.powerupsLoadEvent.emit({ powerups: data, total });
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error("Failed to load game powerups:", error);
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
this.isLoading = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
61
102
|
async loadData() {
|
|
62
|
-
if (this.isLoading ||
|
|
103
|
+
if (this.isLoading || this.total > 0 && this.powerups.length >= this.total) {
|
|
63
104
|
return;
|
|
64
105
|
}
|
|
65
|
-
this.isLoading = true;
|
|
66
106
|
if (this.abortController) {
|
|
67
107
|
this.abortController.abort();
|
|
68
108
|
}
|
|
69
109
|
this.abortController = new AbortController();
|
|
110
|
+
this.isLoading = true;
|
|
70
111
|
try {
|
|
71
112
|
const offset = this.powerups.length;
|
|
72
|
-
const url = new URL(`${this.endpoint}/v1/elevate/powerups
|
|
113
|
+
const url = new URL(`${this.endpoint}/v1/elevate/powerups`);
|
|
73
114
|
const options = {
|
|
74
115
|
headers: {
|
|
75
116
|
'Content-Type': 'application/json',
|
|
@@ -78,28 +119,38 @@ export class BonusPowerupsIngameList {
|
|
|
78
119
|
method: 'GET',
|
|
79
120
|
signal: this.abortController.signal
|
|
80
121
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
122
|
+
url.searchParams.append('pagination', `offset=${offset},limit=${this.limit}`);
|
|
123
|
+
url.searchParams.append('language', this.language);
|
|
84
124
|
Object.entries(powerUpWithoutGamesSearchConditions).forEach(([key, value]) => {
|
|
85
125
|
url.searchParams.append(key, value);
|
|
86
126
|
});
|
|
87
|
-
url.searchParams.append('language', this.language);
|
|
88
127
|
const response = await fetch(url, options);
|
|
89
128
|
if (!response.ok) {
|
|
90
129
|
window.postMessage({ type: 'errorWhenLoadPowerups', status: response.status });
|
|
91
130
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
92
131
|
}
|
|
93
|
-
const { data, total } = await response.json();
|
|
132
|
+
const { data, total, success, errorMessage } = await response.json();
|
|
133
|
+
if (!success) {
|
|
134
|
+
this.activeMessage = {
|
|
135
|
+
isSuccessed: false,
|
|
136
|
+
info: translate("LoadDataFailed"),
|
|
137
|
+
};
|
|
138
|
+
this.showToasting = true;
|
|
139
|
+
this.timerId = setTimeout(() => {
|
|
140
|
+
this.showToasting = false;
|
|
141
|
+
}, 2000);
|
|
142
|
+
throw new Error(`HTTP error! status: ${errorMessage}`);
|
|
143
|
+
}
|
|
94
144
|
this.powerups = [...this.powerups, ...data];
|
|
95
145
|
this.isPowering = this.powerups.filter(e => e.status === PowerUpStatus.ACTIVATED).length > 0;
|
|
96
146
|
this.powerups.forEach(powerUp => {
|
|
97
|
-
|
|
147
|
+
if (this.isPowering) {
|
|
148
|
+
powerUp.isValidForCurrentGame = false;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
powerUp.isValidForCurrentGame = this.validPowerIds.indexOf(powerUp.powerUpID) > -1;
|
|
98
152
|
});
|
|
99
153
|
this.total = total;
|
|
100
|
-
if (!this.showFullList) {
|
|
101
|
-
this.powerupsLoadEvent.emit({ powerups: this.powerups, total });
|
|
102
|
-
}
|
|
103
154
|
}
|
|
104
155
|
catch (error) {
|
|
105
156
|
if (error.name !== 'AbortError') {
|
|
@@ -118,7 +169,7 @@ export class BonusPowerupsIngameList {
|
|
|
118
169
|
}
|
|
119
170
|
this.loadMoreObserver = new IntersectionObserver((entries) => {
|
|
120
171
|
entries.forEach((entry) => {
|
|
121
|
-
if (entry.isIntersecting) {
|
|
172
|
+
if (entry.isIntersecting && entry.target.innerHTML != '') {
|
|
122
173
|
this.loadData().catch(console.error);
|
|
123
174
|
}
|
|
124
175
|
});
|
|
@@ -158,16 +209,18 @@ export class BonusPowerupsIngameList {
|
|
|
158
209
|
}
|
|
159
210
|
const res = await response.json();
|
|
160
211
|
if (res === null || res === void 0 ? void 0 : res.success) {
|
|
161
|
-
powerUp = Object.assign(Object.assign({}, powerUp), { status: PowerUpStatus.ACTIVATED, activatedAt: moment(new Date()).format('YYYY-MM-DD HH:mm:ssZ') });
|
|
162
|
-
const activedIdx = this.powerups.findIndex((e) => e.id === powerUp.id);
|
|
163
|
-
this.powerups[activedIdx] = Object.assign({}, powerUp);
|
|
164
|
-
this.powerups = [...this.powerups];
|
|
165
212
|
this.isPowering = true;
|
|
166
213
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
214
|
+
this.activeMessage = {
|
|
215
|
+
isSuccessed: res.success,
|
|
216
|
+
info: translate(res.success ? "activeSuccess" : "activeError", this.language),
|
|
217
|
+
detail: res.errorMessage
|
|
218
|
+
};
|
|
219
|
+
this.showToasting = true;
|
|
220
|
+
this.timerId = setTimeout(() => {
|
|
221
|
+
this.showToasting = false;
|
|
222
|
+
res.success && this.reloadPowerups();
|
|
223
|
+
}, 2000);
|
|
171
224
|
}
|
|
172
225
|
catch (e) {
|
|
173
226
|
console.error(e);
|
|
@@ -178,9 +231,7 @@ export class BonusPowerupsIngameList {
|
|
|
178
231
|
}
|
|
179
232
|
}
|
|
180
233
|
}
|
|
181
|
-
//Close Current List
|
|
182
234
|
onClose() {
|
|
183
|
-
this.showFullList = false;
|
|
184
235
|
this.closePowerupsEvent.emit({ powerups: this.powerups });
|
|
185
236
|
}
|
|
186
237
|
showDetail(powerup) {
|
|
@@ -195,26 +246,28 @@ export class BonusPowerupsIngameList {
|
|
|
195
246
|
this.showConfirmModal = true;
|
|
196
247
|
}
|
|
197
248
|
componentDidUpdate() {
|
|
198
|
-
if (this.powerups.length < this.total) {
|
|
249
|
+
if (this.total > 0 && this.powerups.length < this.total) {
|
|
199
250
|
this.initializeObserver();
|
|
200
251
|
}
|
|
201
252
|
}
|
|
202
253
|
render() {
|
|
203
|
-
var _a;
|
|
204
|
-
return (h("div", { key: '
|
|
254
|
+
var _a, _b, _c, _d;
|
|
255
|
+
return (h("div", { key: '9426c6dcd8d1a40215965c19ddd01670ecc00f8b', class: 'IngamePowerUpsContainer', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '8448e3b8bceaa29f77d9e09e599f3af8d078fe8a', class: `TopBar ${this.showConfirmModal ? 'Hidden' : ''}` }, h("span", { key: '4f1269d8a21e540a43e09862637b03de8c8d4bf0', class: 'BarTitle' }, translate('powerups', this.language)), h("div", { key: 'b2f52361b45d6dbb1c14f3e8a24a22bbb54a76b4', class: 'IconBtn CircleLinearBorder', onClick: this.onClose.bind(this), innerHTML: CloseSvg })), this.isLoading && this.powerups.length === 0
|
|
205
256
|
? h("smart-loader", null)
|
|
206
|
-
:
|
|
207
|
-
h("div", { class:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
?
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
257
|
+
: (this.powerups.length > 0 ?
|
|
258
|
+
h("div", { class: `Cards ${this.showConfirmModal || this.powerups.length === 0 ? 'Hidden' : ''}` }, this.isPowering &&
|
|
259
|
+
h("div", { class: 'Card PoweringDesc' }, h("div", { class: 'FlexRow' }, h("div", { class: 'Icon', innerHTML: InfoSvg }), h("div", { class: 'Text' }, translate('poweringTooltip', this.language)))), this.powerups.map((powerup, index) => {
|
|
260
|
+
const isLastItem = index === (this.powerups.length - 1);
|
|
261
|
+
return (h("div", { class: `Card ${powerup.status === PowerUpStatus.ACTIVATED ? 'Actived' : ''} ${isLastItem ? "LastItem" : ""}`, ref: isLastItem ? (el) => (this.lastItemElement = el) : null }, h("div", { class: `PowerupTitle FlexRow` }, h("div", { class: 'LeftOfRow' }, h("div", { class: 'EnergyIcon', innerHTML: EnergySvg }), h("div", { class: 'Name' }, powerup.powerUpName)), h("div", { class: 'DetailIcon', onClick: this.showDetail.bind(this, powerup) }, h("div", { class: 'IconBtn CircleLinearBorder', innerHTML: DetailArrow }))), h("div", { class: `ExpireTime Status CircleLinearBorder` }, powerup.status === PowerUpStatus.ACTIVATED
|
|
262
|
+
?
|
|
263
|
+
h("time-count", { "in-progress": true, mode: powerup.boostingPeriod.mode, "left-rounds": (powerup.boostingPeriod.numberOfRounds || 0) - (powerup.usedNumberOfRounds || 0), language: this.language, "expire-time": getActivedExpireTime(powerup) })
|
|
264
|
+
:
|
|
265
|
+
h("time-count", { language: this.language, mode: powerup.boostingPeriod.mode, "expire-time": powerup.expireTime })), h("div", { class: 'MultiplierInfo FlexRow' }, h("div", { class: 'LeftOfRow' }, h("div", { class: 'MultiplierIcon', innerHTML: FireSvg }), h("div", { class: 'MultiplierValue' }, powerup.multiplier.coefficient, "x"), h("div", { class: 'MultiplierMode' }, powerup.multiplier.mode === MultiplierMode.COINS ? translate('coins', this.language) : translate('xp', this.language)), h("div", { class: 'MultiplierIcon', innerHTML: ClockSvg }), h("div", { class: 'MultiplierValue' }, powerup.boostingPeriod[powerup.boostingPeriod.mode === BoostingPeriodMode.NUMBER_OF_ROUNDS ? 'numberOfRounds' : 'minutes']), h("div", { class: 'MultiplierMode' }, powerup.boostingPeriod.mode === BoostingPeriodMode.NUMBER_OF_ROUNDS
|
|
266
|
+
? translate(powerup.boostingPeriod.numberOfRounds > 1 ? 'rounds' : 'round', this.language)
|
|
267
|
+
: translate('minutes', this.language))), (powerup.status === PowerUpStatus.ACTIVE || powerup.status === PowerUpStatus.ACTIVATING) &&
|
|
268
|
+
h("div", { class: `ActiveBtn CircleLinearBorder ${this.isPowering || this.isActivating || !powerup.isValidForCurrentGame ? 'Disabled' : ''} ${this.isActivating ? 'Activating' : ''}`, onClick: () => this.onActiveBtnClick(powerup) }, h("div", { class: 'content' }, " ", translate('activate', this.language))))));
|
|
269
|
+
}), this.isLoading && this.powerups.length > 0 && h("smart-loader", null))
|
|
270
|
+
: h("div", { class: 'EmptyPowerups Cards' }, h("div", { class: 'Icon', innerHTML: ClearSearch }), h("span", { class: 'NoPowerTitle' }, translate('nothingHere', this.language)), h("div", { class: 'NoPowerDescription' }, h("span", null, translate('noPowerUpsNow')), h("span", null, translate('gotoShop'))), h("div", null))), h("active-confirm-modal", { key: '8591d7fc76cfa6effaebd4fbf9a9f5a418bad119', "is-open": this.showConfirmModal, pid: (_a = this.currentPowerup) === null || _a === void 0 ? void 0 : _a.id, language: this.language }), h("div", { key: '590c3ceaebe5aca9f64d6210a2adaff17700faa5', class: `ToastWrapper ${this.showToasting ? "Shown" : "Hidden"} ${((_b = this.activeMessage) === null || _b === void 0 ? void 0 : _b.isSuccessed) ? "Success" : "Failed"}` }, h("div", { key: '7df6ac445d05c7cd19a6af7df50bb88031dfed47', class: `Details` }, h("span", { key: '4735edc51e995f5853e488f3ff24a13619a8283e', class: 'Info' }, (_c = this.activeMessage) === null || _c === void 0 ? void 0 : _c.info), ((_d = this.activeMessage) === null || _d === void 0 ? void 0 : _d.detail) && h("span", { key: '19e1117d681fcd38e13e134e3f57ddc5c9c078ed', class: 'Detail' }, " - [ ", this.activeMessage.detail, " ]")))));
|
|
218
271
|
}
|
|
219
272
|
handleClientStylingChange(newValue, oldValue) {
|
|
220
273
|
if (newValue != oldValue) {
|
|
@@ -258,6 +311,7 @@ export class BonusPowerupsIngameList {
|
|
|
258
311
|
this.loadMoreObserver.disconnect();
|
|
259
312
|
}
|
|
260
313
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
314
|
+
this.timerId && clearTimeout(this.timerId);
|
|
261
315
|
}
|
|
262
316
|
static get is() { return "bonus-powerups-ingame-list"; }
|
|
263
317
|
static get encapsulation() { return "shadow"; }
|
|
@@ -429,9 +483,9 @@ export class BonusPowerupsIngameList {
|
|
|
429
483
|
"reflect": true,
|
|
430
484
|
"defaultValue": "30"
|
|
431
485
|
},
|
|
432
|
-
"
|
|
486
|
+
"disableCount": {
|
|
433
487
|
"type": "boolean",
|
|
434
|
-
"mutable":
|
|
488
|
+
"mutable": false,
|
|
435
489
|
"complexType": {
|
|
436
490
|
"original": "boolean",
|
|
437
491
|
"resolved": "boolean",
|
|
@@ -443,7 +497,7 @@ export class BonusPowerupsIngameList {
|
|
|
443
497
|
"tags": [],
|
|
444
498
|
"text": ""
|
|
445
499
|
},
|
|
446
|
-
"attribute": "
|
|
500
|
+
"attribute": "disable-count",
|
|
447
501
|
"reflect": true,
|
|
448
502
|
"defaultValue": "false"
|
|
449
503
|
}
|
|
@@ -458,7 +512,9 @@ export class BonusPowerupsIngameList {
|
|
|
458
512
|
"isPowering": {},
|
|
459
513
|
"showConfirmModal": {},
|
|
460
514
|
"currentPowerup": {},
|
|
461
|
-
"validPowerIds": {}
|
|
515
|
+
"validPowerIds": {},
|
|
516
|
+
"activeMessage": {},
|
|
517
|
+
"showToasting": {}
|
|
462
518
|
};
|
|
463
519
|
}
|
|
464
520
|
static get events() {
|
|
@@ -522,9 +578,6 @@ export class BonusPowerupsIngameList {
|
|
|
522
578
|
}, {
|
|
523
579
|
"propName": "language",
|
|
524
580
|
"methodName": "handleConfigChange"
|
|
525
|
-
}, {
|
|
526
|
-
"propName": "showFullList",
|
|
527
|
-
"methodName": "loadData"
|
|
528
581
|
}, {
|
|
529
582
|
"propName": "clientStyling",
|
|
530
583
|
"methodName": "handleClientStylingChange"
|
|
@@ -73,8 +73,8 @@ export class TimeCount {
|
|
|
73
73
|
render() {
|
|
74
74
|
return [
|
|
75
75
|
this.inProgress &&
|
|
76
|
-
h("div", { key: '
|
|
77
|
-
h("span", { key: '
|
|
76
|
+
h("div", { key: 'ca4c55507465e393798aece74aedd841f535e553', class: 'InprogressLabel' }, h("span", { key: '22bf42ca81ce3c757471d07ab5032e300286fbbe', class: 'Icon' }), translate('inProgress', this.language)),
|
|
77
|
+
h("span", { key: 'c7b812e96928a802b71c322527a61b60f2c7c995', class: 'Label' }, translate(this.inProgress ? 'endsIn' : 'expiresIn', this.language), " "),
|
|
78
78
|
this.inProgress && this.mode === BoostingPeriodMode.NUMBER_OF_ROUNDS
|
|
79
79
|
? h("span", { class: 'TimeCountDown' }, this.leftRounds, " ", translate(this.leftRounds > 1 ? 'rounds' : 'round', this.language))
|
|
80
80
|
: h("span", { class: 'TimeCountDown' }, this.displayTime)
|
|
@@ -13,13 +13,16 @@ const TRANSLATIONS = {
|
|
|
13
13
|
days: 'Days',
|
|
14
14
|
round: 'Round',
|
|
15
15
|
day: 'Day',
|
|
16
|
+
gotoShop: 'Go to the shop to check power-ups availability.',
|
|
16
17
|
nothingHere: 'Nothing here -- yet!',
|
|
17
|
-
|
|
18
|
+
noPowerUpsNow: 'No power-ups at the moment. ',
|
|
18
19
|
poweringTooltip: 'Power-ups are currently unavailable as you have already activated one power-up. Only one power-up can be active at a time.',
|
|
19
20
|
later: 'Later',
|
|
20
21
|
activateNow: 'Activate Now',
|
|
21
22
|
activeTitle: 'Activate power-up?',
|
|
22
|
-
activeContent: 'In case of activation the countdown starts immediately.\n Are you sure you want to activate?'
|
|
23
|
+
activeContent: 'In case of activation the countdown starts immediately.\n Are you sure you want to activate?',
|
|
24
|
+
activeSuccess: "Activated a power-up",
|
|
25
|
+
activeError: "Failed to activate power-up.",
|
|
23
26
|
}
|
|
24
27
|
};
|
|
25
28
|
export const getTranslations = (url) => {
|
|
@@ -4,6 +4,10 @@ export const powerUpWithoutGamesSearchConditions = {
|
|
|
4
4
|
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,usedNumberOfRounds,currentTime,expireTime,activatedAt",
|
|
5
5
|
status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
|
|
6
6
|
};
|
|
7
|
+
export const gamesPowersSearchConditions = {
|
|
8
|
+
fields: "id,powerUpID,displayName",
|
|
9
|
+
status: `${PowerUpStatus.ACTIVE},${PowerUpStatus.ACTIVATED}`
|
|
10
|
+
};
|
|
7
11
|
export const powerUpSearchConditions = {
|
|
8
12
|
expand: "games",
|
|
9
13
|
fields: "id,powerUpID,displayName,termsUrl,description,status,multiplier,boostingPeriod,usedNumberOfRounds,currentTime,expireTime,activatedAt,games(id,gameId,name,thumbnail,launchUrl)",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-e015b33d.js';
|
|
2
|
-
import { t as translate, C as CloseSvg, a as BoostingPeriodMode, h as hooks } from './bonus-powerups-ingame-list-
|
|
3
|
-
export { B as bonus_powerups_ingame_list } from './bonus-powerups-ingame-list-
|
|
2
|
+
import { t as translate, C as CloseSvg, a as BoostingPeriodMode, h as hooks } from './bonus-powerups-ingame-list-3c160367.js';
|
|
3
|
+
export { B as bonus_powerups_ingame_list } from './bonus-powerups-ingame-list-3c160367.js';
|
|
4
4
|
|
|
5
5
|
const activeConfirmModalCss = ".ModalContainer{position:absolute;top:calc(50% - 200px);left:0;width:calc(100% - 120px);margin:40px;max-width:400px;height:260px;text-align:center;padding:20px;display:flex;gap:30px;flex-direction:column;border:1px solid var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0784313725));transition:opacity 200ms ease-in-out;opacity:1;background:var(--emw--ingame-color-black40, rgba(9, 9, 9, 0.5019607843));border-radius:20px;backdrop-filter:blur(22.9411773682px);justify-content:flex-start}.ModalContainer.Hidden{opacity:0 !important}.ModalContainer.Shown .TopBar{justify-content:flex-end;padding:0px}.ModalContainer .Title{font-weight:bold;font-size:1.2rem}.ModalContainer .Btns{display:flex;justify-content:space-evenly}.ModalContainer .PowupBtn{background:linear-gradient(49deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.1019607843)) 33.61%, var(--emw--ingame-color-white50, rgba(255, 255, 255, 0.1019607843)) 89.19%);border:1px solid rgba(70, 69, 69, 0.5);border-radius:10px;padding:5px 15px;color:var(--emw--color-powup-light-green, #00FA5A);font-weight:bold;cursor:pointer}.ModalContainer .PowupBtn.Active{background:var(--emw--color-powup-light-green, #00FA5A);box-shadow:0px 0px 6px 10px var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.1019607843));color:#0A0A17}";
|
|
6
6
|
const ActiveConfirmModalStyle0 = activeConfirmModalCss;
|
|
@@ -21,7 +21,7 @@ const ActiveConfirmModal = class {
|
|
|
21
21
|
this.activePowerupEvent.emit({ id });
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return h("div", { key: '
|
|
24
|
+
return h("div", { key: 'a3d27838533a9da9c6096958d20ba7c223582888', class: `ModalContainer ${this.isOpen ? 'Shown' : 'Hidden'}` }, h("div", { key: 'e6d9adedf1b882312ae795ee3098af622976e6ac', class: 'TopBar' }, h("div", { key: 'e15e7ba1f6eccc5c15b5c83e06766e525d6f9713', class: 'IconBtn CircleLinearBorder', onClick: () => this.closeModal(), innerHTML: CloseSvg })), h("div", { key: '1a48351e00dd01eb285f516a6b9ddf3619dd9d3a', class: 'Title' }, translate('activeTitle', this.language)), h("div", { key: '4b4981016359af3500c0578d2ebe04fa8a62677d', class: 'ActivePowerupContent' }, translate("activeContent", this.language)), h("div", { key: 'a843ef0088b2674a7b32bc2a04c74abfde8b980b', class: 'Btns' }, h("div", { key: '61289f8630beebd7316fe7966ce5f3de28bde096', class: 'LaterBtn PowupBtn', onClick: () => this.closeModal() }, " ", translate('later', this.language), " "), h("div", { key: '3765062d5adebf082f134412cc41b11edc9e999c', class: 'Active PowupBtn', onClick: () => this.activeNow() }, " ", translate('activateNow', this.language), " ")));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
ActiveConfirmModal.style = ActiveConfirmModalStyle0;
|
|
@@ -99,8 +99,8 @@ const TimeCount = class {
|
|
|
99
99
|
render() {
|
|
100
100
|
return [
|
|
101
101
|
this.inProgress &&
|
|
102
|
-
h("div", { key: '
|
|
103
|
-
h("span", { key: '
|
|
102
|
+
h("div", { key: 'ca4c55507465e393798aece74aedd841f535e553', class: 'InprogressLabel' }, h("span", { key: '22bf42ca81ce3c757471d07ab5032e300286fbbe', class: 'Icon' }), translate('inProgress', this.language)),
|
|
103
|
+
h("span", { key: 'c7b812e96928a802b71c322527a61b60f2c7c995', class: 'Label' }, translate(this.inProgress ? 'endsIn' : 'expiresIn', this.language), " "),
|
|
104
104
|
this.inProgress && this.mode === BoostingPeriodMode.NUMBER_OF_ROUNDS
|
|
105
105
|
? h("span", { class: 'TimeCountDown' }, this.leftRounds, " ", translate(this.leftRounds > 1 ? 'rounds' : 'round', this.language))
|
|
106
106
|
: h("span", { class: 'TimeCountDown' }, this.displayTime)
|