@everymatrix/user-login 1.62.2 → 1.62.3
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/dist/cjs/user-login.cjs.entry.js +21 -19
- package/dist/collection/components/user-login/user-login.js +21 -19
- package/dist/esm/user-login.entry.js +21 -19
- package/dist/user-login/{p-29caa859.entry.js → p-c0428412.entry.js} +1 -1
- package/dist/user-login/user-login.esm.js +1 -1
- package/package.json +1 -1
|
@@ -22213,14 +22213,16 @@ const UserLogin = class {
|
|
|
22213
22213
|
if (this.translationUrl.length > 2) {
|
|
22214
22214
|
await getTranslations(this.translationUrl);
|
|
22215
22215
|
}
|
|
22216
|
-
this.
|
|
22217
|
-
this.
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22216
|
+
if (this.version === 'gm17') {
|
|
22217
|
+
this.getLoginConfig().then(() => {
|
|
22218
|
+
this.appendCaptchaScript();
|
|
22219
|
+
}).catch((error) => {
|
|
22220
|
+
console.error(error);
|
|
22221
|
+
this.hasError = true;
|
|
22222
|
+
this.errorMessage = translate$1('configError', this.lang);
|
|
22223
|
+
this.sendErrorNotification(this.errorMessage);
|
|
22224
|
+
});
|
|
22225
|
+
}
|
|
22224
22226
|
}
|
|
22225
22227
|
/**
|
|
22226
22228
|
* Lifecycle method: Set up event listeners after the component is rendered
|
|
@@ -22377,19 +22379,19 @@ const UserLogin = class {
|
|
|
22377
22379
|
* Render function
|
|
22378
22380
|
*/
|
|
22379
22381
|
render() {
|
|
22380
|
-
let visibilityIcon = index.h("span", { key: '
|
|
22381
|
-
index.h("svg", { key: '
|
|
22382
|
-
index.h("svg", { key: '
|
|
22383
|
-
let userIdentification = index.h("div", { key: '
|
|
22382
|
+
let visibilityIcon = index.h("span", { key: '68804df7a4969782f28ad0ce2774c6405310e159', class: "InputIcon" }, this.isPasswordVisible &&
|
|
22383
|
+
index.h("svg", { key: 'cf9752b1f6c68934cabf52e38fdaa7805fa39eef', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, index.h("g", { key: 'eab73433e2f0fda532e0606f9dbf322ba8944720', transform: "translate(-110.856 -23.242)" }, index.h("circle", { key: '3fdb3cdc42eb2ef4887446ba3903ca654e0e0421', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { key: '502697d88a72241eb5ac5ae5e638a7948507c470', transform: "translate(117.499 27.37)" }, index.h("path", { key: '936c99233cd7bb49515b3b920cb7ebdaa5b63662', class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), index.h("path", { key: 'd4194ab4b94a4ac6b8348e7e3c86224874e2beb5', class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), index.h("g", { key: '514c717603584eb40ea964b48e0a000bbdd8f20c', transform: "translate(110.856 24.899)" }, index.h("path", { key: '15878f6b6c0bbec24c85922cb60b902e9c3654b0', class: "PasswordVisibilityIcon", 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)" }), index.h("path", { key: '38b92906edcedbb016d39efeda3e9c3bf7eb4a20', class: "PasswordVisibilityIcon", 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)" })), index.h("rect", { key: '6a050b163552c274057502dc7871e97fead19e89', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
22384
|
+
index.h("svg", { key: 'b0ecc56b0b4bca51785aaf67f1a22b952225764d', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility PasswordVisible", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.843", height: "10.5", viewBox: "0 0 18.843 10.5" }, index.h("g", { key: '84d8128bb587d3814702db63e518dbc7c784830f', transform: "translate(-14.185 -27.832)" }, index.h("path", { key: '243b0c5dee69ce337259859cd3ead23c471edec6', class: "PasswordVisibilityIcon", 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)" }), index.h("circle", { key: 'f2a444c45a507768a557966bf946623e8419262c', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
22385
|
+
let userIdentification = index.h("div", { key: '09a141f0ad234a861012c9fb515f54908101ae04', class: "FormBox" }, index.h("div", { key: '9e100efe90f8c72e354ae20e50e644a94c519ff4', class: "FormValue" }, this.loginByPhoneNumber === 'true'
|
|
22384
22386
|
? index.h("div", { class: (!this.isValidUserPhone || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox ' }, index.h("div", { class: "PhoneInputBox" }, index.h("div", { class: "PrefixBox" }, index.h("vaadin-combo-box", { items: this.userPrefixOptions, value: this.userPrefix, onChange: this.handleInputChangePartial('prefix') }), index.h("label", { class: (this.userPrefix ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPrefix', this.lang))), index.h("div", { class: "PhoneBox" }, index.h("input", { type: "text", placeholder: '', value: this.userPhone, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), index.h("label", { class: (this.userPhone ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPhone', this.lang)))))
|
|
22385
|
-
: index.h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, index.h("input", { type: "text", placeholder: '', value: this.userNameEmail, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), index.h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate$1('userEmail', this.lang))), index.h("div", { key: '
|
|
22386
|
-
index.h("div", { key: '
|
|
22387
|
-
index.h("slot", { key: '
|
|
22388
|
-
index.h("slot", { key: '
|
|
22387
|
+
: index.h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, index.h("input", { type: "text", placeholder: '', value: this.userNameEmail, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), index.h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate$1('userEmail', this.lang))), index.h("div", { key: 'd4cf7b09529e93b8232244d52cf9b2a248b6acb2', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, index.h("input", { key: '7d13d513021792c519520ede2917117fe8554783', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), index.h("label", { key: '4252ba23b01ed46cd9b86f38279f27613909ebd5', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate$1('password', this.lang))), this.passwordReset == 'true' &&
|
|
22388
|
+
index.h("div", { key: '98a976d22d26614e85a55a62bc8dc45db9591fdd', class: "ForgotPassword" }, index.h("button", { key: 'f7ecda6730be5b1b65ff272706e7af70474d5103', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
22389
|
+
index.h("slot", { key: '4a8ebe837e2ba12a3d1d75b4fd7dd522a7aa2690', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
22390
|
+
index.h("slot", { key: '2779736a3faf4cfac3e4b8b2f8c37baf623e3f46', name: "google" }), index.h("button", { key: 'aa53edc9daacbffa75536087cd0806d93758a5b1', disabled: ((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
|
|
22389
22391
|
(this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
|
|
22390
|
-
!this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.captchaData.isEnabled && !this.captchaData.token), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.hasError &&
|
|
22391
|
-
index.h("p", { key: '
|
|
22392
|
-
return index.h("section", { key: '
|
|
22392
|
+
!this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.version === 'gm17' && this.captchaData.isEnabled && !this.captchaData.token), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.hasError &&
|
|
22393
|
+
index.h("p", { key: '473110561ec0f6938e577ee1d895162395c4bbd0', class: "CredentialsError" }, this.errorMessage)));
|
|
22394
|
+
return index.h("section", { key: '936a5cb3b6fa82502b0206bebf509184b775c8ca', ref: el => this.stylingContainer = el }, userIdentification);
|
|
22393
22395
|
}
|
|
22394
22396
|
static get watchers() { return {
|
|
22395
22397
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -337,14 +337,16 @@ export class UserLogin {
|
|
|
337
337
|
if (this.translationUrl.length > 2) {
|
|
338
338
|
await getTranslations(this.translationUrl);
|
|
339
339
|
}
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
340
|
+
if (this.version === 'gm17') {
|
|
341
|
+
this.getLoginConfig().then(() => {
|
|
342
|
+
this.appendCaptchaScript();
|
|
343
|
+
}).catch((error) => {
|
|
344
|
+
console.error(error);
|
|
345
|
+
this.hasError = true;
|
|
346
|
+
this.errorMessage = translate('configError', this.lang);
|
|
347
|
+
this.sendErrorNotification(this.errorMessage);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
348
350
|
}
|
|
349
351
|
/**
|
|
350
352
|
* Lifecycle method: Set up event listeners after the component is rendered
|
|
@@ -501,19 +503,19 @@ export class UserLogin {
|
|
|
501
503
|
* Render function
|
|
502
504
|
*/
|
|
503
505
|
render() {
|
|
504
|
-
let visibilityIcon = h("span", { key: '
|
|
505
|
-
h("svg", { key: '
|
|
506
|
-
h("svg", { key: '
|
|
507
|
-
let userIdentification = h("div", { key: '
|
|
506
|
+
let visibilityIcon = h("span", { key: '68804df7a4969782f28ad0ce2774c6405310e159', class: "InputIcon" }, this.isPasswordVisible &&
|
|
507
|
+
h("svg", { key: 'cf9752b1f6c68934cabf52e38fdaa7805fa39eef', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, h("g", { key: 'eab73433e2f0fda532e0606f9dbf322ba8944720', transform: "translate(-110.856 -23.242)" }, h("circle", { key: '3fdb3cdc42eb2ef4887446ba3903ca654e0e0421', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { key: '502697d88a72241eb5ac5ae5e638a7948507c470', transform: "translate(117.499 27.37)" }, h("path", { key: '936c99233cd7bb49515b3b920cb7ebdaa5b63662', class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { key: 'd4194ab4b94a4ac6b8348e7e3c86224874e2beb5', class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { key: '514c717603584eb40ea964b48e0a000bbdd8f20c', transform: "translate(110.856 24.899)" }, h("path", { key: '15878f6b6c0bbec24c85922cb60b902e9c3654b0', class: "PasswordVisibilityIcon", 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)" }), h("path", { key: '38b92906edcedbb016d39efeda3e9c3bf7eb4a20', class: "PasswordVisibilityIcon", 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)" })), h("rect", { key: '6a050b163552c274057502dc7871e97fead19e89', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
508
|
+
h("svg", { key: 'b0ecc56b0b4bca51785aaf67f1a22b952225764d', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility PasswordVisible", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.843", height: "10.5", viewBox: "0 0 18.843 10.5" }, h("g", { key: '84d8128bb587d3814702db63e518dbc7c784830f', transform: "translate(-14.185 -27.832)" }, h("path", { key: '243b0c5dee69ce337259859cd3ead23c471edec6', class: "PasswordVisibilityIcon", 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)" }), h("circle", { key: 'f2a444c45a507768a557966bf946623e8419262c', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
509
|
+
let userIdentification = h("div", { key: '09a141f0ad234a861012c9fb515f54908101ae04', class: "FormBox" }, h("div", { key: '9e100efe90f8c72e354ae20e50e644a94c519ff4', class: "FormValue" }, this.loginByPhoneNumber === 'true'
|
|
508
510
|
? h("div", { class: (!this.isValidUserPhone || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox ' }, h("div", { class: "PhoneInputBox" }, h("div", { class: "PrefixBox" }, h("vaadin-combo-box", { items: this.userPrefixOptions, value: this.userPrefix, onChange: this.handleInputChangePartial('prefix') }), h("label", { class: (this.userPrefix ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate('userPrefix', this.lang))), h("div", { class: "PhoneBox" }, h("input", { type: "text", placeholder: '', value: this.userPhone, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h("label", { class: (this.userPhone ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate('userPhone', this.lang)))))
|
|
509
|
-
: h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang))), h("div", { key: '
|
|
510
|
-
h("div", { key: '
|
|
511
|
-
h("slot", { key: '
|
|
512
|
-
h("slot", { key: '
|
|
511
|
+
: h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang))), h("div", { key: 'd4cf7b09529e93b8232244d52cf9b2a248b6acb2', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h("input", { key: '7d13d513021792c519520ede2917117fe8554783', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h("label", { key: '4252ba23b01ed46cd9b86f38279f27613909ebd5', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang))), this.passwordReset == 'true' &&
|
|
512
|
+
h("div", { key: '98a976d22d26614e85a55a62bc8dc45db9591fdd', class: "ForgotPassword" }, h("button", { key: 'f7ecda6730be5b1b65ff272706e7af70474d5103', onClick: this.resetPassword }, translate('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
513
|
+
h("slot", { key: '4a8ebe837e2ba12a3d1d75b4fd7dd522a7aa2690', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
514
|
+
h("slot", { key: '2779736a3faf4cfac3e4b8b2f8c37baf623e3f46', name: "google" }), h("button", { key: 'aa53edc9daacbffa75536087cd0806d93758a5b1', disabled: ((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
|
|
513
515
|
(this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
|
|
514
|
-
!this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.captchaData.isEnabled && !this.captchaData.token), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.hasError &&
|
|
515
|
-
h("p", { key: '
|
|
516
|
-
return h("section", { key: '
|
|
516
|
+
!this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.version === 'gm17' && this.captchaData.isEnabled && !this.captchaData.token), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.hasError &&
|
|
517
|
+
h("p", { key: '473110561ec0f6938e577ee1d895162395c4bbd0', class: "CredentialsError" }, this.errorMessage)));
|
|
518
|
+
return h("section", { key: '936a5cb3b6fa82502b0206bebf509184b775c8ca', ref: el => this.stylingContainer = el }, userIdentification);
|
|
517
519
|
}
|
|
518
520
|
static get is() { return "user-login"; }
|
|
519
521
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22209,14 +22209,16 @@ const UserLogin = class {
|
|
|
22209
22209
|
if (this.translationUrl.length > 2) {
|
|
22210
22210
|
await getTranslations(this.translationUrl);
|
|
22211
22211
|
}
|
|
22212
|
-
this.
|
|
22213
|
-
this.
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22212
|
+
if (this.version === 'gm17') {
|
|
22213
|
+
this.getLoginConfig().then(() => {
|
|
22214
|
+
this.appendCaptchaScript();
|
|
22215
|
+
}).catch((error) => {
|
|
22216
|
+
console.error(error);
|
|
22217
|
+
this.hasError = true;
|
|
22218
|
+
this.errorMessage = translate$1('configError', this.lang);
|
|
22219
|
+
this.sendErrorNotification(this.errorMessage);
|
|
22220
|
+
});
|
|
22221
|
+
}
|
|
22220
22222
|
}
|
|
22221
22223
|
/**
|
|
22222
22224
|
* Lifecycle method: Set up event listeners after the component is rendered
|
|
@@ -22373,19 +22375,19 @@ const UserLogin = class {
|
|
|
22373
22375
|
* Render function
|
|
22374
22376
|
*/
|
|
22375
22377
|
render() {
|
|
22376
|
-
let visibilityIcon = h$2("span", { key: '
|
|
22377
|
-
h$2("svg", { key: '
|
|
22378
|
-
h$2("svg", { key: '
|
|
22379
|
-
let userIdentification = h$2("div", { key: '
|
|
22378
|
+
let visibilityIcon = h$2("span", { key: '68804df7a4969782f28ad0ce2774c6405310e159', class: "InputIcon" }, this.isPasswordVisible &&
|
|
22379
|
+
h$2("svg", { key: 'cf9752b1f6c68934cabf52e38fdaa7805fa39eef', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, h$2("g", { key: 'eab73433e2f0fda532e0606f9dbf322ba8944720', transform: "translate(-110.856 -23.242)" }, h$2("circle", { key: '3fdb3cdc42eb2ef4887446ba3903ca654e0e0421', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h$2("g", { key: '502697d88a72241eb5ac5ae5e638a7948507c470', transform: "translate(117.499 27.37)" }, h$2("path", { key: '936c99233cd7bb49515b3b920cb7ebdaa5b63662', class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h$2("path", { key: 'd4194ab4b94a4ac6b8348e7e3c86224874e2beb5', class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h$2("g", { key: '514c717603584eb40ea964b48e0a000bbdd8f20c', transform: "translate(110.856 24.899)" }, h$2("path", { key: '15878f6b6c0bbec24c85922cb60b902e9c3654b0', class: "PasswordVisibilityIcon", 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)" }), h$2("path", { key: '38b92906edcedbb016d39efeda3e9c3bf7eb4a20', class: "PasswordVisibilityIcon", 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)" })), h$2("rect", { key: '6a050b163552c274057502dc7871e97fead19e89', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
22380
|
+
h$2("svg", { key: 'b0ecc56b0b4bca51785aaf67f1a22b952225764d', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility PasswordVisible", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.843", height: "10.5", viewBox: "0 0 18.843 10.5" }, h$2("g", { key: '84d8128bb587d3814702db63e518dbc7c784830f', transform: "translate(-14.185 -27.832)" }, h$2("path", { key: '243b0c5dee69ce337259859cd3ead23c471edec6', class: "PasswordVisibilityIcon", 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)" }), h$2("circle", { key: 'f2a444c45a507768a557966bf946623e8419262c', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
22381
|
+
let userIdentification = h$2("div", { key: '09a141f0ad234a861012c9fb515f54908101ae04', class: "FormBox" }, h$2("div", { key: '9e100efe90f8c72e354ae20e50e644a94c519ff4', class: "FormValue" }, this.loginByPhoneNumber === 'true'
|
|
22380
22382
|
? h$2("div", { class: (!this.isValidUserPhone || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox ' }, h$2("div", { class: "PhoneInputBox" }, h$2("div", { class: "PrefixBox" }, h$2("vaadin-combo-box", { items: this.userPrefixOptions, value: this.userPrefix, onChange: this.handleInputChangePartial('prefix') }), h$2("label", { class: (this.userPrefix ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPrefix', this.lang))), h$2("div", { class: "PhoneBox" }, h$2("input", { type: "text", placeholder: '', value: this.userPhone, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h$2("label", { class: (this.userPhone ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPhone', this.lang)))))
|
|
22381
|
-
: h$2("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h$2("input", { type: "text", placeholder: '', value: this.userNameEmail, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h$2("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate$1('userEmail', this.lang))), h$2("div", { key: '
|
|
22382
|
-
h$2("div", { key: '
|
|
22383
|
-
h$2("slot", { key: '
|
|
22384
|
-
h$2("slot", { key: '
|
|
22383
|
+
: h$2("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h$2("input", { type: "text", placeholder: '', value: this.userNameEmail, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h$2("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate$1('userEmail', this.lang))), h$2("div", { key: 'd4cf7b09529e93b8232244d52cf9b2a248b6acb2', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h$2("input", { key: '7d13d513021792c519520ede2917117fe8554783', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h$2("label", { key: '4252ba23b01ed46cd9b86f38279f27613909ebd5', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate$1('password', this.lang))), this.passwordReset == 'true' &&
|
|
22384
|
+
h$2("div", { key: '98a976d22d26614e85a55a62bc8dc45db9591fdd', class: "ForgotPassword" }, h$2("button", { key: 'f7ecda6730be5b1b65ff272706e7af70474d5103', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
22385
|
+
h$2("slot", { key: '4a8ebe837e2ba12a3d1d75b4fd7dd522a7aa2690', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
22386
|
+
h$2("slot", { key: '2779736a3faf4cfac3e4b8b2f8c37baf623e3f46', name: "google" }), h$2("button", { key: 'aa53edc9daacbffa75536087cd0806d93758a5b1', disabled: ((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
|
|
22385
22387
|
(this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
|
|
22386
|
-
!this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.captchaData.isEnabled && !this.captchaData.token), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.hasError &&
|
|
22387
|
-
h$2("p", { key: '
|
|
22388
|
-
return h$2("section", { key: '
|
|
22388
|
+
!this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.version === 'gm17' && this.captchaData.isEnabled && !this.captchaData.token), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.hasError &&
|
|
22389
|
+
h$2("p", { key: '473110561ec0f6938e577ee1d895162395c4bbd0', class: "CredentialsError" }, this.errorMessage)));
|
|
22390
|
+
return h$2("section", { key: '936a5cb3b6fa82502b0206bebf509184b775c8ca', ref: el => this.stylingContainer = el }, userIdentification);
|
|
22389
22391
|
}
|
|
22390
22392
|
static get watchers() { return {
|
|
22391
22393
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -2652,4 +2652,4 @@ class ur{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.
|
|
|
2652
2652
|
></vaadin-combo-box-overlay>
|
|
2653
2653
|
|
|
2654
2654
|
<slot name="tooltip"></slot>
|
|
2655
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new er(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ir(this.inputElement,this._labelController)),this._tooltipController=new Io(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}a(vr);const gr=class{constructor(e){t(this,e),this.errorCode="",this.getPhonePrefixes=()=>{const t=new URL("v1/player/validPhoneCodes",this.endpoint);return new Promise((e=>{fetch(t.href).then((t=>t.json())).then((t=>{this.userPrefixOptions=t.phoneCodes.map((t=>({label:t.Prefix,value:t.Prefix}))),e()}))}))},this.autofillCredentialsHandler=t=>{this.userNameEmail=t.detail.userNameEmail,this.userPassword=t.detail.userPassword,this.handleLogin()},this.userLoginGm17=async()=>{let t={"Content-Type":"application/json"};const e={contact:this.userNameEmail,password:this.userPassword};this.captchaData.isEnabled&&(t["X-Captcha-Response"]=this.captchaData.token);const i={method:"POST",headers:t,body:JSON.stringify(e)};try{const t=await fetch(`${this.endpoint}/api/v1/players/password-management/auth/password/verify`,i),e=await t.json(),{token:s}=e;if(!s)throw this.isLoginLoading=!1,new Error("Token not received from the API call.");await this.sendLegislationLogin(s)}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.sendLegislationLogin=async t=>{const e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};try{const t=await fetch(`${this.endpoint}/api/v2/gm/legislation/login`,e),i=await t.json();if(!t.ok){const{message:t,errors:e}=i;throw this.isLoginLoading=!1,console.error(`Legislation login failed: ${t}`,e),new Error("Legislation login request failed.")}{const{sessionId:t,playerId:e}=i;t&&(this.isLoginLoading=!1,window.postMessage({type:"UserSessionID",session:t,userid:e},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1)}}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.userLogin=async()=>{const t=new URL("/v1/player/legislation/login",this.endpoint),e=new Headers;e.append("Content-Type","application/json");const i=JSON.stringify({username:"true"===this.loginByPhoneNumber?`${this.userPrefix} ${this.userPhone}`:this.userNameEmail,password:this.userPassword});fetch(t.href,{method:"POST",headers:e,body:i}).then((t=>t.json())).then((t=>{var e,i,s;if((null===(e=t.sessionBlockers)||void 0===e?void 0:e.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==t?void 0:t.hasToSetPass))return this.hasError=!0,this.errorMessage=o("setUpPassowrd",this.lang),this.sendErrorNotification(o("setUpPassowrd",this.lang)),void window.postMessage({type:"HasToSetPass"},window.location.href);t.sessionId?(window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1,((t,e={})=>{const i=new CustomEvent("track-custom-event",{detail:{type:"logged_in",data:e},bubbles:!0,composed:!0});document.dispatchEvent(i)})(0,{userId:t.userId})):(this.hasError=!0,this.errorCode=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode,this.errorMessage=o(`${this.errorCode}`,this.lang)||(null===(s=null==t?void 0:t.thirdPartyResponse)||void 0===s?void 0:s.message)||o("genericError",this.lang),this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)})).finally((()=>{this.isLoginLoading=!1}))},this.handleLogin=()=>{this.isLoginLoading=!0,this.debounce({gm16:this.userLogin,gm17:this.userLoginGm17}[this.version]||this.userLogin,850)(),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{this.hasError=!1;const i=t.target.value;switch(e){case"user":this.userNameEmail=i,this.isValidUserEmail=this.validate("user",this.userNameEmail);break;case"phone":this.userPhone=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"prefix":this.userPrefix=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"password":this.userPassword=i,this.isValidPassword=this.validate("password",i)}this.isValidUserEmail&&this.isValidUserPhone&&this.isValidPassword||(this.hasError=!0,this.errorMessage=o("invalidField",this.lang))},this.handleInputChangePartial=t=>e=>this.handleInputChange(e,t),this.validate=(t,e)=>{let i;switch(t){case"user":return i=new RegExp(this.userEmailRegex,this.userEmailRegexOptions),i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),i.test(e)&&!!this.userPrefix;case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),i.test(e)}},this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)},this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex=void 0,this.userEmailRegexOptions="i",this.userPhoneRegex=void 0,this.userPhoneRegexOptions="",this.passwordRegex=void 0,this.passwordRegexOptions="",this.version="gm16",this.loginByPhoneNumber="false",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.userPhone="",this.userPrefix="",this.isValidPassword=!0,this.isValidUserPhone=!0,this.isPasswordVisible=!1,this.errorMessage="",this.hasError=!1,this.userPrefixOptions=void 0,this.isLoginLoading=!1,this.captchaData={isEnabled:!0,token:"",provider:"",siteKey:""},this.mbSource=void 0}handleNewTranslations(){s(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhonePrefixes(),this.translationUrl.length>2&&await s(this.translationUrl),this.getLoginConfig().then((()=>{this.appendCaptchaScript()})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=o("configError",this.lang),this.sendErrorNotification(this.errorMessage)}))}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.autofillCredentialsHandler),window.postMessage({type:"UserLoginDidLoad"})}getLoginConfig(){const t=new URL("/api/v1/players/password-management/auth/password/config",this.endpoint);return new Promise(((e,i)=>{fetch(t.href).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>{const{captcha:i}=t;i&&"string"==typeof i.provider&&(i.provider=i.provider.toLowerCase()),this.captchaData=Object.assign({},i),e()})).catch((t=>{console.error("Error fetching login configuration:",t),i(t)}))}))}handleCaptcha(){const{isEnabled:t,provider:e,siteKey:i}=this.captchaData;t&&["cloudflare","google"].includes(e)&&("cloudflare"===e?window.turnstile.render("#turnstileContainer",{sitekey:i,theme:"light",callback:this.captchaCallback.bind(this)}):"google"===e&&window.grecaptcha.ready((()=>{window.grecaptcha.render("googleContainer",{sitekey:i,callback:this.captchaCallback.bind(this),theme:"light"})})))}captchaCallback(t){this.captchaData.token=t,this.captchaData=Object.assign({},this.captchaData)}appendCaptchaScript(){const{isEnabled:t,provider:e}=this.captchaData;if(!t)return;const i=document.createElement("script");"cloudflare"===e?i.src="https://challenges.cloudflare.com/turnstile/v0/api.js":"google"===e&&(i.src="https://www.google.com/recaptcha/api.js"),i.onload=this.handleCaptcha.bind(this),document.head.appendChild(i)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.autofillCredentialsHandler)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}debounce(t,e){let i;return function(...s){clearTimeout(i),i=setTimeout((()=>{t.apply(this,s)}),e)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.userNameEmail,userPassword:this.userPassword}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){let t=e("span",{key:"1192a2390f0b5ea646c8e96a7a3f17e18b16a306",class:"InputIcon"},this.isPasswordVisible&&e("svg",{key:"13fcccd4457633040b0bf29fed962961df64176c",onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.844",height:"12.887",viewBox:"0 0 18.844 12.887"},e("g",{key:"19762a0b0287c8e2a51a3b3bba7cecb353a4f379",transform:"translate(-110.856 -23.242)"},e("circle",{key:"4f46b166744078ea7f8b0f13e26b359ebb8f03da",class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{key:"7a82fe4e4f4ed670f8d83c8b774bda62673c548a",transform:"translate(117.499 27.37)"},e("path",{key:"0454916b36c2a2994fa6e7ccf2feac38861d283d",class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),e("path",{key:"3d166e1f5b399ea5f9013fdaa24bf64b68f531b5",class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),e("g",{key:"8c5e38f057b58a3afcb8a5cc6a44bb852cfa7204",transform:"translate(110.856 24.899)"},e("path",{key:"72910c3a6ba83dac758dfa7aa36721364ebf8a6d",class:"PasswordVisibilityIcon",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)"}),e("path",{key:"d795428138b8ed6cf47ff846dcc69f3940892776",class:"PasswordVisibilityIcon",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)"})),e("rect",{key:"ca376eb5a1a7300b5893936ad987808576933081",class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&e("svg",{key:"d69b7a469e213542bc6deb56156cfa86febbe8ac",onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility PasswordVisible",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.843",height:"10.5",viewBox:"0 0 18.843 10.5"},e("g",{key:"d45723a6916ece014694c1ea1fa171ebc905d21f",transform:"translate(-14.185 -27.832)"},e("path",{key:"d19d2b273a2c9366d6039ad87b1a1df203a49d2e",class:"PasswordVisibilityIcon",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)"}),e("circle",{key:"3127ecec570ef7f567ecb5f3362d65986669de0e",class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=e("div",{key:"69731dda5bf4fd23c0f143de9a662bd12388cc73",class:"FormBox"},e("div",{key:"5b0ca2d058095a6abfdcf3c5feeb9b2e0a7e894c",class:"FormValue"},"true"===this.loginByPhoneNumber?e("div",{class:!this.isValidUserPhone||this.hasError?"InputBox InputInvalidBox":"InputBox "},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.userPrefixOptions,value:this.userPrefix,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.userPrefix?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.userPhone,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPhone?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPhone",this.lang))))):e("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},e("input",{type:"text",placeholder:"",value:this.userNameEmail,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},o("userEmail",this.lang))),e("div",{key:"20c86c0ca9a72f7d50453b297d976c84149011fa",class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},t,e("input",{key:"825f782812500632eab0082b2e6309442372d3b8",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"f3f1e9a14433a5002d51444f3f5de4c680633950",class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},o("password",this.lang))),"true"==this.passwordReset&&e("div",{key:"e59b1fc8dde8d6ef5758404fd544ef914b9b0807",class:"ForgotPassword"},e("button",{key:"b147c546b39422d3eb8461229696333e9283ee03",onClick:this.resetPassword},o("forgotPassword",this.lang))),this.captchaData.isEnabled&&"cloudflare"===this.captchaData.provider&&e("slot",{key:"30bb77473faed7c143719196599782ab4625314c",name:"turnstile"}),this.captchaData.isEnabled&&"google"===this.captchaData.provider&&e("slot",{key:"3c67a39492482cf483dbc7306e9f93c74c847e73",name:"google"}),e("button",{key:"27b2016e65c4d910d297b0ebd014553258046a93",disabled:"true"!==this.loginByPhoneNumber&&(!this.isValidUserEmail||!this.userNameEmail)||"true"===this.loginByPhoneNumber&&(!this.isValidUserPhone||!this.userPhone||!this.userPrefix)||!this.userPassword||!this.isValidPassword||this.isLoginLoading||this.captchaData.isEnabled&&!this.captchaData.token,class:"SubmitCredentials",onClick:this.handleLogin},o("login",this.lang)),this.hasError&&e("p",{key:"33d142c5a20d8c3003b51c4ecad256215314c2b3",class:"CredentialsError"},this.errorMessage)));return e("section",{key:"02a36db14f738bd0f84dc0267aea6bff4fd331d8",ref:t=>this.stylingContainer=t},i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};gr.style=':host{display:block;font-family:"Roboto", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormValue{width:100%}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:100%;border-bottom:2px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.InputBox .PhoneInputBox{display:flex;flex-direction:row}.InputBox .PhoneInputBox .PhoneBox{position:relative;width:100%}.InputBox .PhoneInputBox .PrefixBox{position:relative;width:fit-content}.InputBox.InputInvalidBox .PasswordVisibilityIcon{fill:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));font-size:var(--emw--font-size-medium, 16px);pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:var(--emw--font-size-medium, 16px);padding:0 35px 0 5px;color:var(--emw--registration-typography, var(--emw--color-typography, #000000));box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}vaadin-combo-box:focus-within~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}.ForgotPassword button{margin:-10px 0 17px;font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.SubmitCredentials{display:block;margin:0 auto;outline:none;cursor:pointer;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%));border:2px solid var(--emw--button-border-color, #0E5924);border-radius:var(--emw--button-border-radius, 50px);padding:10px 20px;font-size:var(--emw--font-size-large, 20px);font-family:var(--emw--button-typography);color:var(--emw--button-text-color, #FFFFFF)}.SubmitCredentials:disabled{background:#707070;cursor:default}.Register{font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-typography, var(--emw--color-typography, #FFFFFF));text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px)}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px);padding:0 0 20px 0;margin:0}.CredentialsError input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{gr as user_login}
|
|
2655
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new er(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ir(this.inputElement,this._labelController)),this._tooltipController=new Io(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}a(vr);const gr=class{constructor(e){t(this,e),this.errorCode="",this.getPhonePrefixes=()=>{const t=new URL("v1/player/validPhoneCodes",this.endpoint);return new Promise((e=>{fetch(t.href).then((t=>t.json())).then((t=>{this.userPrefixOptions=t.phoneCodes.map((t=>({label:t.Prefix,value:t.Prefix}))),e()}))}))},this.autofillCredentialsHandler=t=>{this.userNameEmail=t.detail.userNameEmail,this.userPassword=t.detail.userPassword,this.handleLogin()},this.userLoginGm17=async()=>{let t={"Content-Type":"application/json"};const e={contact:this.userNameEmail,password:this.userPassword};this.captchaData.isEnabled&&(t["X-Captcha-Response"]=this.captchaData.token);const i={method:"POST",headers:t,body:JSON.stringify(e)};try{const t=await fetch(`${this.endpoint}/api/v1/players/password-management/auth/password/verify`,i),e=await t.json(),{token:s}=e;if(!s)throw this.isLoginLoading=!1,new Error("Token not received from the API call.");await this.sendLegislationLogin(s)}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.sendLegislationLogin=async t=>{const e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};try{const t=await fetch(`${this.endpoint}/api/v2/gm/legislation/login`,e),i=await t.json();if(!t.ok){const{message:t,errors:e}=i;throw this.isLoginLoading=!1,console.error(`Legislation login failed: ${t}`,e),new Error("Legislation login request failed.")}{const{sessionId:t,playerId:e}=i;t&&(this.isLoginLoading=!1,window.postMessage({type:"UserSessionID",session:t,userid:e},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1)}}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.userLogin=async()=>{const t=new URL("/v1/player/legislation/login",this.endpoint),e=new Headers;e.append("Content-Type","application/json");const i=JSON.stringify({username:"true"===this.loginByPhoneNumber?`${this.userPrefix} ${this.userPhone}`:this.userNameEmail,password:this.userPassword});fetch(t.href,{method:"POST",headers:e,body:i}).then((t=>t.json())).then((t=>{var e,i,s;if((null===(e=t.sessionBlockers)||void 0===e?void 0:e.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==t?void 0:t.hasToSetPass))return this.hasError=!0,this.errorMessage=o("setUpPassowrd",this.lang),this.sendErrorNotification(o("setUpPassowrd",this.lang)),void window.postMessage({type:"HasToSetPass"},window.location.href);t.sessionId?(window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1,((t,e={})=>{const i=new CustomEvent("track-custom-event",{detail:{type:"logged_in",data:e},bubbles:!0,composed:!0});document.dispatchEvent(i)})(0,{userId:t.userId})):(this.hasError=!0,this.errorCode=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode,this.errorMessage=o(`${this.errorCode}`,this.lang)||(null===(s=null==t?void 0:t.thirdPartyResponse)||void 0===s?void 0:s.message)||o("genericError",this.lang),this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)})).finally((()=>{this.isLoginLoading=!1}))},this.handleLogin=()=>{this.isLoginLoading=!0,this.debounce({gm16:this.userLogin,gm17:this.userLoginGm17}[this.version]||this.userLogin,850)(),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{this.hasError=!1;const i=t.target.value;switch(e){case"user":this.userNameEmail=i,this.isValidUserEmail=this.validate("user",this.userNameEmail);break;case"phone":this.userPhone=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"prefix":this.userPrefix=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"password":this.userPassword=i,this.isValidPassword=this.validate("password",i)}this.isValidUserEmail&&this.isValidUserPhone&&this.isValidPassword||(this.hasError=!0,this.errorMessage=o("invalidField",this.lang))},this.handleInputChangePartial=t=>e=>this.handleInputChange(e,t),this.validate=(t,e)=>{let i;switch(t){case"user":return i=new RegExp(this.userEmailRegex,this.userEmailRegexOptions),i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),i.test(e)&&!!this.userPrefix;case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),i.test(e)}},this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)},this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex=void 0,this.userEmailRegexOptions="i",this.userPhoneRegex=void 0,this.userPhoneRegexOptions="",this.passwordRegex=void 0,this.passwordRegexOptions="",this.version="gm16",this.loginByPhoneNumber="false",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.userPhone="",this.userPrefix="",this.isValidPassword=!0,this.isValidUserPhone=!0,this.isPasswordVisible=!1,this.errorMessage="",this.hasError=!1,this.userPrefixOptions=void 0,this.isLoginLoading=!1,this.captchaData={isEnabled:!0,token:"",provider:"",siteKey:""},this.mbSource=void 0}handleNewTranslations(){s(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhonePrefixes(),this.translationUrl.length>2&&await s(this.translationUrl),"gm17"===this.version&&this.getLoginConfig().then((()=>{this.appendCaptchaScript()})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=o("configError",this.lang),this.sendErrorNotification(this.errorMessage)}))}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.autofillCredentialsHandler),window.postMessage({type:"UserLoginDidLoad"})}getLoginConfig(){const t=new URL("/api/v1/players/password-management/auth/password/config",this.endpoint);return new Promise(((e,i)=>{fetch(t.href).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>{const{captcha:i}=t;i&&"string"==typeof i.provider&&(i.provider=i.provider.toLowerCase()),this.captchaData=Object.assign({},i),e()})).catch((t=>{console.error("Error fetching login configuration:",t),i(t)}))}))}handleCaptcha(){const{isEnabled:t,provider:e,siteKey:i}=this.captchaData;t&&["cloudflare","google"].includes(e)&&("cloudflare"===e?window.turnstile.render("#turnstileContainer",{sitekey:i,theme:"light",callback:this.captchaCallback.bind(this)}):"google"===e&&window.grecaptcha.ready((()=>{window.grecaptcha.render("googleContainer",{sitekey:i,callback:this.captchaCallback.bind(this),theme:"light"})})))}captchaCallback(t){this.captchaData.token=t,this.captchaData=Object.assign({},this.captchaData)}appendCaptchaScript(){const{isEnabled:t,provider:e}=this.captchaData;if(!t)return;const i=document.createElement("script");"cloudflare"===e?i.src="https://challenges.cloudflare.com/turnstile/v0/api.js":"google"===e&&(i.src="https://www.google.com/recaptcha/api.js"),i.onload=this.handleCaptcha.bind(this),document.head.appendChild(i)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.autofillCredentialsHandler)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}debounce(t,e){let i;return function(...s){clearTimeout(i),i=setTimeout((()=>{t.apply(this,s)}),e)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.userNameEmail,userPassword:this.userPassword}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){let t=e("span",{key:"68804df7a4969782f28ad0ce2774c6405310e159",class:"InputIcon"},this.isPasswordVisible&&e("svg",{key:"cf9752b1f6c68934cabf52e38fdaa7805fa39eef",onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.844",height:"12.887",viewBox:"0 0 18.844 12.887"},e("g",{key:"eab73433e2f0fda532e0606f9dbf322ba8944720",transform:"translate(-110.856 -23.242)"},e("circle",{key:"3fdb3cdc42eb2ef4887446ba3903ca654e0e0421",class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{key:"502697d88a72241eb5ac5ae5e638a7948507c470",transform:"translate(117.499 27.37)"},e("path",{key:"936c99233cd7bb49515b3b920cb7ebdaa5b63662",class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),e("path",{key:"d4194ab4b94a4ac6b8348e7e3c86224874e2beb5",class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),e("g",{key:"514c717603584eb40ea964b48e0a000bbdd8f20c",transform:"translate(110.856 24.899)"},e("path",{key:"15878f6b6c0bbec24c85922cb60b902e9c3654b0",class:"PasswordVisibilityIcon",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)"}),e("path",{key:"38b92906edcedbb016d39efeda3e9c3bf7eb4a20",class:"PasswordVisibilityIcon",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)"})),e("rect",{key:"6a050b163552c274057502dc7871e97fead19e89",class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&e("svg",{key:"b0ecc56b0b4bca51785aaf67f1a22b952225764d",onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility PasswordVisible",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.843",height:"10.5",viewBox:"0 0 18.843 10.5"},e("g",{key:"84d8128bb587d3814702db63e518dbc7c784830f",transform:"translate(-14.185 -27.832)"},e("path",{key:"243b0c5dee69ce337259859cd3ead23c471edec6",class:"PasswordVisibilityIcon",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)"}),e("circle",{key:"f2a444c45a507768a557966bf946623e8419262c",class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=e("div",{key:"09a141f0ad234a861012c9fb515f54908101ae04",class:"FormBox"},e("div",{key:"9e100efe90f8c72e354ae20e50e644a94c519ff4",class:"FormValue"},"true"===this.loginByPhoneNumber?e("div",{class:!this.isValidUserPhone||this.hasError?"InputBox InputInvalidBox":"InputBox "},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.userPrefixOptions,value:this.userPrefix,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.userPrefix?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.userPhone,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPhone?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPhone",this.lang))))):e("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},e("input",{type:"text",placeholder:"",value:this.userNameEmail,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},o("userEmail",this.lang))),e("div",{key:"d4cf7b09529e93b8232244d52cf9b2a248b6acb2",class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},t,e("input",{key:"7d13d513021792c519520ede2917117fe8554783",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"4252ba23b01ed46cd9b86f38279f27613909ebd5",class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},o("password",this.lang))),"true"==this.passwordReset&&e("div",{key:"98a976d22d26614e85a55a62bc8dc45db9591fdd",class:"ForgotPassword"},e("button",{key:"f7ecda6730be5b1b65ff272706e7af70474d5103",onClick:this.resetPassword},o("forgotPassword",this.lang))),this.captchaData.isEnabled&&"cloudflare"===this.captchaData.provider&&e("slot",{key:"4a8ebe837e2ba12a3d1d75b4fd7dd522a7aa2690",name:"turnstile"}),this.captchaData.isEnabled&&"google"===this.captchaData.provider&&e("slot",{key:"2779736a3faf4cfac3e4b8b2f8c37baf623e3f46",name:"google"}),e("button",{key:"aa53edc9daacbffa75536087cd0806d93758a5b1",disabled:"true"!==this.loginByPhoneNumber&&(!this.isValidUserEmail||!this.userNameEmail)||"true"===this.loginByPhoneNumber&&(!this.isValidUserPhone||!this.userPhone||!this.userPrefix)||!this.userPassword||!this.isValidPassword||this.isLoginLoading||"gm17"===this.version&&this.captchaData.isEnabled&&!this.captchaData.token,class:"SubmitCredentials",onClick:this.handleLogin},o("login",this.lang)),this.hasError&&e("p",{key:"473110561ec0f6938e577ee1d895162395c4bbd0",class:"CredentialsError"},this.errorMessage)));return e("section",{key:"936a5cb3b6fa82502b0206bebf509184b775c8ca",ref:t=>this.stylingContainer=t},i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};gr.style=':host{display:block;font-family:"Roboto", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormValue{width:100%}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:100%;border-bottom:2px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.InputBox .PhoneInputBox{display:flex;flex-direction:row}.InputBox .PhoneInputBox .PhoneBox{position:relative;width:100%}.InputBox .PhoneInputBox .PrefixBox{position:relative;width:fit-content}.InputBox.InputInvalidBox .PasswordVisibilityIcon{fill:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));font-size:var(--emw--font-size-medium, 16px);pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:var(--emw--font-size-medium, 16px);padding:0 35px 0 5px;color:var(--emw--registration-typography, var(--emw--color-typography, #000000));box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}vaadin-combo-box:focus-within~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}.ForgotPassword button{margin:-10px 0 17px;font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.SubmitCredentials{display:block;margin:0 auto;outline:none;cursor:pointer;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%));border:2px solid var(--emw--button-border-color, #0E5924);border-radius:var(--emw--button-border-radius, 50px);padding:10px 20px;font-size:var(--emw--font-size-large, 20px);font-family:var(--emw--button-typography);color:var(--emw--button-text-color, #FFFFFF)}.SubmitCredentials:disabled{background:#707070;cursor:default}.Register{font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-typography, var(--emw--color-typography, #FFFFFF));text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px)}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px);padding:0 0 20px 0;margin:0}.CredentialsError input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{gr as user_login}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as r}from"./p-55620ccb.js";export{s as setNonce}from"./p-55620ccb.js";import{g as n}from"./p-e1255160.js";(()=>{const s=import.meta.url,r={};return""!==s&&(r.resourcesUrl=new URL(".",s).href),e(r)})().then((async e=>(await n(),r([["p-
|
|
1
|
+
import{p as e,b as r}from"./p-55620ccb.js";export{s as setNonce}from"./p-55620ccb.js";import{g as n}from"./p-e1255160.js";(()=>{const s=import.meta.url,r={};return""!==s&&(r.resourcesUrl=new URL(".",s).href),e(r)})().then((async e=>(await n(),r([["p-c0428412",[[1,"user-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],passwordReset:[513,"password-reset"],userEmailRegex:[513,"user-email-regex"],userEmailRegexOptions:[513,"user-email-regex-options"],userPhoneRegex:[513,"user-phone-regex"],userPhoneRegexOptions:[513,"user-phone-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],version:[513],loginByPhoneNumber:[513,"login-by-phone-number"],mbSource:[513,"mb-source"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],userPhone:[32],userPrefix:[32],isValidPassword:[32],isValidUserPhone:[32],isPasswordVisible:[32],errorMessage:[32],hasError:[32],userPrefixOptions:[32],isLoginLoading:[32],captchaData:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
|