@everymatrix/general-player-forgot-password-form-nd 1.43.4 → 1.45.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.
@@ -1,650 +0,0 @@
1
- <svelte:options tag={null} />
2
-
3
- <script lang="ts">
4
- import { onMount } from 'svelte';
5
- import { isMobile } from 'rvhelper';
6
- import { _, addNewMessages, setLocale, setupI18n } from './i18n';
7
- import { TRANSLATIONS } from './translations';
8
-
9
- export let endpoint:string = '';
10
- export let forgotpasswordkey:string = '';
11
- export let captchakey:string = '';
12
- export let lang:string = 'en';
13
- export let simplepasswordvalidation:string = 'false';
14
- export let clientstyling:string = '';
15
- export let clientstylingurl:string = '';
16
- export let translationurl:string = '';
17
- export let savecredentials:string = '';
18
- export let hastosetpass:string = 'false';
19
-
20
- let isLoading:boolean = false;
21
- let forgotPasswordScreen:boolean = true;
22
- let forgotPasswordError:boolean = false;
23
- let forgotPasswordEmailSuccess:boolean = false;
24
- let resetPasswordEmail:string = '';
25
- let newPasswordScreen:boolean = false;
26
- let passwordChangeSuccess:boolean = false;
27
- let mobileView:boolean = false;
28
- let invalidEmail:boolean = false;
29
- let emailIsValid:boolean = false;
30
- let userAgent:string = window.navigator.userAgent;
31
- let userValue:string = '';
32
- let errorMessage:string = '';
33
- let activateSubmit:boolean = false;
34
-
35
- let invalidCurrentPassword:boolean = false;
36
- let invalidNewPassword:boolean = false;
37
- let invalidConfirmPassword:boolean = false;
38
- let newPasswordVisibilityToggle:HTMLElement;
39
- let confirmPasswordVisibilityToggle:HTMLElement;
40
-
41
- let isNewPasswordVisible:boolean = false;
42
- let isConfirmPasswordVisible:boolean = false;
43
- let oldPasswordSameAsNew:boolean = false;
44
-
45
- let userNewPassword:string = '';
46
- let userConfirmPassword:string = '';
47
-
48
- let customStylingContainer:HTMLElement;
49
- let displayNone:boolean = false;
50
- let setPasswordError:boolean = false;
51
-
52
- let titleText:string;
53
- let subtitleText:string;
54
-
55
- setupI18n({ withLocale: 'en', translations: {}});
56
-
57
- const setTranslationUrl = ():void => {
58
- let url:string = translationurl;
59
-
60
- fetch(url).then((res:any) => res.json())
61
- .then((res) => {
62
- Object.keys(res).forEach((item:any):void => {
63
- addNewMessages(item, res[item]);
64
- });
65
- }).catch((err:any) => {
66
- console.log(err);
67
- });
68
- }
69
-
70
- Object.keys(TRANSLATIONS).forEach((item:any) => {
71
- addNewMessages(item, TRANSLATIONS[item]);
72
- });
73
-
74
- const regexValidators = {
75
- email: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,
76
- password: /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s]).{8,20}$/
77
- };
78
-
79
- const checkIsValidEmail = () => {
80
- if (!invalidEmail) {
81
- emailIsValid = true;
82
- } else {
83
- emailIsValid = false;
84
- }
85
- }
86
-
87
- const checkEmailIdentifier = (email:string) => {
88
- if (regexValidators.email.test(email) && email.length <= 100) {
89
- return true;
90
- }
91
-
92
- return false;
93
- }
94
-
95
- const validateEmail = () => {
96
- invalidEmail = !checkEmailIdentifier(resetPasswordEmail);
97
- checkIsValidEmail();
98
- }
99
-
100
- const togglePassword = (field) => {
101
- switch(field) {
102
- case 'userNewPassword':
103
- isNewPasswordVisible = !isNewPasswordVisible;
104
- newPasswordVisibilityToggle.type = isNewPasswordVisible ? "text" : "password";
105
- break;
106
- case 'userConfirmPassword':
107
- isConfirmPasswordVisible = !isConfirmPasswordVisible;
108
- confirmPasswordVisibilityToggle.type = isConfirmPasswordVisible ? "text" : "password";
109
- break;
110
-
111
- default:
112
- break;
113
- }
114
- }
115
-
116
- const switchContent = (name:string) => {
117
- switch (name) {
118
- case 'ToEmailSuccess':
119
- forgotPasswordError = false;
120
- forgotPasswordScreen = false;
121
- forgotPasswordEmailSuccess = true;
122
- break;
123
-
124
- case 'ToReset':
125
- forgotPasswordScreen = false;
126
- newPasswordScreen = true;
127
- break;
128
-
129
- case 'ToSuccess':
130
- newPasswordScreen = false;
131
- passwordChangeSuccess = true;
132
- break;
133
- default:
134
- // do nothing
135
- break;
136
- }
137
- }
138
-
139
- const goToLogin = () => {
140
- window.postMessage({ type: "ToLogin" }, window.location.href);
141
- }
142
-
143
- const doRecaptcha = () => {
144
- return new Promise((resolve, reject) => {
145
- grecaptcha.ready(() => {
146
- grecaptcha.execute(captchakey, { action: "submit" }).then((token) => {
147
- resolve(token);
148
- });
149
- });
150
- });
151
- }
152
-
153
- const sendEmail = (e):void => {
154
- e.preventDefault();
155
- doRecaptcha().then((token) => {
156
- let url:any = new URL(`${endpoint}/v1/player/resetpassword`);
157
-
158
- let dataEmailOptions = {
159
- method: "POST",
160
- headers: {
161
- 'Content-Type': "application/json",
162
- 'Accept': 'application/json',
163
- 'g-recaptcha-response': token,
164
- },
165
- };
166
-
167
- url.searchParams.append('email', resetPasswordEmail);
168
-
169
- fetch(url, dataEmailOptions)
170
- .then((res:any) => {
171
- if (res.status == 200) {
172
- switchContent('ToEmailSuccess');
173
- } else {
174
- forgotPasswordError = true;
175
- }
176
- });
177
- });
178
- }
179
-
180
- const sendPassword = (e):void => {
181
- e.preventDefault();
182
- let url:any = new URL(`${endpoint}/v1/player/ResetPasswordByHashKey`);
183
-
184
- let dataPassword = {
185
- hashKey: forgotpasswordkey,
186
- plainTextPassword: userNewPassword,
187
- };
188
-
189
- let dataPasswordOptions = {
190
- method: "POST",
191
- headers: {
192
- 'Content-Type': "application/json",
193
- 'Accept': 'application/json',
194
- },
195
- body: JSON.stringify(dataPassword)
196
- };
197
-
198
- fetch(url, dataPasswordOptions)
199
- .then((res:any) => {
200
- if (res.status == 200) {
201
- setPasswordError = false;
202
- switchContent('ToSuccess');
203
- } else {
204
- setPasswordError = true;
205
- }
206
- return res.json();
207
- }).then((err:any) => {
208
- errorMessage = err.error;
209
- });
210
- }
211
-
212
- const verifyForgotPasswordScreen = () => {
213
- if (forgotpasswordkey && forgotpasswordkey.length > 0) {
214
- switchContent('ToReset');
215
- }
216
- }
217
-
218
- const checkSubmitState = () => {
219
- if(!invalidNewPassword && !invalidConfirmPassword && userNewPassword && userConfirmPassword) {
220
- activateSubmit = true;
221
- } else {
222
- activateSubmit = false;
223
- }
224
- }
225
-
226
- const checkUserPassword = (password:string) => {
227
- if (simplepasswordvalidation == 'true') {
228
- regexValidators.password = /^(?!.* ).{8,20}$/;
229
- }
230
-
231
- if (regexValidators.password.test(password)) {
232
- return true;
233
- } else {
234
- return false;
235
- }
236
- }
237
-
238
- const validatePassword = (invalid, password, elem) => {
239
- if (elem.id === "new-password") {
240
- invalidNewPassword = !checkUserPassword(password);
241
-
242
- if (userConfirmPassword) {
243
- invalidConfirmPassword = (userNewPassword === userConfirmPassword) ? !checkUserPassword(password) : true;
244
- }
245
- } else {
246
- invalidConfirmPassword = (userNewPassword === userConfirmPassword) ? !checkUserPassword(password) : true;
247
- }
248
- checkSubmitState();
249
- }
250
-
251
- const initialLoad = () => {
252
- setLocale(lang);
253
- }
254
-
255
- const setTexts = ():void => {
256
- titleText = hastosetpass === 'true' ? $_('hasToSetPassTitle') : $_('forgotPasswordTitle');
257
- subtitleText = hastosetpass === 'true' ? $_('resetPasswordSubtitle') : '';
258
- }
259
-
260
- const setClientStyling = ():void => {
261
- let sheet = document.createElement('style');
262
- sheet.innerHTML = clientstyling;
263
- customStylingContainer.appendChild(sheet);
264
- }
265
-
266
- const setClientStylingURL = ():void => {
267
- displayNone = true;
268
-
269
- let url:URL = new URL(clientstylingurl);
270
- let cssFile:HTMLElement = document.createElement('style');
271
-
272
- fetch(url.href)
273
- .then((res:any) => res.text())
274
- .then((data:any) => {
275
- cssFile.innerHTML = data
276
-
277
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
278
- setTimeout(() => { displayNone = false; }, 500);
279
- });
280
- }
281
-
282
- onMount(async () => {
283
- if(isMobile(userAgent)) {
284
- mobileView = true;
285
- }
286
- });
287
-
288
- $: forgotpasswordkey && verifyForgotPasswordScreen();
289
- $: lang && initialLoad();
290
- $: clientstyling && customStylingContainer && setClientStyling();
291
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
292
- $: translationurl && setTranslationUrl();
293
- $: hastosetpass && lang && setTexts();
294
- </script>
295
-
296
- <svelte:head>
297
- {#if captchakey}
298
- <script src="//www.google.com/recaptcha/api.js?render={captchakey}" async defer></script>
299
- {/if}
300
- </svelte:head>
301
-
302
- <div class="g-recaptcha" data-sitekey="{captchakey}" />
303
- <div class="GeneralPlayerForgotPasswordForm" bind:this={customStylingContainer}>
304
- {#if isLoading}
305
- <div class="ModalLoader"></div>
306
- {:else}
307
- <div class="FormContainer {mobileView ? 'FormMobileContainer' : ''}">
308
- {#if forgotPasswordScreen}
309
- <div class="FormForgotPassword">
310
- <div class="FormHeader">
311
- <button class="backButtonForgotPassword" on:click={() => goToLogin()}>
312
- <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>
313
- {$_('goToLogin')}
314
- </button>
315
- <h4 class="FormHeaderTitle" part="FormHeaderTitle">
316
- {titleText}
317
- </h4>
318
- {#if subtitleText}
319
- <p class="FormHeaderSubtitle" part="FormHeaderSubtitle">
320
- {subtitleText}
321
- </p>
322
- {/if}
323
- </div>
324
- <form class="FormContent" part="FormContent">
325
- <div class="ResetPasswordByEmail {invalidEmail ? 'InvalidField' : ''}" part="ResetPasswordByEmail {invalidEmail ? 'InvalidField' : ''}">
326
- <label for="ResetPasswordByEmail">{$_('forgotPasswordEmail')}:<span class="FormRequired" part="FormRequired">*</span></label>
327
- <input type="text" bind:value={resetPasswordEmail} on:keyup={validateEmail} id="ResetPasswordByEmail" />
328
- {#if invalidEmail}
329
- <p class="ForgotPasswordError" part="ForgotPasswordError">{$_('forgotPasswordEmailInputError')}</p>
330
- {/if}
331
- {#if forgotPasswordError}
332
- <p class="ForgotPasswordError" part="ForgotPasswordError">{$_('forgotPasswordEmailError')}</p>
333
- {/if}
334
- </div>
335
- <button class="resetPasswordButton" part="resetPasswordButton" disabled={!emailIsValid} on:click={(e) => sendEmail(e)}>{$_('forgotPasswordReset')}</button>
336
- </form>
337
- </div>
338
- {:else if forgotPasswordEmailSuccess}
339
- <div class="FormForgotPassword" part="FormForgotPassword">
340
- <div class="FormContent" part="FormContent">
341
- <div class="NewPasswordSuccess" part="NewPasswordSuccess">
342
- <svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><defs><style>.a{fill:#16ce16;}.b,.d{fill:none;}.b{stroke:#16ce16;stroke-width:2px;}.c{stroke:none;}</style></defs><g transform="translate(7106 -8970)"><g transform="translate(-7360.574 8503.438)"><path class="a" d="M16.1,28,0,11.9,3.267,8.633,16.1,21.233,37.333,0,40.6,3.267Z" transform="translate(264.272 482.563)"/></g><g class="b" transform="translate(-7106 8970)"><circle class="c" cx="30" cy="30" r="30"/><circle class="d" cx="30" cy="30" r="29"/></g></g></svg>
343
- <h4>{$_('forgotPasswordSuccess')}</h4>
344
- <p>{$_('forgotPasswordSuccessDescription')}</p>
345
- </div>
346
- </div>
347
- </div>
348
- {:else if newPasswordScreen}
349
- <div class="FormForgotPassword test" part="FormForgotPassword test">
350
- <div class="FormHeader" part="FormHeader">
351
- <h4 class="FormHeaderTitle" part="FormHeaderTitle">
352
- {titleText}
353
- </h4>
354
-
355
- {#if subtitleText}
356
- <p class="FormHeaderSubtitle" part="FormHeaderSubtitle">
357
- {subtitleText}
358
- </p>
359
- {/if}
360
- </div>
361
- <form class="FormContent" part="FormContent">
362
- <div class="NewPassword" part="NewPassword">
363
- <label for="NewPassword">{$_('forgotNewPasswordPassword')}:<span class="FormRequired" part="FormRequired">*</span></label>
364
- <input type="password" bind:value={userNewPassword} on:keyup={validatePassword(invalidNewPassword, userNewPassword, newPasswordVisibilityToggle)} id="new-password" autocomplete={savecredentials ? "new-password" : "off" } bind:this={newPasswordVisibilityToggle} />
365
- {#if isNewPasswordVisible}
366
- <svg on:click={() => togglePassword('userNewPassword')} class="TogglePasswordVisibility {invalidNewPassword ? 'InvalidToggle' : ''}" xmlns="http://www.w3.org/2000/svg" width="18.844" height="12.887" viewBox="0 0 18.844 12.887"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><g transform="translate(-110.856 -23.242)"><circle class="a" cx="0.05" cy="0.05" r="0.05" transform="translate(121.017 31.148)"/><g transform="translate(117.499 27.37)"><path class="a" d="M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z" transform="translate(-142.164 -39.123)"/><path class="a" d="M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z" transform="translate(-136.413 -42.068)"/></g><g transform="translate(110.856 24.899)"><path class="a" d="M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z" transform="translate(-110.856 -33.157)"/><path class="a" d="M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z" transform="translate(-130.743 -29.617)"/></g><rect class="a" width="0.972" height="15.861" rx="0.486" transform="translate(114.827 23.858) rotate(-39.315)"/></g></svg>
367
- {:else}
368
- <svg on:click={() => togglePassword('userNewPassword')} class="TogglePasswordVisibility {invalidNewPassword ? 'InvalidToggle' : ''}" xmlns="http://www.w3.org/2000/svg" width="18.843" height="10.5" viewBox="0 0 18.843 10.5"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><g transform="translate(-14.185 -27.832)"><path class="a" d="M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z" transform="translate(0)"/><circle class="a" cx="2.779" cy="2.779" r="2.779" transform="translate(20.827 30.303)"/></g></svg>
369
- {/if}
370
- {#if invalidNewPassword}
371
- {#if simplepasswordvalidation == 'true'}
372
- <p class="InvalidInput" part="InvalidInput">{$_('simplePasswordError')}</p>
373
- {:else}
374
- <p class="InvalidInput" part="InvalidInput">{$_('forgotNewPasswordPasswordError')}</p>
375
- {/if}
376
- {/if}
377
- </div>
378
- <div class="ConfirmPassword" part="ConfirmPassword">
379
- <label for="RetypePassword">{$_('forgotNewPasswordConfirmPassword')}:<span class="FormRequired" part="FormRequired">*</span></label>
380
- <input type="password" bind:value={userConfirmPassword} on:keyup={validatePassword(invalidConfirmPassword, userConfirmPassword, confirmPasswordVisibilityToggle)} id="RetypePassword" bind:this={confirmPasswordVisibilityToggle} />
381
- {#if isConfirmPasswordVisible}
382
- <svg on:click={() => togglePassword('userConfirmPassword')} class="TogglePasswordVisibility {invalidConfirmPassword ? 'InvalidToggle' : ''}" xmlns="http://www.w3.org/2000/svg" width="18.844" height="12.887" viewBox="0 0 18.844 12.887"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><g transform="translate(-110.856 -23.242)"><circle class="a" cx="0.05" cy="0.05" r="0.05" transform="translate(121.017 31.148)"/><g transform="translate(117.499 27.37)"><path class="a" d="M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z" transform="translate(-142.164 -39.123)"/><path class="a" d="M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z" transform="translate(-136.413 -42.068)"/></g><g transform="translate(110.856 24.899)"><path class="a" d="M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z" transform="translate(-110.856 -33.157)"/><path class="a" d="M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z" transform="translate(-130.743 -29.617)"/></g><rect class="a" width="0.972" height="15.861" rx="0.486" transform="translate(114.827 23.858) rotate(-39.315)"/></g></svg>
383
- {:else}
384
- <svg on:click={() => togglePassword('userConfirmPassword')} class="TogglePasswordVisibility {invalidConfirmPassword ? 'InvalidToggle' : ''}" xmlns="http://www.w3.org/2000/svg" width="18.843" height="10.5" viewBox="0 0 18.843 10.5"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><g transform="translate(-14.185 -27.832)"><path class="a" d="M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z" transform="translate(0)"/><circle class="a" cx="2.779" cy="2.779" r="2.779" transform="translate(20.827 30.303)"/></g></svg>
385
- {/if}
386
- {#if invalidConfirmPassword}
387
- <p class="InvalidInput" part="InvalidInput">{$_('forgotNewPasswordConfirmPasswordError')}</p>
388
- {/if}
389
- </div>
390
- {#if setPasswordError}
391
- <p class="ErrorMessage" part="ErrorMessage">{errorMessage}</p>
392
- {/if}
393
- <button class="resetPasswordButton" part="resetPasswordButton" disabled="{!activateSubmit}" on:click={(e) => sendPassword(e)}>{$_('forgotNewPasswordButton')}</button>
394
- </form>
395
- </div>
396
- {:else if passwordChangeSuccess}
397
- <div class="FormForgotPassword" part="FormForgotPassword">
398
- <div class="FormContent" part="FormContent">
399
- <div class="NewPasswordSuccess" part="NewPasswordSuccess">
400
- <svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><defs><style>.a{fill:var(--emw--color-valid, var(--emw--color-valid, #48952a));}.b,.d{fill:none;}.b{stroke:var(--emw--color-valid, var(--emw--color-green, #48952a));stroke-width:2px;}.c{stroke:none;}</style></defs><g transform="translate(7106 -8970)"><g transform="translate(-7360.574 8503.438)"><path class="a" d="M16.1,28,0,11.9,3.267,8.633,16.1,21.233,37.333,0,40.6,3.267Z" transform="translate(264.272 482.563)"/></g><g class="b" transform="translate(-7106 8970)"><circle class="c" cx="30" cy="30" r="30"/><circle class="d" cx="30" cy="30" r="29"/></g></g></svg>
401
- <h4>{$_('forgotChangePasswordTitle')}</h4>
402
- <p>{$_('forgotChangePasswordDescription')}</p>
403
- </div>
404
- <button class="resetPasswordButton" part="resetPasswordButton" on:click={() => goToLogin()}>{$_('forgotChangePasswordLogin')}</button>
405
- </div>
406
- </div>
407
- {/if}
408
- </div>
409
- {/if}
410
- </div>
411
-
412
-
413
- <style lang="scss">
414
-
415
-
416
- *,
417
- *::before,
418
- *::after {
419
- margin: 0;
420
- padding: 0;
421
- list-style: none;
422
- text-decoration: none;
423
- outline: none;
424
- box-sizing: border-box;
425
- }
426
-
427
- input, select {
428
- font-family: inherit;
429
- }
430
-
431
- .GeneralPlayerForgotPasswordForm {
432
- height: auto;
433
- }
434
-
435
- .backButtonForgotPassword {
436
- display: inline-flex;
437
- color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
438
- height: 24px;
439
- line-height: 24px;
440
- border-radius: var(--emw--border-radius-medium, 15px);
441
- border: none;
442
- background: transparent;
443
- padding: 0;
444
- text-transform: uppercase;
445
- font-size: var(--emw--font-size-medium, 16px);
446
- cursor: pointer;
447
- margin-bottom: 30px;
448
- }
449
-
450
- .backButtonForgotPassword svg {
451
- width: 24px;
452
- height: 24px;
453
- margin-right: 20px;
454
- fill: var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
455
- }
456
-
457
- .FormContainer {
458
- width: 100%;
459
- }
460
- .FormForgotPassword {
461
- background: var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));
462
- }
463
- .FormHeaderTitle {
464
- color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
465
- font-size: var(--emw--font-size-large, 20px);
466
- font-weight: var(--emw--font-weight-light, 300);
467
- padding: 0;
468
- text-transform: uppercase;
469
- margin: 0;
470
- }
471
-
472
- .FormHeaderSubtitle{
473
- color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
474
- font-weight: var(--emw--font-weight-light, 300);
475
- padding-top: 14px;
476
- }
477
-
478
- .FormRequired {
479
- color: var(--emw--color-error, #ed0909);
480
- }
481
-
482
- .ForgotPasswordError {
483
- color: var(--emw--color-error, #ed0909);
484
- font-size: 10px;
485
- line-height: 10px;
486
- margin-top: 10px;
487
- }
488
-
489
- .FormContent {
490
- padding-top: 20px;
491
- }
492
-
493
- .NewPasswordSuccess {
494
- display: flex;
495
- flex-direction: column;
496
- flex-wrap: nowrap;
497
- justify-content: space-around;
498
- align-items: center;
499
- }
500
-
501
- .NewPasswordSuccess h4 {
502
- margin-top: 10px;
503
- color: var(--emw--color-valid, var(--emw--color-valid, #48952a));
504
- font-size: 28px;
505
- font-weight: 500;
506
- padding: 0;
507
- text-transform: uppercase;
508
- }
509
-
510
- .NewPasswordSuccess p {
511
- text-align: center;
512
- font-size: var(--emw--font-size-medium, 16px);
513
- color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
514
- text-transform: initial;
515
- padding: 15px 0;
516
- margin-bottom: 110px;
517
- }
518
-
519
- .TogglePasswordVisibility {
520
- height: 19px;
521
- position: absolute;
522
- right: 8px;
523
- top: 34px;
524
- cursor: pointer;
525
- &.InvalidToggle {
526
- path, circle, rect {
527
- fill: var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
528
- }
529
- }
530
- path, circle, rect {
531
- fill: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
532
- }
533
- }
534
-
535
- .ResetPasswordByEmail, .NewPassword, .ConfirmPassword {
536
- color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
537
- display: flex;
538
- flex-direction: column;
539
- padding-bottom: 20px;
540
- position: relative;
541
- label {
542
- font-size: var(--emw--font-size-small, 14px);
543
- font-weight: var(--emw--font-weight-light, 300);
544
- padding-bottom: 5px;
545
- }
546
-
547
- input {
548
- width: 100%;
549
- height: 44px;
550
- border-radius: var(--emw--border-radius-medium, 15px);
551
- border: 1px solid var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
552
- padding: 5px;
553
- font-size: var(--emw--font-size-small, 14px);
554
- box-sizing:border-box;
555
- padding: 5px 15px;
556
- font-size: var(--emw--font-size-medium, 16px);
557
- line-height: 18px;
558
-
559
- &:focus {
560
- border: 2px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));
561
- outline: none;
562
- }
563
- }
564
- &.InvalidField {
565
- input {
566
- border: 1px solid var(--emw--color-error, #ed0909);
567
- background: var(--emw--color-pale, #FBECF4);
568
- color: var(--emw--registration-contrast, var(--emw--color-typography-cotrast, #444444));
569
- }
570
- }
571
- }
572
-
573
-
574
-
575
- .resetPasswordButton {
576
- 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%));
577
- border: 2px solid var(--emw--button-border-color, #0E5924);
578
- border-radius: var(--emw--button-border-radius, 50px);
579
- color: var(--emw--button-typography, var(--emw--button-text-color, #FFFFFF));
580
- font-family: var(--emw--button-typography);
581
- width: 100%;
582
- height: 60px;
583
- padding: 0;
584
- text-transform: uppercase;
585
- font-size: var(--emw--font-size-medium, 16px);
586
- cursor: pointer;
587
- &[disabled] {
588
- background: var(--emw--color-gray-100, #E6E6E6);
589
- border: 1px solid var(--emw--color-gray-150, #828282);
590
- cursor: not-allowed;
591
- }
592
- }
593
-
594
- .ResetPasswordByEmail, .NewPassword, .ConfirmPassword {
595
- padding-bottom: 30px;
596
- }
597
- .ResetPasswordByEmail {
598
- .InvalidInput {
599
- bottom: -3px;
600
- }
601
- }
602
-
603
- .InvalidInput {
604
- color: var(--emw--color-error, #ed0909);
605
- font-size: 10px;
606
- position: absolute;
607
- bottom: 10px;
608
- line-height: 10px;
609
- }
610
-
611
- .ErrorMessage {
612
- margin: 0 0 15px 0;
613
- font-size: var(--emw--font-size-x-small, 12px);
614
- color: var(--emw--color-error, #ed0909);
615
- }
616
-
617
- .FormForgotPassword {
618
- padding: 50px;
619
- }
620
-
621
- .FormMobileContainer {
622
- height: 100%;
623
- background-color: var(--emw--color-gray-50, #F9F8F8);
624
-
625
- .resetPasswordButton,
626
- .ResetPasswordByEmail input {
627
- max-width: unset;
628
- border-radius: var(--emw--border-radius-medium, 15px);
629
- }
630
- }
631
-
632
- .FormMobileContainer {
633
- height: 100%;
634
-
635
- .FormForgotPassword {
636
- padding: 40px 20px;
637
- }
638
-
639
- .resetPasswordButton,
640
- .UserContainer input {
641
- max-width: unset;
642
- }
643
- }
644
-
645
- /* MS Edge */
646
- input::-ms-reveal,
647
- input::-ms-clear {
648
- display: none;
649
- }
650
- </style>
package/src/i18n.js DELETED
@@ -1,27 +0,0 @@
1
- import {
2
- dictionary,
3
- locale,
4
- addMessages,
5
- _
6
- } from 'svelte-i18n';
7
-
8
- function setupI18n({ withLocale: _locale, translations }) {
9
- locale.subscribe((data) => {
10
- if (data == null) {
11
- dictionary.set(translations);
12
- locale.set(_locale);
13
- }
14
- }); // maybe we will need this to make sure that the i18n is set up only once
15
- /*dictionary.set(translations);
16
- locale.set(_locale);*/
17
- }
18
-
19
- function addNewMessages(lang, dict) {
20
- addMessages(lang, dict);
21
- }
22
-
23
- function setLocale(_locale) {
24
- locale.set(_locale);
25
- }
26
-
27
- export { _, setupI18n, addNewMessages, setLocale };
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import GeneralPlayerForgotPasswordForm from './GeneralPlayerForgotPasswordFormNd.svelte';
2
-
3
- !customElements.get('general-player-forgot-password-form-nd') && customElements.define('general-player-forgot-password-form-nd', GeneralPlayerForgotPasswordForm);
4
- export default GeneralPlayerForgotPasswordForm;