@everymatrix/user-actions 1.90.27 → 1.90.28

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.
@@ -1,4 +1,6 @@
1
+ import { h } from "@stencil/core";
1
2
  import { actionsMapping } from "../../utils/utils";
3
+ import "../../../../../user-funds-acknowledgment/dist/types/index";
2
4
  export class UserActions {
3
5
  constructor() {
4
6
  this.emitCurrentActionEvent = () => {
@@ -7,9 +9,25 @@ export class UserActions {
7
9
  this.shiftActionStack = () => {
8
10
  this.actionStack = this.actionStack.slice(1);
9
11
  };
12
+ this.mbSource = undefined;
10
13
  this.endpoint = undefined;
11
14
  this.userid = undefined;
15
+ this.operatorid = undefined;
16
+ this.playercurrency = 'EUR';
17
+ this.hasfundsacknowledgment = 'false';
18
+ this.session = "";
19
+ this.language = 'en';
20
+ this.clientStyling = undefined;
21
+ this.clientStylingUrl = undefined;
22
+ this.translationUrl = '';
23
+ this.currencylocale = 'en';
24
+ this.currencydisplay = 'symbol';
25
+ this.maximumfractiondigits = '2';
26
+ this.minimumfractiondigits = '0';
27
+ this.customdisplayformat = '';
28
+ this.alwaysshowdecimals = 'true';
12
29
  this.actionStack = [];
30
+ this.customerFundsProtectionActive = false;
13
31
  }
14
32
  handleEvent(e) {
15
33
  var _a, _b;
@@ -24,18 +42,29 @@ export class UserActions {
24
42
  return fetch(url.href)
25
43
  .then((response) => response.json())
26
44
  .then(data => {
45
+ var _a, _b;
27
46
  // filtering necessary to prevent widget from throwing "cannot read properties of 'undefined'"
28
- // when the actions received are not part of actionsMapping
47
+ // when the actions received are not part of actionsMapping
29
48
  this.actionStack = data.actions.filter(action => actionsMapping[action.action]);
30
49
  if (this.actionStack.length > 0)
31
50
  this.emitCurrentActionEvent();
51
+ this.customerFundsProtectionActive = (_b = (_a = data.actions) === null || _a === void 0 ? void 0 : _a.some((item) => item.action === "customer-funds-protection")) !== null && _b !== void 0 ? _b : false;
52
+ // signal to prompt modal
53
+ if (this.customerFundsProtectionActive) {
54
+ window.postMessage({ type: 'ProtectionFundsActive' }, window.location.href);
55
+ }
32
56
  });
33
57
  }
34
58
  componentWillLoad() {
35
59
  return this.fetchUserActions();
36
60
  }
37
61
  render() {
38
- return;
62
+ if (!this.customerFundsProtectionActive || this.hasfundsacknowledgment === 'false') {
63
+ return;
64
+ }
65
+ else {
66
+ return (h("user-funds-acknowledgment", { endpoint: this.endpoint, session: this.session, operatorid: this.operatorid, language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, currencylocale: this.currencylocale, currencydisplay: this.currencydisplay, maximumfractiondigits: this.maximumfractiondigits, minimumfractiondigits: this.minimumfractiondigits, playercurrency: this.playercurrency }));
67
+ }
39
68
  }
40
69
  static get is() { return "user-actions"; }
41
70
  static get encapsulation() { return "shadow"; }
@@ -51,6 +80,23 @@ export class UserActions {
51
80
  }
52
81
  static get properties() {
53
82
  return {
83
+ "mbSource": {
84
+ "type": "string",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "string",
88
+ "resolved": "string",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": ""
96
+ },
97
+ "attribute": "mb-source",
98
+ "reflect": true
99
+ },
54
100
  "endpoint": {
55
101
  "type": "string",
56
102
  "mutable": false,
@@ -84,12 +130,262 @@ export class UserActions {
84
130
  },
85
131
  "attribute": "userid",
86
132
  "reflect": false
133
+ },
134
+ "operatorid": {
135
+ "type": "string",
136
+ "mutable": false,
137
+ "complexType": {
138
+ "original": "string",
139
+ "resolved": "string",
140
+ "references": {}
141
+ },
142
+ "required": false,
143
+ "optional": false,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": ""
147
+ },
148
+ "attribute": "operatorid",
149
+ "reflect": false
150
+ },
151
+ "playercurrency": {
152
+ "type": "string",
153
+ "mutable": false,
154
+ "complexType": {
155
+ "original": "string",
156
+ "resolved": "string",
157
+ "references": {}
158
+ },
159
+ "required": false,
160
+ "optional": false,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": ""
164
+ },
165
+ "attribute": "playercurrency",
166
+ "reflect": true,
167
+ "defaultValue": "'EUR'"
168
+ },
169
+ "hasfundsacknowledgment": {
170
+ "type": "string",
171
+ "mutable": false,
172
+ "complexType": {
173
+ "original": "string",
174
+ "resolved": "string",
175
+ "references": {}
176
+ },
177
+ "required": false,
178
+ "optional": false,
179
+ "docs": {
180
+ "tags": [],
181
+ "text": "The userid required for for the call"
182
+ },
183
+ "attribute": "hasfundsacknowledgment",
184
+ "reflect": false,
185
+ "defaultValue": "'false'"
186
+ },
187
+ "session": {
188
+ "type": "string",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "string",
192
+ "resolved": "string",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "The sessionid"
200
+ },
201
+ "attribute": "session",
202
+ "reflect": true,
203
+ "defaultValue": "\"\""
204
+ },
205
+ "language": {
206
+ "type": "string",
207
+ "mutable": true,
208
+ "complexType": {
209
+ "original": "string",
210
+ "resolved": "string",
211
+ "references": {}
212
+ },
213
+ "required": false,
214
+ "optional": false,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": "Language"
218
+ },
219
+ "attribute": "language",
220
+ "reflect": true,
221
+ "defaultValue": "'en'"
222
+ },
223
+ "clientStyling": {
224
+ "type": "string",
225
+ "mutable": false,
226
+ "complexType": {
227
+ "original": "string",
228
+ "resolved": "string",
229
+ "references": {}
230
+ },
231
+ "required": false,
232
+ "optional": false,
233
+ "docs": {
234
+ "tags": [],
235
+ "text": "Client custom styling via inline style"
236
+ },
237
+ "attribute": "client-styling",
238
+ "reflect": true
239
+ },
240
+ "clientStylingUrl": {
241
+ "type": "string",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "string",
245
+ "resolved": "string",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": "Client custom styling via url"
253
+ },
254
+ "attribute": "client-styling-url",
255
+ "reflect": true
256
+ },
257
+ "translationUrl": {
258
+ "type": "string",
259
+ "mutable": false,
260
+ "complexType": {
261
+ "original": "string",
262
+ "resolved": "string",
263
+ "references": {}
264
+ },
265
+ "required": false,
266
+ "optional": false,
267
+ "docs": {
268
+ "tags": [],
269
+ "text": "Translation url"
270
+ },
271
+ "attribute": "translation-url",
272
+ "reflect": true,
273
+ "defaultValue": "''"
274
+ },
275
+ "currencylocale": {
276
+ "type": "string",
277
+ "mutable": false,
278
+ "complexType": {
279
+ "original": "string",
280
+ "resolved": "string",
281
+ "references": {}
282
+ },
283
+ "required": false,
284
+ "optional": false,
285
+ "docs": {
286
+ "tags": [],
287
+ "text": "These props are used only by Intl.NumberFormat and have no effect if customdisplayformat is passed, as it will be used instead"
288
+ },
289
+ "attribute": "currencylocale",
290
+ "reflect": true,
291
+ "defaultValue": "'en'"
292
+ },
293
+ "currencydisplay": {
294
+ "type": "string",
295
+ "mutable": false,
296
+ "complexType": {
297
+ "original": "string",
298
+ "resolved": "string",
299
+ "references": {}
300
+ },
301
+ "required": false,
302
+ "optional": false,
303
+ "docs": {
304
+ "tags": [],
305
+ "text": ""
306
+ },
307
+ "attribute": "currencydisplay",
308
+ "reflect": true,
309
+ "defaultValue": "'symbol'"
310
+ },
311
+ "maximumfractiondigits": {
312
+ "type": "string",
313
+ "mutable": false,
314
+ "complexType": {
315
+ "original": "string",
316
+ "resolved": "string",
317
+ "references": {}
318
+ },
319
+ "required": false,
320
+ "optional": false,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": ""
324
+ },
325
+ "attribute": "maximumfractiondigits",
326
+ "reflect": true,
327
+ "defaultValue": "'2'"
328
+ },
329
+ "minimumfractiondigits": {
330
+ "type": "string",
331
+ "mutable": false,
332
+ "complexType": {
333
+ "original": "string",
334
+ "resolved": "string",
335
+ "references": {}
336
+ },
337
+ "required": false,
338
+ "optional": false,
339
+ "docs": {
340
+ "tags": [],
341
+ "text": ""
342
+ },
343
+ "attribute": "minimumfractiondigits",
344
+ "reflect": true,
345
+ "defaultValue": "'0'"
346
+ },
347
+ "customdisplayformat": {
348
+ "type": "string",
349
+ "mutable": false,
350
+ "complexType": {
351
+ "original": "string",
352
+ "resolved": "string",
353
+ "references": {}
354
+ },
355
+ "required": false,
356
+ "optional": false,
357
+ "docs": {
358
+ "tags": [],
359
+ "text": "Example value: '{amount|,.2} {currency}'. The {} blocks are replaced by their respective values.\nEverything else in the string is left as it is. The \"amount\" block also accepts arguments that must be placed after \"|\".\nFirst char is the Thousands Separator, second is the Decimal Separator, third is Decimal Precision.\nAn empty value (' ') indicates that the default values should be used for that specific arg."
360
+ },
361
+ "attribute": "customdisplayformat",
362
+ "reflect": true,
363
+ "defaultValue": "''"
364
+ },
365
+ "alwaysshowdecimals": {
366
+ "type": "string",
367
+ "mutable": false,
368
+ "complexType": {
369
+ "original": "string",
370
+ "resolved": "string",
371
+ "references": {}
372
+ },
373
+ "required": false,
374
+ "optional": false,
375
+ "docs": {
376
+ "tags": [],
377
+ "text": ""
378
+ },
379
+ "attribute": "alwaysshowdecimals",
380
+ "reflect": true,
381
+ "defaultValue": "'true'"
87
382
  }
88
383
  };
89
384
  }
90
385
  static get states() {
91
386
  return {
92
- "actionStack": {}
387
+ "actionStack": {},
388
+ "customerFundsProtectionActive": {}
93
389
  };
94
390
  }
95
391
  static get listeners() {