@everymatrix/pam-consent-modal-gm2 1.87.44

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 (57) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-7739e965.js +1303 -0
  3. package/dist/cjs/index.cjs.js +10 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/pam-consent-item_2.cjs.entry.js +616 -0
  6. package/dist/cjs/pam-consent-modal-gm2-0517b0e8.js +474 -0
  7. package/dist/cjs/pam-consent-modal-gm2.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +19 -0
  9. package/dist/collection/components/pam-consent-modal-gm2/index.js +1 -0
  10. package/dist/collection/components/pam-consent-modal-gm2/pam-consent-modal-gm2.css +102 -0
  11. package/dist/collection/components/pam-consent-modal-gm2/pam-consent-modal-gm2.js +444 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +119 -0
  14. package/dist/collection/utils/types.js +1 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/index-bc7b46e6.js +1276 -0
  17. package/dist/esm/index.js +2 -0
  18. package/dist/esm/loader.js +11 -0
  19. package/dist/esm/pam-consent-item_2.entry.js +612 -0
  20. package/dist/esm/pam-consent-modal-gm2-c30b5b89.js +469 -0
  21. package/dist/esm/pam-consent-modal-gm2.js +20 -0
  22. package/dist/index.cjs.js +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/pam-consent-modal-gm2/index.esm.js +1 -0
  25. package/dist/pam-consent-modal-gm2/p-0acedac1.js +2 -0
  26. package/dist/pam-consent-modal-gm2/p-7138ec54.js +1 -0
  27. package/dist/pam-consent-modal-gm2/p-e1255160.js +1 -0
  28. package/dist/pam-consent-modal-gm2/p-e25bc764.entry.js +1 -0
  29. package/dist/pam-consent-modal-gm2/pam-consent-modal-gm2.esm.js +1 -0
  30. package/dist/stencil.config.dev.js +19 -0
  31. package/dist/stencil.config.js +18 -0
  32. package/dist/storybook/main.js +43 -0
  33. package/dist/storybook/preview.js +9 -0
  34. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  35. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/packages/stencil/pam-consent-modal-gm2/stencil.config.d.ts +2 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/packages/stencil/pam-consent-modal-gm2/stencil.config.dev.d.ts +2 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/packages/stencil/pam-consent-modal-gm2/storybook/main.d.ts +3 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/packages/stencil/pam-consent-modal-gm2/storybook/preview.d.ts +70 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/tools/plugins/index.d.ts +4 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-consent-modal-gm2/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  44. package/dist/types/components/pam-consent-modal-gm2/index.d.ts +1 -0
  45. package/dist/types/components/pam-consent-modal-gm2/pam-consent-modal-gm2.d.ts +65 -0
  46. package/dist/types/components.d.ts +125 -0
  47. package/dist/types/index.d.ts +1 -0
  48. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  49. package/dist/types/utils/locale.utils.d.ts +2 -0
  50. package/dist/types/utils/types.d.ts +13 -0
  51. package/loader/cdn.js +1 -0
  52. package/loader/index.cjs.js +1 -0
  53. package/loader/index.d.ts +24 -0
  54. package/loader/index.es2017.js +1 -0
  55. package/loader/index.js +2 -0
  56. package/loader/package.json +11 -0
  57. package/package.json +27 -0
@@ -0,0 +1,444 @@
1
+ import { h } from "@stencil/core";
2
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
3
+ import { dispatchCustomEvent } from "../../../../../../../../libs/custom-events/src/index";
4
+ import { getTranslations, translate } from "../../utils/locale.utils";
5
+ import "../../../../../pam-consent-item/dist/types/index";
6
+ export class PamConsentModalGm2 {
7
+ constructor() {
8
+ this.consentStatuses = { ACCEPTED: 'Accepted', DENIED: 'Denied' };
9
+ /** This obj is passed to the api on consent update */
10
+ this.userConsents = [];
11
+ /** Used to render consents */
12
+ this.consentConfig = [];
13
+ this.allowedCategoryGroupsArray = [];
14
+ this.mandatoryTagCodes = new Set();
15
+ this.handleApplyClick = () => {
16
+ this.isQueryFired = true;
17
+ };
18
+ this.handleReject = () => {
19
+ const url = new URL('/v2/player/session/player/', this.endpoint);
20
+ const headers = new Headers();
21
+ headers.append('Content-type', 'application/json');
22
+ headers.append('X-SessionID', this.session);
23
+ const options = {
24
+ method: 'DELETE',
25
+ headers: headers
26
+ };
27
+ fetch(url.href, options)
28
+ .then(() => {
29
+ window.postMessage({ type: 'LogoutSuccessfull' }, window.location.href);
30
+ dispatchCustomEvent('logged_out', {});
31
+ });
32
+ };
33
+ this.endpoint = undefined;
34
+ this.session = undefined;
35
+ this.language = 'en';
36
+ this.includeSubmitButton = undefined;
37
+ this.includeRejectButton = undefined;
38
+ this.includeRejectText = undefined;
39
+ this.allowedCategoryGroups = 'Sports, Casino, VirtualSports, Bingo';
40
+ this.translationUrl = '';
41
+ this.clientStyling = '';
42
+ this.clientStylingUrl = '';
43
+ this.mbSource = undefined;
44
+ this.isLoading = true;
45
+ this.isValid = true;
46
+ this.isQueryFired = false;
47
+ this.receivedQueryResponses = 0;
48
+ this.mandatoryConsentsChecked = 0;
49
+ this.mandatoryConsentsCount = 0;
50
+ }
51
+ handleClientStylingChange(newValue, oldValue) {
52
+ if (newValue != oldValue) {
53
+ setClientStyling(this.stylingContainer, this.clientStyling);
54
+ }
55
+ }
56
+ handleClientStylingUrlChange(newValue, oldValue) {
57
+ if (newValue != oldValue) {
58
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
59
+ }
60
+ }
61
+ handleMbSourceChange(newValue, oldValue) {
62
+ if (newValue != oldValue) {
63
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
64
+ }
65
+ }
66
+ handleQueryResponse() {
67
+ if (this.receivedQueryResponses === this.consentConfig.length) {
68
+ this.updateConsents();
69
+ }
70
+ }
71
+ userLegislationConsentHandler(event) {
72
+ for (const consent of event.detail) {
73
+ if (this.mandatoryTagCodes.has(consent.type) && this.isQueryFired === false) {
74
+ consent.value === true ? this.mandatoryConsentsChecked++ : this.mandatoryConsentsChecked--;
75
+ }
76
+ // Register final user choices only if we're ready to update
77
+ if (this.isQueryFired) {
78
+ this.userConsents.push({
79
+ tagCode: consent.type,
80
+ status: consent.value ? this.consentStatuses.ACCEPTED : this.consentStatuses.DENIED,
81
+ });
82
+ }
83
+ }
84
+ if (this.isQueryFired) {
85
+ this.receivedQueryResponses++;
86
+ }
87
+ }
88
+ async componentWillLoad() {
89
+ this.allowedCategoryGroupsArray = this.allowedCategoryGroups.split(',').map(item => item.trim());
90
+ this.getConsents().then(consents => {
91
+ this.setConsentConfig(consents);
92
+ window.postMessage({ type: 'UserActionsExists', displayUserActions: this.mandatoryConsentsCount > 0 }, window.location.href);
93
+ });
94
+ if (this.translationUrl.length > 2) {
95
+ await getTranslations(this.translationUrl);
96
+ }
97
+ }
98
+ componentDidLoad() {
99
+ if (this.stylingContainer) {
100
+ if (this.mbSource)
101
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
102
+ if (this.clientStyling)
103
+ setClientStyling(this.stylingContainer, this.clientStyling);
104
+ if (this.clientStylingUrl)
105
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
106
+ }
107
+ }
108
+ disconnectedCallback() {
109
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
110
+ }
111
+ getConsents() {
112
+ const url = new URL('/api/v2/gm/legislation/consents/requirements', this.endpoint);
113
+ url.searchParams.set('loginSessionId', this.session);
114
+ const options = { method: 'GET' };
115
+ return fetch(url.href, options)
116
+ .then(res => {
117
+ if (res.status === 200) {
118
+ return res.json();
119
+ }
120
+ throw new Error(String(res.status));
121
+ })
122
+ .catch(error => {
123
+ console.error('Error fetching data:', error);
124
+ return null;
125
+ })
126
+ .finally(() => { this.isLoading = false; });
127
+ }
128
+ setConsentConfig(consents) {
129
+ for (const consent of consents) {
130
+ const mandatory = consent.mustAccept;
131
+ if (mandatory) {
132
+ ++this.mandatoryConsentsCount;
133
+ this.mandatoryTagCodes.add(consent.tagCode);
134
+ }
135
+ const categoryCode = consent.category.categoryTagCode;
136
+ if (this.allowedCategoryGroupsArray.includes(categoryCode)) {
137
+ const target = this.consentConfig.find(c => c.group === categoryCode.toLowerCase());
138
+ if (target) {
139
+ target.consentTypes += (',' + consent.tagCode);
140
+ target.mandatory += (',' + String(mandatory));
141
+ }
142
+ else {
143
+ this.consentConfig.push({
144
+ consentTypes: consent.tagCode,
145
+ group: categoryCode.toLowerCase(),
146
+ mandatory: String(mandatory)
147
+ });
148
+ }
149
+ }
150
+ else {
151
+ this.consentConfig.push({
152
+ consentTypes: consent.tagCode,
153
+ group: '',
154
+ mandatory: String(mandatory)
155
+ });
156
+ }
157
+ }
158
+ }
159
+ updateConsents() {
160
+ const url = new URL('/api/v2/gm/legislation/consents/login', this.endpoint);
161
+ url.searchParams.set('loginSessionId', this.session);
162
+ const headers = new Headers();
163
+ headers.append('Content-Type', 'application/json');
164
+ headers.append('Accept', 'application/json');
165
+ const body = JSON.stringify({ note: '', userConsents: this.userConsents });
166
+ const options = {
167
+ method: 'PATCH',
168
+ headers,
169
+ body
170
+ };
171
+ fetch(url.href, options)
172
+ .then(res => res.json())
173
+ .then(() => {
174
+ window.postMessage({
175
+ type: 'WidgetNotification',
176
+ data: {
177
+ type: 'success',
178
+ message: translate('consentUpdateSuccess', this.language)
179
+ }
180
+ }, window.location.href);
181
+ })
182
+ .catch((err) => {
183
+ window.postMessage({
184
+ type: 'WidgetNotification',
185
+ data: {
186
+ type: 'error',
187
+ message: translate('serverNotResponding', this.language),
188
+ err
189
+ }
190
+ }, window.location.href);
191
+ })
192
+ .finally(() => {
193
+ window.postMessage({ type: 'UserActionsCompleted' }, window.location.href);
194
+ });
195
+ }
196
+ render() {
197
+ this.isValid = this.mandatoryConsentsChecked === this.mandatoryConsentsCount;
198
+ return (h("div", { key: '90e9076be34bb3556ee584768cf255bc07ef453b', class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("div", null, h("slot", { name: 'spinner' }), h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" })))) : (h("div", { class: "PamConsentModal" }, h("h2", { class: "ConsentNotice" }, translate('userNoticeText', this.language)), h("div", { class: "ConsentsWrapper" }, this.consentConfig.map(consent => (h("slot", { name: consent.group || consent.consentTypes }, h("pam-consent-item", { language: this.language, "translation-url": this.translationUrl, group: consent.group, consentTypes: consent.consentTypes, queried: this.isQueryFired, mandatory: consent.mandatory, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "client-styling": this.clientStyling }))))), h("div", { class: "ButtonsWrapper" }, this.includeRejectButton &&
199
+ h("button", { class: "ConsentRejectButton", onClick: this.handleReject }, translate('rejectButtonText', this.language)), this.includeSubmitButton &&
200
+ h("button", { class: "ConsentSubmitButton", disabled: !this.isValid, onClick: this.handleApplyClick }, translate('submitButtonText', this.language))), this.includeRejectText && h("p", { class: "RejectText" }, translate('rejectText', this.language))))));
201
+ }
202
+ static get is() { return "pam-consent-modal-gm2"; }
203
+ static get encapsulation() { return "shadow"; }
204
+ static get originalStyleUrls() {
205
+ return {
206
+ "$": ["pam-consent-modal-gm2.scss"]
207
+ };
208
+ }
209
+ static get styleUrls() {
210
+ return {
211
+ "$": ["pam-consent-modal-gm2.css"]
212
+ };
213
+ }
214
+ static get properties() {
215
+ return {
216
+ "endpoint": {
217
+ "type": "string",
218
+ "mutable": false,
219
+ "complexType": {
220
+ "original": "string",
221
+ "resolved": "string",
222
+ "references": {}
223
+ },
224
+ "required": true,
225
+ "optional": false,
226
+ "docs": {
227
+ "tags": [],
228
+ "text": "the endpoint required for the update call"
229
+ },
230
+ "attribute": "endpoint",
231
+ "reflect": true
232
+ },
233
+ "session": {
234
+ "type": "string",
235
+ "mutable": false,
236
+ "complexType": {
237
+ "original": "string",
238
+ "resolved": "string",
239
+ "references": {}
240
+ },
241
+ "required": true,
242
+ "optional": false,
243
+ "docs": {
244
+ "tags": [],
245
+ "text": "user session required for the update call"
246
+ },
247
+ "attribute": "session",
248
+ "reflect": true
249
+ },
250
+ "language": {
251
+ "type": "string",
252
+ "mutable": true,
253
+ "complexType": {
254
+ "original": "string",
255
+ "resolved": "string",
256
+ "references": {}
257
+ },
258
+ "required": false,
259
+ "optional": false,
260
+ "docs": {
261
+ "tags": [],
262
+ "text": "language"
263
+ },
264
+ "attribute": "language",
265
+ "reflect": true,
266
+ "defaultValue": "'en'"
267
+ },
268
+ "includeSubmitButton": {
269
+ "type": "boolean",
270
+ "mutable": false,
271
+ "complexType": {
272
+ "original": "boolean",
273
+ "resolved": "boolean",
274
+ "references": {}
275
+ },
276
+ "required": true,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": "whether or not to include the submit button (in case we want to compose a different )"
281
+ },
282
+ "attribute": "include-submit-button",
283
+ "reflect": true
284
+ },
285
+ "includeRejectButton": {
286
+ "type": "boolean",
287
+ "mutable": false,
288
+ "complexType": {
289
+ "original": "boolean",
290
+ "resolved": "boolean",
291
+ "references": {}
292
+ },
293
+ "required": true,
294
+ "optional": false,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": "whether or not to include the reject button"
298
+ },
299
+ "attribute": "include-reject-button",
300
+ "reflect": true
301
+ },
302
+ "includeRejectText": {
303
+ "type": "boolean",
304
+ "mutable": false,
305
+ "complexType": {
306
+ "original": "boolean",
307
+ "resolved": "boolean",
308
+ "references": {}
309
+ },
310
+ "required": true,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": "whether or not to include the reject desctiption text"
315
+ },
316
+ "attribute": "include-reject-text",
317
+ "reflect": true
318
+ },
319
+ "allowedCategoryGroups": {
320
+ "type": "string",
321
+ "mutable": false,
322
+ "complexType": {
323
+ "original": "string",
324
+ "resolved": "string",
325
+ "references": {}
326
+ },
327
+ "required": false,
328
+ "optional": false,
329
+ "docs": {
330
+ "tags": [],
331
+ "text": "Categories that are allowed to form groups"
332
+ },
333
+ "attribute": "allowed-category-groups",
334
+ "reflect": true,
335
+ "defaultValue": "'Sports, Casino, VirtualSports, Bingo'"
336
+ },
337
+ "translationUrl": {
338
+ "type": "string",
339
+ "mutable": false,
340
+ "complexType": {
341
+ "original": "string",
342
+ "resolved": "string",
343
+ "references": {}
344
+ },
345
+ "required": false,
346
+ "optional": false,
347
+ "docs": {
348
+ "tags": [],
349
+ "text": "Translation url"
350
+ },
351
+ "attribute": "translation-url",
352
+ "reflect": true,
353
+ "defaultValue": "''"
354
+ },
355
+ "clientStyling": {
356
+ "type": "string",
357
+ "mutable": true,
358
+ "complexType": {
359
+ "original": "string",
360
+ "resolved": "string",
361
+ "references": {}
362
+ },
363
+ "required": false,
364
+ "optional": false,
365
+ "docs": {
366
+ "tags": [],
367
+ "text": "Client custom styling via inline style"
368
+ },
369
+ "attribute": "client-styling",
370
+ "reflect": true,
371
+ "defaultValue": "''"
372
+ },
373
+ "clientStylingUrl": {
374
+ "type": "string",
375
+ "mutable": false,
376
+ "complexType": {
377
+ "original": "string",
378
+ "resolved": "string",
379
+ "references": {}
380
+ },
381
+ "required": false,
382
+ "optional": false,
383
+ "docs": {
384
+ "tags": [],
385
+ "text": "Client custom styling via url"
386
+ },
387
+ "attribute": "client-styling-url",
388
+ "reflect": true,
389
+ "defaultValue": "''"
390
+ },
391
+ "mbSource": {
392
+ "type": "string",
393
+ "mutable": false,
394
+ "complexType": {
395
+ "original": "string",
396
+ "resolved": "string",
397
+ "references": {}
398
+ },
399
+ "required": false,
400
+ "optional": false,
401
+ "docs": {
402
+ "tags": [],
403
+ "text": "mbSource"
404
+ },
405
+ "attribute": "mb-source",
406
+ "reflect": true
407
+ }
408
+ };
409
+ }
410
+ static get states() {
411
+ return {
412
+ "isLoading": {},
413
+ "isValid": {},
414
+ "isQueryFired": {},
415
+ "receivedQueryResponses": {},
416
+ "mandatoryConsentsChecked": {},
417
+ "mandatoryConsentsCount": {}
418
+ };
419
+ }
420
+ static get watchers() {
421
+ return [{
422
+ "propName": "clientStyling",
423
+ "methodName": "handleClientStylingChange"
424
+ }, {
425
+ "propName": "clientStylingUrl",
426
+ "methodName": "handleClientStylingUrlChange"
427
+ }, {
428
+ "propName": "mbSource",
429
+ "methodName": "handleMbSourceChange"
430
+ }, {
431
+ "propName": "receivedQueryResponses",
432
+ "methodName": "handleQueryResponse"
433
+ }];
434
+ }
435
+ static get listeners() {
436
+ return [{
437
+ "name": "userLegislationConsent",
438
+ "method": "userLegislationConsentHandler",
439
+ "target": undefined,
440
+ "capture": false,
441
+ "passive": false
442
+ }];
443
+ }
444
+ }
@@ -0,0 +1 @@
1
+ export * from './components/pam-consent-modal-gm2';
@@ -0,0 +1,119 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const TRANSLATIONS = {
3
+ en: {
4
+ userNoticeText: 'Before you can proceed you must consent to the following',
5
+ submitButtonText: 'Submit',
6
+ rejectButtonText: 'Reject',
7
+ rejectText: 'Rejecting new consents will result in the inability to continue the login process and you will be logged out.',
8
+ consentUpdateSuccess: 'Consent update successful!',
9
+ serverNotResponding: 'Server might not be responding'
10
+ },
11
+ 'en-us': {
12
+ userNoticeText: 'Before you can proceed you must consent to the following',
13
+ submitButtonText: 'Submit',
14
+ rejectButtonText: 'Reject',
15
+ rejectText: 'Rejecting new consents will result in the inability to continue the login process and you will be logged out.',
16
+ consentUpdateSuccess: 'Consent update successful!',
17
+ serverNotResponding: 'Server might not be responding'
18
+ },
19
+ ro: {
20
+ userNoticeText: 'Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele',
21
+ submitButtonText: 'Trimite',
22
+ rejectButtonText: 'Respinge',
23
+ rejectText: 'Respingerea noilor consimțăminte va duce la imposibilitatea de a continua procesul de autentificare și veți fi deconectat.',
24
+ consentUpdateSuccess: 'Actualizare consimțământ reușită!',
25
+ serverNotResponding: 'Serverul s-ar putea să nu răspundă'
26
+ },
27
+ hr: {
28
+ userNoticeText: 'Prije nego što možete nastaviti, morate pristati na sljedeće',
29
+ submitButtonText: 'Pošalji',
30
+ rejectButtonText: 'Odbij',
31
+ rejectText: 'Odbijanje novih pristanka rezultirat će nemogućnošću nastavka procesa prijave i bit ćete odjavljeni.',
32
+ consentUpdateSuccess: 'Ažuriranje pristanka uspješno!',
33
+ serverNotResponding: 'Poslužitelj možda ne odgovara'
34
+ },
35
+ fr: {
36
+ userNoticeText: 'Avant de continuer, vous devez consentir aux éléments suivants',
37
+ submitButtonText: 'Soumettre',
38
+ rejectButtonText: 'Rejeter',
39
+ rejectText: 'Le rejet des nouveaux consentements entraînera l\'impossibilité de continuer le processus de connexion et vous serez déconnecté.',
40
+ consentUpdateSuccess: 'Mise à jour du consentement réussie!',
41
+ serverNotResponding: 'Le serveur ne répond peut-être pas'
42
+ },
43
+ cs: {
44
+ userNoticeText: 'Než budete moci pokračovat, musíte souhlasit s následujícím',
45
+ submitButtonText: 'Odeslat',
46
+ rejectButtonText: 'Odmítnout',
47
+ rejectText: 'Odmítnutí nových souhlasů povede k nemožnosti pokračovat v procesu přihlášení a budete odhlášeni.',
48
+ consentUpdateSuccess: 'Aktualizace souhlasu proběhla úspěšně!',
49
+ serverNotResponding: 'Server možná neodpovídá'
50
+ },
51
+ de: {
52
+ userNoticeText: 'Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen',
53
+ submitButtonText: 'Absenden',
54
+ rejectButtonText: 'Ablehnen',
55
+ rejectText: 'Das Ablehnen neuer Zustimmungen führt dazu, dass der Anmeldevorgang nicht fortgesetzt werden kann und Sie abgemeldet werden.',
56
+ consentUpdateSuccess: 'Zustimmung erfolgreich aktualisiert!',
57
+ serverNotResponding: 'Der Server antwortet möglicherweise nicht'
58
+ },
59
+ es: {
60
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
61
+ submitButtonText: 'Enviar',
62
+ rejectButtonText: 'Rechazar',
63
+ rejectText: 'Rechazar nuevos consentimientos resultará en la imposibilidad de continuar el proceso de inicio de sesión y se cerrará la sesión.',
64
+ consentUpdateSuccess: '¡Actualización del consentimiento exitosa!',
65
+ serverNotResponding: 'El servidor podría no estar respondiendo'
66
+ },
67
+ pt: {
68
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
69
+ submitButtonText: 'Enviar',
70
+ rejectButtonText: 'Rejeitar',
71
+ rejectText: 'Rejeitar novos consentimentos resultará na impossibilidade de continuar o processo de login e você será desconectado.',
72
+ consentUpdateSuccess: 'Atualização de consentimento bem-sucedida!',
73
+ serverNotResponding: 'O servidor pode não estar respondendo'
74
+ },
75
+ 'es-mx': {
76
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
77
+ submitButtonText: 'Enviar',
78
+ rejectButtonText: 'Rechazar',
79
+ rejectText: 'Rechazar nuevos consentimientos resultará en la imposibilidad de continuar el proceso de inicio de sesión y se cerrará la sesión.',
80
+ consentUpdateSuccess: '¡Actualización del consentimiento exitosa!',
81
+ serverNotResponding: 'El servidor podría no estar respondiendo'
82
+ },
83
+ 'pt-br': {
84
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
85
+ submitButtonText: 'Enviar',
86
+ rejectButtonText: 'Rejeitar',
87
+ rejectText: 'Rejeitar novos consentimentos resultará na impossibilidade de continuar o processo de login e você será desconectado.',
88
+ consentUpdateSuccess: 'Atualização de consentimento bem-sucedida!',
89
+ serverNotResponding: 'O servidor pode não estar respondendo'
90
+ }
91
+ };
92
+ export const getTranslations = (url) => {
93
+ return new Promise((resolve) => {
94
+ fetch(url)
95
+ .then((res) => res.json())
96
+ .then((data) => {
97
+ Object.keys(data).forEach((lang) => {
98
+ if (!TRANSLATIONS[lang]) {
99
+ TRANSLATIONS[lang] = {};
100
+ }
101
+ for (let key in data[lang]) {
102
+ TRANSLATIONS[lang][key] = data[lang][key];
103
+ }
104
+ });
105
+ resolve(true);
106
+ });
107
+ });
108
+ };
109
+ export const translate = (key, customLang, values) => {
110
+ const lang = customLang;
111
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
112
+ if (values !== undefined) {
113
+ for (const [key, value] of Object.entries(values.values)) {
114
+ const regex = new RegExp(`{${key}}`, 'g');
115
+ translation = translation.replace(regex, value);
116
+ }
117
+ }
118
+ return translation;
119
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };