@everymatrix/user-login 1.99.31 → 1.99.33

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.
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
11
+ return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"cfCaptchaIsVisible":[1,"cf-captcha-is-visible"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -7589,7 +7589,7 @@ const UserLogin = class {
7589
7589
  if (typeof ((_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === "function") {
7590
7590
  token = await ((_c = (_b = this.captchaInstance) === null || _b === void 0 ? void 0 : _b.ensureToken) === null || _c === void 0 ? void 0 : _c.call(_b));
7591
7591
  headers[TURNSTILE_TOKEN_RESPONSE_HEADER] = token !== null && token !== void 0 ? token : "";
7592
- headers[TURNSTILE_IS_VISIBLE_HEADER] = "false";
7592
+ headers[TURNSTILE_IS_VISIBLE_HEADER] = this.cfCaptchaIsVisible;
7593
7593
  }
7594
7594
  else {
7595
7595
  token = this.captchaToken;
@@ -7687,7 +7687,7 @@ const UserLogin = class {
7687
7687
  const turnstileToken = await ((_b = (_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === null || _b === void 0 ? void 0 : _b.call(_a));
7688
7688
  if (turnstileToken) {
7689
7689
  headers.append(TURNSTILE_TOKEN_RESPONSE_HEADER, turnstileToken);
7690
- headers.append(TURNSTILE_IS_VISIBLE_HEADER, 'false');
7690
+ headers.append(TURNSTILE_IS_VISIBLE_HEADER, this.cfCaptchaIsVisible);
7691
7691
  }
7692
7692
  }
7693
7693
  catch (error) {
@@ -7893,6 +7893,7 @@ const UserLogin = class {
7893
7893
  this.biometricactionmode = 'switch';
7894
7894
  this.isFromLogin = true;
7895
7895
  this.turnstileSiteKey = undefined;
7896
+ this.cfCaptchaIsVisible = 'false';
7896
7897
  this.userNameEmail = '';
7897
7898
  this.userPassword = '';
7898
7899
  this.isValidUserEmail = true;
@@ -8173,7 +8174,7 @@ const UserLogin = class {
8173
8174
  * Render function
8174
8175
  */
8175
8176
  render() {
8176
- return (index.h("section", { key: 'b68862360fc82cbee468e48ddb6359f9e4974417', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), index.h("slot", { key: '9f5a57a674ffddc608234719d541e872e576e744', name: CAPTCHA_CONTAINER_SLOT })));
8177
+ return (index.h("section", { key: '0bacb3e129ac8c4fb9ce07449995ef21e86d213f', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), index.h("slot", { key: '3c5417e4daab9845d38c34412a6ee4aecbc4c70d', name: CAPTCHA_CONTAINER_SLOT })));
8177
8178
  }
8178
8179
  get host() { return index.getElement(this); }
8179
8180
  static get watchers() { return {
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
22
+ return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"cfCaptchaIsVisible":[1,"cf-captcha-is-visible"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -63,7 +63,7 @@ export class UserLogin {
63
63
  if (typeof ((_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === "function") {
64
64
  token = await ((_c = (_b = this.captchaInstance) === null || _b === void 0 ? void 0 : _b.ensureToken) === null || _c === void 0 ? void 0 : _c.call(_b));
65
65
  headers[TURNSTILE_TOKEN_RESPONSE_HEADER] = token !== null && token !== void 0 ? token : "";
66
- headers[TURNSTILE_IS_VISIBLE_HEADER] = "false";
66
+ headers[TURNSTILE_IS_VISIBLE_HEADER] = this.cfCaptchaIsVisible;
67
67
  }
68
68
  else {
69
69
  token = this.captchaToken;
@@ -161,7 +161,7 @@ export class UserLogin {
161
161
  const turnstileToken = await ((_b = (_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === null || _b === void 0 ? void 0 : _b.call(_a));
162
162
  if (turnstileToken) {
163
163
  headers.append(TURNSTILE_TOKEN_RESPONSE_HEADER, turnstileToken);
164
- headers.append(TURNSTILE_IS_VISIBLE_HEADER, 'false');
164
+ headers.append(TURNSTILE_IS_VISIBLE_HEADER, this.cfCaptchaIsVisible);
165
165
  }
166
166
  }
167
167
  catch (error) {
@@ -367,6 +367,7 @@ export class UserLogin {
367
367
  this.biometricactionmode = 'switch';
368
368
  this.isFromLogin = true;
369
369
  this.turnstileSiteKey = undefined;
370
+ this.cfCaptchaIsVisible = 'false';
370
371
  this.userNameEmail = '';
371
372
  this.userPassword = '';
372
373
  this.isValidUserEmail = true;
@@ -647,7 +648,7 @@ export class UserLogin {
647
648
  * Render function
648
649
  */
649
650
  render() {
650
- return (h("section", { key: 'b68862360fc82cbee468e48ddb6359f9e4974417', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), h("slot", { key: '9f5a57a674ffddc608234719d541e872e576e744', name: CAPTCHA_CONTAINER_SLOT })));
651
+ return (h("section", { key: '0bacb3e129ac8c4fb9ce07449995ef21e86d213f', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), h("slot", { key: '3c5417e4daab9845d38c34412a6ee4aecbc4c70d', name: CAPTCHA_CONTAINER_SLOT })));
651
652
  }
652
653
  static get is() { return "user-login"; }
653
654
  static get encapsulation() { return "shadow"; }
@@ -1073,6 +1074,24 @@ export class UserLogin {
1073
1074
  },
1074
1075
  "attribute": "turnstile-site-key",
1075
1076
  "reflect": false
1077
+ },
1078
+ "cfCaptchaIsVisible": {
1079
+ "type": "string",
1080
+ "mutable": false,
1081
+ "complexType": {
1082
+ "original": "string",
1083
+ "resolved": "string",
1084
+ "references": {}
1085
+ },
1086
+ "required": false,
1087
+ "optional": true,
1088
+ "docs": {
1089
+ "tags": [],
1090
+ "text": "cfCaptchaIsVisible (header)"
1091
+ },
1092
+ "attribute": "cf-captcha-is-visible",
1093
+ "reflect": false,
1094
+ "defaultValue": "'false'"
1076
1095
  }
1077
1096
  };
1078
1097
  }
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
8
+ return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"cfCaptchaIsVisible":[1,"cf-captcha-is-visible"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -7585,7 +7585,7 @@ const UserLogin = class {
7585
7585
  if (typeof ((_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === "function") {
7586
7586
  token = await ((_c = (_b = this.captchaInstance) === null || _b === void 0 ? void 0 : _b.ensureToken) === null || _c === void 0 ? void 0 : _c.call(_b));
7587
7587
  headers[TURNSTILE_TOKEN_RESPONSE_HEADER] = token !== null && token !== void 0 ? token : "";
7588
- headers[TURNSTILE_IS_VISIBLE_HEADER] = "false";
7588
+ headers[TURNSTILE_IS_VISIBLE_HEADER] = this.cfCaptchaIsVisible;
7589
7589
  }
7590
7590
  else {
7591
7591
  token = this.captchaToken;
@@ -7683,7 +7683,7 @@ const UserLogin = class {
7683
7683
  const turnstileToken = await ((_b = (_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === null || _b === void 0 ? void 0 : _b.call(_a));
7684
7684
  if (turnstileToken) {
7685
7685
  headers.append(TURNSTILE_TOKEN_RESPONSE_HEADER, turnstileToken);
7686
- headers.append(TURNSTILE_IS_VISIBLE_HEADER, 'false');
7686
+ headers.append(TURNSTILE_IS_VISIBLE_HEADER, this.cfCaptchaIsVisible);
7687
7687
  }
7688
7688
  }
7689
7689
  catch (error) {
@@ -7889,6 +7889,7 @@ const UserLogin = class {
7889
7889
  this.biometricactionmode = 'switch';
7890
7890
  this.isFromLogin = true;
7891
7891
  this.turnstileSiteKey = undefined;
7892
+ this.cfCaptchaIsVisible = 'false';
7892
7893
  this.userNameEmail = '';
7893
7894
  this.userPassword = '';
7894
7895
  this.isValidUserEmail = true;
@@ -8169,7 +8170,7 @@ const UserLogin = class {
8169
8170
  * Render function
8170
8171
  */
8171
8172
  render() {
8172
- return (h("section", { key: 'b68862360fc82cbee468e48ddb6359f9e4974417', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), h("slot", { key: '9f5a57a674ffddc608234719d541e872e576e744', name: CAPTCHA_CONTAINER_SLOT })));
8173
+ return (h("section", { key: '0bacb3e129ac8c4fb9ce07449995ef21e86d213f', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), h("slot", { key: '3c5417e4daab9845d38c34412a6ee4aecbc4c70d', name: CAPTCHA_CONTAINER_SLOT })));
8173
8174
  }
8174
8175
  get host() { return getElement(this); }
8175
8176
  static get watchers() { return {
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
19
+ return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"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"],"useRegisPasswordCheck":[516,"use-regis-password-check"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"cfCaptchaIsVisible":[1,"cf-captcha-is-visible"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"registrationPasswordLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"useRegisPasswordCheck":["loadRegistrationPasswordValidation"],"endpoint":["loadRegistrationPasswordValidation"]}]]]], options);
20
20
  });
@@ -93,6 +93,10 @@ export declare class UserLogin {
93
93
  * Acts as the enable/disable flag for Turnstile.
94
94
  */
95
95
  turnstileSiteKey?: string;
96
+ /**
97
+ * cfCaptchaIsVisible (header)
98
+ */
99
+ cfCaptchaIsVisible?: string;
96
100
  userNameEmail: string;
97
101
  userPassword: string;
98
102
  isValidUserEmail: boolean;
@@ -21,6 +21,10 @@ export namespace Components {
21
21
  * Display mode for biometric toggle.
22
22
  */
23
23
  "biometricactionmode": 'button' | 'switch';
24
+ /**
25
+ * cfCaptchaIsVisible (header)
26
+ */
27
+ "cfCaptchaIsVisible"?: string;
24
28
  /**
25
29
  * Inline CSS styling provided by the client
26
30
  */
@@ -125,6 +129,10 @@ declare namespace LocalJSX {
125
129
  * Display mode for biometric toggle.
126
130
  */
127
131
  "biometricactionmode"?: 'button' | 'switch';
132
+ /**
133
+ * cfCaptchaIsVisible (header)
134
+ */
135
+ "cfCaptchaIsVisible"?: string;
128
136
  /**
129
137
  * Inline CSS styling provided by the client
130
138
  */
@@ -6654,4 +6654,4 @@ Jt("vaadin-tabs",U`
6654
6654
  </div>
6655
6655
 
6656
6656
  <div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
6657
- `}static get is(){return"vaadin-tabs"}}T(Pl);const Tl=class{constructor(e){t(this,e),this.errorCode="",this.captchaInstance=null,this.registrationPasswordValidator=null,this.registrationPasswordRequest=0,this.messageHandler=async t=>{var e;"NativeAppReady"===(null===(e=t.data)||void 0===e?void 0:e.type)&&(this.isNativeApp=!0,this.biometricsLoaded||(await import("./player-account-biometrics-action-84ade958.js"),this.biometricsLoaded=!0))},this.checkNativeApp=()=>{window.postMessage({type:"CheckNativeApp"})},this.getPhoneCodes=async()=>{const t=new URL(`${this.endpoint}/v1/player/operatorSupportedPhoneCodes`);return fetch(t.href).then((t=>t.json())).then((t=>{var e;return(null!==(e=null==t?void 0:t.phoneCodes)&&void 0!==e?e:[]).map((t=>({label:t,value:t})))})).catch((t=>console.log("Failed to fetch phone codes:",t)))},this.autofillCredentialsHandler=t=>{const{userNameEmail:e,userPassword:i,userPrefix:o,userPhone:s}=(null==t?void 0:t.detail)||{};this.userNameEmail=e,this.userPassword=i,this.userPrefix=o,this.userPhone=s,this.handleLogin()},this.userLoginGm17=async()=>{var t,e,i,o,s;let n={"Content-Type":"application/json"};const a={contact:this.userNameEmail,password:this.userPassword};if(this.captchaInstance){let o;"function"==typeof(null===(t=this.captchaInstance)||void 0===t?void 0:t.ensureToken)?(o=await(null===(i=null===(e=this.captchaInstance)||void 0===e?void 0:e.ensureToken)||void 0===i?void 0:i.call(e)),n[m]=null!=o?o:"",n[v]="false"):(o=this.captchaToken,n["g-recaptcha-response"]=null!=o?o:"")}const l={method:"POST",headers:n,body:JSON.stringify(a)};try{const t=await fetch(`${this.endpoint}/api/v1/players/password-management/auth/password/verify`,l),e=await t.json(),{token:i}=e;if(!i)throw new Error("Token not received from the API call.");await this.sendLegislationLogin(i)}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}finally{this.isLoginLoading=!1,null===(s=null===(o=this.captchaInstance)||void 0===o?void 0:o.reset)||void 0===s||s.call(o)}},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:r("successMessage",this.lang)}},window.location.href),this.hasError=!1)}}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.userLogin=async()=>{var t,e;const i=new URL(`${this.endpoint}/v1/player/legislation/login`),o=new Headers;if(o.append("Content-Type","application/json"),this.turnstileSiteKey&&this.captchaInstance)try{const i=await(null===(e=null===(t=this.captchaInstance)||void 0===t?void 0:t.ensureToken)||void 0===e?void 0:e.call(t));i&&(o.append(m,i),o.append(v,"false"))}catch(t){return this.hasError=!0,this.isLoginLoading=!1,void(null!==t&&(this.errorMessage=r("genericError",this.lang)||`${t}`,this.sendErrorNotification(this.errorMessage)))}const s=JSON.stringify({username:"true"===this.loginByPhoneNumber?`${this.userPrefix} ${this.userPhone}`:this.userNameEmail,password:this.userPassword});return fetch(i.href,{method:"POST",headers:o,body:s}).then((t=>t.json())).then((t=>{var e,i,o,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=r("setUpPassowrd",this.lang),this.sendErrorNotification(r("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:r("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!==(o=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode)&&void 0!==o?o:null==t?void 0:t.errorCode,this.errorMessage="GmErr_USER_AUTH_FAILED"===this.errorCode&&"true"===this.loginByPhoneNumber?r("AuthFailedPhoneNumber",this.lang):r(`${this.errorCode}`,this.lang)||(null===(s=null==t?void 0:t.thirdPartyResponse)||void 0===s?void 0:s.message)||(null==t?void 0:t.message)||r("genericError",this.lang),"GmErr_USER_AUTH_FAILED"!==this.errorCode&&"GmErr_Unauthorized"!==this.errorCode&&"Unauthorized"!==this.errorCode||this.dispatchClearLoginCredentialsEvent(),this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)})).finally((()=>{var t,e;this.isLoginLoading=!1,null===(e=null===(t=this.captchaInstance)||void 0===t?void 0:t.reset)||void 0===e||e.call(t)}))},this.handleLogin=()=>{window.postMessage({type:"SubmitLogin"},window.location.href),this.isLoginLoading=!0;const t={gm16:this.userLogin,gm17:this.userLoginGm17}[this.version]||this.userLogin;this.debounce((async()=>{await t(),this.dispatchUpdateLoginCredentialsEvent()}),850)()},this.handleSubmit=t=>{"Enter"===t.key&&!this.checkIsDisabled()&&this.handleLogin()},this.handleInputChange=(t,e)=>{var i;const o=t.target.value;switch(e){case"user":this.userNameEmail=o,this.isValidUserEmail=this.validate("user",this.userNameEmail),this.errorForFields[e]=!this.isValidUserEmail||o.length<3;break;case"phone":this.userPhone=o.replace(/[^0-9]/g,""),this.inputUserPhoneReference&&(this.inputUserPhoneReference.value=this.userPhone),this.isValidUserPhone=this.validate("phone",this.userPhone),this.errorForFields[e]=!this.isValidUserPhone&&o.length>3;break;case"prefix":this.userPrefix=o,this.isValidUserPhone=this.validate("phone",this.userPhone),this.errorForFields[e]=!this.isValidUserPhone;break;case"password":this.userPassword=o,this.isValidPassword=this.validate("password",o);const t=Number(null!==(i=null==this?void 0:this.minPassLength)&&void 0!==i?i:3);this.errorForFields[e]=!this.isValidPassword&&o.length>t}},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":if(this.useRegisPasswordCheck){if(this.registrationPasswordLoading)return!1;if(this.registrationPasswordValidator)return this.registrationPasswordValidator(e)}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.minPassLength=3,this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex="",this.userEmailRegexOptions="i",this.userPhoneRegex="",this.userPhoneRegexOptions="",this.passwordRegex="",this.passwordRegexOptions="",this.useRegisPasswordCheck=!1,this.version="gm16",this.loginByPhoneNumber="false",this.defaultPrefix=void 0,this.isPrefixEditable="true",this.mbSource=void 0,this.biometricEnabled="false",this.biometricactionmode="switch",this.isFromLogin=!0,this.turnstileSiteKey=void 0,this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.userPhone="",this.userPrefix="",this.isValidPassword=!0,this.isValidUserPhone=!0,this.isPasswordVisible=!1,this.errorMessage="",this.errorForFields={},this.hasError=!1,this.phoneCodes=[],this.isLoginLoading=!1,this.isNativeApp=!1,this.biometricsLoaded=!1,this.registrationPasswordLoading=!1}handleNewTranslations(){s(this.translationUrl)}handleClientStylingChange(t,e){t!==e&&a(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,e){t!==e&&this.clientStylingUrl&&l(this.stylingContainer,this.clientStylingUrl)}async autofillCredentials(t){const{userNameEmail:e,userPassword:i,userPrefix:o="",userPhone:s=""}=t||{};this.userNameEmail=e,this.userPassword=i,this.userPrefix=o,this.userPhone=s,this.handleLogin()}async componentWillLoad(){var t,e;this.useRegisPasswordCheck&&await this.loadRegistrationPasswordValidation(),"true"===this.loginByPhoneNumber&&(this.defaultPrefix&&"false"===this.isPrefixEditable?(this.phoneCodes=[{label:this.defaultPrefix,value:this.defaultPrefix}],this.userPrefix=this.defaultPrefix):(this.phoneCodes=await this.getPhoneCodes()||[],(null===(t=this.phoneCodes)||void 0===t?void 0:t.length)&&!this.defaultPrefix&&"false"===this.isPrefixEditable?this.userPrefix=null===(e=this.phoneCodes[0])||void 0===e?void 0:e.value:this.defaultPrefix&&"true"===this.isPrefixEditable&&(this.userPrefix=this.defaultPrefix,this.phoneCodes.some((t=>t.value===this.defaultPrefix))||this.phoneCodes.push({label:this.defaultPrefix,value:this.defaultPrefix})))),this.translationUrl.length>2&&await s(this.translationUrl),"gm17"===this.version&&this.getLoginConfig().then((t=>{this.initializeCaptcha(t)})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=r("configError",this.lang),this.sendErrorNotification(this.errorMessage)})),"true"===this.biometricEnabled&&(window.addEventListener("message",this.messageHandler),this.checkNativeApp())}handleClientStyling(){void 0===window.emMessageBus?(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&l(this.stylingContainer,this.clientStylingUrl)):this.stylingSubscription=function(t,e,i,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return function(t,e){const i=document.createElement("style");return window.emMessageBus.subscribe(e,(e=>{t&&(i.innerHTML=e,t.appendChild(i))}))}(t,e);window[n]||(window[n]={});const s=(i=function(t,e){return window.emMessageBus.subscribe(e,(i=>{if(!t)return;const o=t.getRootNode(),s=window[n];let r=s[e]&&s[e].sheet;r?s[e].refCount=s[e].refCount+1:(r=new CSSStyleSheet,r.replaceSync(i),s[e]={sheet:r,refCount:1});const a=o.adoptedStyleSheets||[];a.includes(r)||(o.adoptedStyleSheets=[...a,r])}))}(t,e)).unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[n][e]){const t=window[n][e];t.refCount>1?t.refCount=t.refCount-1:delete window[n][e]}s()},i}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription,!0)}componentDidLoad(){this.handleClientStyling(),window.addEventListener("LoginCredentials",this.autofillCredentialsHandler),window.postMessage({type:"UserLoginDidLoad"}),this.turnstileSiteKey&&this.initializeCaptcha({isEnabled:!0,provider:"cloudflare",siteKey:this.turnstileSiteKey})}getLoginConfig(){const t=new URL(`${this.endpoint}/api/v1/players/password-management/auth/password/config`);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()),e(i)})).catch((t=>{console.error("Error fetching login configuration:",t),i(t)}))}))}async loadRegistrationPasswordValidation(){var t;const e=++this.registrationPasswordRequest;if(this.registrationPasswordValidator=null,this.registrationPasswordLoading=this.useRegisPasswordCheck,this.useRegisPasswordCheck)try{const t=await async function(t){var e,i,o;const s=new URL(`${t}/v1/player/legislation/registration/config/`),r=await fetch(s.href,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}});if(!r.ok)throw new Error(`HTTP error! Status: ${r.status}`);const n=await r.json(),a=Array.isArray(null===(e=null==n?void 0:n.content)||void 0===e?void 0:e.fields)?null===(i=n.content.fields.find((t=>"Password"===(null==t?void 0:t.name))))||void 0===i?void 0:i.validate:null;if(!a||"boolean"!=typeof a.mandatory||null!=a.type&&"string"!==a.type||null!=a.custom&&!Array.isArray(a.custom))throw new Error("Registration password validation is missing or invalid.");const{mandatory:l,minLength:h,maxLength:c}=a;for(const t of[h,c])if(null!=t&&(!Number.isInteger(t)||t<0))throw new Error("Registration password length bound is invalid.");if(null!=h&&null!=c&&h>c)throw new Error("Registration password length bounds are inconsistent.");const d=[];for(const t of null!==(o=a.custom)&&void 0!==o?o:[]){if(!t||"string"!=typeof t.rule)throw new Error("Registration password rule is invalid.");if("regex"===t.rule){if("string"!=typeof t.pattern)throw new Error("Registration password regex pattern is invalid.");d.push(new RegExp(t.pattern))}}return t=>0===t.length?!l:(null==h||t.length>=h)&&(null==c||t.length<=c)&&d.every((e=>e.test(t)))}(this.endpoint);if(e!==this.registrationPasswordRequest)return;this.registrationPasswordValidator=t}catch(t){if(e!==this.registrationPasswordRequest)return;console.error("Error fetching registration password validation:",t)}e===this.registrationPasswordRequest&&(this.registrationPasswordLoading=!1,this.isValidPassword=this.validate("password",this.userPassword),this.errorForFields=Object.assign(Object.assign({},this.errorForFields),{password:!this.isValidPassword&&this.userPassword.length>Number(null!==(t=this.minPassLength)&&void 0!==t?t:3)}))}async initializeCaptcha({provider:t,siteKey:e,enableFallback:i}){const o=((t,e)=>{const i=t.shadowRoot?.querySelector(`slot[name="${e}"]`);return i?(i.assignedElements?.()[0]??null)||(console.error(`[${t.tagName.toLowerCase()}] no element assigned to slot "${e}".`),null):(console.error(`[${t.tagName.toLowerCase()}] slot "${e}" not found.`),null)})(this.host,y);this.captchaInstance={google:c,cloudflare:g}[t]({action:"login",siteKey:e,enableFallback:i,callback:"google"===t?t=>{this.captchaToken=t}:void 0}),await this.captchaInstance.render(o)}disconnectedCallback(){var t,e;this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.autofillCredentialsHandler),window.removeEventListener("message",this.messageHandler),this.turnstileSiteKey&&(null===(e=null===(t=this.captchaInstance)||void 0===t?void 0:t.cleanup)||void 0===e||e.call(t))}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=500){let i;return(...o)=>{clearTimeout(i),i=setTimeout((()=>{t(...o)}),e)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:null==this?void 0:this.userNameEmail,userPassword:this.userPassword,userPrefix:null==this?void 0:this.userPrefix,userPhone:null==this?void 0:this.userPhone}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}dispatchClearLoginCredentialsEvent(){const t=new CustomEvent("ClearLoginCredentials",{bubbles:!0});window.dispatchEvent(t)}checkIsDisabled(){return Boolean("true"!==this.loginByPhoneNumber&&(!this.isValidUserEmail||!this.userNameEmail)||"true"===this.loginByPhoneNumber&&(!this.isValidUserPhone||!this.userPhone||!this.userPrefix)||!this.userPassword||!this.isValidPassword||this.isLoginLoading||this.registrationPasswordLoading||"gm17"===this.version&&this.captchaInstance&&!this.captchaToken)}renderVisibilityIcon(){return e("span",{class:"InputIcon"},this.isPasswordVisible&&e("svg",{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",{transform:"translate(-110.856 -23.242)"},e("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{transform:"translate(117.499 27.37)"},e("path",{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",{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",{transform:"translate(110.856 24.899)"},e("path",{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",{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",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&e("svg",{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",{transform:"translate(-14.185 -27.832)"},e("path",{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",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"}))))}renderUserIdentification(){return e("div",{class:"FormBox"},e("div",{class:"FormValue",onKeyDown:this.handleSubmit},"true"===this.loginByPhoneNumber?e("div",{class:!this.isValidUserPhone&&this.hasError?"InputBox InputInvalidBox":"InputBox "},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},"true"===this.isPrefixEditable?e("vaadin-combo-box",{items:this.phoneCodes,value:this.userPrefix,onChange:this.handleInputChangePartial("prefix")}):e("div",{class:"UneditablePrefix"},this.userPrefix),e("label",{class:(this.userPrefix?"FieldFilledIn":"")+" "+(!this.isValidUserPhone&&this.errorForFields.phone?"FieldInvalid":"")},r("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{name:"tel",type:"tel",placeholder:"",ref:t=>this.inputUserPhoneReference=t,value:this.userPhone,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPhone?"FieldFilledIn":"")+" "+(!this.isValidUserPhone&&this.errorForFields.phone?"FieldInvalid":"")},r("userPhone",this.lang)),!this.isValidUserPhone&&this.errorForFields.phone&&e("p",{class:"CredentialsError"},r("userPhoneError",this.lang))))):e("div",{class:!this.isValidUserEmail&&this.errorForFields.user?"InputBox InputInvalidBox":"InputBox"},e("input",{name:"user",type:"text",placeholder:"",value:this.userNameEmail,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail&&this.errorForFields.user?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&this.errorForFields.user&&e("p",{class:"CredentialsError"},r("userEmailError",this.lang))),e("div",{class:!this.isValidPassword&&this.errorForFields.password?"InputBox InputInvalidBox":"InputBox"},this.renderVisibilityIcon(),e("input",{name:"password",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword&&this.errorForFields.password?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&this.errorForFields.password&&e("p",{class:"CredentialsError"},r("userPasswordError",this.lang))),"true"===this.biometricEnabled&&this.isNativeApp&&e("div",{class:"PlayerBiometricsContainer"},e("div",{class:"PlayerBiometrics"},e("span",null,r("biometricLogin")),e("player-account-biometrics-action",{mode:this.biometricactionmode,isFromLogin:this.isFromLogin,isNativeApp:this.isNativeApp,lang:this.lang,translationurl:this.translationUrl,clientstyling:this.clientStyling,clientstylingurl:this.clientStylingUrl,mbsource:this.mbSource,isLoading:this.isLoginLoading}))),"true"==this.passwordReset&&e("div",{class:"ForgotPassword"},e("button",{onClick:this.resetPassword},r("forgotPassword",this.lang))),e("button",{disabled:this.checkIsDisabled(),class:"SubmitCredentials",onClick:this.handleLogin},r("login",this.lang)),this.hasError&&e("p",{class:"CredentialsError"},this.errorMessage)))}render(){return e("section",{key:"b68862360fc82cbee468e48ddb6359f9e4974417",ref:t=>this.stylingContainer=t},this.renderUserIdentification(),e("slot",{key:"9f5a57a674ffddc608234719d541e872e576e744",name:y}))}get host(){return i(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],useRegisPasswordCheck:["loadRegistrationPasswordValidation"],endpoint:["loadRegistrationPasswordValidation"]}}};Tl.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 .PhoneInputBox .PrefixBox .UneditablePrefix{height:100%;width:100px;padding:0 0 0 5px;align-content:center;background:var(--emw--color-gray-100, #e6e6e6);border-radius:var(--emw--border-radius-medium, 10px)}.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:-10px;font-size:var(--emw--font-size-x-small, 16px)}vaadin-combo-box:focus-within~label,label.FieldFilledIn{top:-10px;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:var(--emw--color-primary, #0E5924);border-radius:var(--emw--button-border-radius, 10px);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:var(--emw--color-primary, #0E5924);opacity:0.4;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))}.PlayerBiometricsContainer .PlayerBiometrics{margin:30px 0 40px;font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-typography, var(--emw--color-typography, #000));display:flex;justify-content:space-between;background-color:transparent}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{Tl as user_login}
6657
+ `}static get is(){return"vaadin-tabs"}}T(Pl);const Tl=class{constructor(e){t(this,e),this.errorCode="",this.captchaInstance=null,this.registrationPasswordValidator=null,this.registrationPasswordRequest=0,this.messageHandler=async t=>{var e;"NativeAppReady"===(null===(e=t.data)||void 0===e?void 0:e.type)&&(this.isNativeApp=!0,this.biometricsLoaded||(await import("./player-account-biometrics-action-84ade958.js"),this.biometricsLoaded=!0))},this.checkNativeApp=()=>{window.postMessage({type:"CheckNativeApp"})},this.getPhoneCodes=async()=>{const t=new URL(`${this.endpoint}/v1/player/operatorSupportedPhoneCodes`);return fetch(t.href).then((t=>t.json())).then((t=>{var e;return(null!==(e=null==t?void 0:t.phoneCodes)&&void 0!==e?e:[]).map((t=>({label:t,value:t})))})).catch((t=>console.log("Failed to fetch phone codes:",t)))},this.autofillCredentialsHandler=t=>{const{userNameEmail:e,userPassword:i,userPrefix:o,userPhone:s}=(null==t?void 0:t.detail)||{};this.userNameEmail=e,this.userPassword=i,this.userPrefix=o,this.userPhone=s,this.handleLogin()},this.userLoginGm17=async()=>{var t,e,i,o,s;let n={"Content-Type":"application/json"};const a={contact:this.userNameEmail,password:this.userPassword};if(this.captchaInstance){let o;"function"==typeof(null===(t=this.captchaInstance)||void 0===t?void 0:t.ensureToken)?(o=await(null===(i=null===(e=this.captchaInstance)||void 0===e?void 0:e.ensureToken)||void 0===i?void 0:i.call(e)),n[m]=null!=o?o:"",n[v]=this.cfCaptchaIsVisible):(o=this.captchaToken,n["g-recaptcha-response"]=null!=o?o:"")}const l={method:"POST",headers:n,body:JSON.stringify(a)};try{const t=await fetch(`${this.endpoint}/api/v1/players/password-management/auth/password/verify`,l),e=await t.json(),{token:i}=e;if(!i)throw new Error("Token not received from the API call.");await this.sendLegislationLogin(i)}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}finally{this.isLoginLoading=!1,null===(s=null===(o=this.captchaInstance)||void 0===o?void 0:o.reset)||void 0===s||s.call(o)}},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:r("successMessage",this.lang)}},window.location.href),this.hasError=!1)}}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.userLogin=async()=>{var t,e;const i=new URL(`${this.endpoint}/v1/player/legislation/login`),o=new Headers;if(o.append("Content-Type","application/json"),this.turnstileSiteKey&&this.captchaInstance)try{const i=await(null===(e=null===(t=this.captchaInstance)||void 0===t?void 0:t.ensureToken)||void 0===e?void 0:e.call(t));i&&(o.append(m,i),o.append(v,this.cfCaptchaIsVisible))}catch(t){return this.hasError=!0,this.isLoginLoading=!1,void(null!==t&&(this.errorMessage=r("genericError",this.lang)||`${t}`,this.sendErrorNotification(this.errorMessage)))}const s=JSON.stringify({username:"true"===this.loginByPhoneNumber?`${this.userPrefix} ${this.userPhone}`:this.userNameEmail,password:this.userPassword});return fetch(i.href,{method:"POST",headers:o,body:s}).then((t=>t.json())).then((t=>{var e,i,o,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=r("setUpPassowrd",this.lang),this.sendErrorNotification(r("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:r("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!==(o=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode)&&void 0!==o?o:null==t?void 0:t.errorCode,this.errorMessage="GmErr_USER_AUTH_FAILED"===this.errorCode&&"true"===this.loginByPhoneNumber?r("AuthFailedPhoneNumber",this.lang):r(`${this.errorCode}`,this.lang)||(null===(s=null==t?void 0:t.thirdPartyResponse)||void 0===s?void 0:s.message)||(null==t?void 0:t.message)||r("genericError",this.lang),"GmErr_USER_AUTH_FAILED"!==this.errorCode&&"GmErr_Unauthorized"!==this.errorCode&&"Unauthorized"!==this.errorCode||this.dispatchClearLoginCredentialsEvent(),this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)})).finally((()=>{var t,e;this.isLoginLoading=!1,null===(e=null===(t=this.captchaInstance)||void 0===t?void 0:t.reset)||void 0===e||e.call(t)}))},this.handleLogin=()=>{window.postMessage({type:"SubmitLogin"},window.location.href),this.isLoginLoading=!0;const t={gm16:this.userLogin,gm17:this.userLoginGm17}[this.version]||this.userLogin;this.debounce((async()=>{await t(),this.dispatchUpdateLoginCredentialsEvent()}),850)()},this.handleSubmit=t=>{"Enter"===t.key&&!this.checkIsDisabled()&&this.handleLogin()},this.handleInputChange=(t,e)=>{var i;const o=t.target.value;switch(e){case"user":this.userNameEmail=o,this.isValidUserEmail=this.validate("user",this.userNameEmail),this.errorForFields[e]=!this.isValidUserEmail||o.length<3;break;case"phone":this.userPhone=o.replace(/[^0-9]/g,""),this.inputUserPhoneReference&&(this.inputUserPhoneReference.value=this.userPhone),this.isValidUserPhone=this.validate("phone",this.userPhone),this.errorForFields[e]=!this.isValidUserPhone&&o.length>3;break;case"prefix":this.userPrefix=o,this.isValidUserPhone=this.validate("phone",this.userPhone),this.errorForFields[e]=!this.isValidUserPhone;break;case"password":this.userPassword=o,this.isValidPassword=this.validate("password",o);const t=Number(null!==(i=null==this?void 0:this.minPassLength)&&void 0!==i?i:3);this.errorForFields[e]=!this.isValidPassword&&o.length>t}},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":if(this.useRegisPasswordCheck){if(this.registrationPasswordLoading)return!1;if(this.registrationPasswordValidator)return this.registrationPasswordValidator(e)}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.minPassLength=3,this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex="",this.userEmailRegexOptions="i",this.userPhoneRegex="",this.userPhoneRegexOptions="",this.passwordRegex="",this.passwordRegexOptions="",this.useRegisPasswordCheck=!1,this.version="gm16",this.loginByPhoneNumber="false",this.defaultPrefix=void 0,this.isPrefixEditable="true",this.mbSource=void 0,this.biometricEnabled="false",this.biometricactionmode="switch",this.isFromLogin=!0,this.turnstileSiteKey=void 0,this.cfCaptchaIsVisible="false",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.userPhone="",this.userPrefix="",this.isValidPassword=!0,this.isValidUserPhone=!0,this.isPasswordVisible=!1,this.errorMessage="",this.errorForFields={},this.hasError=!1,this.phoneCodes=[],this.isLoginLoading=!1,this.isNativeApp=!1,this.biometricsLoaded=!1,this.registrationPasswordLoading=!1}handleNewTranslations(){s(this.translationUrl)}handleClientStylingChange(t,e){t!==e&&a(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,e){t!==e&&this.clientStylingUrl&&l(this.stylingContainer,this.clientStylingUrl)}async autofillCredentials(t){const{userNameEmail:e,userPassword:i,userPrefix:o="",userPhone:s=""}=t||{};this.userNameEmail=e,this.userPassword=i,this.userPrefix=o,this.userPhone=s,this.handleLogin()}async componentWillLoad(){var t,e;this.useRegisPasswordCheck&&await this.loadRegistrationPasswordValidation(),"true"===this.loginByPhoneNumber&&(this.defaultPrefix&&"false"===this.isPrefixEditable?(this.phoneCodes=[{label:this.defaultPrefix,value:this.defaultPrefix}],this.userPrefix=this.defaultPrefix):(this.phoneCodes=await this.getPhoneCodes()||[],(null===(t=this.phoneCodes)||void 0===t?void 0:t.length)&&!this.defaultPrefix&&"false"===this.isPrefixEditable?this.userPrefix=null===(e=this.phoneCodes[0])||void 0===e?void 0:e.value:this.defaultPrefix&&"true"===this.isPrefixEditable&&(this.userPrefix=this.defaultPrefix,this.phoneCodes.some((t=>t.value===this.defaultPrefix))||this.phoneCodes.push({label:this.defaultPrefix,value:this.defaultPrefix})))),this.translationUrl.length>2&&await s(this.translationUrl),"gm17"===this.version&&this.getLoginConfig().then((t=>{this.initializeCaptcha(t)})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=r("configError",this.lang),this.sendErrorNotification(this.errorMessage)})),"true"===this.biometricEnabled&&(window.addEventListener("message",this.messageHandler),this.checkNativeApp())}handleClientStyling(){void 0===window.emMessageBus?(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&l(this.stylingContainer,this.clientStylingUrl)):this.stylingSubscription=function(t,e,i,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return function(t,e){const i=document.createElement("style");return window.emMessageBus.subscribe(e,(e=>{t&&(i.innerHTML=e,t.appendChild(i))}))}(t,e);window[n]||(window[n]={});const s=(i=function(t,e){return window.emMessageBus.subscribe(e,(i=>{if(!t)return;const o=t.getRootNode(),s=window[n];let r=s[e]&&s[e].sheet;r?s[e].refCount=s[e].refCount+1:(r=new CSSStyleSheet,r.replaceSync(i),s[e]={sheet:r,refCount:1});const a=o.adoptedStyleSheets||[];a.includes(r)||(o.adoptedStyleSheets=[...a,r])}))}(t,e)).unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[n][e]){const t=window[n][e];t.refCount>1?t.refCount=t.refCount-1:delete window[n][e]}s()},i}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription,!0)}componentDidLoad(){this.handleClientStyling(),window.addEventListener("LoginCredentials",this.autofillCredentialsHandler),window.postMessage({type:"UserLoginDidLoad"}),this.turnstileSiteKey&&this.initializeCaptcha({isEnabled:!0,provider:"cloudflare",siteKey:this.turnstileSiteKey})}getLoginConfig(){const t=new URL(`${this.endpoint}/api/v1/players/password-management/auth/password/config`);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()),e(i)})).catch((t=>{console.error("Error fetching login configuration:",t),i(t)}))}))}async loadRegistrationPasswordValidation(){var t;const e=++this.registrationPasswordRequest;if(this.registrationPasswordValidator=null,this.registrationPasswordLoading=this.useRegisPasswordCheck,this.useRegisPasswordCheck)try{const t=await async function(t){var e,i,o;const s=new URL(`${t}/v1/player/legislation/registration/config/`),r=await fetch(s.href,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}});if(!r.ok)throw new Error(`HTTP error! Status: ${r.status}`);const n=await r.json(),a=Array.isArray(null===(e=null==n?void 0:n.content)||void 0===e?void 0:e.fields)?null===(i=n.content.fields.find((t=>"Password"===(null==t?void 0:t.name))))||void 0===i?void 0:i.validate:null;if(!a||"boolean"!=typeof a.mandatory||null!=a.type&&"string"!==a.type||null!=a.custom&&!Array.isArray(a.custom))throw new Error("Registration password validation is missing or invalid.");const{mandatory:l,minLength:h,maxLength:c}=a;for(const t of[h,c])if(null!=t&&(!Number.isInteger(t)||t<0))throw new Error("Registration password length bound is invalid.");if(null!=h&&null!=c&&h>c)throw new Error("Registration password length bounds are inconsistent.");const d=[];for(const t of null!==(o=a.custom)&&void 0!==o?o:[]){if(!t||"string"!=typeof t.rule)throw new Error("Registration password rule is invalid.");if("regex"===t.rule){if("string"!=typeof t.pattern)throw new Error("Registration password regex pattern is invalid.");d.push(new RegExp(t.pattern))}}return t=>0===t.length?!l:(null==h||t.length>=h)&&(null==c||t.length<=c)&&d.every((e=>e.test(t)))}(this.endpoint);if(e!==this.registrationPasswordRequest)return;this.registrationPasswordValidator=t}catch(t){if(e!==this.registrationPasswordRequest)return;console.error("Error fetching registration password validation:",t)}e===this.registrationPasswordRequest&&(this.registrationPasswordLoading=!1,this.isValidPassword=this.validate("password",this.userPassword),this.errorForFields=Object.assign(Object.assign({},this.errorForFields),{password:!this.isValidPassword&&this.userPassword.length>Number(null!==(t=this.minPassLength)&&void 0!==t?t:3)}))}async initializeCaptcha({provider:t,siteKey:e,enableFallback:i}){const o=((t,e)=>{const i=t.shadowRoot?.querySelector(`slot[name="${e}"]`);return i?(i.assignedElements?.()[0]??null)||(console.error(`[${t.tagName.toLowerCase()}] no element assigned to slot "${e}".`),null):(console.error(`[${t.tagName.toLowerCase()}] slot "${e}" not found.`),null)})(this.host,y);this.captchaInstance={google:c,cloudflare:g}[t]({action:"login",siteKey:e,enableFallback:i,callback:"google"===t?t=>{this.captchaToken=t}:void 0}),await this.captchaInstance.render(o)}disconnectedCallback(){var t,e;this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.autofillCredentialsHandler),window.removeEventListener("message",this.messageHandler),this.turnstileSiteKey&&(null===(e=null===(t=this.captchaInstance)||void 0===t?void 0:t.cleanup)||void 0===e||e.call(t))}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=500){let i;return(...o)=>{clearTimeout(i),i=setTimeout((()=>{t(...o)}),e)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:null==this?void 0:this.userNameEmail,userPassword:this.userPassword,userPrefix:null==this?void 0:this.userPrefix,userPhone:null==this?void 0:this.userPhone}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}dispatchClearLoginCredentialsEvent(){const t=new CustomEvent("ClearLoginCredentials",{bubbles:!0});window.dispatchEvent(t)}checkIsDisabled(){return Boolean("true"!==this.loginByPhoneNumber&&(!this.isValidUserEmail||!this.userNameEmail)||"true"===this.loginByPhoneNumber&&(!this.isValidUserPhone||!this.userPhone||!this.userPrefix)||!this.userPassword||!this.isValidPassword||this.isLoginLoading||this.registrationPasswordLoading||"gm17"===this.version&&this.captchaInstance&&!this.captchaToken)}renderVisibilityIcon(){return e("span",{class:"InputIcon"},this.isPasswordVisible&&e("svg",{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",{transform:"translate(-110.856 -23.242)"},e("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{transform:"translate(117.499 27.37)"},e("path",{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",{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",{transform:"translate(110.856 24.899)"},e("path",{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",{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",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&e("svg",{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",{transform:"translate(-14.185 -27.832)"},e("path",{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",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"}))))}renderUserIdentification(){return e("div",{class:"FormBox"},e("div",{class:"FormValue",onKeyDown:this.handleSubmit},"true"===this.loginByPhoneNumber?e("div",{class:!this.isValidUserPhone&&this.hasError?"InputBox InputInvalidBox":"InputBox "},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},"true"===this.isPrefixEditable?e("vaadin-combo-box",{items:this.phoneCodes,value:this.userPrefix,onChange:this.handleInputChangePartial("prefix")}):e("div",{class:"UneditablePrefix"},this.userPrefix),e("label",{class:(this.userPrefix?"FieldFilledIn":"")+" "+(!this.isValidUserPhone&&this.errorForFields.phone?"FieldInvalid":"")},r("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{name:"tel",type:"tel",placeholder:"",ref:t=>this.inputUserPhoneReference=t,value:this.userPhone,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPhone?"FieldFilledIn":"")+" "+(!this.isValidUserPhone&&this.errorForFields.phone?"FieldInvalid":"")},r("userPhone",this.lang)),!this.isValidUserPhone&&this.errorForFields.phone&&e("p",{class:"CredentialsError"},r("userPhoneError",this.lang))))):e("div",{class:!this.isValidUserEmail&&this.errorForFields.user?"InputBox InputInvalidBox":"InputBox"},e("input",{name:"user",type:"text",placeholder:"",value:this.userNameEmail,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail&&this.errorForFields.user?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&this.errorForFields.user&&e("p",{class:"CredentialsError"},r("userEmailError",this.lang))),e("div",{class:!this.isValidPassword&&this.errorForFields.password?"InputBox InputInvalidBox":"InputBox"},this.renderVisibilityIcon(),e("input",{name:"password",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword&&this.errorForFields.password?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&this.errorForFields.password&&e("p",{class:"CredentialsError"},r("userPasswordError",this.lang))),"true"===this.biometricEnabled&&this.isNativeApp&&e("div",{class:"PlayerBiometricsContainer"},e("div",{class:"PlayerBiometrics"},e("span",null,r("biometricLogin")),e("player-account-biometrics-action",{mode:this.biometricactionmode,isFromLogin:this.isFromLogin,isNativeApp:this.isNativeApp,lang:this.lang,translationurl:this.translationUrl,clientstyling:this.clientStyling,clientstylingurl:this.clientStylingUrl,mbsource:this.mbSource,isLoading:this.isLoginLoading}))),"true"==this.passwordReset&&e("div",{class:"ForgotPassword"},e("button",{onClick:this.resetPassword},r("forgotPassword",this.lang))),e("button",{disabled:this.checkIsDisabled(),class:"SubmitCredentials",onClick:this.handleLogin},r("login",this.lang)),this.hasError&&e("p",{class:"CredentialsError"},this.errorMessage)))}render(){return e("section",{key:"0bacb3e129ac8c4fb9ce07449995ef21e86d213f",ref:t=>this.stylingContainer=t},this.renderUserIdentification(),e("slot",{key:"3c5417e4daab9845d38c34412a6ee4aecbc4c70d",name:y}))}get host(){return i(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],useRegisPasswordCheck:["loadRegistrationPasswordValidation"],endpoint:["loadRegistrationPasswordValidation"]}}};Tl.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 .PhoneInputBox .PrefixBox .UneditablePrefix{height:100%;width:100px;padding:0 0 0 5px;align-content:center;background:var(--emw--color-gray-100, #e6e6e6);border-radius:var(--emw--border-radius-medium, 10px)}.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:-10px;font-size:var(--emw--font-size-x-small, 16px)}vaadin-combo-box:focus-within~label,label.FieldFilledIn{top:-10px;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:var(--emw--color-primary, #0E5924);border-radius:var(--emw--button-border-radius, 10px);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:var(--emw--color-primary, #0E5924);opacity:0.4;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))}.PlayerBiometricsContainer .PlayerBiometrics{margin:30px 0 40px;font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-typography, var(--emw--color-typography, #000));display:flex;justify-content:space-between;background-color:transparent}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{Tl as user_login}
@@ -1 +1 @@
1
- import{p as e,b as i}from"./index-b943f0d9.js";export{s as setNonce}from"./index-b943f0d9.js";import{g as r}from"./app-globals-0f993ce5.js";(()=>{const s=import.meta.url,i={};return""!==s&&(i.resourcesUrl=new URL(".",s).href),e(i)})().then((async e=>(await r(),i([["user-login",[[1,"user-login",{endpoint:[513],minPassLength:[514,"min-pass-length"],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"],useRegisPasswordCheck:[516,"use-regis-password-check"],version:[513],loginByPhoneNumber:[513,"login-by-phone-number"],defaultPrefix:[513,"default-prefix"],isPrefixEditable:[513,"is-prefix-editable"],mbSource:[513,"mb-source"],biometricEnabled:[513,"biometric-enabled"],biometricactionmode:[1],isFromLogin:[4,"is-from-login"],turnstileSiteKey:[1,"turnstile-site-key"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],userPhone:[32],userPrefix:[32],isValidPassword:[32],isValidUserPhone:[32],isPasswordVisible:[32],errorMessage:[32],errorForFields:[32],hasError:[32],phoneCodes:[32],isLoginLoading:[32],isNativeApp:[32],biometricsLoaded:[32],registrationPasswordLoading:[32],autofillCredentials:[64]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],useRegisPasswordCheck:["loadRegistrationPasswordValidation"],endpoint:["loadRegistrationPasswordValidation"]}]]]],e))));
1
+ import{p as e,b as i}from"./index-b943f0d9.js";export{s as setNonce}from"./index-b943f0d9.js";import{g as r}from"./app-globals-0f993ce5.js";(()=>{const s=import.meta.url,i={};return""!==s&&(i.resourcesUrl=new URL(".",s).href),e(i)})().then((async e=>(await r(),i([["user-login",[[1,"user-login",{endpoint:[513],minPassLength:[514,"min-pass-length"],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"],useRegisPasswordCheck:[516,"use-regis-password-check"],version:[513],loginByPhoneNumber:[513,"login-by-phone-number"],defaultPrefix:[513,"default-prefix"],isPrefixEditable:[513,"is-prefix-editable"],mbSource:[513,"mb-source"],biometricEnabled:[513,"biometric-enabled"],biometricactionmode:[1],isFromLogin:[4,"is-from-login"],turnstileSiteKey:[1,"turnstile-site-key"],cfCaptchaIsVisible:[1,"cf-captcha-is-visible"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],userPhone:[32],userPrefix:[32],isValidPassword:[32],isValidUserPhone:[32],isPasswordVisible:[32],errorMessage:[32],errorForFields:[32],hasError:[32],phoneCodes:[32],isLoginLoading:[32],isNativeApp:[32],biometricsLoaded:[32],registrationPasswordLoading:[32],autofillCredentials:[64]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],useRegisPasswordCheck:["loadRegistrationPasswordValidation"],endpoint:["loadRegistrationPasswordValidation"]}]]]],e))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-login",
3
- "version": "1.99.31",
3
+ "version": "1.99.33",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",