@everymatrix/user-login 1.94.18 → 1.94.20

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 index = require('./index-7c1c14d6.js');
5
+ const index = require('./index-abb69c35.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  /*
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"userPhoneRegex":[513,"user-phone-regex"],"userPhoneRegexOptions":[513,"user-phone-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"captchaData":[32],"isNativeApp":[32],"biometricsLoaded":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
22
+ return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"userPhoneRegex":[513,"user-phone-regex"],"userPhoneRegexOptions":[513,"user-phone-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"turnstileEnableFallback":[4,"turnstile-enable-fallback"],"turnstileRetryCount":[2,"turnstile-retry-count"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"isTurnstileLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -1,11 +1,15 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { getTranslations, translate } from "../../utils/locale.utils";
3
3
  import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
4
+ import { getSlottedElement } from "../../../../../../../../libs/common/src/utils/index";
4
5
  import { dispatchCustomEvent } from "../../../../../../../../libs/custom-events/src/index";
6
+ import { createRecaptcha, createTurnstile, } from "../../../../../../../../libs/common/src/captcha/index";
7
+ import { CAPTCHA_CONTAINER_SLOT } from "../../utils/utils";
5
8
  import "../../../../../../../libs/vaadin-facade/index";
6
9
  export class UserLogin {
7
10
  constructor() {
8
11
  this.errorCode = '';
12
+ this.captchaInstance = null;
9
13
  this.messageHandler = async (e) => {
10
14
  var _a;
11
15
  if (((_a = e.data) === null || _a === void 0 ? void 0 : _a.type) === 'NativeAppReady') {
@@ -22,11 +26,11 @@ export class UserLogin {
22
26
  /**
23
27
  * Fetch phone prefixes from the API
24
28
  */
25
- this.getPhoneCodes = () => {
29
+ this.getPhoneCodes = async () => {
26
30
  const url = new URL(`${this.endpoint}/v1/player/operatorSupportedPhoneCodes`);
27
31
  return fetch(url.href)
28
32
  .then(res => res.json())
29
- .then(data => data.phoneCodes.map(code => ({ label: code, value: code })))
33
+ .then(data => { var _a; return ((_a = data === null || data === void 0 ? void 0 : data.phoneCodes) !== null && _a !== void 0 ? _a : []).map(code => ({ label: code, value: code })); })
30
34
  .catch(err => console.log('Failed to fetch phone codes:', err));
31
35
  };
32
36
  /**
@@ -44,6 +48,7 @@ export class UserLogin {
44
48
  * Login API call for Gm 1.7
45
49
  */
46
50
  this.userLoginGm17 = async () => {
51
+ var _a, _b, _c;
47
52
  let headers = {
48
53
  'Content-Type': 'application/json'
49
54
  };
@@ -51,8 +56,15 @@ export class UserLogin {
51
56
  contact: this.userNameEmail,
52
57
  password: this.userPassword
53
58
  };
54
- if (this.captchaData.isEnabled) {
55
- headers['X-Captcha-Response'] = this.captchaData.token;
59
+ if (this.captchaInstance) {
60
+ let token;
61
+ if (typeof ((_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === "function") {
62
+ token = await ((_c = (_b = this.captchaInstance) === null || _b === void 0 ? void 0 : _b.ensureToken) === null || _c === void 0 ? void 0 : _c.call(_b));
63
+ }
64
+ else {
65
+ token = this.captchaToken;
66
+ }
67
+ headers['cf-captcha-response'] = token !== null && token !== void 0 ? token : "";
56
68
  }
57
69
  const options = {
58
70
  method: 'POST',
@@ -135,9 +147,26 @@ export class UserLogin {
135
147
  * Login API call
136
148
  */
137
149
  this.userLogin = async () => {
150
+ var _a, _b;
138
151
  const url = new URL(`${this.endpoint}/v1/player/legislation/login`);
139
152
  const headers = new Headers();
140
153
  headers.append('Content-Type', 'application/json');
154
+ if (this.turnstileSiteKey && this.captchaInstance) {
155
+ try {
156
+ const turnstileToken = await ((_b = (_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.ensureToken) === null || _b === void 0 ? void 0 : _b.call(_a));
157
+ if (turnstileToken) {
158
+ headers.append('cf-captcha-response', turnstileToken);
159
+ headers.append('cfCaptchaIsVisible', 'false');
160
+ }
161
+ }
162
+ catch (error) {
163
+ this.hasError = true;
164
+ this.errorMessage = translate('genericError', this.lang) || `${error}`;
165
+ this.sendErrorNotification(this.errorMessage);
166
+ this.isLoginLoading = false;
167
+ return;
168
+ }
169
+ }
141
170
  const body = JSON.stringify({
142
171
  username: this.loginByPhoneNumber === 'true' ? `${this.userPrefix} ${this.userPhone}` : this.userNameEmail,
143
172
  password: this.userPassword
@@ -305,11 +334,11 @@ export class UserLogin {
305
334
  this.clientStylingUrl = '';
306
335
  this.translationUrl = '';
307
336
  this.passwordReset = 'false';
308
- this.userEmailRegex = undefined;
337
+ this.userEmailRegex = '';
309
338
  this.userEmailRegexOptions = 'i';
310
- this.userPhoneRegex = undefined;
339
+ this.userPhoneRegex = '';
311
340
  this.userPhoneRegexOptions = '';
312
- this.passwordRegex = undefined;
341
+ this.passwordRegex = '';
313
342
  this.passwordRegexOptions = '';
314
343
  this.version = 'gm16';
315
344
  this.loginByPhoneNumber = 'false';
@@ -319,6 +348,9 @@ export class UserLogin {
319
348
  this.biometricEnabled = 'false';
320
349
  this.biometricactionmode = 'switch';
321
350
  this.isFromLogin = true;
351
+ this.turnstileSiteKey = undefined;
352
+ this.turnstileEnableFallback = false;
353
+ this.turnstileRetryCount = undefined;
322
354
  this.userNameEmail = '';
323
355
  this.userPassword = '';
324
356
  this.isValidUserEmail = true;
@@ -330,16 +362,11 @@ export class UserLogin {
330
362
  this.errorMessage = '';
331
363
  this.errorForFields = {};
332
364
  this.hasError = false;
333
- this.phoneCodes = undefined;
365
+ this.phoneCodes = [];
334
366
  this.isLoginLoading = false;
335
- this.captchaData = {
336
- isEnabled: true,
337
- token: '',
338
- provider: '',
339
- siteKey: ''
340
- };
341
367
  this.isNativeApp = false;
342
368
  this.biometricsLoaded = false;
369
+ this.isTurnstileLoading = false;
343
370
  }
344
371
  /**
345
372
  * Watch for changes in the translation URL and fetch new translations
@@ -368,7 +395,7 @@ export class UserLogin {
368
395
  * Populate login credentials from an external caller and trigger the login process
369
396
  */
370
397
  async autofillCredentials(credentials) {
371
- const { userNameEmail, userPassword, userPrefix, userPhone } = credentials || {};
398
+ const { userNameEmail, userPassword, userPrefix = '', userPhone = '' } = credentials || {};
372
399
  this.userNameEmail = userNameEmail;
373
400
  this.userPassword = userPassword;
374
401
  this.userPrefix = userPrefix;
@@ -380,15 +407,16 @@ export class UserLogin {
380
407
  * Lifecycle method: Fetch translations on component load
381
408
  */
382
409
  async componentWillLoad() {
410
+ var _a, _b;
383
411
  if (this.loginByPhoneNumber === 'true') {
384
412
  if (this.defaultPrefix && this.isPrefixEditable === 'false') {
385
413
  this.phoneCodes = [{ label: this.defaultPrefix, value: this.defaultPrefix }];
386
414
  this.userPrefix = this.defaultPrefix;
387
415
  }
388
416
  else {
389
- this.phoneCodes = await this.getPhoneCodes();
390
- if (!this.defaultPrefix && this.isPrefixEditable === 'false') {
391
- this.userPrefix = this.phoneCodes[0].value;
417
+ this.phoneCodes = await (this.getPhoneCodes()) || [];
418
+ if (((_a = this.phoneCodes) === null || _a === void 0 ? void 0 : _a.length) && !this.defaultPrefix && this.isPrefixEditable === 'false') {
419
+ this.userPrefix = (_b = this.phoneCodes[0]) === null || _b === void 0 ? void 0 : _b.value;
392
420
  }
393
421
  else if (this.defaultPrefix && this.isPrefixEditable === 'true') {
394
422
  this.userPrefix = this.defaultPrefix;
@@ -402,8 +430,8 @@ export class UserLogin {
402
430
  await getTranslations(this.translationUrl);
403
431
  }
404
432
  if (this.version === 'gm17') {
405
- this.getLoginConfig().then(() => {
406
- this.appendCaptchaScript();
433
+ this.getLoginConfig().then((captchaData) => {
434
+ this.initializeCaptcha(captchaData);
407
435
  }).catch((error) => {
408
436
  console.error(error);
409
437
  this.hasError = true;
@@ -434,9 +462,17 @@ export class UserLogin {
434
462
  this.handleClientStyling();
435
463
  window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
436
464
  window.postMessage({ type: 'UserLoginDidLoad' });
465
+ if (this.turnstileSiteKey) {
466
+ this.initializeCaptcha({
467
+ isEnabled: true,
468
+ provider: "cloudflare",
469
+ siteKey: this.turnstileSiteKey,
470
+ enableFallback: this.turnstileEnableFallback
471
+ });
472
+ }
437
473
  }
438
474
  /**
439
- * Fetches the login configuration from the backend API.
475
+ * Fetches the login configuration from the backend API, used for gm17 only.
440
476
  *
441
477
  * @returns A Promise that resolves once the configuration is fetched and set.
442
478
  */
@@ -455,8 +491,7 @@ export class UserLogin {
455
491
  if (captcha && typeof captcha.provider === 'string') {
456
492
  captcha.provider = captcha.provider.toLowerCase();
457
493
  }
458
- this.captchaData = Object.assign({}, captcha);
459
- resolve();
494
+ resolve(captcha);
460
495
  })
461
496
  .catch((error) => {
462
497
  console.error('Error fetching login configuration:', error);
@@ -464,70 +499,30 @@ export class UserLogin {
464
499
  });
465
500
  });
466
501
  }
467
- /**
468
- * Handles the integration of CAPTCHA based on the login configuration.
469
- * Dynamically injects the necessary CAPTCHA script if enabled.
470
- */
471
- handleCaptcha() {
472
- const { isEnabled, provider, siteKey } = this.captchaData;
473
- if (!isEnabled) {
474
- return;
475
- }
476
- if (!['cloudflare', 'google'].includes(provider)) {
477
- return;
478
- }
479
- if (provider === 'cloudflare') {
480
- window.turnstile.render('#turnstileContainer', {
481
- sitekey: siteKey,
482
- theme: 'light',
483
- callback: this.captchaCallback.bind(this),
484
- });
485
- }
486
- else if (provider === 'google') {
487
- window.grecaptcha.ready(() => {
488
- window.grecaptcha.render('googleContainer', {
489
- sitekey: siteKey,
490
- callback: this.captchaCallback.bind(this),
491
- theme: 'light'
492
- });
493
- });
494
- }
495
- }
496
- /**
497
- * Common callback function for CAPTCHA response handling.
498
- * @param token CAPTCHA response token.
499
- */
500
- captchaCallback(token) {
501
- this.captchaData.token = token;
502
- this.captchaData = Object.assign({}, this.captchaData); // Needed to tell Stencil something was changed
503
- }
504
- /**
505
- * Dynamically loads the Turnstile script and renders CAPTCHA when ready.
506
- * @param src - The URL of the CAPTCHA script to load.
507
- * @param captcha - The CAPTCHA configuration.
508
- */
509
- appendCaptchaScript() {
510
- const { isEnabled, provider } = this.captchaData;
511
- if (!isEnabled) {
512
- return;
513
- }
514
- const script = document.createElement('script');
515
- if (provider === 'cloudflare') {
516
- script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
517
- }
518
- else if (provider === 'google') {
519
- script.src = 'https://www.google.com/recaptcha/api.js';
520
- }
521
- script.onload = this.handleCaptcha.bind(this);
522
- document.head.appendChild(script);
502
+ async initializeCaptcha({ provider, siteKey, enableFallback }) {
503
+ const slotElement = getSlottedElement(this.host, CAPTCHA_CONTAINER_SLOT);
504
+ this.captchaContainerEl = slotElement;
505
+ const captchaCreator = {
506
+ "google": createRecaptcha,
507
+ "cloudflare": createTurnstile
508
+ };
509
+ this.captchaInstance = captchaCreator[provider]({
510
+ action: 'login',
511
+ siteKey,
512
+ enableFallback,
513
+ callback: provider === "google" ? (token) => { this.captchaToken = token; } : undefined
514
+ });
515
+ await this.captchaInstance.render(this.captchaContainerEl);
523
516
  }
524
517
  /**
525
518
  * Lifecycle method: Clean up event listeners when the component is removed
526
519
  */
527
520
  disconnectedCallback() {
521
+ var _a, _b;
528
522
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
529
523
  window.removeEventListener('LoginCredentials', this.autofillCredentialsHandler);
530
524
  window.removeEventListener('message', this.messageHandler);
525
+ (_b = (_a = this.captchaInstance) === null || _a === void 0 ? void 0 : _a.cleanup) === null || _b === void 0 ? void 0 : _b.call(_a);
531
526
  }
532
527
  /**
533
528
  * Send error notification as a post message
@@ -544,12 +539,12 @@ export class UserLogin {
544
539
  /**
545
540
  * Debounce function to limit API calls
546
541
  */
547
- debounce(func, delay) {
542
+ debounce(fn, delay = 500) {
548
543
  let timer;
549
- return function (...args) {
544
+ return (...args) => {
550
545
  clearTimeout(timer);
551
546
  timer = setTimeout(() => {
552
- func.apply(this, args);
547
+ fn(...args);
553
548
  }, delay);
554
549
  };
555
550
  }
@@ -579,9 +574,12 @@ export class UserLogin {
579
574
  window.dispatchEvent(event);
580
575
  }
581
576
  checkIsDisabled() {
582
- const isDisabled = Boolean(((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
577
+ const isDisabled = Boolean((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
583
578
  (this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
584
- !this.userPassword || !this.isValidPassword) || this.isLoginLoading || (this.version === 'gm17' && this.captchaData.isEnabled && !this.captchaData.token));
579
+ !this.userPassword ||
580
+ !this.isValidPassword ||
581
+ this.isLoginLoading ||
582
+ (this.version === 'gm17' && this.captchaInstance && !this.captchaToken));
585
583
  return isDisabled;
586
584
  }
587
585
  renderVisibilityIcon() {
@@ -599,16 +597,14 @@ export class UserLogin {
599
597
  h("p", { class: "CredentialsError" }, translate('userEmailError', this.lang))), h("div", { class: (!this.isValidPassword && this.errorForFields['password']) ? 'InputBox InputInvalidBox' : 'InputBox' }, this.renderVisibilityIcon(), h("input", { name: 'password', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword && this.errorForFields['password'] ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword && this.errorForFields['password'] &&
600
598
  h("p", { class: "CredentialsError" }, translate('userPasswordError', this.lang))), this.biometricEnabled === 'true' && this.isNativeApp &&
601
599
  h("div", { class: "PlayerBiometricsContainer" }, h("div", { class: "PlayerBiometrics" }, h("span", null, translate('biometricLogin')), h("player-account-biometrics-action", { mode: this.biometricactionmode, isFromLogin: this.isFromLogin, isNativeApp: this.isNativeApp, lang: this.lang, translationurl: this.translationUrl, clientstyling: this.clientStyling, clientstylingurl: this.clientStylingUrl, mbsource: this.mbSource, isLoading: this.isLoginLoading }))), this.passwordReset == 'true' &&
602
- h("div", { class: "ForgotPassword" }, h("button", { onClick: this.resetPassword }, translate('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
603
- h("slot", { name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
604
- h("slot", { name: "google" }), h("button", { disabled: this.checkIsDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.hasError &&
600
+ h("div", { class: "ForgotPassword" }, h("button", { onClick: this.resetPassword }, translate('forgotPassword', this.lang))), h("button", { disabled: this.checkIsDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.hasError &&
605
601
  h("p", { class: "CredentialsError" }, this.errorMessage))));
606
602
  }
607
603
  /**
608
604
  * Render function
609
- */
605
+ */
610
606
  render() {
611
- return h("section", { key: '6dcfae23bb6f3bb107c030d3fef3f8e32f88e12b', ref: el => this.stylingContainer = el }, this.renderUserIdentification());
607
+ return (h("section", { key: 'c72b94ac2e6cde988ae4798402680a527e4a004e', ref: el => this.stylingContainer = el }, this.renderUserIdentification(), h("slot", { key: '36c64bfcc9d5e19ae7b22d50638bf3c720167606', name: CAPTCHA_CONTAINER_SLOT })));
612
608
  }
613
609
  static get is() { return "user-login"; }
614
610
  static get encapsulation() { return "shadow"; }
@@ -765,7 +761,8 @@ export class UserLogin {
765
761
  "text": "Regular expression for validating the user email"
766
762
  },
767
763
  "attribute": "user-email-regex",
768
- "reflect": true
764
+ "reflect": true,
765
+ "defaultValue": "''"
769
766
  },
770
767
  "userEmailRegexOptions": {
771
768
  "type": "string",
@@ -800,7 +797,8 @@ export class UserLogin {
800
797
  "text": "User phone regex"
801
798
  },
802
799
  "attribute": "user-phone-regex",
803
- "reflect": true
800
+ "reflect": true,
801
+ "defaultValue": "''"
804
802
  },
805
803
  "userPhoneRegexOptions": {
806
804
  "type": "string",
@@ -835,7 +833,8 @@ export class UserLogin {
835
833
  "text": "Regular expression for validating the password"
836
834
  },
837
835
  "attribute": "password-regex",
838
- "reflect": true
836
+ "reflect": true,
837
+ "defaultValue": "''"
839
838
  },
840
839
  "passwordRegexOptions": {
841
840
  "type": "string",
@@ -859,8 +858,8 @@ export class UserLogin {
859
858
  "type": "string",
860
859
  "mutable": false,
861
860
  "complexType": {
862
- "original": "string",
863
- "resolved": "string",
861
+ "original": "'gm16' | 'gm17'",
862
+ "resolved": "\"gm16\" | \"gm17\"",
864
863
  "references": {}
865
864
  },
866
865
  "required": false,
@@ -900,7 +899,7 @@ export class UserLogin {
900
899
  "references": {}
901
900
  },
902
901
  "required": false,
903
- "optional": false,
902
+ "optional": true,
904
903
  "docs": {
905
904
  "tags": [],
906
905
  "text": "Defines a prefix to be pre-selected"
@@ -935,7 +934,7 @@ export class UserLogin {
935
934
  "references": {}
936
935
  },
937
936
  "required": false,
938
- "optional": false,
937
+ "optional": true,
939
938
  "docs": {
940
939
  "tags": [],
941
940
  "text": "The source identifier for message bus styling.\nThis is used to apply styles dynamically from a stream."
@@ -996,6 +995,58 @@ export class UserLogin {
996
995
  "attribute": "is-from-login",
997
996
  "reflect": false,
998
997
  "defaultValue": "true"
998
+ },
999
+ "turnstileSiteKey": {
1000
+ "type": "string",
1001
+ "mutable": false,
1002
+ "complexType": {
1003
+ "original": "string",
1004
+ "resolved": "string",
1005
+ "references": {}
1006
+ },
1007
+ "required": false,
1008
+ "optional": true,
1009
+ "docs": {
1010
+ "tags": [],
1011
+ "text": "Cloudflare Turnstile site key.\nActs as the enable/disable flag for Turnstile."
1012
+ },
1013
+ "attribute": "turnstile-site-key",
1014
+ "reflect": false
1015
+ },
1016
+ "turnstileEnableFallback": {
1017
+ "type": "boolean",
1018
+ "mutable": false,
1019
+ "complexType": {
1020
+ "original": "boolean",
1021
+ "resolved": "boolean",
1022
+ "references": {}
1023
+ },
1024
+ "required": false,
1025
+ "optional": true,
1026
+ "docs": {
1027
+ "tags": [],
1028
+ "text": "Enable Turnstile fallback behavior."
1029
+ },
1030
+ "attribute": "turnstile-enable-fallback",
1031
+ "reflect": false,
1032
+ "defaultValue": "false"
1033
+ },
1034
+ "turnstileRetryCount": {
1035
+ "type": "number",
1036
+ "mutable": false,
1037
+ "complexType": {
1038
+ "original": "number",
1039
+ "resolved": "number",
1040
+ "references": {}
1041
+ },
1042
+ "required": false,
1043
+ "optional": true,
1044
+ "docs": {
1045
+ "tags": [],
1046
+ "text": "Number of retry attempts for Turnstile."
1047
+ },
1048
+ "attribute": "turnstile-retry-count",
1049
+ "reflect": false
999
1050
  }
1000
1051
  };
1001
1052
  }
@@ -1014,9 +1065,9 @@ export class UserLogin {
1014
1065
  "hasError": {},
1015
1066
  "phoneCodes": {},
1016
1067
  "isLoginLoading": {},
1017
- "captchaData": {},
1018
1068
  "isNativeApp": {},
1019
- "biometricsLoaded": {}
1069
+ "biometricsLoaded": {},
1070
+ "isTurnstileLoading": {}
1020
1071
  };
1021
1072
  }
1022
1073
  static get methods() {
@@ -1049,6 +1100,7 @@ export class UserLogin {
1049
1100
  }
1050
1101
  };
1051
1102
  }
1103
+ static get elementRef() { return "host"; }
1052
1104
  static get watchers() {
1053
1105
  return [{
1054
1106
  "propName": "translationUrl",
@@ -1,3 +1,4 @@
1
1
  export function format(first, middle, last) {
2
2
  return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
3
3
  }
4
+ export const CAPTCHA_CONTAINER_SLOT = "captchaContainer";
@@ -291,6 +291,7 @@ var parsePropertyValue = (propValue, propType) => {
291
291
  }
292
292
  return propValue;
293
293
  };
294
+ var getElement = (ref) => getHostRef(ref).$hostElement$ ;
294
295
  var emitEvent = (elm, name, opts) => {
295
296
  const ev = plt.ce(name, opts);
296
297
  elm.dispatchEvent(ev);
@@ -1214,4 +1215,4 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1214
1215
  // src/runtime/nonce.ts
1215
1216
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1216
1217
 
1217
- export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
1218
+ export { bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-13692399.js';
2
- export { s as setNonce } from './index-13692399.js';
1
+ import { b as bootstrapLazy } from './index-b943f0d9.js';
2
+ export { s as setNonce } from './index-b943f0d9.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"userPhoneRegex":[513,"user-phone-regex"],"userPhoneRegexOptions":[513,"user-phone-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"captchaData":[32],"isNativeApp":[32],"biometricsLoaded":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
8
+ return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"minPassLength":[514,"min-pass-length"],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"userPhoneRegex":[513,"user-phone-regex"],"userPhoneRegexOptions":[513,"user-phone-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"defaultPrefix":[513,"default-prefix"],"isPrefixEditable":[513,"is-prefix-editable"],"mbSource":[513,"mb-source"],"biometricEnabled":[513,"biometric-enabled"],"biometricactionmode":[1],"isFromLogin":[4,"is-from-login"],"turnstileSiteKey":[1,"turnstile-site-key"],"turnstileEnableFallback":[4,"turnstile-enable-fallback"],"turnstileRetryCount":[2,"turnstile-retry-count"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"errorMessage":[32],"errorForFields":[32],"hasError":[32],"phoneCodes":[32],"isLoginLoading":[32],"isNativeApp":[32],"biometricsLoaded":[32],"isTurnstileLoading":[32],"autofillCredentials":[64]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };