@everymatrix/general-player-register-form-step3-nd 1.37.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/CHANGELOG.md +9 -0
- package/README.md +30 -0
- package/dist/general-player-register-form-step3-nd.js +2 -0
- package/dist/general-player-register-form-step3-nd.js.map +1 -0
- package/index.html +21 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +67 -0
- package/src/GeneralPlayerRegisterFormStep3Nd.svelte +780 -0
- package/src/i18n.js +27 -0
- package/src/index.ts +4 -0
- package/src/translations.js +192 -0
- package/stories/GeneralPlayerRegisterFormStep3.stories.js +13 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,780 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
import { _, addNewMessages, setLocale, setupI18n } from './i18n';
|
|
6
|
+
import { TRANSLATIONS } from './translations';
|
|
7
|
+
|
|
8
|
+
export let userconsentsexist:string = 'false';
|
|
9
|
+
export let termsconditions:string = 'false';
|
|
10
|
+
export let smsoffers:string = 'false';
|
|
11
|
+
export let emailmarketing:string = 'false';
|
|
12
|
+
export let endpoint:string = '';
|
|
13
|
+
export let captchakey:string = '';
|
|
14
|
+
export let lang:string = '';
|
|
15
|
+
|
|
16
|
+
// Possible disabled fields = ['address', 'postalCode', 'mobile', 'city', 'country', 'nationality'];
|
|
17
|
+
export let disabledfields:string = '';
|
|
18
|
+
export let defaultoptions:string = '';
|
|
19
|
+
export let clientstyling:string = '';
|
|
20
|
+
export let clientstylingurl:string = '';
|
|
21
|
+
export let translationurl:string = '';
|
|
22
|
+
|
|
23
|
+
let invalidAddress:boolean;
|
|
24
|
+
let invalidPostalCode:boolean;
|
|
25
|
+
let invalidMobile:boolean;
|
|
26
|
+
let invalidCity:boolean;
|
|
27
|
+
let invalidNationality:boolean;
|
|
28
|
+
|
|
29
|
+
let addressFocus:boolean = false;
|
|
30
|
+
let postalCodeFocus:boolean = false;
|
|
31
|
+
let mobileFocus:boolean = false;
|
|
32
|
+
let cityFocus:boolean = false;
|
|
33
|
+
|
|
34
|
+
let disabledFieldsList:Array<string>;
|
|
35
|
+
let defaultOptionsList:Array<string>;
|
|
36
|
+
|
|
37
|
+
let showError:boolean = false;
|
|
38
|
+
let error:string = '';
|
|
39
|
+
|
|
40
|
+
let address:string = '';
|
|
41
|
+
let postalCode:string = '';
|
|
42
|
+
let city:string = '';
|
|
43
|
+
let countries:Array<Object> = [];
|
|
44
|
+
let countrySelected:string = '';
|
|
45
|
+
let nationalities:Array<Object> = [];
|
|
46
|
+
let nationalitySelected:string = '';
|
|
47
|
+
let mobile:string = '';
|
|
48
|
+
let mobilePrefixes:Array<Object> = [];
|
|
49
|
+
let mobilePrefixSelected:string = '';
|
|
50
|
+
let consentOffers:boolean = false;
|
|
51
|
+
let consentOffersSms:boolean = false;
|
|
52
|
+
let consentOffersEmail:boolean = false;
|
|
53
|
+
let consentTerms:boolean = false;
|
|
54
|
+
|
|
55
|
+
let isValid:boolean = false;
|
|
56
|
+
let customStylingContainer:HTMLElement;
|
|
57
|
+
let displayNone:boolean = false;
|
|
58
|
+
|
|
59
|
+
setupI18n({ withLocale: 'en', translations: {}});
|
|
60
|
+
|
|
61
|
+
const setTranslationUrl = ():void => {
|
|
62
|
+
let url:string = translationurl;
|
|
63
|
+
|
|
64
|
+
fetch(url).then((res:any) => res.json())
|
|
65
|
+
.then((res) => {
|
|
66
|
+
Object.keys(res).forEach((item:any):void => {
|
|
67
|
+
addNewMessages(item, res[item]);
|
|
68
|
+
});
|
|
69
|
+
}).catch((err:any) => {
|
|
70
|
+
console.log(err);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Object.keys(TRANSLATIONS).forEach((item:any) => {
|
|
75
|
+
addNewMessages(item, TRANSLATIONS[item]);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
let textTC = $_('registerTermsConditions');
|
|
79
|
+
|
|
80
|
+
const getCountriesList = ():void => {
|
|
81
|
+
fetch(`${endpoint}/v1/player/countries`)
|
|
82
|
+
.then((res:any) => res.json())
|
|
83
|
+
.then((countryList:any) => {
|
|
84
|
+
fetch(`${endpoint}/v1/player/operatorSupportedCountries`).then((res:any) => {
|
|
85
|
+
if (res.status >= 300) {
|
|
86
|
+
return new Error('Error while fetching the supported countries');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return res.json();
|
|
90
|
+
})
|
|
91
|
+
.then((supportedCountries:any) => {
|
|
92
|
+
countries = countryList.countries.filter((item:any) => {
|
|
93
|
+
return supportedCountries.countries.indexOf(item.Alpha2Code) >= 0;
|
|
94
|
+
});
|
|
95
|
+
if (!countrySelected) {
|
|
96
|
+
countrySelected = countries[0].Alpha2Code;
|
|
97
|
+
}
|
|
98
|
+
nationalities = countryList.countries;
|
|
99
|
+
if (!nationalitySelected) {
|
|
100
|
+
nationalitySelected = nationalities.filter((item:any) => supportedCountries.countries.indexOf(item.Alpha2Code) >= 0)[0].Alpha2Code;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const getPhoneCodes = ():void => {
|
|
107
|
+
fetch(`${endpoint}/v1/player/phonecodes`)
|
|
108
|
+
.then((res:any) => res.json())
|
|
109
|
+
.then(data => {
|
|
110
|
+
mobilePrefixes = data.phoneCodes;
|
|
111
|
+
if (!mobilePrefixSelected) {
|
|
112
|
+
mobilePrefixSelected = mobilePrefixes[0].Prefix;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const checkIsValid = ():void => {
|
|
118
|
+
isValid = !(invalidAddress || invalidPostalCode || invalidCity || invalidMobile || showError || (userconsentsexist === 'true' && (termsconditions === 'true' && !consentTerms)));
|
|
119
|
+
|
|
120
|
+
if (address.length <= 0 || postalCode.length <= 0 || city.length <= 0 || mobile.length <= 0) {
|
|
121
|
+
isValid = false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const checkAddress = ():boolean => {
|
|
126
|
+
if (address && address.length <= 100) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const validateAddress = ():void => {
|
|
134
|
+
invalidAddress = !checkAddress();
|
|
135
|
+
checkIsValid();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const checkPostalCode = ():boolean => {
|
|
139
|
+
if (postalCode && postalCode.length <= 20) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const validatePostalCode = ():void => {
|
|
147
|
+
invalidPostalCode = !checkPostalCode();
|
|
148
|
+
checkIsValid();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const checkCity = ():boolean => {
|
|
152
|
+
if (city && city.length <= 50) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const validateCity = ():void => {
|
|
160
|
+
invalidCity = !checkCity();
|
|
161
|
+
checkIsValid();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const checkMobile = ():boolean => {
|
|
165
|
+
if (mobile && mobile.length >= 5 && mobile.length <= 12) {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const validateMobile = ():void => {
|
|
173
|
+
invalidMobile = !checkMobile();
|
|
174
|
+
checkIsValid();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const toggleOffers = (data:string):void => {
|
|
178
|
+
switch(data) {
|
|
179
|
+
case "GeneralOffers":
|
|
180
|
+
if (consentOffers === false) {
|
|
181
|
+
consentOffers = true;
|
|
182
|
+
consentOffersSms = true;
|
|
183
|
+
consentOffersEmail = true;
|
|
184
|
+
} else {
|
|
185
|
+
consentOffers = false;
|
|
186
|
+
consentOffersSms = false;
|
|
187
|
+
consentOffersEmail = false;
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
|
|
191
|
+
case "SmsOffers":
|
|
192
|
+
if (consentOffersSms === false) {
|
|
193
|
+
consentOffersSms = true;
|
|
194
|
+
consentOffers = true;
|
|
195
|
+
} else {
|
|
196
|
+
consentOffersSms = false;
|
|
197
|
+
}
|
|
198
|
+
uncheckOffers();
|
|
199
|
+
break;
|
|
200
|
+
|
|
201
|
+
case "EmailOffers":
|
|
202
|
+
if (consentOffersEmail === false) {
|
|
203
|
+
consentOffersEmail = true;
|
|
204
|
+
consentOffers = true;
|
|
205
|
+
} else {
|
|
206
|
+
consentOffersEmail = false;
|
|
207
|
+
}
|
|
208
|
+
uncheckOffers();
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const uncheckOffers = ():void => {
|
|
214
|
+
if (!consentOffersSms && !consentOffersEmail) {
|
|
215
|
+
consentOffers = false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const toggleTerms = ():void => {
|
|
220
|
+
if (consentTerms === false) {
|
|
221
|
+
consentTerms = true;
|
|
222
|
+
} else {
|
|
223
|
+
consentTerms = false;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
checkIsValid();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const doRecaptcha = ():Promise<string> => {
|
|
230
|
+
return new Promise((resolve, reject) => {
|
|
231
|
+
grecaptcha.ready(() => {
|
|
232
|
+
grecaptcha.execute(captchakey, { action: "submit" }).then((token:string) => {
|
|
233
|
+
resolve(token);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const goNext = (e):void => {
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
let registerStepThreeData = {};
|
|
242
|
+
|
|
243
|
+
doRecaptcha().then((token:string) => {
|
|
244
|
+
registerStepThreeData = {
|
|
245
|
+
address,
|
|
246
|
+
postalCode,
|
|
247
|
+
city,
|
|
248
|
+
countrySelected,
|
|
249
|
+
nationalitySelected,
|
|
250
|
+
mobilePrefixSelected,
|
|
251
|
+
mobile,
|
|
252
|
+
consentOffersSms,
|
|
253
|
+
consentOffersEmail,
|
|
254
|
+
consentTerms,
|
|
255
|
+
consentOffers,
|
|
256
|
+
token
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
window.postMessage({ type: 'RegisterStepThree', registerStepThreeData }, window.location.href);
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const goBack = ():void => {
|
|
264
|
+
let registerStepThreeData = {
|
|
265
|
+
address,
|
|
266
|
+
postalCode,
|
|
267
|
+
city,
|
|
268
|
+
countrySelected,
|
|
269
|
+
nationalitySelected,
|
|
270
|
+
mobilePrefixSelected,
|
|
271
|
+
mobile,
|
|
272
|
+
consentOffersSms,
|
|
273
|
+
consentOffersEmail,
|
|
274
|
+
consentTerms,
|
|
275
|
+
consentOffers,
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
window.postMessage({ type: 'GoBackStepThree', registerStepThreeData }, window.location.href);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const messageHandler = (e:any):void => {
|
|
283
|
+
if (e.data) {
|
|
284
|
+
switch(e.data.type) {
|
|
285
|
+
case 'StepThreeDataBackup':
|
|
286
|
+
address = e.data.userData.address1;
|
|
287
|
+
postalCode = e.data.userData.postalCode;
|
|
288
|
+
city = e.data.userData.city;
|
|
289
|
+
countrySelected = e.data.userData.country;
|
|
290
|
+
nationalitySelected = e.data.userData.nationality;
|
|
291
|
+
mobilePrefixSelected = e.data.userData.mobile.prefix;
|
|
292
|
+
mobile = e.data.userData.mobile.number;
|
|
293
|
+
consentOffersSms = e.data.userData.userConsents.sms;
|
|
294
|
+
consentOffersEmail = e.data.userData.userConsents.emailmarketing;
|
|
295
|
+
consentTerms = e.data.userData.userConsents.termsandconditions;
|
|
296
|
+
checkIsValid();
|
|
297
|
+
break;
|
|
298
|
+
|
|
299
|
+
case 'ShowRegistrationError':
|
|
300
|
+
showError = e.data.showError;
|
|
301
|
+
error = e.data.error;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const formatDisabledFields = ():void => {
|
|
307
|
+
disabledFieldsList = disabledfields.split(',');
|
|
308
|
+
|
|
309
|
+
if (disabledFieldsList.indexOf('address') >= 0) {
|
|
310
|
+
invalidAddress = false;
|
|
311
|
+
address = 'dummy address';
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (disabledFieldsList.indexOf('postalCode') >= 0) {
|
|
315
|
+
invalidPostalCode = false;
|
|
316
|
+
postalCode = '000000';
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (disabledFieldsList.indexOf('mobile') >= 0) {
|
|
320
|
+
invalidMobile = false;
|
|
321
|
+
mobile = '1234123412';
|
|
322
|
+
mobilePrefixSelected = '000';
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (disabledFieldsList.indexOf('city') >= 0) {
|
|
326
|
+
invalidCity = false;
|
|
327
|
+
city = 'dummy city';
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (disabledFieldsList.indexOf('country') >= 0) {
|
|
331
|
+
countrySelected = 'dummy country';
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (disabledFieldsList.indexOf('nationality') >= 0) {
|
|
335
|
+
invalidNationality = false;
|
|
336
|
+
nationalitySelected = 'dummy nationality';
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const applyDefaultOptions = ():void =>{
|
|
341
|
+
defaultOptionsList = defaultoptions.split(',');
|
|
342
|
+
|
|
343
|
+
if (defaultOptionsList.indexOf('consentsTerms') >= 0) {
|
|
344
|
+
consentTerms = true;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (defaultOptionsList.indexOf('consentsOffers') >= 0) {
|
|
348
|
+
consentOffers = true;
|
|
349
|
+
consentOffersSms = true;
|
|
350
|
+
consentOffersEmail = true;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
defaultOptionsList.forEach(e => {
|
|
354
|
+
if(e.includes('phonePrefix')){
|
|
355
|
+
mobilePrefixSelected = e.split(':')[1].toString();
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const setActiveLanguage = ():void => {
|
|
361
|
+
setLocale(lang);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const setClientStyling = ():void => {
|
|
365
|
+
let sheet = document.createElement('style');
|
|
366
|
+
sheet.innerHTML = clientstyling;
|
|
367
|
+
customStylingContainer.appendChild(sheet);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const setClientStylingURL = ():void => {
|
|
371
|
+
displayNone = true;
|
|
372
|
+
|
|
373
|
+
let url:URL = new URL(clientstylingurl);
|
|
374
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
375
|
+
|
|
376
|
+
fetch(url.href)
|
|
377
|
+
.then((res:any) => res.text())
|
|
378
|
+
.then((data:any) => {
|
|
379
|
+
cssFile.innerHTML = data
|
|
380
|
+
|
|
381
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
382
|
+
setTimeout(() => { displayNone = false; }, 500);
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
onMount(() => {
|
|
387
|
+
window.addEventListener('message', messageHandler, false);
|
|
388
|
+
|
|
389
|
+
return () => {
|
|
390
|
+
window.removeEventListener('message', messageHandler);
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
$: endpoint && getCountriesList();
|
|
395
|
+
$: endpoint && getPhoneCodes();
|
|
396
|
+
$: lang && setActiveLanguage();
|
|
397
|
+
$: disabledfields && formatDisabledFields();
|
|
398
|
+
$: defaultoptions && applyDefaultOptions();
|
|
399
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
400
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
401
|
+
$: translationurl && setTranslationUrl();
|
|
402
|
+
</script>
|
|
403
|
+
|
|
404
|
+
<svelte:head>
|
|
405
|
+
{#if captchakey}
|
|
406
|
+
<script src="//www.google.com/recaptcha/api.js?render={captchakey}" async defer></script>
|
|
407
|
+
{/if}
|
|
408
|
+
</svelte:head>
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
<div bind:this={customStylingContainer}>
|
|
413
|
+
<div class="RegisterFormHeader">
|
|
414
|
+
<button class="BackButton" on:click={goBack}>
|
|
415
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.a{fill:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));}</style></defs><path class="a" d="M12,0,9.818,2.182l8.26,8.26H0v3.117H18.078l-8.26,8.26L12,24,24,12Z" transform="translate(24 24) rotate(180)"/></svg>
|
|
416
|
+
{$_('registerBackButton')}
|
|
417
|
+
</button>
|
|
418
|
+
</div>
|
|
419
|
+
<form class="RegisterFormContent">
|
|
420
|
+
<div class="AddressPostalCodeContainer">
|
|
421
|
+
<div class="AddressContainer {invalidAddress && !addressFocus ? 'InvalidField' : ''}{disabledFieldsList?.indexOf('address') >= 0 ? 'Hidden' : ''}">
|
|
422
|
+
<label for="Address">{$_('registerAddress')}:<span class="FormRequired">*</span></label>
|
|
423
|
+
<input bind:value={address} on:keyup={validateAddress} on:focus={() => addressFocus = true} on:blur={() => addressFocus = false} type="text" id="Address" />
|
|
424
|
+
{#if invalidAddress}
|
|
425
|
+
<p class="InvalidInput">{$_('registerAddressError')}</p>
|
|
426
|
+
{/if}
|
|
427
|
+
</div>
|
|
428
|
+
<div class="PostalCodeContainer {invalidPostalCode && !postalCodeFocus ? 'InvalidField' : ''}{disabledFieldsList?.indexOf('postalCode') >= 0 ? 'Hidden' : ''}">
|
|
429
|
+
<label for="PostalCode">{$_('registerPostalCode')}:<span class="FormRequired">*</span></label>
|
|
430
|
+
<input bind:value={postalCode} on:keyup={validatePostalCode} on:focus={() => postalCodeFocus = true} on:blur={() => postalCodeFocus = false} type="text" id="PostalCode" />
|
|
431
|
+
{#if invalidPostalCode}
|
|
432
|
+
<p class="InvalidInput">{$_('registerPostalCodeError')}</p>
|
|
433
|
+
{/if}
|
|
434
|
+
</div>
|
|
435
|
+
</div>
|
|
436
|
+
<div class="CityContainer {invalidCity && cityFocus ? 'InvalidField' : ''}{disabledFieldsList?.indexOf('city') >= 0 ? 'Hidden' : ''}">
|
|
437
|
+
<label for="City">{$_('registerCity')}:<span class="FormRequired">*</span></label>
|
|
438
|
+
<input bind:value={city} on:keyup={validateCity} on:focus={() => cityFocus = true} on:blur={() => cityFocus = false} type="text" id="City" />
|
|
439
|
+
{#if invalidCity}
|
|
440
|
+
<p class="InvalidInput">{$_('registerCityError')}</p>
|
|
441
|
+
{/if}
|
|
442
|
+
</div>
|
|
443
|
+
<div class="CountryContainer {disabledFieldsList?.indexOf('country') >= 0 ? 'Hidden' : ''}">
|
|
444
|
+
<label for="Country">{$_('registerCountry')}:<span class="FormRequired">*</span></label>
|
|
445
|
+
<select bind:value={countrySelected} id="Country">
|
|
446
|
+
{#each countries as country}
|
|
447
|
+
<option value={country.Alpha2Code}>{country.Name}</option>
|
|
448
|
+
{/each}
|
|
449
|
+
</select>
|
|
450
|
+
</div>
|
|
451
|
+
<div class="NationalityContainer {disabledFieldsList?.indexOf('nationality') >= 0 ? 'Hidden' : ''}">
|
|
452
|
+
<label for="Nationality">{$_('registerNationality')}:<span class="FormRequired">*</span></label>
|
|
453
|
+
<select bind:value={nationalitySelected} id="Nationality">
|
|
454
|
+
{#each nationalities as nationality}
|
|
455
|
+
<option value={nationality.Alpha2Code}>{nationality.Name}</option>
|
|
456
|
+
{/each}
|
|
457
|
+
</select>
|
|
458
|
+
</div>
|
|
459
|
+
<div class="MobileContainer {invalidMobile && !mobileFocus ? 'InvalidField' : ''}{disabledFieldsList?.indexOf('mobile') >= 0 ? 'Hidden' : ''}">
|
|
460
|
+
<label for="Mobile">{$_('registerMobile')}:<span class="FormRequired">*</span></label>
|
|
461
|
+
<div class="MobileWrapper">
|
|
462
|
+
<select bind:value={mobilePrefixSelected} class="MobilePrefixSelected">
|
|
463
|
+
{#each mobilePrefixes as mobilePrefix}
|
|
464
|
+
<option value={mobilePrefix.Prefix}>{mobilePrefix.Prefix}</option>
|
|
465
|
+
{/each}
|
|
466
|
+
</select>
|
|
467
|
+
<input bind:value={mobile} on:keyup={validateMobile} on:focus={() => mobileFocus = true} on:blur={() => mobileFocus = false} type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" id="Mobile" class="MobileInput"/>
|
|
468
|
+
</div>
|
|
469
|
+
{#if invalidMobile}
|
|
470
|
+
<p class="InvalidInput">{$_('registerMobileError')}</p>
|
|
471
|
+
{/if}
|
|
472
|
+
</div>
|
|
473
|
+
{#if userconsentsexist === 'true'}
|
|
474
|
+
{#if smsoffers === 'true' || emailmarketing === 'true'}
|
|
475
|
+
<div class="OffersContainer">
|
|
476
|
+
<label class="Offers">
|
|
477
|
+
{$_('registerUserConsents')}
|
|
478
|
+
<input type="Checkbox" checked="{consentOffers}" on:click={() => toggleOffers("GeneralOffers")}>
|
|
479
|
+
<span class="Checkmark"></span>
|
|
480
|
+
</label>
|
|
481
|
+
<div class="OffersMethodsWrapper">
|
|
482
|
+
{#if smsoffers === 'true'}
|
|
483
|
+
<label class="OffersMethod">
|
|
484
|
+
{$_('registerUserConsentsSMS')}
|
|
485
|
+
<input type="Checkbox" checked="{consentOffersSms}" on:click={() => toggleOffers("SmsOffers")}>
|
|
486
|
+
<span class="Checkmark"></span>
|
|
487
|
+
</label>
|
|
488
|
+
{/if}
|
|
489
|
+
{#if emailmarketing === 'true'}
|
|
490
|
+
<label class="OffersMethod">
|
|
491
|
+
{$_('registerUserConsentsEmail')}
|
|
492
|
+
<input type="Checkbox" checked="{consentOffersEmail}" on:click={() => toggleOffers("EmailOffers")}>
|
|
493
|
+
<span class="Checkmark"></span>
|
|
494
|
+
</label>
|
|
495
|
+
{/if}
|
|
496
|
+
</div>
|
|
497
|
+
</div>
|
|
498
|
+
{/if}
|
|
499
|
+
{#if termsconditions === 'true'}
|
|
500
|
+
<div class="AgeContainer">
|
|
501
|
+
<label class="AgeConsent">
|
|
502
|
+
<span>{@html textTC}</span>
|
|
503
|
+
<input type="Checkbox" checked="{consentTerms}" on:click={() => toggleTerms()}>
|
|
504
|
+
<span class="Checkmark"></span>
|
|
505
|
+
</label>
|
|
506
|
+
</div>
|
|
507
|
+
{#if !consentTerms}
|
|
508
|
+
<div class="NotificationContainer">
|
|
509
|
+
<p>{$_('registerTermsConditionsError')}</p>
|
|
510
|
+
</div>
|
|
511
|
+
{/if}
|
|
512
|
+
{/if}
|
|
513
|
+
{/if}
|
|
514
|
+
<div class="g-recaptcha" data-sitekey="{captchakey}" />
|
|
515
|
+
<button
|
|
516
|
+
class="RegisterStepNext"
|
|
517
|
+
disabled={!isValid}
|
|
518
|
+
on:click={(e) => goNext(e)}>
|
|
519
|
+
{$_('registerOpenAccount')}
|
|
520
|
+
</button>
|
|
521
|
+
</form>
|
|
522
|
+
{#if showError}
|
|
523
|
+
<div>
|
|
524
|
+
<p class="RegisterError">{error}</p>
|
|
525
|
+
</div>
|
|
526
|
+
{/if}
|
|
527
|
+
</div>
|
|
528
|
+
|
|
529
|
+
<style lang="scss">
|
|
530
|
+
|
|
531
|
+
input, select {
|
|
532
|
+
font-family: inherit;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
.BackButton {
|
|
537
|
+
display: inline-flex;
|
|
538
|
+
color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
|
|
539
|
+
height: 15px;
|
|
540
|
+
border-radius: var(--emw--border-radius-small, 5px);
|
|
541
|
+
border: none;
|
|
542
|
+
background: transparent;
|
|
543
|
+
padding: 0;
|
|
544
|
+
text-transform: uppercase;
|
|
545
|
+
font-size: 22px;
|
|
546
|
+
cursor: pointer;
|
|
547
|
+
margin-bottom: 30px;
|
|
548
|
+
svg {
|
|
549
|
+
width: 20px;
|
|
550
|
+
height: 20px;
|
|
551
|
+
margin-right: 20px;
|
|
552
|
+
fill: var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.AddressPostalCodeContainer {
|
|
557
|
+
display: flex;
|
|
558
|
+
gap: 16px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.CountryContainer {
|
|
562
|
+
label {
|
|
563
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
564
|
+
font-weight: var(--emw--font-weight-light, 300);
|
|
565
|
+
padding-bottom: 5px;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
select {
|
|
571
|
+
width: 100%;
|
|
572
|
+
height: 44px;
|
|
573
|
+
border: 1px solid var(--emw--color-gray-100, #E6E6E6);
|
|
574
|
+
border-radius: var(--emw--border-radius-medium, 15px);
|
|
575
|
+
box-sizing: border-box;
|
|
576
|
+
padding: 5px 15px;
|
|
577
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
578
|
+
line-height: 18px;
|
|
579
|
+
-webkit-appearance: none;
|
|
580
|
+
-moz-appearance: none;
|
|
581
|
+
appearance: none;
|
|
582
|
+
background: url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='%23000000' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat var(--emw--color-white, #FFFFFF);
|
|
583
|
+
background-position: calc(100% - 0.75rem) center;
|
|
584
|
+
|
|
585
|
+
&:focus, :focus-within, :focus-visible, :visited {
|
|
586
|
+
border: 1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
587
|
+
box-shadow: 0 0 0 1pt var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
.AddressContainer,
|
|
594
|
+
.PostalCodeContainer,
|
|
595
|
+
.CityContainer,
|
|
596
|
+
.CountryContainer,
|
|
597
|
+
.NationalityContainer,
|
|
598
|
+
.MobileContainer {
|
|
599
|
+
color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
|
|
600
|
+
display: flex;
|
|
601
|
+
flex-direction: column;
|
|
602
|
+
padding-bottom: 30px;
|
|
603
|
+
position: relative;
|
|
604
|
+
|
|
605
|
+
label {
|
|
606
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
607
|
+
font-weight: var(--emw--font-weight-light, 300);
|
|
608
|
+
padding-bottom: 5px;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
input, select {
|
|
612
|
+
width: 100%;
|
|
613
|
+
height: 44px;
|
|
614
|
+
border-radius: var(--emw--border-radius-medium, 15px);
|
|
615
|
+
border: 1px solid var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));
|
|
616
|
+
box-sizing: border-box;
|
|
617
|
+
padding: 5px 15px;
|
|
618
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
619
|
+
line-height: 18px;
|
|
620
|
+
&:focus {
|
|
621
|
+
border: 2px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
622
|
+
outline: none;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
&.InvalidField {
|
|
627
|
+
input {
|
|
628
|
+
border: 1px solid var(--emw--color-error, #ed0909);
|
|
629
|
+
background: var(--emw--color-pale, #FBECF4);
|
|
630
|
+
color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
&.Hidden {
|
|
635
|
+
display: none;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.AddressContainer {
|
|
640
|
+
width: 65%;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.PostalCodeContainer {
|
|
644
|
+
width: 35%;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.MobileWrapper {
|
|
648
|
+
display: flex;
|
|
649
|
+
gap: 16px;
|
|
650
|
+
.MobilePrefixSelected {
|
|
651
|
+
width: 30%;
|
|
652
|
+
-webkit-appearance: none;
|
|
653
|
+
-moz-appearance: none;
|
|
654
|
+
appearance: none;
|
|
655
|
+
background: url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='%23000000' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat var(--emw--color-white, #FFFFFF);
|
|
656
|
+
background-position: calc(100% - 0.75rem) center;
|
|
657
|
+
|
|
658
|
+
&:focus, :focus-within, :focus-visible, :visited {
|
|
659
|
+
border: 1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
660
|
+
box-shadow: 0 0 0 1pt var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
}
|
|
664
|
+
.MobileInput {
|
|
665
|
+
width: 70%;
|
|
666
|
+
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.grecaptcha-badge { opacity:0;}
|
|
671
|
+
|
|
672
|
+
.FormRequired {
|
|
673
|
+
color: var(--emw--color-secondary, #E1A749);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.InvalidInput {
|
|
677
|
+
color: var(--emw--color-error, #ed0909);
|
|
678
|
+
font-size: 10px;
|
|
679
|
+
line-height: 10px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.ErrorMessage {
|
|
683
|
+
margin: 0 0 15px 0;
|
|
684
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
|
685
|
+
color: var(--emw--color-error, #ed0909);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.OffersMethodsWrapper {
|
|
689
|
+
padding-left: 32px;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.Offers,
|
|
693
|
+
.OffersMethod,
|
|
694
|
+
.AgeConsent {
|
|
695
|
+
display: block;
|
|
696
|
+
position: relative;
|
|
697
|
+
padding: 5px 0 0 35px;
|
|
698
|
+
margin-bottom: 16px;
|
|
699
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
700
|
+
user-select: none;
|
|
701
|
+
line-height: 18px;
|
|
702
|
+
|
|
703
|
+
label {
|
|
704
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
705
|
+
cursor: pointer;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
input {
|
|
709
|
+
position: absolute;
|
|
710
|
+
opacity: 0;
|
|
711
|
+
cursor: pointer;
|
|
712
|
+
height: 0;
|
|
713
|
+
width: 0;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.Checkmark {
|
|
717
|
+
position: absolute;
|
|
718
|
+
top: 0;
|
|
719
|
+
left: 0;
|
|
720
|
+
height: 25px;
|
|
721
|
+
width: 25px;
|
|
722
|
+
background-color: var(--emw--color-gray-100, #E6E6E6);
|
|
723
|
+
border-radius: 50%;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
input:checked ~ .Checkmark {
|
|
727
|
+
background-color: var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.Checkmark:after {
|
|
731
|
+
content: "";
|
|
732
|
+
position: absolute;
|
|
733
|
+
display: none;
|
|
734
|
+
left: 9px;
|
|
735
|
+
top: 5px;
|
|
736
|
+
width: 5px;
|
|
737
|
+
height: 10px;
|
|
738
|
+
border: solid white;
|
|
739
|
+
border-width: 0 3px 3px 0;
|
|
740
|
+
transform: rotate(45deg);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
input:checked ~ .Checkmark:after {
|
|
744
|
+
display: block;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.NotificationContainer {
|
|
749
|
+
margin-top: 32px;
|
|
750
|
+
p {
|
|
751
|
+
color: var(--emw--categories-color-secondary, var(--emw--color-secondary, #E1A749));
|
|
752
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.RegisterError {
|
|
757
|
+
color: var(--emw--color-error, #ed0909);
|
|
758
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
759
|
+
line-height: 18px;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.RegisterStepNext {
|
|
763
|
+
background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));
|
|
764
|
+
border: 2px solid var(--emw--button-border-color, #0E5924);
|
|
765
|
+
border-radius: var(--emw--button-border-radius, 50px);
|
|
766
|
+
color: var(--emfe-w-button-typography, var(--emw--button-text-color, #FFFFFF));
|
|
767
|
+
width: 100%;
|
|
768
|
+
height: 60px;
|
|
769
|
+
padding: 0;
|
|
770
|
+
text-transform: uppercase;
|
|
771
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
772
|
+
cursor: pointer;
|
|
773
|
+
margin-top: 24px;
|
|
774
|
+
&[disabled] {
|
|
775
|
+
background: var(--emw--color-gray-100, #E6E6E6);
|
|
776
|
+
border: 1px solid var(--emw--color-gray-100, #E6E6E6);
|
|
777
|
+
cursor: not-allowed;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
</style>
|