@everymatrix/user-action-controller 1.31.2 → 1.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +3 -2
- package/dist/cjs/index-87049e21.js +0 -1300
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/player-user-consents_2.cjs.entry.js +0 -370
- package/dist/cjs/user-action-controller.cjs.js +0 -19
- package/dist/collection/collection-manifest.json +0 -19
- package/dist/collection/components/user-action-controller/user-action-controller.css +0 -89
- package/dist/collection/components/user-action-controller/user-action-controller.js +0 -440
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/locale.utils.js +0 -60
- package/dist/collection/utils/utils.js +0 -3
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/player-user-consents.js +0 -6
- package/dist/components/player-user-consents2.js +0 -114
- package/dist/components/user-action-controller.d.ts +0 -11
- package/dist/components/user-action-controller.js +0 -323
- package/dist/esm/index-71f14530.js +0 -1274
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/player-user-consents_2.entry.js +0 -365
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/user-action-controller.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil.config.js +0 -22
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/user-action-controller/.stencil/packages/user-action-controller/stencil.config.d.ts +0 -2
- package/dist/types/components/user-action-controller/user-action-controller.d.ts +0 -78
- package/dist/types/components.d.ts +0 -125
- package/dist/types/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/locale.utils.d.ts +0 -2
- package/dist/types/utils/utils.d.ts +0 -1
- package/dist/user-action-controller/index.esm.js +0 -0
- package/dist/user-action-controller/p-711fa494.entry.js +0 -1
- package/dist/user-action-controller/p-ba444709.js +0 -1
- package/dist/user-action-controller/user-action-controller.esm.js +0 -1
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
package/dist/cjs/index.cjs.js
DELETED
package/dist/cjs/loader.cjs.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-87049e21.js');
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
-
*/
|
|
10
|
-
const patchEsm = () => {
|
|
11
|
-
return index.promiseResolve();
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const defineCustomElements = (win, options) => {
|
|
15
|
-
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
-
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"submitButtonText":[513,"submit-button-text"],"userNoticeText":[513,"user-notice-text"],"gmVersion":[1,"gm-version"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"queryFired":[32],"readyActionsCount":[32],"activeUserActions":[32],"userActionsValidated":[32],"receivedQueryResponses":[32],"limitStylingAppends":[32],"isLoading":[32],"mandatoryActionsChecked":[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-user-consents",{"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"tcLink":[513,"tc-link"],"privacyLink":[513,"privacy-link"],"clientStyling":[1,"client-styling"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
exports.defineCustomElements = defineCustomElements;
|
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-87049e21.js');
|
|
6
|
-
|
|
7
|
-
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.userConsent:hover{border-bottom:1px solid #000;cursor:pointer}.MandatoryItem{color:#f00;font-size:1.2rem}";
|
|
8
|
-
|
|
9
|
-
const PlayerUserConsents = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.userLegislationConsent = index.createEvent(this, "userLegislationConsent", 7);
|
|
13
|
-
/**
|
|
14
|
-
* 'true' when parent expects component to emit it's current value
|
|
15
|
-
*/
|
|
16
|
-
this.queried = false;
|
|
17
|
-
/**
|
|
18
|
-
* the type of the consent, used to determine render details
|
|
19
|
-
*/
|
|
20
|
-
this.consentType = '';
|
|
21
|
-
/**
|
|
22
|
-
* wether or not this consent is mandatory. Used for render details
|
|
23
|
-
*/
|
|
24
|
-
this.mandatory = false;
|
|
25
|
-
/**
|
|
26
|
-
* the title of the consent to be displayed
|
|
27
|
-
*/
|
|
28
|
-
this.consentTitle = '';
|
|
29
|
-
/**
|
|
30
|
-
* link to the t&c page
|
|
31
|
-
*/
|
|
32
|
-
this.tcLink = '#';
|
|
33
|
-
/**
|
|
34
|
-
* link to privacy policy page
|
|
35
|
-
*/
|
|
36
|
-
this.privacyLink = '#';
|
|
37
|
-
/**
|
|
38
|
-
* Client custom styling via inline style
|
|
39
|
-
*/
|
|
40
|
-
this.clientStyling = '';
|
|
41
|
-
/**
|
|
42
|
-
* the text content to be rendered by the component. Determined at runtime
|
|
43
|
-
*/
|
|
44
|
-
this.textContent = '';
|
|
45
|
-
this.limitStylingAppends = false;
|
|
46
|
-
// Maybe switch this out with a localization source
|
|
47
|
-
this.stringVariants = {
|
|
48
|
-
termsandconditions1: "I accept the ",
|
|
49
|
-
termsandconditions2: ", I have read and understood the ",
|
|
50
|
-
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
51
|
-
tc: "Terms and Conditions",
|
|
52
|
-
privacy: "Privacy Policy",
|
|
53
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
54
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
55
|
-
};
|
|
56
|
-
this.setClientStyling = () => {
|
|
57
|
-
let sheet = document.createElement('style');
|
|
58
|
-
sheet.innerHTML = this.clientStyling;
|
|
59
|
-
this.stylingContainer.prepend(sheet);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
determineTextContent() {
|
|
63
|
-
let result = this.consentType === 'termsandconditions' ?
|
|
64
|
-
index.h("span", null, this.stringVariants['termsandconditions1'], index.h("a", { href: this.tcLink }, this.stringVariants['tc']), this.stringVariants['termsandconditions2'], index.h("a", { href: this.privacyLink }, this.stringVariants['privacy']), this.stringVariants['termsandconditions3'])
|
|
65
|
-
: index.h("span", null, this.stringVariants[this.consentType]);
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
userLegislationConsentHandler() {
|
|
69
|
-
this.userLegislationConsent.emit({
|
|
70
|
-
type: this.consentType,
|
|
71
|
-
value: this.checkboxInput.checked
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
componentDidRender() {
|
|
75
|
-
// start custom styling area
|
|
76
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
77
|
-
if (this.clientStyling)
|
|
78
|
-
this.setClientStyling();
|
|
79
|
-
this.limitStylingAppends = true;
|
|
80
|
-
}
|
|
81
|
-
// end custom styling area
|
|
82
|
-
}
|
|
83
|
-
render() {
|
|
84
|
-
if (this.queried) {
|
|
85
|
-
this.userLegislationConsentHandler();
|
|
86
|
-
}
|
|
87
|
-
this.textContent = this.determineTextContent();
|
|
88
|
-
return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("p", { class: "ConsentTitle" }, this.consentTitle), index.h("label", { class: "userConsent", htmlFor: "userConsent" }, index.h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.textContent, this.mandatory && index.h("span", { class: "MandatoryItem" }, "*"))));
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
PlayerUserConsents.style = playerUserConsentsCss;
|
|
92
|
-
|
|
93
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
94
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
|
|
95
|
-
const TRANSLATIONS = {
|
|
96
|
-
en: {
|
|
97
|
-
termsandconditions: 'Terms and Conditions',
|
|
98
|
-
sms: 'SMS marketing',
|
|
99
|
-
emailmarketing: 'Email marketing'
|
|
100
|
-
},
|
|
101
|
-
ro: {
|
|
102
|
-
termsandconditions: 'Terms and Conditions',
|
|
103
|
-
sms: 'SMS marketing',
|
|
104
|
-
emailmarketing: 'Email marketing'
|
|
105
|
-
},
|
|
106
|
-
hr: {
|
|
107
|
-
termsandconditions: 'Terms and Conditions',
|
|
108
|
-
sms: 'SMS marketing',
|
|
109
|
-
emailmarketing: 'Email marketing'
|
|
110
|
-
},
|
|
111
|
-
fr: {
|
|
112
|
-
termsandconditions: 'Terms and Conditions',
|
|
113
|
-
sms: 'SMS marketing',
|
|
114
|
-
emailmarketing: 'Email marketing'
|
|
115
|
-
},
|
|
116
|
-
cs: {
|
|
117
|
-
termsandconditions: 'Terms and Conditions',
|
|
118
|
-
sms: 'SMS marketing',
|
|
119
|
-
emailmarketing: 'Email marketing'
|
|
120
|
-
},
|
|
121
|
-
de: {
|
|
122
|
-
termsandconditions: 'Terms and Conditions',
|
|
123
|
-
sms: 'SMS marketing',
|
|
124
|
-
emailmarketing: 'Email marketing'
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
const getTranslations = (url) => {
|
|
128
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
129
|
-
return new Promise((resolve) => {
|
|
130
|
-
fetch(url)
|
|
131
|
-
.then((res) => res.json())
|
|
132
|
-
.then((data) => {
|
|
133
|
-
Object.keys(data).forEach((item) => {
|
|
134
|
-
for (let key in data[item]) {
|
|
135
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
resolve(true);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
const translate = (key, customLang, values) => {
|
|
143
|
-
const lang = customLang;
|
|
144
|
-
let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
145
|
-
if (values !== undefined) {
|
|
146
|
-
for (const [key, value] of Object.entries(values.values)) {
|
|
147
|
-
const regex = new RegExp(`{${key}}`, 'g');
|
|
148
|
-
translation = translation.replace(regex, value);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return translation;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
|
|
155
|
-
|
|
156
|
-
const UserActionController = class {
|
|
157
|
-
constructor(hostRef) {
|
|
158
|
-
index.registerInstance(this, hostRef);
|
|
159
|
-
/**
|
|
160
|
-
* Language
|
|
161
|
-
*/
|
|
162
|
-
this.lang = 'en';
|
|
163
|
-
/**
|
|
164
|
-
* Select GM version
|
|
165
|
-
*/
|
|
166
|
-
this.gmVersion = '';
|
|
167
|
-
/**
|
|
168
|
-
* Translation url
|
|
169
|
-
*/
|
|
170
|
-
this.translationUrl = '';
|
|
171
|
-
/**
|
|
172
|
-
* Client custom styling via inline style
|
|
173
|
-
*/
|
|
174
|
-
this.clientStyling = '';
|
|
175
|
-
/**
|
|
176
|
-
* Client custom styling via url
|
|
177
|
-
*/
|
|
178
|
-
this.clientStylingUrl = '';
|
|
179
|
-
/**
|
|
180
|
-
* Which actions are required in order to activate the "Apply" button. Other actions are considered optional.
|
|
181
|
-
*/
|
|
182
|
-
this.queryFired = false;
|
|
183
|
-
this.readyActionsCount = 0;
|
|
184
|
-
this.activeUserActions = [];
|
|
185
|
-
this.userActionsValidated = true;
|
|
186
|
-
this.receivedQueryResponses = 0;
|
|
187
|
-
this.limitStylingAppends = false;
|
|
188
|
-
this.isLoading = true;
|
|
189
|
-
this.mandatoryActionsChecked = 0;
|
|
190
|
-
//for now this variable is hardcoded bcs we have only terms and conditions mandatory and we dont receive with these new functionality the mandatory actions
|
|
191
|
-
this.mandatoryActions = ['termsandconditions'];
|
|
192
|
-
this.userActions = [];
|
|
193
|
-
this.consentTitles = {
|
|
194
|
-
termsandconditions: translate('termsandconditions', this.lang),
|
|
195
|
-
sms: translate('sms', this.lang),
|
|
196
|
-
emailmarketing: translate('emailmarketing', this.lang)
|
|
197
|
-
};
|
|
198
|
-
this.setClientStyling = () => {
|
|
199
|
-
let sheet = document.createElement('style');
|
|
200
|
-
sheet.innerHTML = this.clientStyling;
|
|
201
|
-
this.stylingContainer.prepend(sheet);
|
|
202
|
-
};
|
|
203
|
-
this.setClientStylingURL = () => {
|
|
204
|
-
let url = new URL(this.clientStylingUrl);
|
|
205
|
-
let cssFile = document.createElement('style');
|
|
206
|
-
fetch(url.href)
|
|
207
|
-
.then((res) => res.text())
|
|
208
|
-
.then((data) => {
|
|
209
|
-
this.clientStyling = data;
|
|
210
|
-
cssFile.innerHTML = data;
|
|
211
|
-
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
212
|
-
})
|
|
213
|
-
.catch((err) => {
|
|
214
|
-
console.log('error ', err);
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
handleNewTranslations() {
|
|
219
|
-
getTranslations(this.translationUrl);
|
|
220
|
-
}
|
|
221
|
-
handleQueryResponse() {
|
|
222
|
-
if (this.receivedQueryResponses === this.activeUserActions.length) {
|
|
223
|
-
this.updateUserConsents();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
userLegislationConsentHandler(event) {
|
|
227
|
-
const actionType = event.detail.type;
|
|
228
|
-
const actionTypeChecked = event.detail.value;
|
|
229
|
-
if (this.mandatoryActions.includes(actionType) && this.queryFired === false) {
|
|
230
|
-
actionTypeChecked === true ? this.mandatoryActionsChecked++ : this.mandatoryActionsChecked--;
|
|
231
|
-
}
|
|
232
|
-
// Register final user choices only if we're ready to update
|
|
233
|
-
if (this.queryFired) {
|
|
234
|
-
this.userActions.push({ tagCode: actionType, status: actionTypeChecked ? 'Accepted' : 'Denied' });
|
|
235
|
-
this.receivedQueryResponses++;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
determineUserActions() {
|
|
239
|
-
const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
|
|
240
|
-
const headers = new Headers();
|
|
241
|
-
headers.append('X-SessionId', this.userSession);
|
|
242
|
-
let requestOptions;
|
|
243
|
-
requestOptions = {
|
|
244
|
-
method: 'GET',
|
|
245
|
-
headers
|
|
246
|
-
};
|
|
247
|
-
if (url && requestOptions) {
|
|
248
|
-
return fetch(url.href, requestOptions)
|
|
249
|
-
.then(res => res.json())
|
|
250
|
-
.then(data => {
|
|
251
|
-
const actionItems = data.items;
|
|
252
|
-
actionItems.forEach(element => {
|
|
253
|
-
if (element.status === 'Expired') {
|
|
254
|
-
this.activeUserActions.push(element.tagCode);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
this.isLoading = false;
|
|
258
|
-
})
|
|
259
|
-
.catch(error => {
|
|
260
|
-
console.error('Error fetching data:', error);
|
|
261
|
-
this.isLoading = false;
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
return Promise.reject('Unsupported endpoint');
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
updateUserConsents() {
|
|
269
|
-
let url;
|
|
270
|
-
let requestOptions;
|
|
271
|
-
url = (this.gmVersion === 'gmcore')
|
|
272
|
-
? new URL(`${this.endpoint}/v1/player/${this.userId}/consent`)
|
|
273
|
-
: new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
|
|
274
|
-
const body = (this.gmVersion === 'gmcore')
|
|
275
|
-
? {
|
|
276
|
-
items: this.userActions
|
|
277
|
-
}
|
|
278
|
-
: {
|
|
279
|
-
consents: [
|
|
280
|
-
{
|
|
281
|
-
tagCode: "termsandconditions",
|
|
282
|
-
note: "",
|
|
283
|
-
status: 1
|
|
284
|
-
}
|
|
285
|
-
]
|
|
286
|
-
};
|
|
287
|
-
requestOptions = {
|
|
288
|
-
method: 'POST',
|
|
289
|
-
headers: {
|
|
290
|
-
'Content-Type': 'application/json',
|
|
291
|
-
'Accept': 'application/json',
|
|
292
|
-
'X-SessionId': `${this.userSession}`,
|
|
293
|
-
},
|
|
294
|
-
body: JSON.stringify(body)
|
|
295
|
-
};
|
|
296
|
-
if (url && requestOptions) {
|
|
297
|
-
fetch(url.href, requestOptions)
|
|
298
|
-
.then(res => res.json())
|
|
299
|
-
.then(() => {
|
|
300
|
-
window.postMessage({
|
|
301
|
-
type: 'WidgetNotification',
|
|
302
|
-
data: {
|
|
303
|
-
type: 'success',
|
|
304
|
-
message: 'Consent update successful!'
|
|
305
|
-
}
|
|
306
|
-
}, window.location.href);
|
|
307
|
-
})
|
|
308
|
-
.catch((err) => {
|
|
309
|
-
window.postMessage({
|
|
310
|
-
type: 'WidgetNotification',
|
|
311
|
-
data: {
|
|
312
|
-
type: 'error',
|
|
313
|
-
message: 'Server might not be responding',
|
|
314
|
-
err
|
|
315
|
-
}
|
|
316
|
-
}, window.location.href);
|
|
317
|
-
})
|
|
318
|
-
.finally(() => {
|
|
319
|
-
window.postMessage({ type: 'UserActionsCompleted' }, window.location.href);
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
handleApplyClick() {
|
|
324
|
-
this.queryFired = true;
|
|
325
|
-
}
|
|
326
|
-
async componentWillLoad() {
|
|
327
|
-
if (this.gmVersion === 'gmcore') {
|
|
328
|
-
return this.determineUserActions();
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
this.activeUserActions = ['termsandconditions'];
|
|
332
|
-
this.isLoading = false;
|
|
333
|
-
}
|
|
334
|
-
if (this.translationUrl.length > 2) {
|
|
335
|
-
await getTranslations(this.translationUrl);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
componentDidRender() {
|
|
339
|
-
// start custom styling area
|
|
340
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
341
|
-
if (this.clientStyling)
|
|
342
|
-
this.setClientStyling();
|
|
343
|
-
if (this.clientStylingUrl)
|
|
344
|
-
this.setClientStylingURL();
|
|
345
|
-
this.limitStylingAppends = true;
|
|
346
|
-
}
|
|
347
|
-
// end custom styling area
|
|
348
|
-
}
|
|
349
|
-
render() {
|
|
350
|
-
const isMandatoryPresent = this.mandatoryActions.every(action => this.activeUserActions.includes(action));
|
|
351
|
-
if (isMandatoryPresent) {
|
|
352
|
-
this.userActionsValidated = !(this.mandatoryActionsChecked === this.mandatoryActions.length);
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
this.userActionsValidated = false;
|
|
356
|
-
}
|
|
357
|
-
return (index.h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (index.h("slot", { name: 'spinner' })
|
|
358
|
-
&&
|
|
359
|
-
index.h("svg", { class: "spinner", viewBox: "0 0 50 50" }, index.h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (index.h("div", { class: "UserActionController" }, index.h("h2", { class: "UserConsentNotice" }, this.userNoticeText), index.h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (index.h("slot", { name: action }, index.h("player-user-consents", { slot: action, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
|
|
360
|
-
index.h("button", { class: "ConsentSubmitButton", disabled: this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
|
|
361
|
-
}
|
|
362
|
-
static get watchers() { return {
|
|
363
|
-
"translationUrl": ["handleNewTranslations"],
|
|
364
|
-
"receivedQueryResponses": ["handleQueryResponse"]
|
|
365
|
-
}; }
|
|
366
|
-
};
|
|
367
|
-
UserActionController.style = userActionControllerCss;
|
|
368
|
-
|
|
369
|
-
exports.player_user_consents = PlayerUserConsents;
|
|
370
|
-
exports.user_action_controller = UserActionController;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-87049e21.js');
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
-
*/
|
|
8
|
-
const patchBrowser = () => {
|
|
9
|
-
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-action-controller.cjs.js', document.baseURI).href));
|
|
10
|
-
const opts = {};
|
|
11
|
-
if (importMeta !== '') {
|
|
12
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
-
}
|
|
14
|
-
return index.promiseResolve(opts);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"submitButtonText":[513,"submit-button-text"],"userNoticeText":[513,"user-notice-text"],"gmVersion":[1,"gm-version"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"queryFired":[32],"readyActionsCount":[32],"activeUserActions":[32],"userActionsValidated":[32],"receivedQueryResponses":[32],"limitStylingAppends":[32],"isLoading":[32],"mandatoryActionsChecked":[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-user-consents",{"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"tcLink":[513,"tc-link"],"privacyLink":[513,"privacy-link"],"clientStyling":[1,"client-styling"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
19
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"entries": [
|
|
3
|
-
"./components/user-action-controller/user-action-controller.js"
|
|
4
|
-
],
|
|
5
|
-
"compiler": {
|
|
6
|
-
"name": "@stencil/core",
|
|
7
|
-
"version": "2.15.2",
|
|
8
|
-
"typescriptVersion": "4.5.4"
|
|
9
|
-
},
|
|
10
|
-
"collections": [
|
|
11
|
-
{
|
|
12
|
-
"name": "@everymatrix/player-user-consents",
|
|
13
|
-
"tags": [
|
|
14
|
-
"player-user-consents"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"bundles": []
|
|
19
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.QueryReferenceContainer {
|
|
6
|
-
height: 100%;
|
|
7
|
-
width: 100%;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.UserConsentNotice {
|
|
11
|
-
font-size: 1.2rem;
|
|
12
|
-
font-weight: 200;
|
|
13
|
-
text-align: center;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.CloseButton {
|
|
17
|
-
width: 25px;
|
|
18
|
-
height: 25px;
|
|
19
|
-
align-self: flex-end;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.UserActionController {
|
|
23
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
24
|
-
font-weight: 100;
|
|
25
|
-
height: 100%;
|
|
26
|
-
width: 100%;
|
|
27
|
-
padding: 1rem 1.5rem 2rem;
|
|
28
|
-
background-color: #fff;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
justify-content: space-between;
|
|
32
|
-
border-radius: 5%;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.ConsentSubmitButton {
|
|
36
|
-
font-size: 1rem;
|
|
37
|
-
padding: 0.4rem 1.4rem;
|
|
38
|
-
background: #fff;
|
|
39
|
-
border: 2px solid #000;
|
|
40
|
-
color: #000;
|
|
41
|
-
border-radius: 5px;
|
|
42
|
-
align-self: flex-end;
|
|
43
|
-
}
|
|
44
|
-
.ConsentSubmitButton:disabled {
|
|
45
|
-
border: 2px solid #ccc;
|
|
46
|
-
color: #ccc;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@media screen and (max-width: 320px) {
|
|
50
|
-
.QueryReferenceContainer {
|
|
51
|
-
font-size: 0.8rem;
|
|
52
|
-
color: blue;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
.spinner {
|
|
56
|
-
animation: rotate 2s linear infinite;
|
|
57
|
-
z-index: 2;
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 50%;
|
|
60
|
-
left: 50%;
|
|
61
|
-
margin: -25px 0 0 -25px;
|
|
62
|
-
width: 50px;
|
|
63
|
-
height: 50px;
|
|
64
|
-
}
|
|
65
|
-
.spinner .path {
|
|
66
|
-
stroke: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));
|
|
67
|
-
stroke-linecap: round;
|
|
68
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@keyframes rotate {
|
|
72
|
-
100% {
|
|
73
|
-
transform: rotate(360deg);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
@keyframes dash {
|
|
77
|
-
0% {
|
|
78
|
-
stroke-dasharray: 1, 150;
|
|
79
|
-
stroke-dashoffset: 0;
|
|
80
|
-
}
|
|
81
|
-
50% {
|
|
82
|
-
stroke-dasharray: 90, 150;
|
|
83
|
-
stroke-dashoffset: -35;
|
|
84
|
-
}
|
|
85
|
-
100% {
|
|
86
|
-
stroke-dasharray: 90, 150;
|
|
87
|
-
stroke-dashoffset: -124;
|
|
88
|
-
}
|
|
89
|
-
}
|