@everymatrix/player-user-consents 1.34.0 → 1.35.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.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["player-user-consents.cjs",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
17
+ return index.bootstrapLazy([["player-user-consents.cjs",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"gmVersion":[1,"gm-version"],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -7,58 +7,94 @@ const index = require('./index-e77a2edf.js');
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const TRANSLATIONS = {
9
9
  en: {
10
- termsandconditions1: "I accept the ",
11
- termsandconditions2: ", I have read and understood the ",
12
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
13
- tc: "Terms and Conditions",
14
- privacy: "Privacy Policy",
10
+ termsAndConditions: {
11
+ acceptPart1: "I accept the ",
12
+ acceptPart2: ", I have read and understood the ",
13
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
14
+ tc: "Terms and Conditions"
15
+ },
16
+ privacyPolicy: {
17
+ readUnderstandPart1: "I have read and understood the ",
18
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
19
+ privacy: "Privacy Policy"
20
+ },
15
21
  sms: "I consent to receive marketing communication via SMS.",
16
- emailmarketing: "I consent to receive marketing communication via Email."
22
+ email: "I consent to receive marketing communication via Email."
17
23
  },
18
24
  ro: {
19
- termsandconditions1: "Accept ",
20
- termsandconditions2: " platformei. Am citit şi înţeles ",
21
- termsandconditions3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
22
- tc: "Termenii şi condiţiile",
23
- privacy: "Politica de confidenţialitate",
25
+ termsAndConditions: {
26
+ acceptPart1: "Accept ",
27
+ acceptPart2: " platformei. Am citit şi înţeles ",
28
+ acceptPart3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
29
+ tc: "Termenii şi condiţiile"
30
+ },
31
+ privacyPolicy: {
32
+ readUnderstandPart1: "Am citit şi înţeles ",
33
+ readUnderstandPart2: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
34
+ privacy: "Politica de confidenţialitate"
35
+ },
24
36
  sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
25
- emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
37
+ email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
26
38
  },
27
39
  hr: {
28
- termsandconditions1: "I accept the ",
29
- termsandconditions2: ", I have read and understood the ",
30
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
31
- tc: "Terms and Conditions",
32
- privacy: "Privacy Policy",
40
+ termsAndConditions: {
41
+ acceptPart1: "I accept the ",
42
+ acceptPart2: ", I have read and understood the ",
43
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
44
+ tc: "Terms and Conditions"
45
+ },
46
+ privacyPolicy: {
47
+ readUnderstandPart1: "I have read and understood the ",
48
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
49
+ privacy: "Privacy Policy"
50
+ },
33
51
  sms: "I consent to receive marketing communication via SMS.",
34
- emailmarketing: "I consent to receive marketing communication via Email."
52
+ email: "I consent to receive marketing communication via Email."
35
53
  },
36
54
  fr: {
37
- termsandconditions1: "I accept the ",
38
- termsandconditions2: ", I have read and understood the ",
39
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
40
- tc: "Terms and Conditions",
41
- privacy: "Privacy Policy",
55
+ termsAndConditions: {
56
+ acceptPart1: "I accept the ",
57
+ acceptPart2: ", I have read and understood the ",
58
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
59
+ tc: "Terms and Conditions"
60
+ },
61
+ privacyPolicy: {
62
+ readUnderstandPart1: "I have read and understood the ",
63
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
64
+ privacy: "Privacy Policy"
65
+ },
42
66
  sms: "I consent to receive marketing communication via SMS.",
43
- emailmarketing: "I consent to receive marketing communication via Email."
67
+ email: "I consent to receive marketing communication via Email."
44
68
  },
45
69
  cs: {
46
- termsandconditions1: "I accept the ",
47
- termsandconditions2: ", I have read and understood the ",
48
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
49
- tc: "Terms and Conditions",
50
- privacy: "Privacy Policy",
70
+ termsAndConditions: {
71
+ acceptPart1: "I accept the ",
72
+ acceptPart2: ", I have read and understood the ",
73
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
74
+ tc: "Terms and Conditions"
75
+ },
76
+ privacyPolicy: {
77
+ readUnderstandPart1: "I have read and understood the ",
78
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
79
+ privacy: "Privacy Policy"
80
+ },
51
81
  sms: "I consent to receive marketing communication via SMS.",
52
- emailmarketing: "I consent to receive marketing communication via Email."
82
+ email: "I consent to receive marketing communication via Email."
53
83
  },
54
84
  de: {
55
- termsandconditions1: "I accept the ",
56
- termsandconditions2: ", I have read and understood the ",
57
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
58
- tc: "Terms and Conditions",
59
- privacy: "Privacy Policy",
85
+ termsAndConditions: {
86
+ acceptPart1: "I accept the ",
87
+ acceptPart2: ", I have read and understood the ",
88
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
89
+ tc: "Terms and Conditions"
90
+ },
91
+ privacyPolicy: {
92
+ readUnderstandPart1: "I have read and understood the ",
93
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
94
+ privacy: "Privacy Policy"
95
+ },
60
96
  sms: "I consent to receive marketing communication via SMS.",
61
- emailmarketing: "I consent to receive marketing communication via Email."
97
+ email: "I consent to receive marketing communication via Email."
62
98
  },
63
99
  };
64
100
  const getTranslations = (url) => {
@@ -77,12 +113,18 @@ const getTranslations = (url) => {
77
113
  });
78
114
  };
79
115
  const translate = (key, customLang, values) => {
80
- const lang = customLang;
81
- let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
116
+ const lang = customLang || DEFAULT_LANGUAGE;
117
+ const getNestedTranslation = (obj, path) => {
118
+ return path.split('.').reduce((o, k) => (o && o[k] !== undefined ? o[k] : null), obj);
119
+ };
120
+ let translation = getNestedTranslation(TRANSLATIONS[lang], key);
121
+ if (translation === null) {
122
+ return key;
123
+ }
82
124
  if (values !== undefined) {
83
- for (const [key, value] of Object.entries(values.values)) {
84
- const regex = new RegExp(`{${key}}`, 'g');
85
- translation = translation.replace(regex, value);
125
+ for (const [k, v] of Object.entries(values)) {
126
+ const regex = new RegExp(`{${k}}`, 'g');
127
+ translation = translation.replace(regex, v);
86
128
  }
87
129
  }
88
130
  return translation;
@@ -110,6 +152,10 @@ const PlayerUserConsents = class {
110
152
  * wether or not this consent is mandatory. Used for render details
111
153
  */
112
154
  this.mandatory = false;
155
+ /**
156
+ * Select GM version
157
+ */
158
+ this.gmVersion = '';
113
159
  /**
114
160
  * the title of the consent to be displayed
115
161
  */
@@ -159,9 +205,20 @@ const PlayerUserConsents = class {
159
205
  // end custom styling area
160
206
  }
161
207
  determineTextContent() {
162
- return this.consentType === 'termsandconditions' ?
163
- index.h("p", null, translate('termsandconditions1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
164
- : index.h("p", null, translate(this.consentType, this.lang));
208
+ if (this.gmVersion === 'gmcore') {
209
+ if (this.consentType === 'termsandconditions') {
210
+ return index.h("p", null, translate('termsAndConditions.acceptPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)), translate('termsAndConditions.acceptPart2', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)), translate('termsAndConditions.acceptPart3', this.lang));
211
+ }
212
+ }
213
+ if (this.gmVersion === 'gm16') {
214
+ if (this.consentType === 'termsandconditions') {
215
+ return index.h("p", null, translate('termsAndConditions.acceptPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)));
216
+ }
217
+ if (this.consentType === 'privacypolicy') {
218
+ return index.h("p", null, translate('privacyPolicy.readUnderstandPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)), translate('privacyPolicy.readUnderstandPart2', this.lang));
219
+ }
220
+ }
221
+ return index.h("p", null, translate(this.consentType, this.lang));
165
222
  }
166
223
  render() {
167
224
  if (this.queried) {
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["player-user-consents.cjs",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
18
+ return index.bootstrapLazy([["player-user-consents.cjs",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"gmVersion":[1,"gm-version"],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
19
19
  });
@@ -1,5 +1,5 @@
1
1
  import { Component, h, Event, Prop, State, Watch } from '@stencil/core';
2
- import { getTranslations, translate } from '../../utils/utils';
2
+ import { getTranslations, translate } from '../../utils/locale.utils';
3
3
  export class PlayerUserConsents {
4
4
  constructor() {
5
5
  /**
@@ -18,6 +18,10 @@ export class PlayerUserConsents {
18
18
  * wether or not this consent is mandatory. Used for render details
19
19
  */
20
20
  this.mandatory = false;
21
+ /**
22
+ * Select GM version
23
+ */
24
+ this.gmVersion = '';
21
25
  /**
22
26
  * the title of the consent to be displayed
23
27
  */
@@ -67,14 +71,30 @@ export class PlayerUserConsents {
67
71
  // end custom styling area
68
72
  }
69
73
  determineTextContent() {
70
- return this.consentType === 'termsandconditions' ?
71
- h("p", null,
72
- translate('termsandconditions1', this.lang),
73
- h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)),
74
- translate('termsandconditions2', this.lang),
75
- h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)),
76
- translate('termsandconditions3', this.lang))
77
- : h("p", null, translate(this.consentType, this.lang));
74
+ if (this.gmVersion === 'gmcore') {
75
+ if (this.consentType === 'termsandconditions') {
76
+ return h("p", null,
77
+ translate('termsAndConditions.acceptPart1', this.lang),
78
+ h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)),
79
+ translate('termsAndConditions.acceptPart2', this.lang),
80
+ h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)),
81
+ translate('termsAndConditions.acceptPart3', this.lang));
82
+ }
83
+ }
84
+ if (this.gmVersion === 'gm16') {
85
+ if (this.consentType === 'termsandconditions') {
86
+ return h("p", null,
87
+ translate('termsAndConditions.acceptPart1', this.lang),
88
+ h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)));
89
+ }
90
+ if (this.consentType === 'privacypolicy') {
91
+ return h("p", null,
92
+ translate('privacyPolicy.readUnderstandPart1', this.lang),
93
+ h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)),
94
+ translate('privacyPolicy.readUnderstandPart2', this.lang));
95
+ }
96
+ }
97
+ return h("p", null, translate(this.consentType, this.lang));
78
98
  }
79
99
  render() {
80
100
  if (this.queried) {
@@ -168,6 +188,24 @@ export class PlayerUserConsents {
168
188
  "reflect": true,
169
189
  "defaultValue": "false"
170
190
  },
191
+ "gmVersion": {
192
+ "type": "string",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "string",
196
+ "resolved": "string",
197
+ "references": {}
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": "Select GM version"
204
+ },
205
+ "attribute": "gm-version",
206
+ "reflect": false,
207
+ "defaultValue": "''"
208
+ },
171
209
  "consentTitle": {
172
210
  "type": "string",
173
211
  "mutable": false,
@@ -0,0 +1,125 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const TRANSLATIONS = {
3
+ en: {
4
+ termsAndConditions: {
5
+ acceptPart1: "I accept the ",
6
+ acceptPart2: ", I have read and understood the ",
7
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
8
+ tc: "Terms and Conditions"
9
+ },
10
+ privacyPolicy: {
11
+ readUnderstandPart1: "I have read and understood the ",
12
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
13
+ privacy: "Privacy Policy"
14
+ },
15
+ sms: "I consent to receive marketing communication via SMS.",
16
+ email: "I consent to receive marketing communication via Email."
17
+ },
18
+ ro: {
19
+ termsAndConditions: {
20
+ acceptPart1: "Accept ",
21
+ acceptPart2: " platformei. Am citit şi înţeles ",
22
+ acceptPart3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
23
+ tc: "Termenii şi condiţiile"
24
+ },
25
+ privacyPolicy: {
26
+ readUnderstandPart1: "Am citit şi înţeles ",
27
+ readUnderstandPart2: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
28
+ privacy: "Politica de confidenţialitate"
29
+ },
30
+ sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
31
+ email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
32
+ },
33
+ hr: {
34
+ termsAndConditions: {
35
+ acceptPart1: "I accept the ",
36
+ acceptPart2: ", I have read and understood the ",
37
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
38
+ tc: "Terms and Conditions"
39
+ },
40
+ privacyPolicy: {
41
+ readUnderstandPart1: "I have read and understood the ",
42
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
43
+ privacy: "Privacy Policy"
44
+ },
45
+ sms: "I consent to receive marketing communication via SMS.",
46
+ email: "I consent to receive marketing communication via Email."
47
+ },
48
+ fr: {
49
+ termsAndConditions: {
50
+ acceptPart1: "I accept the ",
51
+ acceptPart2: ", I have read and understood the ",
52
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
53
+ tc: "Terms and Conditions"
54
+ },
55
+ privacyPolicy: {
56
+ readUnderstandPart1: "I have read and understood the ",
57
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
58
+ privacy: "Privacy Policy"
59
+ },
60
+ sms: "I consent to receive marketing communication via SMS.",
61
+ email: "I consent to receive marketing communication via Email."
62
+ },
63
+ cs: {
64
+ termsAndConditions: {
65
+ acceptPart1: "I accept the ",
66
+ acceptPart2: ", I have read and understood the ",
67
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
68
+ tc: "Terms and Conditions"
69
+ },
70
+ privacyPolicy: {
71
+ readUnderstandPart1: "I have read and understood the ",
72
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
73
+ privacy: "Privacy Policy"
74
+ },
75
+ sms: "I consent to receive marketing communication via SMS.",
76
+ email: "I consent to receive marketing communication via Email."
77
+ },
78
+ de: {
79
+ termsAndConditions: {
80
+ acceptPart1: "I accept the ",
81
+ acceptPart2: ", I have read and understood the ",
82
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
83
+ tc: "Terms and Conditions"
84
+ },
85
+ privacyPolicy: {
86
+ readUnderstandPart1: "I have read and understood the ",
87
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
88
+ privacy: "Privacy Policy"
89
+ },
90
+ sms: "I consent to receive marketing communication via SMS.",
91
+ email: "I consent to receive marketing communication via Email."
92
+ },
93
+ };
94
+ export const getTranslations = (url) => {
95
+ // fetch url, get the data, replace the TRANSLATIONS content
96
+ return new Promise((resolve) => {
97
+ fetch(url)
98
+ .then((res) => res.json())
99
+ .then((data) => {
100
+ Object.keys(data).forEach((item) => {
101
+ for (let key in data[item]) {
102
+ TRANSLATIONS[item][key] = data[item][key];
103
+ }
104
+ });
105
+ resolve(true);
106
+ });
107
+ });
108
+ };
109
+ export const translate = (key, customLang, values) => {
110
+ const lang = customLang || DEFAULT_LANGUAGE;
111
+ const getNestedTranslation = (obj, path) => {
112
+ return path.split('.').reduce((o, k) => (o && o[k] !== undefined ? o[k] : null), obj);
113
+ };
114
+ let translation = getNestedTranslation(TRANSLATIONS[lang], key);
115
+ if (translation === null) {
116
+ return key;
117
+ }
118
+ if (values !== undefined) {
119
+ for (const [k, v] of Object.entries(values)) {
120
+ const regex = new RegExp(`{${k}}`, 'g');
121
+ translation = translation.replace(regex, v);
122
+ }
123
+ }
124
+ return translation;
125
+ };
@@ -1,83 +0,0 @@
1
- const DEFAULT_LANGUAGE = 'en';
2
- const TRANSLATIONS = {
3
- en: {
4
- termsandconditions1: "I accept the ",
5
- termsandconditions2: ", I have read and understood the ",
6
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
7
- tc: "Terms and Conditions",
8
- privacy: "Privacy Policy",
9
- sms: "I consent to receive marketing communication via SMS.",
10
- emailmarketing: "I consent to receive marketing communication via Email."
11
- },
12
- ro: {
13
- termsandconditions1: "Accept ",
14
- termsandconditions2: " platformei. Am citit şi înţeles ",
15
- termsandconditions3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
16
- tc: "Termenii şi condiţiile",
17
- privacy: "Politica de confidenţialitate",
18
- sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
19
- emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
20
- },
21
- hr: {
22
- termsandconditions1: "I accept the ",
23
- termsandconditions2: ", I have read and understood the ",
24
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
25
- tc: "Terms and Conditions",
26
- privacy: "Privacy Policy",
27
- sms: "I consent to receive marketing communication via SMS.",
28
- emailmarketing: "I consent to receive marketing communication via Email."
29
- },
30
- fr: {
31
- termsandconditions1: "I accept the ",
32
- termsandconditions2: ", I have read and understood the ",
33
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
34
- tc: "Terms and Conditions",
35
- privacy: "Privacy Policy",
36
- sms: "I consent to receive marketing communication via SMS.",
37
- emailmarketing: "I consent to receive marketing communication via Email."
38
- },
39
- cs: {
40
- termsandconditions1: "I accept the ",
41
- termsandconditions2: ", I have read and understood the ",
42
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
43
- tc: "Terms and Conditions",
44
- privacy: "Privacy Policy",
45
- sms: "I consent to receive marketing communication via SMS.",
46
- emailmarketing: "I consent to receive marketing communication via Email."
47
- },
48
- de: {
49
- termsandconditions1: "I accept the ",
50
- termsandconditions2: ", I have read and understood the ",
51
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
52
- tc: "Terms and Conditions",
53
- privacy: "Privacy Policy",
54
- sms: "I consent to receive marketing communication via SMS.",
55
- emailmarketing: "I consent to receive marketing communication via Email."
56
- },
57
- };
58
- export const getTranslations = (url) => {
59
- // fetch url, get the data, replace the TRANSLATIONS content
60
- return new Promise((resolve) => {
61
- fetch(url)
62
- .then((res) => res.json())
63
- .then((data) => {
64
- Object.keys(data).forEach((item) => {
65
- for (let key in data[item]) {
66
- TRANSLATIONS[item][key] = data[item][key];
67
- }
68
- });
69
- resolve(true);
70
- });
71
- });
72
- };
73
- export const translate = (key, customLang, values) => {
74
- const lang = customLang;
75
- let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
76
- if (values !== undefined) {
77
- for (const [key, value] of Object.entries(values.values)) {
78
- const regex = new RegExp(`{${key}}`, 'g');
79
- translation = translation.replace(regex, value);
80
- }
81
- }
82
- return translation;
83
- };
@@ -3,58 +3,94 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
5
5
  en: {
6
- termsandconditions1: "I accept the ",
7
- termsandconditions2: ", I have read and understood the ",
8
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
9
- tc: "Terms and Conditions",
10
- privacy: "Privacy Policy",
6
+ termsAndConditions: {
7
+ acceptPart1: "I accept the ",
8
+ acceptPart2: ", I have read and understood the ",
9
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
10
+ tc: "Terms and Conditions"
11
+ },
12
+ privacyPolicy: {
13
+ readUnderstandPart1: "I have read and understood the ",
14
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
15
+ privacy: "Privacy Policy"
16
+ },
11
17
  sms: "I consent to receive marketing communication via SMS.",
12
- emailmarketing: "I consent to receive marketing communication via Email."
18
+ email: "I consent to receive marketing communication via Email."
13
19
  },
14
20
  ro: {
15
- termsandconditions1: "Accept ",
16
- termsandconditions2: " platformei. Am citit şi înţeles ",
17
- termsandconditions3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
18
- tc: "Termenii şi condiţiile",
19
- privacy: "Politica de confidenţialitate",
21
+ termsAndConditions: {
22
+ acceptPart1: "Accept ",
23
+ acceptPart2: " platformei. Am citit şi înţeles ",
24
+ acceptPart3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
25
+ tc: "Termenii şi condiţiile"
26
+ },
27
+ privacyPolicy: {
28
+ readUnderstandPart1: "Am citit şi înţeles ",
29
+ readUnderstandPart2: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
30
+ privacy: "Politica de confidenţialitate"
31
+ },
20
32
  sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
21
- emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
33
+ email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
22
34
  },
23
35
  hr: {
24
- termsandconditions1: "I accept the ",
25
- termsandconditions2: ", I have read and understood the ",
26
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
27
- tc: "Terms and Conditions",
28
- privacy: "Privacy Policy",
36
+ termsAndConditions: {
37
+ acceptPart1: "I accept the ",
38
+ acceptPart2: ", I have read and understood the ",
39
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
40
+ tc: "Terms and Conditions"
41
+ },
42
+ privacyPolicy: {
43
+ readUnderstandPart1: "I have read and understood the ",
44
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
45
+ privacy: "Privacy Policy"
46
+ },
29
47
  sms: "I consent to receive marketing communication via SMS.",
30
- emailmarketing: "I consent to receive marketing communication via Email."
48
+ email: "I consent to receive marketing communication via Email."
31
49
  },
32
50
  fr: {
33
- termsandconditions1: "I accept the ",
34
- termsandconditions2: ", I have read and understood the ",
35
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
36
- tc: "Terms and Conditions",
37
- privacy: "Privacy Policy",
51
+ termsAndConditions: {
52
+ acceptPart1: "I accept the ",
53
+ acceptPart2: ", I have read and understood the ",
54
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
55
+ tc: "Terms and Conditions"
56
+ },
57
+ privacyPolicy: {
58
+ readUnderstandPart1: "I have read and understood the ",
59
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
60
+ privacy: "Privacy Policy"
61
+ },
38
62
  sms: "I consent to receive marketing communication via SMS.",
39
- emailmarketing: "I consent to receive marketing communication via Email."
63
+ email: "I consent to receive marketing communication via Email."
40
64
  },
41
65
  cs: {
42
- termsandconditions1: "I accept the ",
43
- termsandconditions2: ", I have read and understood the ",
44
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
45
- tc: "Terms and Conditions",
46
- privacy: "Privacy Policy",
66
+ termsAndConditions: {
67
+ acceptPart1: "I accept the ",
68
+ acceptPart2: ", I have read and understood the ",
69
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
70
+ tc: "Terms and Conditions"
71
+ },
72
+ privacyPolicy: {
73
+ readUnderstandPart1: "I have read and understood the ",
74
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
75
+ privacy: "Privacy Policy"
76
+ },
47
77
  sms: "I consent to receive marketing communication via SMS.",
48
- emailmarketing: "I consent to receive marketing communication via Email."
78
+ email: "I consent to receive marketing communication via Email."
49
79
  },
50
80
  de: {
51
- termsandconditions1: "I accept the ",
52
- termsandconditions2: ", I have read and understood the ",
53
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
54
- tc: "Terms and Conditions",
55
- privacy: "Privacy Policy",
81
+ termsAndConditions: {
82
+ acceptPart1: "I accept the ",
83
+ acceptPart2: ", I have read and understood the ",
84
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
85
+ tc: "Terms and Conditions"
86
+ },
87
+ privacyPolicy: {
88
+ readUnderstandPart1: "I have read and understood the ",
89
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
90
+ privacy: "Privacy Policy"
91
+ },
56
92
  sms: "I consent to receive marketing communication via SMS.",
57
- emailmarketing: "I consent to receive marketing communication via Email."
93
+ email: "I consent to receive marketing communication via Email."
58
94
  },
59
95
  };
60
96
  const getTranslations = (url) => {
@@ -73,12 +109,18 @@ const getTranslations = (url) => {
73
109
  });
74
110
  };
75
111
  const translate = (key, customLang, values) => {
76
- const lang = customLang;
77
- let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
112
+ const lang = customLang || DEFAULT_LANGUAGE;
113
+ const getNestedTranslation = (obj, path) => {
114
+ return path.split('.').reduce((o, k) => (o && o[k] !== undefined ? o[k] : null), obj);
115
+ };
116
+ let translation = getNestedTranslation(TRANSLATIONS[lang], key);
117
+ if (translation === null) {
118
+ return key;
119
+ }
78
120
  if (values !== undefined) {
79
- for (const [key, value] of Object.entries(values.values)) {
80
- const regex = new RegExp(`{${key}}`, 'g');
81
- translation = translation.replace(regex, value);
121
+ for (const [k, v] of Object.entries(values)) {
122
+ const regex = new RegExp(`{${k}}`, 'g');
123
+ translation = translation.replace(regex, v);
82
124
  }
83
125
  }
84
126
  return translation;
@@ -108,6 +150,10 @@ const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
108
150
  * wether or not this consent is mandatory. Used for render details
109
151
  */
110
152
  this.mandatory = false;
153
+ /**
154
+ * Select GM version
155
+ */
156
+ this.gmVersion = '';
111
157
  /**
112
158
  * the title of the consent to be displayed
113
159
  */
@@ -157,9 +203,20 @@ const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
157
203
  // end custom styling area
158
204
  }
159
205
  determineTextContent() {
160
- return this.consentType === 'termsandconditions' ?
161
- h("p", null, translate('termsandconditions1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
162
- : h("p", null, translate(this.consentType, this.lang));
206
+ if (this.gmVersion === 'gmcore') {
207
+ if (this.consentType === 'termsandconditions') {
208
+ return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)), translate('termsAndConditions.acceptPart2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)), translate('termsAndConditions.acceptPart3', this.lang));
209
+ }
210
+ }
211
+ if (this.gmVersion === 'gm16') {
212
+ if (this.consentType === 'termsandconditions') {
213
+ return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)));
214
+ }
215
+ if (this.consentType === 'privacypolicy') {
216
+ return h("p", null, translate('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)), translate('privacyPolicy.readUnderstandPart2', this.lang));
217
+ }
218
+ }
219
+ return h("p", null, translate(this.consentType, this.lang));
163
220
  }
164
221
  render() {
165
222
  if (this.queried) {
@@ -176,6 +233,7 @@ const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
176
233
  "queried": [516],
177
234
  "consentType": [513, "consent-type"],
178
235
  "mandatory": [516],
236
+ "gmVersion": [1, "gm-version"],
179
237
  "consentTitle": [513, "consent-title"],
180
238
  "clientStyling": [1, "client-styling"],
181
239
  "translationUrl": [513, "translation-url"],
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
13
+ return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"gmVersion":[1,"gm-version"],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -3,58 +3,94 @@ import { r as registerInstance, c as createEvent, h } from './index-b34076ff.js'
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
5
5
  en: {
6
- termsandconditions1: "I accept the ",
7
- termsandconditions2: ", I have read and understood the ",
8
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
9
- tc: "Terms and Conditions",
10
- privacy: "Privacy Policy",
6
+ termsAndConditions: {
7
+ acceptPart1: "I accept the ",
8
+ acceptPart2: ", I have read and understood the ",
9
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
10
+ tc: "Terms and Conditions"
11
+ },
12
+ privacyPolicy: {
13
+ readUnderstandPart1: "I have read and understood the ",
14
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
15
+ privacy: "Privacy Policy"
16
+ },
11
17
  sms: "I consent to receive marketing communication via SMS.",
12
- emailmarketing: "I consent to receive marketing communication via Email."
18
+ email: "I consent to receive marketing communication via Email."
13
19
  },
14
20
  ro: {
15
- termsandconditions1: "Accept ",
16
- termsandconditions2: " platformei. Am citit şi înţeles ",
17
- termsandconditions3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
18
- tc: "Termenii şi condiţiile",
19
- privacy: "Politica de confidenţialitate",
21
+ termsAndConditions: {
22
+ acceptPart1: "Accept ",
23
+ acceptPart2: " platformei. Am citit şi înţeles ",
24
+ acceptPart3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
25
+ tc: "Termenii şi condiţiile"
26
+ },
27
+ privacyPolicy: {
28
+ readUnderstandPart1: "Am citit şi înţeles ",
29
+ readUnderstandPart2: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
30
+ privacy: "Politica de confidenţialitate"
31
+ },
20
32
  sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
21
- emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
33
+ email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
22
34
  },
23
35
  hr: {
24
- termsandconditions1: "I accept the ",
25
- termsandconditions2: ", I have read and understood the ",
26
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
27
- tc: "Terms and Conditions",
28
- privacy: "Privacy Policy",
36
+ termsAndConditions: {
37
+ acceptPart1: "I accept the ",
38
+ acceptPart2: ", I have read and understood the ",
39
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
40
+ tc: "Terms and Conditions"
41
+ },
42
+ privacyPolicy: {
43
+ readUnderstandPart1: "I have read and understood the ",
44
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
45
+ privacy: "Privacy Policy"
46
+ },
29
47
  sms: "I consent to receive marketing communication via SMS.",
30
- emailmarketing: "I consent to receive marketing communication via Email."
48
+ email: "I consent to receive marketing communication via Email."
31
49
  },
32
50
  fr: {
33
- termsandconditions1: "I accept the ",
34
- termsandconditions2: ", I have read and understood the ",
35
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
36
- tc: "Terms and Conditions",
37
- privacy: "Privacy Policy",
51
+ termsAndConditions: {
52
+ acceptPart1: "I accept the ",
53
+ acceptPart2: ", I have read and understood the ",
54
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
55
+ tc: "Terms and Conditions"
56
+ },
57
+ privacyPolicy: {
58
+ readUnderstandPart1: "I have read and understood the ",
59
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
60
+ privacy: "Privacy Policy"
61
+ },
38
62
  sms: "I consent to receive marketing communication via SMS.",
39
- emailmarketing: "I consent to receive marketing communication via Email."
63
+ email: "I consent to receive marketing communication via Email."
40
64
  },
41
65
  cs: {
42
- termsandconditions1: "I accept the ",
43
- termsandconditions2: ", I have read and understood the ",
44
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
45
- tc: "Terms and Conditions",
46
- privacy: "Privacy Policy",
66
+ termsAndConditions: {
67
+ acceptPart1: "I accept the ",
68
+ acceptPart2: ", I have read and understood the ",
69
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
70
+ tc: "Terms and Conditions"
71
+ },
72
+ privacyPolicy: {
73
+ readUnderstandPart1: "I have read and understood the ",
74
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
75
+ privacy: "Privacy Policy"
76
+ },
47
77
  sms: "I consent to receive marketing communication via SMS.",
48
- emailmarketing: "I consent to receive marketing communication via Email."
78
+ email: "I consent to receive marketing communication via Email."
49
79
  },
50
80
  de: {
51
- termsandconditions1: "I accept the ",
52
- termsandconditions2: ", I have read and understood the ",
53
- termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
54
- tc: "Terms and Conditions",
55
- privacy: "Privacy Policy",
81
+ termsAndConditions: {
82
+ acceptPart1: "I accept the ",
83
+ acceptPart2: ", I have read and understood the ",
84
+ acceptPart3: " as published on this site and confirm that I am over 18 years old.",
85
+ tc: "Terms and Conditions"
86
+ },
87
+ privacyPolicy: {
88
+ readUnderstandPart1: "I have read and understood the ",
89
+ readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
90
+ privacy: "Privacy Policy"
91
+ },
56
92
  sms: "I consent to receive marketing communication via SMS.",
57
- emailmarketing: "I consent to receive marketing communication via Email."
93
+ email: "I consent to receive marketing communication via Email."
58
94
  },
59
95
  };
60
96
  const getTranslations = (url) => {
@@ -73,12 +109,18 @@ const getTranslations = (url) => {
73
109
  });
74
110
  };
75
111
  const translate = (key, customLang, values) => {
76
- const lang = customLang;
77
- let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
112
+ const lang = customLang || DEFAULT_LANGUAGE;
113
+ const getNestedTranslation = (obj, path) => {
114
+ return path.split('.').reduce((o, k) => (o && o[k] !== undefined ? o[k] : null), obj);
115
+ };
116
+ let translation = getNestedTranslation(TRANSLATIONS[lang], key);
117
+ if (translation === null) {
118
+ return key;
119
+ }
78
120
  if (values !== undefined) {
79
- for (const [key, value] of Object.entries(values.values)) {
80
- const regex = new RegExp(`{${key}}`, 'g');
81
- translation = translation.replace(regex, value);
121
+ for (const [k, v] of Object.entries(values)) {
122
+ const regex = new RegExp(`{${k}}`, 'g');
123
+ translation = translation.replace(regex, v);
82
124
  }
83
125
  }
84
126
  return translation;
@@ -106,6 +148,10 @@ const PlayerUserConsents = class {
106
148
  * wether or not this consent is mandatory. Used for render details
107
149
  */
108
150
  this.mandatory = false;
151
+ /**
152
+ * Select GM version
153
+ */
154
+ this.gmVersion = '';
109
155
  /**
110
156
  * the title of the consent to be displayed
111
157
  */
@@ -155,9 +201,20 @@ const PlayerUserConsents = class {
155
201
  // end custom styling area
156
202
  }
157
203
  determineTextContent() {
158
- return this.consentType === 'termsandconditions' ?
159
- h("p", null, translate('termsandconditions1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
160
- : h("p", null, translate(this.consentType, this.lang));
204
+ if (this.gmVersion === 'gmcore') {
205
+ if (this.consentType === 'termsandconditions') {
206
+ return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)), translate('termsAndConditions.acceptPart2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)), translate('termsAndConditions.acceptPart3', this.lang));
207
+ }
208
+ }
209
+ if (this.gmVersion === 'gm16') {
210
+ if (this.consentType === 'termsandconditions') {
211
+ return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tc', this.lang)));
212
+ }
213
+ if (this.consentType === 'privacypolicy') {
214
+ return h("p", null, translate('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacy', this.lang)), translate('privacyPolicy.readUnderstandPart2', this.lang));
215
+ }
216
+ }
217
+ return h("p", null, translate(this.consentType, this.lang));
161
218
  }
162
219
  render() {
163
220
  if (this.queried) {
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
16
+ return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"gmVersion":[1,"gm-version"],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
17
17
  });
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-b1139724.js";const a={en:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},ro:{termsAndConditions:{acceptPart1:"Accept ",acceptPart2:" platformei. Am citit şi înţeles ",acceptPart3:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",tc:"Termenii şi condiţiile"},privacyPolicy:{readUnderstandPart1:"Am citit şi înţeles ",readUnderstandPart2:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",privacy:"Politica de confidenţialitate"},sms:"Sunt de acord să primesc promoţii de marketing prin SMS.",email:"Sunt de acord să primesc promoţii de marketing pe e-mail."},hr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},fr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},cs:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},de:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."}},n=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])a[e][i]=t[e][i]})),e(!0)}))})),s=(t,e,i)=>{let n=(s=a[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),s));var s;if(null===n)return t;if(void 0!==i)for(const[t,e]of Object.entries(i)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},r=class{constructor(i){t(this,i),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1,this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}handleNewTranslations(){n(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await n(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}determineTextContent(){if("gmcore"===this.gmVersion&&"termsandconditions"===this.consentType)return i("p",null,s("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},s("termsAndConditions.tc",this.lang)),s("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},s("privacyPolicy.privacy",this.lang)),s("termsAndConditions.acceptPart3",this.lang));if("gm16"===this.gmVersion){if("termsandconditions"===this.consentType)return i("p",null,s("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},s("termsAndConditions.tc",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,s("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},s("privacyPolicy.privacy",this.lang)),s("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,s(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{ref:t=>this.stylingContainer=t},i("p",{class:"ConsentTitle"},this.consentTitle),i("label",{class:"UserConsent",htmlFor:"userConsent"},i("input",{ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};r.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";export{r as player_user_consents}
@@ -1 +1 @@
1
- import{p as t,b as n}from"./p-b1139724.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((t=>n([["p-51068378",[[1,"player-user-consents",{lang:[1537],queried:[516],consentType:[513,"consent-type"],mandatory:[516],consentTitle:[513,"consent-title"],clientStyling:[1,"client-styling"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]}]]]],t)));
1
+ import{p as n,b as t}from"./p-b1139724.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-3825462d",[[1,"player-user-consents",{lang:[1537],queried:[516],consentType:[513,"consent-type"],mandatory:[516],gmVersion:[1,"gm-version"],consentTitle:[513,"consent-title"],clientStyling:[1,"client-styling"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]}]]]],n)));
@@ -16,6 +16,10 @@ export declare class PlayerUserConsents {
16
16
  * wether or not this consent is mandatory. Used for render details
17
17
  */
18
18
  mandatory: boolean;
19
+ /**
20
+ * Select GM version
21
+ */
22
+ gmVersion: string;
19
23
  /**
20
24
  * the title of the consent to be displayed
21
25
  */
@@ -19,6 +19,10 @@ export namespace Components {
19
19
  * the type of the consent, used to determine render details
20
20
  */
21
21
  "consentType": string;
22
+ /**
23
+ * Select GM version
24
+ */
25
+ "gmVersion": string;
22
26
  /**
23
27
  * Language
24
28
  */
@@ -62,6 +66,10 @@ declare namespace LocalJSX {
62
66
  * the type of the consent, used to determine render details
63
67
  */
64
68
  "consentType"?: string;
69
+ /**
70
+ * Select GM version
71
+ */
72
+ "gmVersion"?: string;
65
73
  /**
66
74
  * Language
67
75
  */
@@ -0,0 +1,2 @@
1
+ export declare const getTranslations: (url: string) => Promise<unknown>;
2
+ export declare const translate: (key: string, customLang?: string, values?: any) => string;
@@ -1,2 +0,0 @@
1
- export declare const getTranslations: (url: string) => Promise<unknown>;
2
- export declare const translate: (key: string, customLang?: any, values?: any) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-user-consents",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as i,c as t,h as n}from"./p-b1139724.js";const e={en:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},ro:{termsandconditions1:"Accept ",termsandconditions2:" platformei. Am citit şi înţeles ",termsandconditions3:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",tc:"Termenii şi condiţiile",privacy:"Politica de confidenţialitate",sms:"Sunt de acord să primesc promoţii de marketing prin SMS.",emailmarketing:"Sunt de acord să primesc promoţii de marketing pe e-mail."},hr:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},fr:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},cs:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},de:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."}},s=i=>new Promise((t=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((t=>{for(let n in i[t])e[t][n]=i[t][n]})),t(!0)}))})),o=(i,t,n)=>{let s=e[void 0!==t?t:"en"][i];if(void 0!==n)for(const[i,t]of Object.entries(n.values)){const n=new RegExp(`{${i}}`,"g");s=s.replace(n,t)}return s},a=class{constructor(n){i(this,n),this.userLegislationConsent=t(this,"userLegislationConsent",7),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.consentTitle="",this.clientStyling="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1,this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)}}handleNewTranslations(){s(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await s(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}determineTextContent(){return"termsandconditions"===this.consentType?n("p",null,o("termsandconditions1",this.lang),n("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},o("tc",this.lang)),o("termsandconditions2",this.lang),n("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},o("privacy",this.lang)),o("termsandconditions3",this.lang)):n("p",null,o(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),n("div",{ref:i=>this.stylingContainer=i},n("p",{class:"ConsentTitle"},this.consentTitle),n("label",{class:"UserConsent",htmlFor:"userConsent"},n("input",{ref:i=>this.checkboxInput=i,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&n("span",{class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};a.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";export{a as player_user_consents}