@everymatrix/pam-login 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const pamLogin = require('./pam-login-13f9280c.js');
5
+ const pamLogin = require('./pam-login-473c670d.js');
6
6
  require('./index-c5001c3e.js');
7
7
 
8
8
 
@@ -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([["pam-login_2.cjs",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"prefixValue":[32],"prefixOptions":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
11
+ return index.bootstrapLazy([["pam-login_2.cjs",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"phoneCodeValue":[32],"phoneCodes":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -21899,18 +21899,16 @@ const PamLogin = class {
21899
21899
  /**
21900
21900
  * Fetch phone prefixes from the API
21901
21901
  */
21902
- this.getPrefixOptions = () => {
21903
- const url = new URL('v1/player/validPhoneCodes', this.endpoint);
21904
- return new Promise((resolve) => {
21905
- fetch(url.href)
21906
- .then((res) => res.json())
21907
- .then((res) => {
21908
- this.prefixOptions = res.phoneCodes.map(code => {
21909
- return { label: code.Prefix, value: code.Prefix };
21910
- });
21911
- resolve();
21902
+ this.getPhoneCodes = () => {
21903
+ const url = new URL('v1/player/operatorSupportedPhoneCodes', this.endpoint);
21904
+ return fetch(url.href)
21905
+ .then(res => res.json())
21906
+ .then(data => {
21907
+ this.phoneCodes = data.phoneCodes.map(code => {
21908
+ return { label: code, value: code };
21912
21909
  });
21913
- });
21910
+ })
21911
+ .catch(err => console.log('Failed to fetch phone codes:', err));
21914
21912
  };
21915
21913
  /**
21916
21914
  * Handle autofilling of credentials from a dispatched event
@@ -22030,7 +22028,7 @@ const PamLogin = class {
22030
22028
  this.isContactValid = this.validate('phone', this.contactValue);
22031
22029
  break;
22032
22030
  case 'prefix':
22033
- this.prefixValue = inputValue;
22031
+ this.phoneCodeValue = inputValue;
22034
22032
  this.isContactValid = this.validate('phone', this.contactValue);
22035
22033
  break;
22036
22034
  case 'password':
@@ -22055,14 +22053,14 @@ const PamLogin = class {
22055
22053
  return input.length <= 3 || regex.test(input);
22056
22054
  case 'phone':
22057
22055
  regex = new RegExp(this.userPhoneRegex, this.userPhoneRegexOptions);
22058
- return input.length <= 3 || regex.test(input) && Boolean(this.prefixValue);
22056
+ return input.length <= 3 || regex.test(input) && Boolean(this.phoneCodeValue);
22059
22057
  case 'password':
22060
22058
  regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
22061
22059
  return input.length <= 3 || regex.test(input);
22062
22060
  }
22063
22061
  };
22064
22062
  this.isSubmitDisabled = () => {
22065
- return ((!this.isContactValid || !this.contactValue || (this.loginByPhoneNumber === 'true' && !this.prefixValue))
22063
+ return ((!this.isContactValid || !this.contactValue || (this.loginByPhoneNumber === 'true' && !this.phoneCodeValue))
22066
22064
  || !this.passwordValue
22067
22065
  || !this.isPasswordValid) || this.isLoading
22068
22066
  || (this.captchaData.isEnabled && !this.captchaData.token);
@@ -22101,8 +22099,8 @@ const PamLogin = class {
22101
22099
  this.isLoading = false;
22102
22100
  this.contactValue = '';
22103
22101
  this.passwordValue = '';
22104
- this.prefixValue = '';
22105
- this.prefixOptions = undefined;
22102
+ this.phoneCodeValue = '';
22103
+ this.phoneCodes = undefined;
22106
22104
  this.isContactValid = true;
22107
22105
  this.isPasswordValid = true;
22108
22106
  this.isPasswordVisible = false;
@@ -22148,7 +22146,7 @@ const PamLogin = class {
22148
22146
  */
22149
22147
  async componentWillLoad() {
22150
22148
  if (this.loginByPhoneNumber === 'true') {
22151
- await this.getPrefixOptions();
22149
+ await this.getPhoneCodes();
22152
22150
  }
22153
22151
  if (this.translationUrl.length > 2) {
22154
22152
  await getTranslations(this.translationUrl);
@@ -22305,21 +22303,21 @@ const PamLogin = class {
22305
22303
  * Render function
22306
22304
  */
22307
22305
  render() {
22308
- const visibilityIcon = index.h("span", { key: 'bb874e46d790f8a76529b2f4ee0ccb2ea49ace3e', class: "InputIcon" }, this.isPasswordVisible
22306
+ const visibilityIcon = index.h("span", { key: '7374b9075a40a785273ee060cc5c1adce55f22f9', class: "InputIcon" }, this.isPasswordVisible
22309
22307
  ? index.h("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" }, index.h("g", { transform: "translate(-110.856 -23.242)" }, index.h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { transform: "translate(117.499 27.37)" }, index.h("path", { 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", { 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", { transform: "translate(110.856 24.899)" }, index.h("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)" }), index.h("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)" })), index.h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" })))
22310
22308
  : index.h("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" }, index.h("g", { transform: "translate(-14.185 -27.832)" }, index.h("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)" }), index.h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
22311
- const loginForm = (index.h("div", { key: '3822128fa2d495e22cfe6487b92a59074edc207b', class: "FormBox" }, index.h("div", { key: 'b492b35e0496d783bee08268de7da92de188e7b2', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
22312
- ? index.h("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, index.h("div", { class: "PhoneInputBox" }, index.h("div", { class: "PrefixBox" }, index.h("vaadin-combo-box", { items: this.prefixOptions, value: this.prefixValue, onChange: this.handleInputChangePartial('prefix') }), index.h("label", { class: (this.prefixValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPrefix', this.lang))), index.h("div", { class: "PhoneBox" }, index.h("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), index.h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPhone', this.lang)))), !this.isContactValid &&
22309
+ const loginForm = (index.h("div", { key: 'e6329737430ea03f988447e4244422c8a21cccab', class: "FormBox" }, index.h("div", { key: '8d620c5d6ae58c9e878ea09472f7baef78b068f7', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
22310
+ ? index.h("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, index.h("div", { class: "PhoneInputBox" }, index.h("div", { class: "PrefixBox" }, index.h("vaadin-combo-box", { items: this.phoneCodes, value: this.phoneCodeValue, onChange: this.handleInputChangePartial('prefix') }), index.h("label", { class: (this.phoneCodeValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPrefix', this.lang))), index.h("div", { class: "PhoneBox" }, index.h("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), index.h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPhone', this.lang)))), !this.isContactValid &&
22313
22311
  index.h("p", { class: "CredentialsError" }, translate$1('userPhoneError', this.lang)))
22314
22312
  : index.h("div", { class: this.isContactValid ? 'InputBox' : 'InputBox InputInvalidBox' }, index.h("input", { type: "text", placeholder: '', value: this.contactValue, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), index.h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userEmail', this.lang)), !this.isContactValid &&
22315
- index.h("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), index.h("div", { key: '941ccdbbdffadfa763255f6d035d11e25f95bca9', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, index.h("input", { key: '40e370bf348dc25c9c9b951cc8bef83ce2ee7c72', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), index.h("label", { key: 'c6c86c450654d495d0022dd123d20ded3426fccf', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate$1('password', this.lang)), this.isPasswordValid ||
22316
- index.h("p", { key: '98cd887991ab13215cdeba0d74deaef1f74bd61a', class: "CredentialsError" }, translate$1('userPasswordError', this.lang))), this.passwordReset == 'true' &&
22317
- index.h("div", { key: 'ccb6a014b9238dc1b43ee6d7fcbde0f6ad65a974', class: "ForgotPassword" }, index.h("button", { key: 'c07e6292964c9ffaf18f84b3fb639168bfe69711', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
22318
- index.h("slot", { key: '873d1144706d713f38e87d7413dc65bea89eaf07', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
22319
- index.h("slot", { key: '2e88c7d908719ad03c32feb39c2782b6a53fa3e6', name: "google" }), index.h("button", { key: '16f1ce841ea0797a2a53fa88283e9504b149674b', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.apiErrorMessage &&
22320
- index.h("p", { key: '6bfaca1c1894113134d8112bf0245c4fe8f539ff', class: "CredentialsError" }, this.apiErrorMessage))));
22321
- const skeleton = (index.h("div", { key: '6a5bdd7a73a48735fb7893846d18eab4cb5cd15d', class: "LoadingSkeleton" }, index.h("form", { key: '56909c222a4a5c01e00033183c49bac967fdd704', class: "Form" }, index.h("section", { key: 'aa5fb3aeccaa92b2dbaded30bc91f27d5fc88995', class: "FieldsSection" }, index.h("div", { key: '2232d21237018605d4dc5be187a2f5ef6dcbfdff', class: "FieldContainer" }, index.h("div", { key: 'b6ba71f89fae3edf9c8fbfc74a77b75287c12fcc', class: "FieldTitle" }, index.h("ui-skeleton", { key: '9237a050a5eec7ecb28d20e8e9af148ea5991474', structure: "title", width: "auto", height: "20px" })), index.h("ui-skeleton", { key: '7f1bcda4723e9f6f24dad602bff1480e122624da', structure: "rectangle", width: "auto", height: "35px" })), index.h("div", { key: 'ff6c82b4e37d9b796fecd9ca4c919a70ab1ed4ab', class: "FieldContainer" }, index.h("div", { key: 'a85bf5caf0db9b8ad12a475014f71d975a5114ed', class: "FieldTitle" }, index.h("ui-skeleton", { key: 'fe0600c8fa0564724b10203bf72c929566fcba54', structure: "title", width: "auto", height: "20px" })), index.h("ui-skeleton", { key: 'f59b2ccdbb812f8941e22bfae8f788f2bc821898', structure: "rectangle", width: "auto", height: "35px" }))), index.h("section", { key: '8b337059fb6bb2566c173ba5a2a6139b7a5a0d29', class: "ButtonsSection" }, index.h("div", { key: 'a5d537f7724c07b069cdf74b223237d140f51193', class: "Button" }, index.h("ui-skeleton", { key: 'ea24ff03ffb93d4d41a8617c6e2d16b6c94dc060', structure: "rectangle", width: "auto", height: "50px" }))))));
22322
- return (index.h("section", { key: '91eba8645bb65ce5871683189547dd9afcfb8e4a', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
22313
+ index.h("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), index.h("div", { key: '3e654d0faf6268a2a44870b7c17f206a000efe56', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, index.h("input", { key: '35f9203a90619c9aef4047bad6b0041ecee37abe', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), index.h("label", { key: '79d0351589cde486169bf713bd763d9ae02dea1e', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate$1('password', this.lang)), this.isPasswordValid ||
22314
+ index.h("p", { key: '07249828e3168b3908c69d46134d4020f20a8288', class: "CredentialsError" }, translate$1('userPasswordError', this.lang))), this.passwordReset == 'true' &&
22315
+ index.h("div", { key: '3c7a518e46ba14896be800f57ff414b616592fc5', class: "ForgotPassword" }, index.h("button", { key: '3aea4149f42c0f817ad2b97bdf0b9d6a38008e41', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
22316
+ index.h("slot", { key: '8379b390d68325a4601459a45696c30d87d695eb', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
22317
+ index.h("slot", { key: '290e79e106282f87196428f4fe7b59e30645228c', name: "google" }), index.h("button", { key: '33f37f8e3aedcd561d8198865cb5af4f3b4d1e3f', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.apiErrorMessage &&
22318
+ index.h("p", { key: '27eb501ce5a520978c54327c7480df7efb54dbcc', class: "CredentialsError" }, this.apiErrorMessage))));
22319
+ const skeleton = (index.h("div", { key: 'aa7e0b94f08ce3e180b6ff3cdff0396502eed0d9', class: "LoadingSkeleton" }, index.h("form", { key: 'df646fdee9d4a0cb802de1cfc1a9f562f00a737e', class: "Form" }, index.h("section", { key: 'f8fead4ba0a7350ff85b784acdc60a9acd2d2e4a', class: "FieldsSection" }, index.h("div", { key: '30e59b5a9190297b9f808d1f67ef59a873ae00a1', class: "FieldContainer" }, index.h("div", { key: 'cb7a2a78b89447e9fa8d553022d8c14111424cee', class: "FieldTitle" }, index.h("ui-skeleton", { key: '369a6fb94d8ddebcd4d81b738ae4b4b1d623e6e9', structure: "title", width: "auto", height: "20px" })), index.h("ui-skeleton", { key: '6aaf9e8a13bf8d4c30245c79d04fd4c6d013d771', structure: "rectangle", width: "auto", height: "35px" })), index.h("div", { key: '01eb04f30cd51e40a11a0447a514b2a7aaf779d4', class: "FieldContainer" }, index.h("div", { key: '2d23f028924f87dcdbdcabd352668ce6821e3ca7', class: "FieldTitle" }, index.h("ui-skeleton", { key: '9438f81cba906da223dbf25da04748e899bb7273', structure: "title", width: "auto", height: "20px" })), index.h("ui-skeleton", { key: '7d128d685e923ba084b48ce587af7031db8deb03', structure: "rectangle", width: "auto", height: "35px" }))), index.h("section", { key: '2084b7641a274939db4bcde7fce82ae717edbd5b', class: "ButtonsSection" }, index.h("div", { key: '5b838a5815a537c812eb95c9760d4f1be0c6d457', class: "Button" }, index.h("ui-skeleton", { key: '7d0e20018649d37079567795b52ce34dd5b824a2', structure: "rectangle", width: "auto", height: "50px" }))))));
22320
+ return (index.h("section", { key: 'd75baf969a810e169463146e113905a70efd03db', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
22323
22321
  }
22324
22322
  static get watchers() { return {
22325
22323
  "translationUrl": ["handleNewTranslations"],
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["pam-login_2.cjs",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"prefixValue":[32],"prefixOptions":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
22
+ return index.bootstrapLazy([["pam-login_2.cjs",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"phoneCodeValue":[32],"phoneCodes":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const pamLogin = require('./pam-login-13f9280c.js');
5
+ const pamLogin = require('./pam-login-473c670d.js');
6
6
  const index = require('./index-c5001c3e.js');
7
7
 
8
- const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
8
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
9
9
  const UiSkeletonStyle0 = uiSkeletonCss;
10
10
 
11
11
  const UiSkeleton = class {
@@ -18,7 +18,8 @@ const UiSkeleton = class {
18
18
  marginBottom: this.handleStylingProps(this.marginBottom),
19
19
  marginTop: this.handleStylingProps(this.marginTop),
20
20
  marginLeft: this.handleStylingProps(this.marginLeft),
21
- marginRight: this.handleStylingProps(this.marginRight)
21
+ marginRight: this.handleStylingProps(this.marginRight),
22
+ size: this.handleStylingProps(this.size)
22
23
  };
23
24
  this.structure = undefined;
24
25
  this.width = 'unset';
@@ -31,9 +32,6 @@ const UiSkeleton = class {
31
32
  this.animation = true;
32
33
  this.rows = 0;
33
34
  this.size = '100%';
34
- this.color = '#c2c2c2';
35
- this.primaryColor = '#c2c2c2';
36
- this.secondaryColor = '#ffffff';
37
35
  }
38
36
  handleStructureChange(newValue, oldValue) {
39
37
  if (oldValue !== newValue) {
@@ -108,9 +106,6 @@ const UiSkeleton = class {
108
106
  --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
109
107
  --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
110
108
  --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
111
- --emw-skeleton-logo-background: ${this.color};
112
- --emw-skeleton-primary-color: ${this.primaryColor};
113
- --emw-skeleton-secondary-color: ${this.secondaryColor};
114
109
  }
115
110
  `;
116
111
  break;
@@ -124,9 +119,6 @@ const UiSkeleton = class {
124
119
  --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
125
120
  --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
126
121
  --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
127
- --emw-skeleton-image-background: ${this.color};
128
- --emw-skeleton-primary-color: ${this.primaryColor};
129
- --emw-skeleton-secondary-color: ${this.secondaryColor};
130
122
  }
131
123
  `;
132
124
  break;
@@ -140,9 +132,6 @@ const UiSkeleton = class {
140
132
  --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
141
133
  --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
142
134
  --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
143
- --emw-skeleton-title-background: ${this.color};
144
- --emw-skeleton-primary-color: ${this.primaryColor};
145
- --emw-skeleton-secondary-color: ${this.secondaryColor};
146
135
  }
147
136
  `;
148
137
  break;
@@ -156,9 +145,6 @@ const UiSkeleton = class {
156
145
  --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
157
146
  --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
158
147
  --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
159
- --emw-skeleton-text-background: ${this.color};
160
- --emw-skeleton-primary-color: ${this.primaryColor};
161
- --emw-skeleton-secondary-color: ${this.secondaryColor};
162
148
  }
163
149
  `;
164
150
  break;
@@ -172,26 +158,20 @@ const UiSkeleton = class {
172
158
  --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
173
159
  --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
174
160
  --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
175
- --emw-skeleton-rectangle-background: ${this.color};
176
- --emw-skeleton-primary-color: ${this.primaryColor};
177
- --emw-skeleton-secondary-color: ${this.secondaryColor};
178
161
  }
179
162
  `;
180
163
  break;
181
164
  case 'circle':
182
165
  styleBlock = `
183
166
  :host {
184
- --emw-skeleton-circle-size: ${this.size};
185
- --emw-skeleton-circle-background: ${this.color};
186
- --emw-skeleton-primary-color: ${this.primaryColor};
187
- --emw-skeleton-secondary-color: ${this.secondaryColor};
167
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
188
168
  }
189
169
  `;
190
170
  break;
191
171
  default:
192
172
  styleBlock = '';
193
173
  }
194
- return (index.h(index.Host, { key: '5c185b76c438d20d4ad88bc48d94ff5628410bb7' }, index.h("style", { key: 'de95e60a5955d5b2af83710423fe40329c187f7e' }, styleBlock), this.handleStructure(this.structure)));
174
+ return (index.h(index.Host, { key: 'e6b885bfd985ce7663d990756fe9101e25eb97f0' }, index.h("style", { key: '06ae24c7bb74f4dacfc12ae58085333f9dc89da5' }, styleBlock), this.handleStructure(this.structure)));
195
175
  }
196
176
  static get watchers() { return {
197
177
  "structure": ["handleStructureChange"]
@@ -8,18 +8,16 @@ export class PamLogin {
8
8
  /**
9
9
  * Fetch phone prefixes from the API
10
10
  */
11
- this.getPrefixOptions = () => {
12
- const url = new URL('v1/player/validPhoneCodes', this.endpoint);
13
- return new Promise((resolve) => {
14
- fetch(url.href)
15
- .then((res) => res.json())
16
- .then((res) => {
17
- this.prefixOptions = res.phoneCodes.map(code => {
18
- return { label: code.Prefix, value: code.Prefix };
19
- });
20
- resolve();
11
+ this.getPhoneCodes = () => {
12
+ const url = new URL('v1/player/operatorSupportedPhoneCodes', this.endpoint);
13
+ return fetch(url.href)
14
+ .then(res => res.json())
15
+ .then(data => {
16
+ this.phoneCodes = data.phoneCodes.map(code => {
17
+ return { label: code, value: code };
21
18
  });
22
- });
19
+ })
20
+ .catch(err => console.log('Failed to fetch phone codes:', err));
23
21
  };
24
22
  /**
25
23
  * Handle autofilling of credentials from a dispatched event
@@ -139,7 +137,7 @@ export class PamLogin {
139
137
  this.isContactValid = this.validate('phone', this.contactValue);
140
138
  break;
141
139
  case 'prefix':
142
- this.prefixValue = inputValue;
140
+ this.phoneCodeValue = inputValue;
143
141
  this.isContactValid = this.validate('phone', this.contactValue);
144
142
  break;
145
143
  case 'password':
@@ -164,14 +162,14 @@ export class PamLogin {
164
162
  return input.length <= 3 || regex.test(input);
165
163
  case 'phone':
166
164
  regex = new RegExp(this.userPhoneRegex, this.userPhoneRegexOptions);
167
- return input.length <= 3 || regex.test(input) && Boolean(this.prefixValue);
165
+ return input.length <= 3 || regex.test(input) && Boolean(this.phoneCodeValue);
168
166
  case 'password':
169
167
  regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
170
168
  return input.length <= 3 || regex.test(input);
171
169
  }
172
170
  };
173
171
  this.isSubmitDisabled = () => {
174
- return ((!this.isContactValid || !this.contactValue || (this.loginByPhoneNumber === 'true' && !this.prefixValue))
172
+ return ((!this.isContactValid || !this.contactValue || (this.loginByPhoneNumber === 'true' && !this.phoneCodeValue))
175
173
  || !this.passwordValue
176
174
  || !this.isPasswordValid) || this.isLoading
177
175
  || (this.captchaData.isEnabled && !this.captchaData.token);
@@ -210,8 +208,8 @@ export class PamLogin {
210
208
  this.isLoading = false;
211
209
  this.contactValue = '';
212
210
  this.passwordValue = '';
213
- this.prefixValue = '';
214
- this.prefixOptions = undefined;
211
+ this.phoneCodeValue = '';
212
+ this.phoneCodes = undefined;
215
213
  this.isContactValid = true;
216
214
  this.isPasswordValid = true;
217
215
  this.isPasswordVisible = false;
@@ -257,7 +255,7 @@ export class PamLogin {
257
255
  */
258
256
  async componentWillLoad() {
259
257
  if (this.loginByPhoneNumber === 'true') {
260
- await this.getPrefixOptions();
258
+ await this.getPhoneCodes();
261
259
  }
262
260
  if (this.translationUrl.length > 2) {
263
261
  await getTranslations(this.translationUrl);
@@ -414,21 +412,21 @@ export class PamLogin {
414
412
  * Render function
415
413
  */
416
414
  render() {
417
- const visibilityIcon = h("span", { key: 'bb874e46d790f8a76529b2f4ee0ccb2ea49ace3e', class: "InputIcon" }, this.isPasswordVisible
415
+ const visibilityIcon = h("span", { key: '7374b9075a40a785273ee060cc5c1adce55f22f9', class: "InputIcon" }, this.isPasswordVisible
418
416
  ? h("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" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, h("path", { 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", { 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", { transform: "translate(110.856 24.899)" }, h("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)" }), h("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)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" })))
419
417
  : h("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" }, h("g", { transform: "translate(-14.185 -27.832)" }, h("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)" }), h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
420
- const loginForm = (h("div", { key: '3822128fa2d495e22cfe6487b92a59074edc207b', class: "FormBox" }, h("div", { key: 'b492b35e0496d783bee08268de7da92de188e7b2', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
421
- ? h("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, h("div", { class: "PhoneInputBox" }, h("div", { class: "PrefixBox" }, h("vaadin-combo-box", { items: this.prefixOptions, value: this.prefixValue, onChange: this.handleInputChangePartial('prefix') }), h("label", { class: (this.prefixValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userPrefix', this.lang))), h("div", { class: "PhoneBox" }, h("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userPhone', this.lang)))), !this.isContactValid &&
418
+ const loginForm = (h("div", { key: 'e6329737430ea03f988447e4244422c8a21cccab', class: "FormBox" }, h("div", { key: '8d620c5d6ae58c9e878ea09472f7baef78b068f7', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
419
+ ? h("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, h("div", { class: "PhoneInputBox" }, h("div", { class: "PrefixBox" }, h("vaadin-combo-box", { items: this.phoneCodes, value: this.phoneCodeValue, onChange: this.handleInputChangePartial('prefix') }), h("label", { class: (this.phoneCodeValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userPrefix', this.lang))), h("div", { class: "PhoneBox" }, h("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userPhone', this.lang)))), !this.isContactValid &&
422
420
  h("p", { class: "CredentialsError" }, translate('userPhoneError', this.lang)))
423
421
  : h("div", { class: this.isContactValid ? 'InputBox' : 'InputBox InputInvalidBox' }, h("input", { type: "text", placeholder: '', value: this.contactValue, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userEmail', this.lang)), !this.isContactValid &&
424
- h("p", { class: "CredentialsError" }, translate('userEmailError', this.lang))), h("div", { key: '941ccdbbdffadfa763255f6d035d11e25f95bca9', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, h("input", { key: '40e370bf348dc25c9c9b951cc8bef83ce2ee7c72', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h("label", { key: 'c6c86c450654d495d0022dd123d20ded3426fccf', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate('password', this.lang)), this.isPasswordValid ||
425
- h("p", { key: '98cd887991ab13215cdeba0d74deaef1f74bd61a', class: "CredentialsError" }, translate('userPasswordError', this.lang))), this.passwordReset == 'true' &&
426
- h("div", { key: 'ccb6a014b9238dc1b43ee6d7fcbde0f6ad65a974', class: "ForgotPassword" }, h("button", { key: 'c07e6292964c9ffaf18f84b3fb639168bfe69711', onClick: this.resetPassword }, translate('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
427
- h("slot", { key: '873d1144706d713f38e87d7413dc65bea89eaf07', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
428
- h("slot", { key: '2e88c7d908719ad03c32feb39c2782b6a53fa3e6', name: "google" }), h("button", { key: '16f1ce841ea0797a2a53fa88283e9504b149674b', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.apiErrorMessage &&
429
- h("p", { key: '6bfaca1c1894113134d8112bf0245c4fe8f539ff', class: "CredentialsError" }, this.apiErrorMessage))));
430
- const skeleton = (h("div", { key: '6a5bdd7a73a48735fb7893846d18eab4cb5cd15d', class: "LoadingSkeleton" }, h("form", { key: '56909c222a4a5c01e00033183c49bac967fdd704', class: "Form" }, h("section", { key: 'aa5fb3aeccaa92b2dbaded30bc91f27d5fc88995', class: "FieldsSection" }, h("div", { key: '2232d21237018605d4dc5be187a2f5ef6dcbfdff', class: "FieldContainer" }, h("div", { key: 'b6ba71f89fae3edf9c8fbfc74a77b75287c12fcc', class: "FieldTitle" }, h("ui-skeleton", { key: '9237a050a5eec7ecb28d20e8e9af148ea5991474', structure: "title", width: "auto", height: "20px" })), h("ui-skeleton", { key: '7f1bcda4723e9f6f24dad602bff1480e122624da', structure: "rectangle", width: "auto", height: "35px" })), h("div", { key: 'ff6c82b4e37d9b796fecd9ca4c919a70ab1ed4ab', class: "FieldContainer" }, h("div", { key: 'a85bf5caf0db9b8ad12a475014f71d975a5114ed', class: "FieldTitle" }, h("ui-skeleton", { key: 'fe0600c8fa0564724b10203bf72c929566fcba54', structure: "title", width: "auto", height: "20px" })), h("ui-skeleton", { key: 'f59b2ccdbb812f8941e22bfae8f788f2bc821898', structure: "rectangle", width: "auto", height: "35px" }))), h("section", { key: '8b337059fb6bb2566c173ba5a2a6139b7a5a0d29', class: "ButtonsSection" }, h("div", { key: 'a5d537f7724c07b069cdf74b223237d140f51193', class: "Button" }, h("ui-skeleton", { key: 'ea24ff03ffb93d4d41a8617c6e2d16b6c94dc060', structure: "rectangle", width: "auto", height: "50px" }))))));
431
- return (h("section", { key: '91eba8645bb65ce5871683189547dd9afcfb8e4a', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
422
+ h("p", { class: "CredentialsError" }, translate('userEmailError', this.lang))), h("div", { key: '3e654d0faf6268a2a44870b7c17f206a000efe56', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, h("input", { key: '35f9203a90619c9aef4047bad6b0041ecee37abe', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h("label", { key: '79d0351589cde486169bf713bd763d9ae02dea1e', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate('password', this.lang)), this.isPasswordValid ||
423
+ h("p", { key: '07249828e3168b3908c69d46134d4020f20a8288', class: "CredentialsError" }, translate('userPasswordError', this.lang))), this.passwordReset == 'true' &&
424
+ h("div", { key: '3c7a518e46ba14896be800f57ff414b616592fc5', class: "ForgotPassword" }, h("button", { key: '3aea4149f42c0f817ad2b97bdf0b9d6a38008e41', onClick: this.resetPassword }, translate('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
425
+ h("slot", { key: '8379b390d68325a4601459a45696c30d87d695eb', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
426
+ h("slot", { key: '290e79e106282f87196428f4fe7b59e30645228c', name: "google" }), h("button", { key: '33f37f8e3aedcd561d8198865cb5af4f3b4d1e3f', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.apiErrorMessage &&
427
+ h("p", { key: '27eb501ce5a520978c54327c7480df7efb54dbcc', class: "CredentialsError" }, this.apiErrorMessage))));
428
+ const skeleton = (h("div", { key: 'aa7e0b94f08ce3e180b6ff3cdff0396502eed0d9', class: "LoadingSkeleton" }, h("form", { key: 'df646fdee9d4a0cb802de1cfc1a9f562f00a737e', class: "Form" }, h("section", { key: 'f8fead4ba0a7350ff85b784acdc60a9acd2d2e4a', class: "FieldsSection" }, h("div", { key: '30e59b5a9190297b9f808d1f67ef59a873ae00a1', class: "FieldContainer" }, h("div", { key: 'cb7a2a78b89447e9fa8d553022d8c14111424cee', class: "FieldTitle" }, h("ui-skeleton", { key: '369a6fb94d8ddebcd4d81b738ae4b4b1d623e6e9', structure: "title", width: "auto", height: "20px" })), h("ui-skeleton", { key: '6aaf9e8a13bf8d4c30245c79d04fd4c6d013d771', structure: "rectangle", width: "auto", height: "35px" })), h("div", { key: '01eb04f30cd51e40a11a0447a514b2a7aaf779d4', class: "FieldContainer" }, h("div", { key: '2d23f028924f87dcdbdcabd352668ce6821e3ca7', class: "FieldTitle" }, h("ui-skeleton", { key: '9438f81cba906da223dbf25da04748e899bb7273', structure: "title", width: "auto", height: "20px" })), h("ui-skeleton", { key: '7d128d685e923ba084b48ce587af7031db8deb03', structure: "rectangle", width: "auto", height: "35px" }))), h("section", { key: '2084b7641a274939db4bcde7fce82ae717edbd5b', class: "ButtonsSection" }, h("div", { key: '5b838a5815a537c812eb95c9760d4f1be0c6d457', class: "Button" }, h("ui-skeleton", { key: '7d0e20018649d37079567795b52ce34dd5b824a2', structure: "rectangle", width: "auto", height: "50px" }))))));
429
+ return (h("section", { key: 'd75baf969a810e169463146e113905a70efd03db', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
432
430
  }
433
431
  static get is() { return "pam-login"; }
434
432
  static get encapsulation() { return "shadow"; }
@@ -699,8 +697,8 @@ export class PamLogin {
699
697
  "isLoading": {},
700
698
  "contactValue": {},
701
699
  "passwordValue": {},
702
- "prefixValue": {},
703
- "prefixOptions": {},
700
+ "phoneCodeValue": {},
701
+ "phoneCodes": {},
704
702
  "isContactValid": {},
705
703
  "isPasswordValid": {},
706
704
  "isPasswordVisible": {},
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PamLogin } from './pam-login-c277e537.js';
1
+ export { P as PamLogin } from './pam-login-8ea88687.js';
2
2
  import './index-a126c540.js';
@@ -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([["pam-login_2",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"prefixValue":[32],"prefixOptions":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
8
+ return bootstrapLazy([["pam-login_2",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"phoneCodeValue":[32],"phoneCodes":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -21897,18 +21897,16 @@ const PamLogin = class {
21897
21897
  /**
21898
21898
  * Fetch phone prefixes from the API
21899
21899
  */
21900
- this.getPrefixOptions = () => {
21901
- const url = new URL('v1/player/validPhoneCodes', this.endpoint);
21902
- return new Promise((resolve) => {
21903
- fetch(url.href)
21904
- .then((res) => res.json())
21905
- .then((res) => {
21906
- this.prefixOptions = res.phoneCodes.map(code => {
21907
- return { label: code.Prefix, value: code.Prefix };
21908
- });
21909
- resolve();
21900
+ this.getPhoneCodes = () => {
21901
+ const url = new URL('v1/player/operatorSupportedPhoneCodes', this.endpoint);
21902
+ return fetch(url.href)
21903
+ .then(res => res.json())
21904
+ .then(data => {
21905
+ this.phoneCodes = data.phoneCodes.map(code => {
21906
+ return { label: code, value: code };
21910
21907
  });
21911
- });
21908
+ })
21909
+ .catch(err => console.log('Failed to fetch phone codes:', err));
21912
21910
  };
21913
21911
  /**
21914
21912
  * Handle autofilling of credentials from a dispatched event
@@ -22028,7 +22026,7 @@ const PamLogin = class {
22028
22026
  this.isContactValid = this.validate('phone', this.contactValue);
22029
22027
  break;
22030
22028
  case 'prefix':
22031
- this.prefixValue = inputValue;
22029
+ this.phoneCodeValue = inputValue;
22032
22030
  this.isContactValid = this.validate('phone', this.contactValue);
22033
22031
  break;
22034
22032
  case 'password':
@@ -22053,14 +22051,14 @@ const PamLogin = class {
22053
22051
  return input.length <= 3 || regex.test(input);
22054
22052
  case 'phone':
22055
22053
  regex = new RegExp(this.userPhoneRegex, this.userPhoneRegexOptions);
22056
- return input.length <= 3 || regex.test(input) && Boolean(this.prefixValue);
22054
+ return input.length <= 3 || regex.test(input) && Boolean(this.phoneCodeValue);
22057
22055
  case 'password':
22058
22056
  regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
22059
22057
  return input.length <= 3 || regex.test(input);
22060
22058
  }
22061
22059
  };
22062
22060
  this.isSubmitDisabled = () => {
22063
- return ((!this.isContactValid || !this.contactValue || (this.loginByPhoneNumber === 'true' && !this.prefixValue))
22061
+ return ((!this.isContactValid || !this.contactValue || (this.loginByPhoneNumber === 'true' && !this.phoneCodeValue))
22064
22062
  || !this.passwordValue
22065
22063
  || !this.isPasswordValid) || this.isLoading
22066
22064
  || (this.captchaData.isEnabled && !this.captchaData.token);
@@ -22099,8 +22097,8 @@ const PamLogin = class {
22099
22097
  this.isLoading = false;
22100
22098
  this.contactValue = '';
22101
22099
  this.passwordValue = '';
22102
- this.prefixValue = '';
22103
- this.prefixOptions = undefined;
22100
+ this.phoneCodeValue = '';
22101
+ this.phoneCodes = undefined;
22104
22102
  this.isContactValid = true;
22105
22103
  this.isPasswordValid = true;
22106
22104
  this.isPasswordVisible = false;
@@ -22146,7 +22144,7 @@ const PamLogin = class {
22146
22144
  */
22147
22145
  async componentWillLoad() {
22148
22146
  if (this.loginByPhoneNumber === 'true') {
22149
- await this.getPrefixOptions();
22147
+ await this.getPhoneCodes();
22150
22148
  }
22151
22149
  if (this.translationUrl.length > 2) {
22152
22150
  await getTranslations(this.translationUrl);
@@ -22303,21 +22301,21 @@ const PamLogin = class {
22303
22301
  * Render function
22304
22302
  */
22305
22303
  render() {
22306
- const visibilityIcon = h$2("span", { key: 'bb874e46d790f8a76529b2f4ee0ccb2ea49ace3e', class: "InputIcon" }, this.isPasswordVisible
22304
+ const visibilityIcon = h$2("span", { key: '7374b9075a40a785273ee060cc5c1adce55f22f9', class: "InputIcon" }, this.isPasswordVisible
22307
22305
  ? h$2("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" }, h$2("g", { transform: "translate(-110.856 -23.242)" }, h$2("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h$2("g", { transform: "translate(117.499 27.37)" }, h$2("path", { 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", { 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", { transform: "translate(110.856 24.899)" }, h$2("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)" }), h$2("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)" })), h$2("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" })))
22308
22306
  : h$2("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" }, h$2("g", { transform: "translate(-14.185 -27.832)" }, h$2("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)" }), h$2("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
22309
- const loginForm = (h$2("div", { key: '3822128fa2d495e22cfe6487b92a59074edc207b', class: "FormBox" }, h$2("div", { key: 'b492b35e0496d783bee08268de7da92de188e7b2', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
22310
- ? h$2("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, h$2("div", { class: "PhoneInputBox" }, h$2("div", { class: "PrefixBox" }, h$2("vaadin-combo-box", { items: this.prefixOptions, value: this.prefixValue, onChange: this.handleInputChangePartial('prefix') }), h$2("label", { class: (this.prefixValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPrefix', this.lang))), h$2("div", { class: "PhoneBox" }, h$2("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h$2("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPhone', this.lang)))), !this.isContactValid &&
22307
+ const loginForm = (h$2("div", { key: 'e6329737430ea03f988447e4244422c8a21cccab', class: "FormBox" }, h$2("div", { key: '8d620c5d6ae58c9e878ea09472f7baef78b068f7', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
22308
+ ? h$2("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, h$2("div", { class: "PhoneInputBox" }, h$2("div", { class: "PrefixBox" }, h$2("vaadin-combo-box", { items: this.phoneCodes, value: this.phoneCodeValue, onChange: this.handleInputChangePartial('prefix') }), h$2("label", { class: (this.phoneCodeValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPrefix', this.lang))), h$2("div", { class: "PhoneBox" }, h$2("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h$2("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPhone', this.lang)))), !this.isContactValid &&
22311
22309
  h$2("p", { class: "CredentialsError" }, translate$1('userPhoneError', this.lang)))
22312
22310
  : h$2("div", { class: this.isContactValid ? 'InputBox' : 'InputBox InputInvalidBox' }, h$2("input", { type: "text", placeholder: '', value: this.contactValue, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h$2("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userEmail', this.lang)), !this.isContactValid &&
22313
- h$2("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), h$2("div", { key: '941ccdbbdffadfa763255f6d035d11e25f95bca9', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, h$2("input", { key: '40e370bf348dc25c9c9b951cc8bef83ce2ee7c72', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h$2("label", { key: 'c6c86c450654d495d0022dd123d20ded3426fccf', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate$1('password', this.lang)), this.isPasswordValid ||
22314
- h$2("p", { key: '98cd887991ab13215cdeba0d74deaef1f74bd61a', class: "CredentialsError" }, translate$1('userPasswordError', this.lang))), this.passwordReset == 'true' &&
22315
- h$2("div", { key: 'ccb6a014b9238dc1b43ee6d7fcbde0f6ad65a974', class: "ForgotPassword" }, h$2("button", { key: 'c07e6292964c9ffaf18f84b3fb639168bfe69711', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
22316
- h$2("slot", { key: '873d1144706d713f38e87d7413dc65bea89eaf07', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
22317
- h$2("slot", { key: '2e88c7d908719ad03c32feb39c2782b6a53fa3e6', name: "google" }), h$2("button", { key: '16f1ce841ea0797a2a53fa88283e9504b149674b', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.apiErrorMessage &&
22318
- h$2("p", { key: '6bfaca1c1894113134d8112bf0245c4fe8f539ff', class: "CredentialsError" }, this.apiErrorMessage))));
22319
- const skeleton = (h$2("div", { key: '6a5bdd7a73a48735fb7893846d18eab4cb5cd15d', class: "LoadingSkeleton" }, h$2("form", { key: '56909c222a4a5c01e00033183c49bac967fdd704', class: "Form" }, h$2("section", { key: 'aa5fb3aeccaa92b2dbaded30bc91f27d5fc88995', class: "FieldsSection" }, h$2("div", { key: '2232d21237018605d4dc5be187a2f5ef6dcbfdff', class: "FieldContainer" }, h$2("div", { key: 'b6ba71f89fae3edf9c8fbfc74a77b75287c12fcc', class: "FieldTitle" }, h$2("ui-skeleton", { key: '9237a050a5eec7ecb28d20e8e9af148ea5991474', structure: "title", width: "auto", height: "20px" })), h$2("ui-skeleton", { key: '7f1bcda4723e9f6f24dad602bff1480e122624da', structure: "rectangle", width: "auto", height: "35px" })), h$2("div", { key: 'ff6c82b4e37d9b796fecd9ca4c919a70ab1ed4ab', class: "FieldContainer" }, h$2("div", { key: 'a85bf5caf0db9b8ad12a475014f71d975a5114ed', class: "FieldTitle" }, h$2("ui-skeleton", { key: 'fe0600c8fa0564724b10203bf72c929566fcba54', structure: "title", width: "auto", height: "20px" })), h$2("ui-skeleton", { key: 'f59b2ccdbb812f8941e22bfae8f788f2bc821898', structure: "rectangle", width: "auto", height: "35px" }))), h$2("section", { key: '8b337059fb6bb2566c173ba5a2a6139b7a5a0d29', class: "ButtonsSection" }, h$2("div", { key: 'a5d537f7724c07b069cdf74b223237d140f51193', class: "Button" }, h$2("ui-skeleton", { key: 'ea24ff03ffb93d4d41a8617c6e2d16b6c94dc060', structure: "rectangle", width: "auto", height: "50px" }))))));
22320
- return (h$2("section", { key: '91eba8645bb65ce5871683189547dd9afcfb8e4a', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
22311
+ h$2("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), h$2("div", { key: '3e654d0faf6268a2a44870b7c17f206a000efe56', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, h$2("input", { key: '35f9203a90619c9aef4047bad6b0041ecee37abe', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h$2("label", { key: '79d0351589cde486169bf713bd763d9ae02dea1e', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate$1('password', this.lang)), this.isPasswordValid ||
22312
+ h$2("p", { key: '07249828e3168b3908c69d46134d4020f20a8288', class: "CredentialsError" }, translate$1('userPasswordError', this.lang))), this.passwordReset == 'true' &&
22313
+ h$2("div", { key: '3c7a518e46ba14896be800f57ff414b616592fc5', class: "ForgotPassword" }, h$2("button", { key: '3aea4149f42c0f817ad2b97bdf0b9d6a38008e41', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
22314
+ h$2("slot", { key: '8379b390d68325a4601459a45696c30d87d695eb', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
22315
+ h$2("slot", { key: '290e79e106282f87196428f4fe7b59e30645228c', name: "google" }), h$2("button", { key: '33f37f8e3aedcd561d8198865cb5af4f3b4d1e3f', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.apiErrorMessage &&
22316
+ h$2("p", { key: '27eb501ce5a520978c54327c7480df7efb54dbcc', class: "CredentialsError" }, this.apiErrorMessage))));
22317
+ const skeleton = (h$2("div", { key: 'aa7e0b94f08ce3e180b6ff3cdff0396502eed0d9', class: "LoadingSkeleton" }, h$2("form", { key: 'df646fdee9d4a0cb802de1cfc1a9f562f00a737e', class: "Form" }, h$2("section", { key: 'f8fead4ba0a7350ff85b784acdc60a9acd2d2e4a', class: "FieldsSection" }, h$2("div", { key: '30e59b5a9190297b9f808d1f67ef59a873ae00a1', class: "FieldContainer" }, h$2("div", { key: 'cb7a2a78b89447e9fa8d553022d8c14111424cee', class: "FieldTitle" }, h$2("ui-skeleton", { key: '369a6fb94d8ddebcd4d81b738ae4b4b1d623e6e9', structure: "title", width: "auto", height: "20px" })), h$2("ui-skeleton", { key: '6aaf9e8a13bf8d4c30245c79d04fd4c6d013d771', structure: "rectangle", width: "auto", height: "35px" })), h$2("div", { key: '01eb04f30cd51e40a11a0447a514b2a7aaf779d4', class: "FieldContainer" }, h$2("div", { key: '2d23f028924f87dcdbdcabd352668ce6821e3ca7', class: "FieldTitle" }, h$2("ui-skeleton", { key: '9438f81cba906da223dbf25da04748e899bb7273', structure: "title", width: "auto", height: "20px" })), h$2("ui-skeleton", { key: '7d128d685e923ba084b48ce587af7031db8deb03', structure: "rectangle", width: "auto", height: "35px" }))), h$2("section", { key: '2084b7641a274939db4bcde7fce82ae717edbd5b', class: "ButtonsSection" }, h$2("div", { key: '5b838a5815a537c812eb95c9760d4f1be0c6d457', class: "Button" }, h$2("ui-skeleton", { key: '7d0e20018649d37079567795b52ce34dd5b824a2', structure: "rectangle", width: "auto", height: "50px" }))))));
22318
+ return (h$2("section", { key: 'd75baf969a810e169463146e113905a70efd03db', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
22321
22319
  }
22322
22320
  static get watchers() { return {
22323
22321
  "translationUrl": ["handleNewTranslations"],
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["pam-login_2",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"prefixValue":[32],"prefixOptions":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
19
+ return bootstrapLazy([["pam-login_2",[[1,"pam-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"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"],"loginByPhoneNumber":[513,"login-by-phone-number"],"isLoading":[32],"contactValue":[32],"passwordValue":[32],"phoneCodeValue":[32],"phoneCodes":[32],"isContactValid":[32],"isPasswordValid":[32],"isPasswordVisible":[32],"apiErrorMessage":[32],"captchaData":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
20
20
  });
@@ -1,7 +1,7 @@
1
- export { P as pam_login } from './pam-login-c277e537.js';
1
+ export { P as pam_login } from './pam-login-8ea88687.js';
2
2
  import { r as registerInstance, h, H as Host } from './index-a126c540.js';
3
3
 
4
- const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
4
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
5
5
  const UiSkeletonStyle0 = uiSkeletonCss;
6
6
 
7
7
  const UiSkeleton = class {
@@ -14,7 +14,8 @@ const UiSkeleton = class {
14
14
  marginBottom: this.handleStylingProps(this.marginBottom),
15
15
  marginTop: this.handleStylingProps(this.marginTop),
16
16
  marginLeft: this.handleStylingProps(this.marginLeft),
17
- marginRight: this.handleStylingProps(this.marginRight)
17
+ marginRight: this.handleStylingProps(this.marginRight),
18
+ size: this.handleStylingProps(this.size)
18
19
  };
19
20
  this.structure = undefined;
20
21
  this.width = 'unset';
@@ -27,9 +28,6 @@ const UiSkeleton = class {
27
28
  this.animation = true;
28
29
  this.rows = 0;
29
30
  this.size = '100%';
30
- this.color = '#c2c2c2';
31
- this.primaryColor = '#c2c2c2';
32
- this.secondaryColor = '#ffffff';
33
31
  }
34
32
  handleStructureChange(newValue, oldValue) {
35
33
  if (oldValue !== newValue) {
@@ -104,9 +102,6 @@ const UiSkeleton = class {
104
102
  --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
105
103
  --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
106
104
  --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
107
- --emw-skeleton-logo-background: ${this.color};
108
- --emw-skeleton-primary-color: ${this.primaryColor};
109
- --emw-skeleton-secondary-color: ${this.secondaryColor};
110
105
  }
111
106
  `;
112
107
  break;
@@ -120,9 +115,6 @@ const UiSkeleton = class {
120
115
  --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
121
116
  --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
122
117
  --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
123
- --emw-skeleton-image-background: ${this.color};
124
- --emw-skeleton-primary-color: ${this.primaryColor};
125
- --emw-skeleton-secondary-color: ${this.secondaryColor};
126
118
  }
127
119
  `;
128
120
  break;
@@ -136,9 +128,6 @@ const UiSkeleton = class {
136
128
  --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
137
129
  --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
138
130
  --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
139
- --emw-skeleton-title-background: ${this.color};
140
- --emw-skeleton-primary-color: ${this.primaryColor};
141
- --emw-skeleton-secondary-color: ${this.secondaryColor};
142
131
  }
143
132
  `;
144
133
  break;
@@ -152,9 +141,6 @@ const UiSkeleton = class {
152
141
  --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
153
142
  --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
154
143
  --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
155
- --emw-skeleton-text-background: ${this.color};
156
- --emw-skeleton-primary-color: ${this.primaryColor};
157
- --emw-skeleton-secondary-color: ${this.secondaryColor};
158
144
  }
159
145
  `;
160
146
  break;
@@ -168,26 +154,20 @@ const UiSkeleton = class {
168
154
  --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
169
155
  --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
170
156
  --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
171
- --emw-skeleton-rectangle-background: ${this.color};
172
- --emw-skeleton-primary-color: ${this.primaryColor};
173
- --emw-skeleton-secondary-color: ${this.secondaryColor};
174
157
  }
175
158
  `;
176
159
  break;
177
160
  case 'circle':
178
161
  styleBlock = `
179
162
  :host {
180
- --emw-skeleton-circle-size: ${this.size};
181
- --emw-skeleton-circle-background: ${this.color};
182
- --emw-skeleton-primary-color: ${this.primaryColor};
183
- --emw-skeleton-secondary-color: ${this.secondaryColor};
163
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
184
164
  }
185
165
  `;
186
166
  break;
187
167
  default:
188
168
  styleBlock = '';
189
169
  }
190
- return (h(Host, { key: '5c185b76c438d20d4ad88bc48d94ff5628410bb7' }, h("style", { key: 'de95e60a5955d5b2af83710423fe40329c187f7e' }, styleBlock), this.handleStructure(this.structure)));
170
+ return (h(Host, { key: 'e6b885bfd985ce7663d990756fe9101e25eb97f0' }, h("style", { key: '06ae24c7bb74f4dacfc12ae58085333f9dc89da5' }, styleBlock), this.handleStructure(this.structure)));
191
171
  }
192
172
  static get watchers() { return {
193
173
  "structure": ["handleStructureChange"]
@@ -1 +1 @@
1
- export{P as PamLogin}from"./pam-login-c277e537.js";import"./index-a126c540.js";
1
+ export{P as PamLogin}from"./pam-login-8ea88687.js";import"./index-a126c540.js";
@@ -2651,4 +2651,4 @@ class pr{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.
2651
2651
  ></vaadin-combo-box-overlay>
2652
2652
 
2653
2653
  <slot name="tooltip"></slot>
2654
- `}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new ir(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new sr(this.inputElement,this._labelController)),this._tooltipController=new So(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(gr);const br=class{constructor(e){t(this,e),this.getPrefixOptions=()=>{const t=new URL("v1/player/validPhoneCodes",this.endpoint);return new Promise((e=>{fetch(t.href).then((t=>t.json())).then((t=>{this.prefixOptions=t.phoneCodes.map((t=>({label:t.Prefix,value:t.Prefix}))),e()}))}))},this.handleAutofillCredentials=t=>{this.contactValue=t.detail.userNameEmail,this.passwordValue=t.detail.userPassword,this.handleLogin()},this.getLoginToken=()=>{const t=new URL("api/v1/players/password-management/auth/password/verify",this.endpoint),e={"Content-Type":"application/json"};this.captchaData.isEnabled&&(e["X-Captcha-Response"]=this.captchaData.token);const i={method:"POST",headers:e,body:JSON.stringify({contact:this.contactValue,password:this.passwordValue})};return new Promise(((e,s)=>{fetch(t.href,i).then((t=>t.json())).then((t=>t.token?e(t.token):s("Token not received from the API call")))}))},this.loginPlayer=t=>{const e=new URL("api/v2/gm/legislation/login",this.endpoint),i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};return new Promise(((t,s)=>{fetch(e.href,i).then((t=>t.json()),(t=>s(t))).then((e=>e.sessionId&&e.playerId?t(e):s(e)))}))},this.handleLogin=()=>{this.isLoading=!0,this.getLoginToken().then((t=>{this.loginPlayer(t).then((t=>{window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.playerId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href),this.apiErrorMessage=""})).catch((t=>{console.error(`Legislation login failed: ${t.message}`,t.errors),this.apiErrorMessage=n("genericError",this.lang),this.sendErrorNotification(this.apiErrorMessage)})).finally((()=>this.isLoading=!1))})).catch((t=>{console.error(t),this.apiErrorMessage=n("genericError",this.lang),this.sendErrorNotification(this.apiErrorMessage),this.isLoading=!1})),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{const i=t.target.value;switch(e){case"user":this.contactValue=i,this.isContactValid=this.validate("user",this.contactValue);break;case"phone":this.contactValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"prefix":this.prefixValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"password":this.passwordValue=i,this.isPasswordValid=this.validate("password",i)}},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),e.length<=3||i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),e.length<=3||i.test(e)&&Boolean(this.prefixValue);case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),e.length<=3||i.test(e)}},this.isSubmitDisabled=()=>!this.isContactValid||!this.contactValue||"true"===this.loginByPhoneNumber&&!this.prefixValue||!this.passwordValue||!this.isPasswordValid||this.isLoading||this.captchaData.isEnabled&&!this.captchaData.token,this.handleSubmit=t=>{"Enter"!==t.key||this.isSubmitDisabled()||this.handleLogin()},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.mbSource=void 0,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.loginByPhoneNumber="false",this.isLoading=!1,this.contactValue="",this.passwordValue="",this.prefixValue="",this.prefixOptions=void 0,this.isContactValid=!0,this.isPasswordValid=!0,this.isPasswordVisible=!1,this.apiErrorMessage="",this.captchaData={isEnabled:!0,token:"",provider:"",siteKey:""}}handleNewTranslations(){r(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&i(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPrefixOptions(),this.translationUrl.length>2&&await r(this.translationUrl),this.getLoginConfig().then((()=>this.appendCaptchaScript()),(t=>{console.error(t),this.apiErrorMessage=n("configError",this.lang),this.sendErrorNotification(this.apiErrorMessage)}))}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&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.handleAutofillCredentials),window.postMessage({type:"UserLoginDidLoad"})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.handleAutofillCredentials)}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;if(t&&["cloudflare","google"].includes(e))switch(e){case"cloudflare":return void window.turnstile.render("#turnstileContainer",{sitekey:i,theme:"light",callback:this.captchaCallback.bind(this)});case"google":return void 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");switch(e){case"cloudflare":i.src="https://challenges.cloudflare.com/turnstile/v0/api.js";break;case"google":i.src="https://www.google.com/recaptcha/api.js"}i.onload=this.handleCaptcha.bind(this),document.head.appendChild(i)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}dispatchUpdateLoginCredentialsEvent(){this.apiErrorMessage||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.contactValue,userPassword:this.passwordValue}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){const t=e("span",{key:"bb874e46d790f8a76529b2f4ee0ccb2ea49ace3e",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)"}))):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)"})))),i=e("div",{key:"3822128fa2d495e22cfe6487b92a59074edc207b",class:"FormBox"},e("div",{key:"b492b35e0496d783bee08268de7da92de188e7b2",class:"FormValue",onKeyDown:this.handleSubmit},"true"===this.loginByPhoneNumber?e("div",{class:this.isContactValid&&!this.apiErrorMessage?"InputBox":"InputBox InputInvalidBox"},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.prefixOptions,value:this.prefixValue,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.prefixValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPhone",this.lang)))),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userPhoneError",this.lang))):e("div",{class:this.isContactValid?"InputBox":"InputBox InputInvalidBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userEmail",this.lang)),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userEmailError",this.lang))),e("div",{key:"941ccdbbdffadfa763255f6d035d11e25f95bca9",class:this.isPasswordValid?"InputBox":"InputBox InputInvalidBox"},t,e("input",{key:"40e370bf348dc25c9c9b951cc8bef83ce2ee7c72",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.passwordValue,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"c6c86c450654d495d0022dd123d20ded3426fccf",class:(this.passwordValue?"FieldFilledIn":"")+" "+(this.isPasswordValid?"":"FieldInvalid")},n("password",this.lang)),this.isPasswordValid||e("p",{key:"98cd887991ab13215cdeba0d74deaef1f74bd61a",class:"CredentialsError"},n("userPasswordError",this.lang))),"true"==this.passwordReset&&e("div",{key:"ccb6a014b9238dc1b43ee6d7fcbde0f6ad65a974",class:"ForgotPassword"},e("button",{key:"c07e6292964c9ffaf18f84b3fb639168bfe69711",onClick:this.resetPassword},n("forgotPassword",this.lang))),this.captchaData.isEnabled&&"cloudflare"===this.captchaData.provider&&e("slot",{key:"873d1144706d713f38e87d7413dc65bea89eaf07",name:"turnstile"}),this.captchaData.isEnabled&&"google"===this.captchaData.provider&&e("slot",{key:"2e88c7d908719ad03c32feb39c2782b6a53fa3e6",name:"google"}),e("button",{key:"16f1ce841ea0797a2a53fa88283e9504b149674b",disabled:this.isSubmitDisabled(),class:"SubmitCredentials",onClick:this.handleLogin},n("login",this.lang)),this.apiErrorMessage&&e("p",{key:"6bfaca1c1894113134d8112bf0245c4fe8f539ff",class:"CredentialsError"},this.apiErrorMessage))),s=e("div",{key:"6a5bdd7a73a48735fb7893846d18eab4cb5cd15d",class:"LoadingSkeleton"},e("form",{key:"56909c222a4a5c01e00033183c49bac967fdd704",class:"Form"},e("section",{key:"aa5fb3aeccaa92b2dbaded30bc91f27d5fc88995",class:"FieldsSection"},e("div",{key:"2232d21237018605d4dc5be187a2f5ef6dcbfdff",class:"FieldContainer"},e("div",{key:"b6ba71f89fae3edf9c8fbfc74a77b75287c12fcc",class:"FieldTitle"},e("ui-skeleton",{key:"9237a050a5eec7ecb28d20e8e9af148ea5991474",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"7f1bcda4723e9f6f24dad602bff1480e122624da",structure:"rectangle",width:"auto",height:"35px"})),e("div",{key:"ff6c82b4e37d9b796fecd9ca4c919a70ab1ed4ab",class:"FieldContainer"},e("div",{key:"a85bf5caf0db9b8ad12a475014f71d975a5114ed",class:"FieldTitle"},e("ui-skeleton",{key:"fe0600c8fa0564724b10203bf72c929566fcba54",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"f59b2ccdbb812f8941e22bfae8f788f2bc821898",structure:"rectangle",width:"auto",height:"35px"}))),e("section",{key:"8b337059fb6bb2566c173ba5a2a6139b7a5a0d29",class:"ButtonsSection"},e("div",{key:"a5d537f7724c07b069cdf74b223237d140f51193",class:"Button"},e("ui-skeleton",{key:"ea24ff03ffb93d4d41a8617c6e2d16b6c94dc060",structure:"rectangle",width:"auto",height:"50px"})))));return e("section",{key:"91eba8645bb65ce5871683189547dd9afcfb8e4a",ref:t=>this.stylingContainer=t},this.isLoading?s:i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};br.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: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}.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}}.LoadingSkeleton{width:100%;height:100%}.LoadingSkeleton .Form{display:flex;flex-direction:column;gap:50px;width:100%;height:100%}.LoadingSkeleton .Form .ButtonReturn{width:150px;height:30px;margin-top:15px;display:block}.LoadingSkeleton .Form .FieldsSection{display:block}.LoadingSkeleton .Form .FieldsSection .FieldContainer .FieldTitle{width:150px;margin-top:30px;margin-bottom:15px}.LoadingSkeleton .Form .ButtonsSection .Button{border-radius:50px;background:transparent;border:none;overflow:hidden}';export{br as P}
2654
+ `}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new ir(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new sr(this.inputElement,this._labelController)),this._tooltipController=new So(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(gr);const br=class{constructor(e){t(this,e),this.getPhoneCodes=()=>{const t=new URL("v1/player/operatorSupportedPhoneCodes",this.endpoint);return fetch(t.href).then((t=>t.json())).then((t=>{this.phoneCodes=t.phoneCodes.map((t=>({label:t,value:t})))})).catch((t=>console.log("Failed to fetch phone codes:",t)))},this.handleAutofillCredentials=t=>{this.contactValue=t.detail.userNameEmail,this.passwordValue=t.detail.userPassword,this.handleLogin()},this.getLoginToken=()=>{const t=new URL("api/v1/players/password-management/auth/password/verify",this.endpoint),e={"Content-Type":"application/json"};this.captchaData.isEnabled&&(e["X-Captcha-Response"]=this.captchaData.token);const i={method:"POST",headers:e,body:JSON.stringify({contact:this.contactValue,password:this.passwordValue})};return new Promise(((e,s)=>{fetch(t.href,i).then((t=>t.json())).then((t=>t.token?e(t.token):s("Token not received from the API call")))}))},this.loginPlayer=t=>{const e=new URL("api/v2/gm/legislation/login",this.endpoint),i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};return new Promise(((t,s)=>{fetch(e.href,i).then((t=>t.json()),(t=>s(t))).then((e=>e.sessionId&&e.playerId?t(e):s(e)))}))},this.handleLogin=()=>{this.isLoading=!0,this.getLoginToken().then((t=>{this.loginPlayer(t).then((t=>{window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.playerId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href),this.apiErrorMessage=""})).catch((t=>{console.error(`Legislation login failed: ${t.message}`,t.errors),this.apiErrorMessage=n("genericError",this.lang),this.sendErrorNotification(this.apiErrorMessage)})).finally((()=>this.isLoading=!1))})).catch((t=>{console.error(t),this.apiErrorMessage=n("genericError",this.lang),this.sendErrorNotification(this.apiErrorMessage),this.isLoading=!1})),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{const i=t.target.value;switch(e){case"user":this.contactValue=i,this.isContactValid=this.validate("user",this.contactValue);break;case"phone":this.contactValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"prefix":this.phoneCodeValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"password":this.passwordValue=i,this.isPasswordValid=this.validate("password",i)}},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),e.length<=3||i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),e.length<=3||i.test(e)&&Boolean(this.phoneCodeValue);case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),e.length<=3||i.test(e)}},this.isSubmitDisabled=()=>!this.isContactValid||!this.contactValue||"true"===this.loginByPhoneNumber&&!this.phoneCodeValue||!this.passwordValue||!this.isPasswordValid||this.isLoading||this.captchaData.isEnabled&&!this.captchaData.token,this.handleSubmit=t=>{"Enter"!==t.key||this.isSubmitDisabled()||this.handleLogin()},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.mbSource=void 0,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.loginByPhoneNumber="false",this.isLoading=!1,this.contactValue="",this.passwordValue="",this.phoneCodeValue="",this.phoneCodes=void 0,this.isContactValid=!0,this.isPasswordValid=!0,this.isPasswordVisible=!1,this.apiErrorMessage="",this.captchaData={isEnabled:!0,token:"",provider:"",siteKey:""}}handleNewTranslations(){r(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&i(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhoneCodes(),this.translationUrl.length>2&&await r(this.translationUrl),this.getLoginConfig().then((()=>this.appendCaptchaScript()),(t=>{console.error(t),this.apiErrorMessage=n("configError",this.lang),this.sendErrorNotification(this.apiErrorMessage)}))}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&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.handleAutofillCredentials),window.postMessage({type:"UserLoginDidLoad"})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.handleAutofillCredentials)}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;if(t&&["cloudflare","google"].includes(e))switch(e){case"cloudflare":return void window.turnstile.render("#turnstileContainer",{sitekey:i,theme:"light",callback:this.captchaCallback.bind(this)});case"google":return void 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");switch(e){case"cloudflare":i.src="https://challenges.cloudflare.com/turnstile/v0/api.js";break;case"google":i.src="https://www.google.com/recaptcha/api.js"}i.onload=this.handleCaptcha.bind(this),document.head.appendChild(i)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}dispatchUpdateLoginCredentialsEvent(){this.apiErrorMessage||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.contactValue,userPassword:this.passwordValue}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){const t=e("span",{key:"7374b9075a40a785273ee060cc5c1adce55f22f9",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)"}))):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)"})))),i=e("div",{key:"e6329737430ea03f988447e4244422c8a21cccab",class:"FormBox"},e("div",{key:"8d620c5d6ae58c9e878ea09472f7baef78b068f7",class:"FormValue",onKeyDown:this.handleSubmit},"true"===this.loginByPhoneNumber?e("div",{class:this.isContactValid&&!this.apiErrorMessage?"InputBox":"InputBox InputInvalidBox"},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.phoneCodes,value:this.phoneCodeValue,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.phoneCodeValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPhone",this.lang)))),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userPhoneError",this.lang))):e("div",{class:this.isContactValid?"InputBox":"InputBox InputInvalidBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userEmail",this.lang)),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userEmailError",this.lang))),e("div",{key:"3e654d0faf6268a2a44870b7c17f206a000efe56",class:this.isPasswordValid?"InputBox":"InputBox InputInvalidBox"},t,e("input",{key:"35f9203a90619c9aef4047bad6b0041ecee37abe",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.passwordValue,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"79d0351589cde486169bf713bd763d9ae02dea1e",class:(this.passwordValue?"FieldFilledIn":"")+" "+(this.isPasswordValid?"":"FieldInvalid")},n("password",this.lang)),this.isPasswordValid||e("p",{key:"07249828e3168b3908c69d46134d4020f20a8288",class:"CredentialsError"},n("userPasswordError",this.lang))),"true"==this.passwordReset&&e("div",{key:"3c7a518e46ba14896be800f57ff414b616592fc5",class:"ForgotPassword"},e("button",{key:"3aea4149f42c0f817ad2b97bdf0b9d6a38008e41",onClick:this.resetPassword},n("forgotPassword",this.lang))),this.captchaData.isEnabled&&"cloudflare"===this.captchaData.provider&&e("slot",{key:"8379b390d68325a4601459a45696c30d87d695eb",name:"turnstile"}),this.captchaData.isEnabled&&"google"===this.captchaData.provider&&e("slot",{key:"290e79e106282f87196428f4fe7b59e30645228c",name:"google"}),e("button",{key:"33f37f8e3aedcd561d8198865cb5af4f3b4d1e3f",disabled:this.isSubmitDisabled(),class:"SubmitCredentials",onClick:this.handleLogin},n("login",this.lang)),this.apiErrorMessage&&e("p",{key:"27eb501ce5a520978c54327c7480df7efb54dbcc",class:"CredentialsError"},this.apiErrorMessage))),s=e("div",{key:"aa7e0b94f08ce3e180b6ff3cdff0396502eed0d9",class:"LoadingSkeleton"},e("form",{key:"df646fdee9d4a0cb802de1cfc1a9f562f00a737e",class:"Form"},e("section",{key:"f8fead4ba0a7350ff85b784acdc60a9acd2d2e4a",class:"FieldsSection"},e("div",{key:"30e59b5a9190297b9f808d1f67ef59a873ae00a1",class:"FieldContainer"},e("div",{key:"cb7a2a78b89447e9fa8d553022d8c14111424cee",class:"FieldTitle"},e("ui-skeleton",{key:"369a6fb94d8ddebcd4d81b738ae4b4b1d623e6e9",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"6aaf9e8a13bf8d4c30245c79d04fd4c6d013d771",structure:"rectangle",width:"auto",height:"35px"})),e("div",{key:"01eb04f30cd51e40a11a0447a514b2a7aaf779d4",class:"FieldContainer"},e("div",{key:"2d23f028924f87dcdbdcabd352668ce6821e3ca7",class:"FieldTitle"},e("ui-skeleton",{key:"9438f81cba906da223dbf25da04748e899bb7273",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"7d128d685e923ba084b48ce587af7031db8deb03",structure:"rectangle",width:"auto",height:"35px"}))),e("section",{key:"2084b7641a274939db4bcde7fce82ae717edbd5b",class:"ButtonsSection"},e("div",{key:"5b838a5815a537c812eb95c9760d4f1be0c6d457",class:"Button"},e("ui-skeleton",{key:"7d0e20018649d37079567795b52ce34dd5b824a2",structure:"rectangle",width:"auto",height:"50px"})))));return e("section",{key:"d75baf969a810e169463146e113905a70efd03db",ref:t=>this.stylingContainer=t},this.isLoading?s:i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};br.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: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}.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}}.LoadingSkeleton{width:100%;height:100%}.LoadingSkeleton .Form{display:flex;flex-direction:column;gap:50px;width:100%;height:100%}.LoadingSkeleton .Form .ButtonReturn{width:150px;height:30px;margin-top:15px;display:block}.LoadingSkeleton .Form .FieldsSection{display:block}.LoadingSkeleton .Form .FieldsSection .FieldContainer .FieldTitle{width:150px;margin-top:30px;margin-bottom:15px}.LoadingSkeleton .Form .ButtonsSection .Button{border-radius:50px;background:transparent;border:none;overflow:hidden}';export{br as P}
@@ -1 +1 @@
1
- import{p as e,b as r}from"./index-a126c540.js";export{s as setNonce}from"./index-a126c540.js";import{g as n}from"./app-globals-0f993ce5.js";(()=>{const r=import.meta.url,n={};return""!==r&&(n.resourcesUrl=new URL(".",r).href),e(n)})().then((async e=>(await n(),r([["pam-login_2",[[1,"pam-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],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"],loginByPhoneNumber:[513,"login-by-phone-number"],isLoading:[32],contactValue:[32],passwordValue:[32],prefixValue:[32],prefixOptions:[32],isContactValid:[32],isPasswordValid:[32],isPasswordVisible:[32],apiErrorMessage:[32],captchaData:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1],color:[1],primaryColor:[1,"primary-color"],secondaryColor:[1,"secondary-color"]},null,{structure:["handleStructureChange"]}]]]],e))));
1
+ import{p as e,b as n}from"./index-a126c540.js";export{s as setNonce}from"./index-a126c540.js";import{g as r}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,r={};return""!==n&&(r.resourcesUrl=new URL(".",n).href),e(r)})().then((async e=>(await r(),n([["pam-login_2",[[1,"pam-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],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"],loginByPhoneNumber:[513,"login-by-phone-number"],isLoading:[32],contactValue:[32],passwordValue:[32],phoneCodeValue:[32],phoneCodes:[32],isContactValid:[32],isPasswordValid:[32],isPasswordVisible:[32],apiErrorMessage:[32],captchaData:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1]},null,{structure:["handleStructureChange"]}]]]],e))));
@@ -1 +1 @@
1
- export{P as pam_login}from"./pam-login-c277e537.js";import{r as e,h as t,H as n}from"./index-a126c540.js";const o=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%",this.color="#c2c2c2",this.primaryColor="#c2c2c2",this.secondaryColor="#ffffff"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n --emw-skeleton-logo-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n --emw-skeleton-image-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n --emw-skeleton-title-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n --emw-skeleton-text-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n --emw-skeleton-rectangle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.size};\n --emw-skeleton-circle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;default:e=""}return t(n,{key:"5c185b76c438d20d4ad88bc48d94ff5628410bb7"},t("style",{key:"de95e60a5955d5b2af83710423fe40329c187f7e"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};o.style=":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";export{o as ui_skeleton}
1
+ export{P as pam_login}from"./pam-login-8ea88687.js";import{r as e,h as t,H as n}from"./index-a126c540.js";const i=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"e6b885bfd985ce7663d990756fe9101e25eb97f0"},t("style",{key:"06ae24c7bb74f4dacfc12ae58085333f9dc89da5"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};i.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{i as ui_skeleton}
@@ -66,9 +66,9 @@ export declare class PamLogin {
66
66
  /** Password entered in the form */
67
67
  passwordValue: string;
68
68
  /** User prefix entered in the form */
69
- prefixValue: string;
69
+ phoneCodeValue: string;
70
70
  /** User prefix options for phone number login */
71
- prefixOptions: Record<string, string>[];
71
+ phoneCodes: Record<string, string>[];
72
72
  /** Flag to indicate whether the entered email is valid */
73
73
  isContactValid: boolean;
74
74
  /** Flag to indicate whether the entered password is valid */
@@ -140,7 +140,7 @@ export declare class PamLogin {
140
140
  /**
141
141
  * Fetch phone prefixes from the API
142
142
  */
143
- getPrefixOptions: () => Promise<void>;
143
+ getPhoneCodes: () => Promise<void>;
144
144
  /**
145
145
  * Handle autofilling of credentials from a dispatched event
146
146
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/pam-login",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",