@everymatrix/player-step-up-auth 1.88.21 → 1.88.23

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 playerStepUpAuth = require('./player-step-up-auth-8c9ed351.js');
5
+ const playerStepUpAuth = require('./player-step-up-auth-9ade02f4.js');
6
6
  require('./index-bf4d774c.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([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
11
+ return index.bootstrapLazy([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"mode":[513],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -451,6 +451,7 @@ const PlayerStepUpAuth = class {
451
451
  this.endpoint = undefined;
452
452
  this.userSession = undefined;
453
453
  this.translationUrl = '';
454
+ this.mode = 'numeric';
454
455
  this.showPopup = false;
455
456
  this.otp = undefined;
456
457
  this.isLoading = true;
@@ -836,9 +837,9 @@ const PlayerStepUpAuth = class {
836
837
  * Displays the OTP popup, input fields, timer, and action buttons.
837
838
  */
838
839
  render() {
839
- return (index.h("div", { key: '31703a17e1f7b44ca4ebe5520f2fe129a309671a', ref: el => this.stylingContainer = el }, this.showPopup && (index.h("div", { key: '3e1f12aa2eccd8494268f03b53aaa9411a52c7be', class: "OtpPopupOverlay" }, index.h("div", { key: '7ebfaab2f0798ea661d8a8a9021a7c2e14da1896', class: `OtpPopupContent ${this.shakeError ? 'shake' : ''}` }, this.isLoading ? (index.h("div", { class: "OtpLoaderContainer" }, index.h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (index.h("div", { class: "OtpError" }, index.h("div", { class: "OtpErrorHeader" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), index.h("h2", null, translate('errorHeader', this.language))), index.h("p", null, this.errorMessage), index.h("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": translate('close', this.language) }, translate('close', this.language)))) : (index.h(index.Fragment, null, index.h("div", { class: "otp-description" }, this.showResendOtp ? (index.h("p", { class: "OtpNoticeMessage", role: "alert" }, translate('otpExpiredMessage', this.language))) : (index.h(index.Fragment, null, index.h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && (index.h("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))))), index.h("div", { class: "OtpFieldWrapper" }, index.h("h2", null, translate('otpHeading', this.language)), index.h("div", { class: "OtpField" }, this.otp.map((char, index$1) => {
840
+ return (index.h("div", { key: '767f774b7244dbe264590e32364f17d7fcde0fa5', ref: el => this.stylingContainer = el }, this.showPopup && (index.h("div", { key: 'ed8bd21c48b9afa91bca17568bd90dcb26d1d171', class: "OtpPopupOverlay" }, index.h("div", { key: '2047ade4a5f2d62576f15368c86359c0c88014f7', class: `OtpPopupContent ${this.shakeError ? 'shake' : ''}` }, this.isLoading ? (index.h("div", { class: "OtpLoaderContainer" }, index.h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (index.h("div", { class: "OtpError" }, index.h("div", { class: "OtpErrorHeader" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), index.h("h2", null, translate('errorHeader', this.language))), index.h("p", null, this.errorMessage), index.h("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": translate('close', this.language) }, translate('close', this.language)))) : (index.h(index.Fragment, null, index.h("div", { class: "otp-description" }, this.showResendOtp ? (index.h("p", { class: "OtpNoticeMessage", role: "alert" }, translate('otpExpiredMessage', this.language))) : (index.h(index.Fragment, null, index.h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && (index.h("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))))), index.h("div", { class: "OtpFieldWrapper" }, index.h("h2", null, translate('otpHeading', this.language)), index.h("div", { class: "OtpField" }, this.otp.map((char, index$1) => {
840
841
  const isHalfway = this.config.inputLength % 2 === 0 && index$1 === (this.config.inputLength / 2) - 1;
841
- return (index.h("input", { key: index$1, ref: el => this.setOtpInputRef(el, index$1), id: `otp-input-${index$1}`, type: "text", class: `otp-box ${isHalfway ? 'space' : ''} ${char ? 'filled' : ''} ${this.hasErrors ? 'error' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index$1), onKeyDown: (event) => this.handleKeyDown(event, index$1), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.inputDisabled, autoComplete: 'off', "aria-label": `${translate('otpDigit', this.language)} ${index$1 + 1}`, "aria-invalid": this.hasErrors }));
842
+ return (index.h("input", { key: index$1, ref: el => this.setOtpInputRef(el, index$1), id: `otp-input-${index$1}`, type: "text", inputmode: this.mode, pattern: this.mode === 'numeric' ? '[0-9]' : undefined, class: `otp-box ${isHalfway ? 'space' : ''} ${char ? 'filled' : ''} ${this.hasErrors ? 'error' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index$1), onKeyDown: (event) => this.handleKeyDown(event, index$1), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.inputDisabled, autoComplete: 'off', "aria-label": `${translate('otpDigit', this.language)} ${index$1 + 1}`, "aria-invalid": this.hasErrors }));
842
843
  })), index.h("div", { class: "OtpTimerContainer" }, index.h("div", { class: `OtpTimer ${this.isLastWarning ? 'warning' : ''} ${this.timeLeft < 60 ? 'critical' : ''}`, role: "timer", "aria-live": "polite" }, index.h("svg", { class: "timer-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { d: "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" })), index.h("span", { class: "timer-text" }, this.formatTime(this.timeLeft), " ", translate('minutes', this.language))))), this.isSuccess && (index.h("div", { class: "OtpSuccessOverlay" }, index.h("svg", { class: "success-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" })), index.h("span", null, translate('otpVerified', this.language)))), index.h("div", { class: "OtpActionButtons" }, this.showResendOtp ? (index.h("button", { class: "OtpButton primary", onClick: this.handleResendOtp, disabled: this.isLoading, "aria-label": translate('resendOtp', this.language) }, translate('resendOtp', this.language))) : (index.h("button", { class: `OtpButton primary ${this.isValidating ? 'loading' : ''}`, onClick: this.submitOtp, disabled: this.otp.join('').length !== this.config.inputLength || this.isValidating || this.isLoading, "aria-label": translate('submit', this.language), "aria-busy": this.isValidating }, this.isValidating ? (index.h(index.Fragment, null, index.h("span", { class: "button-spinner" }), index.h("span", { class: "button-text" }, translate('verifying', this.language)))) : (index.h("span", { class: "button-text" }, translate('submit', this.language))))), index.h("button", { class: "OtpButton secondary", onClick: this.manualClosePopup, disabled: this.isValidating, "aria-label": translate('close', this.language) }, translate('close', this.language)))))))))));
843
844
  }
844
845
  get el() { return index.getElement(this); }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const playerStepUpAuth = require('./player-step-up-auth-8c9ed351.js');
5
+ const playerStepUpAuth = require('./player-step-up-auth-9ade02f4.js');
6
6
  require('./index-bf4d774c.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([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
22
+ return index.bootstrapLazy([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"mode":[513],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -90,6 +90,7 @@ export class PlayerStepUpAuth {
90
90
  this.endpoint = undefined;
91
91
  this.userSession = undefined;
92
92
  this.translationUrl = '';
93
+ this.mode = 'numeric';
93
94
  this.showPopup = false;
94
95
  this.otp = undefined;
95
96
  this.isLoading = true;
@@ -475,9 +476,9 @@ export class PlayerStepUpAuth {
475
476
  * Displays the OTP popup, input fields, timer, and action buttons.
476
477
  */
477
478
  render() {
478
- return (h("div", { key: '31703a17e1f7b44ca4ebe5520f2fe129a309671a', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: '3e1f12aa2eccd8494268f03b53aaa9411a52c7be', class: "OtpPopupOverlay" }, h("div", { key: '7ebfaab2f0798ea661d8a8a9021a7c2e14da1896', class: `OtpPopupContent ${this.shakeError ? 'shake' : ''}` }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": translate('close', this.language) }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, this.showResendOtp ? (h("p", { class: "OtpNoticeMessage", role: "alert" }, translate('otpExpiredMessage', this.language))) : (h(Fragment, null, h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && (h("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))))), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField" }, this.otp.map((char, index) => {
479
+ return (h("div", { key: '767f774b7244dbe264590e32364f17d7fcde0fa5', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: 'ed8bd21c48b9afa91bca17568bd90dcb26d1d171', class: "OtpPopupOverlay" }, h("div", { key: '2047ade4a5f2d62576f15368c86359c0c88014f7', class: `OtpPopupContent ${this.shakeError ? 'shake' : ''}` }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": translate('close', this.language) }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, this.showResendOtp ? (h("p", { class: "OtpNoticeMessage", role: "alert" }, translate('otpExpiredMessage', this.language))) : (h(Fragment, null, h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && (h("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))))), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField" }, this.otp.map((char, index) => {
479
480
  const isHalfway = this.config.inputLength % 2 === 0 && index === (this.config.inputLength / 2) - 1;
480
- return (h("input", { key: index, ref: el => this.setOtpInputRef(el, index), id: `otp-input-${index}`, type: "text", class: `otp-box ${isHalfway ? 'space' : ''} ${char ? 'filled' : ''} ${this.hasErrors ? 'error' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index), onKeyDown: (event) => this.handleKeyDown(event, index), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.inputDisabled, autoComplete: 'off', "aria-label": `${translate('otpDigit', this.language)} ${index + 1}`, "aria-invalid": this.hasErrors }));
481
+ return (h("input", { key: index, ref: el => this.setOtpInputRef(el, index), id: `otp-input-${index}`, type: "text", inputmode: this.mode, pattern: this.mode === 'numeric' ? '[0-9]' : undefined, class: `otp-box ${isHalfway ? 'space' : ''} ${char ? 'filled' : ''} ${this.hasErrors ? 'error' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index), onKeyDown: (event) => this.handleKeyDown(event, index), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.inputDisabled, autoComplete: 'off', "aria-label": `${translate('otpDigit', this.language)} ${index + 1}`, "aria-invalid": this.hasErrors }));
481
482
  })), h("div", { class: "OtpTimerContainer" }, h("div", { class: `OtpTimer ${this.isLastWarning ? 'warning' : ''} ${this.timeLeft < 60 ? 'critical' : ''}`, role: "timer", "aria-live": "polite" }, h("svg", { class: "timer-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" })), h("span", { class: "timer-text" }, this.formatTime(this.timeLeft), " ", translate('minutes', this.language))))), this.isSuccess && (h("div", { class: "OtpSuccessOverlay" }, h("svg", { class: "success-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" })), h("span", null, translate('otpVerified', this.language)))), h("div", { class: "OtpActionButtons" }, this.showResendOtp ? (h("button", { class: "OtpButton primary", onClick: this.handleResendOtp, disabled: this.isLoading, "aria-label": translate('resendOtp', this.language) }, translate('resendOtp', this.language))) : (h("button", { class: `OtpButton primary ${this.isValidating ? 'loading' : ''}`, onClick: this.submitOtp, disabled: this.otp.join('').length !== this.config.inputLength || this.isValidating || this.isLoading, "aria-label": translate('submit', this.language), "aria-busy": this.isValidating }, this.isValidating ? (h(Fragment, null, h("span", { class: "button-spinner" }), h("span", { class: "button-text" }, translate('verifying', this.language)))) : (h("span", { class: "button-text" }, translate('submit', this.language))))), h("button", { class: "OtpButton secondary", onClick: this.manualClosePopup, disabled: this.isValidating, "aria-label": translate('close', this.language) }, translate('close', this.language)))))))))));
482
483
  }
483
484
  static get is() { return "player-step-up-auth"; }
@@ -614,6 +615,24 @@ export class PlayerStepUpAuth {
614
615
  "attribute": "translation-url",
615
616
  "reflect": true,
616
617
  "defaultValue": "''"
618
+ },
619
+ "mode": {
620
+ "type": "string",
621
+ "mutable": false,
622
+ "complexType": {
623
+ "original": "string",
624
+ "resolved": "string",
625
+ "references": {}
626
+ },
627
+ "required": false,
628
+ "optional": false,
629
+ "docs": {
630
+ "tags": [],
631
+ "text": ""
632
+ },
633
+ "attribute": "mode",
634
+ "reflect": true,
635
+ "defaultValue": "'numeric'"
617
636
  }
618
637
  };
619
638
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PlayerStepUpAuth } from './player-step-up-auth-9d437b84.js';
1
+ export { P as PlayerStepUpAuth } from './player-step-up-auth-b54fc2e5.js';
2
2
  import './index-c6eee6d8.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([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
8
+ return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"mode":[513],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -449,6 +449,7 @@ const PlayerStepUpAuth = class {
449
449
  this.endpoint = undefined;
450
450
  this.userSession = undefined;
451
451
  this.translationUrl = '';
452
+ this.mode = 'numeric';
452
453
  this.showPopup = false;
453
454
  this.otp = undefined;
454
455
  this.isLoading = true;
@@ -834,9 +835,9 @@ const PlayerStepUpAuth = class {
834
835
  * Displays the OTP popup, input fields, timer, and action buttons.
835
836
  */
836
837
  render() {
837
- return (h("div", { key: '31703a17e1f7b44ca4ebe5520f2fe129a309671a', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: '3e1f12aa2eccd8494268f03b53aaa9411a52c7be', class: "OtpPopupOverlay" }, h("div", { key: '7ebfaab2f0798ea661d8a8a9021a7c2e14da1896', class: `OtpPopupContent ${this.shakeError ? 'shake' : ''}` }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": translate('close', this.language) }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, this.showResendOtp ? (h("p", { class: "OtpNoticeMessage", role: "alert" }, translate('otpExpiredMessage', this.language))) : (h(Fragment, null, h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && (h("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))))), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField" }, this.otp.map((char, index) => {
838
+ return (h("div", { key: '767f774b7244dbe264590e32364f17d7fcde0fa5', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: 'ed8bd21c48b9afa91bca17568bd90dcb26d1d171', class: "OtpPopupOverlay" }, h("div", { key: '2047ade4a5f2d62576f15368c86359c0c88014f7', class: `OtpPopupContent ${this.shakeError ? 'shake' : ''}` }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": translate('close', this.language) }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, this.showResendOtp ? (h("p", { class: "OtpNoticeMessage", role: "alert" }, translate('otpExpiredMessage', this.language))) : (h(Fragment, null, h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && (h("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))))), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField" }, this.otp.map((char, index) => {
838
839
  const isHalfway = this.config.inputLength % 2 === 0 && index === (this.config.inputLength / 2) - 1;
839
- return (h("input", { key: index, ref: el => this.setOtpInputRef(el, index), id: `otp-input-${index}`, type: "text", class: `otp-box ${isHalfway ? 'space' : ''} ${char ? 'filled' : ''} ${this.hasErrors ? 'error' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index), onKeyDown: (event) => this.handleKeyDown(event, index), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.inputDisabled, autoComplete: 'off', "aria-label": `${translate('otpDigit', this.language)} ${index + 1}`, "aria-invalid": this.hasErrors }));
840
+ return (h("input", { key: index, ref: el => this.setOtpInputRef(el, index), id: `otp-input-${index}`, type: "text", inputmode: this.mode, pattern: this.mode === 'numeric' ? '[0-9]' : undefined, class: `otp-box ${isHalfway ? 'space' : ''} ${char ? 'filled' : ''} ${this.hasErrors ? 'error' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index), onKeyDown: (event) => this.handleKeyDown(event, index), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.inputDisabled, autoComplete: 'off', "aria-label": `${translate('otpDigit', this.language)} ${index + 1}`, "aria-invalid": this.hasErrors }));
840
841
  })), h("div", { class: "OtpTimerContainer" }, h("div", { class: `OtpTimer ${this.isLastWarning ? 'warning' : ''} ${this.timeLeft < 60 ? 'critical' : ''}`, role: "timer", "aria-live": "polite" }, h("svg", { class: "timer-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" })), h("span", { class: "timer-text" }, this.formatTime(this.timeLeft), " ", translate('minutes', this.language))))), this.isSuccess && (h("div", { class: "OtpSuccessOverlay" }, h("svg", { class: "success-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" })), h("span", null, translate('otpVerified', this.language)))), h("div", { class: "OtpActionButtons" }, this.showResendOtp ? (h("button", { class: "OtpButton primary", onClick: this.handleResendOtp, disabled: this.isLoading, "aria-label": translate('resendOtp', this.language) }, translate('resendOtp', this.language))) : (h("button", { class: `OtpButton primary ${this.isValidating ? 'loading' : ''}`, onClick: this.submitOtp, disabled: this.otp.join('').length !== this.config.inputLength || this.isValidating || this.isLoading, "aria-label": translate('submit', this.language), "aria-busy": this.isValidating }, this.isValidating ? (h(Fragment, null, h("span", { class: "button-spinner" }), h("span", { class: "button-text" }, translate('verifying', this.language)))) : (h("span", { class: "button-text" }, translate('submit', this.language))))), h("button", { class: "OtpButton secondary", onClick: this.manualClosePopup, disabled: this.isValidating, "aria-label": translate('close', this.language) }, translate('close', this.language)))))))))));
841
842
  }
842
843
  get el() { return getElement(this); }
@@ -1,2 +1,2 @@
1
- export { P as player_step_up_auth } from './player-step-up-auth-9d437b84.js';
1
+ export { P as player_step_up_auth } from './player-step-up-auth-b54fc2e5.js';
2
2
  import './index-c6eee6d8.js';
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
19
+ return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"mode":[513],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32],"inputDisabled":[32],"isValidating":[32],"isSuccess":[32],"shakeError":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
20
20
  });
@@ -1 +1 @@
1
- export{P as PlayerStepUpAuth}from"./player-step-up-auth-9d437b84.js";import"./index-c6eee6d8.js";
1
+ export{P as PlayerStepUpAuth}from"./player-step-up-auth-b54fc2e5.js";import"./index-c6eee6d8.js";
@@ -0,0 +1 @@
1
+ import{r as e,h as t,F as i,g as r}from"./index-c6eee6d8.js";const s="__WIDGET_GLOBAL_STYLE_CACHE__";function o(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function a(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const n={en:{popupMessage:"Please enter the security code received on your email address to perform the update.",popupMessageLastWarning:"If the next validation attempt is failed, you will be logged out and blocked temporarily.",minutes:"minutes",errorHeader:"Error",configError:"Unable to load OTP data. Please try again later.",otpHeading:"Enter OTP",resendOtp:"Resend OTP",submit:"Submit",close:"Close",invalidOtp:"The code you've sent is not valid. Please try again.",accountBlocked:"Too many attempts for OTP. Your account has been blocked for one hour.",submissionError:"Something went wrong. Please try again.",otpExpiredMessage:"Validation code has expired, please request a new one to continue.",otpDigit:"OTP digit",verifying:"Verifying...",otpVerified:"OTP Verified Successfully!"},ro:{popupMessage:"Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.",popupMessageLastWarning:"Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.",minutes:"minute",errorHeader:"Eroare",configError:"Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.",otpHeading:"Introduceți OTP",resendOtp:"Retrimitere OTP",submit:"Trimite",close:"Închide",invalidOtp:"Codul introdus nu este valid. Vă rugăm să încercați din nou.",accountBlocked:"Prea multe încercări de OTP. Contul dvs. a fost blocat timp de o oră.",submissionError:"Ceva a mers prost. Vă rugăm să încercați din nou.",otpExpiredMessage:"Codul de validare a expirat, vă rugăm să solicitați unul nou pentru a continua.",otpDigit:"Cifră OTP",verifying:"Se verifică...",otpVerified:"OTP verificat cu succes!"},fr:{popupMessage:"Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.",popupMessageLastWarning:"Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.",minutes:"minutes",errorHeader:"Erreur",configError:"Impossible de charger les données OTP. Veuillez réessayer plus tard.",otpHeading:"Entrez OTP",resendOtp:"Renvoyer OTP",submit:"Soumettre",close:"Fermer",invalidOtp:"Le code que vous avez saisi n’est pas valide. Veuillez réessayer.",accountBlocked:"Trop de tentatives OTP. Votre compte a été bloqué pendant une heure.",submissionError:"Quelque chose s'est mal passé. Veuillez réessayer.",otpExpiredMessage:"Le code de validation a expiré, veuillez en demander un nouveau pour continuer.",otpDigit:"Chiffre OTP",verifying:"Vérification...",otpVerified:"OTP vérifié avec succès!"},hu:{popupMessage:"Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.",popupMessageLastWarning:"Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.",minutes:"perc",errorHeader:"Hiba",configError:"Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.",otpHeading:"OTP megadása",resendOtp:"Újraküldés",submit:"Beküldés",close:"Bezárás",invalidOtp:"A megadott kód érvénytelen. Kérjük, próbálja újra.",accountBlocked:"Túl sok OTP próbálkozás. A fiókja egy órára zárolva lett.",submissionError:"Valami hiba történt. Kérjük, próbálja újra.",otpExpiredMessage:"A megerősítő kód lejárt, kérjük, kérjen egy újat a folytatáshoz.",otpDigit:"OTP számjegy",verifying:"Ellenőrzés...",otpVerified:"OTP sikeresen ellenőrizve!"},tr:{popupMessage:"Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.",popupMessageLastWarning:"Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",minutes:"dakika",errorHeader:"Hata",configError:"OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.",otpHeading:"OTP Girin",resendOtp:"OTP'yi Yeniden Gönder",submit:"Gönder",close:"Kapat",invalidOtp:"Gönderdiğiniz kod geçersiz. Lütfen tekrar deneyin.",accountBlocked:"Çok fazla OTP denemesi yapıldı. Hesabınız bir saat boyunca kilitlendi.",submissionError:"Bir şeyler yanlış gitti. Lütfen tekrar deneyin.",otpExpiredMessage:"Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir tane isteyin.",otpDigit:"OTP rakamı",verifying:"Doğrulanıyor...",otpVerified:"OTP başarıyla doğrulandı!"},el:{popupMessage:"Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.",popupMessageLastWarning:"Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.",minutes:"λεπτά",errorHeader:"Σφάλμα",configError:"Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.",otpHeading:"Εισαγωγή OTP",resendOtp:"Αποστολή ξανά OTP",submit:"Υποβολή",close:"Κλείσιμο",invalidOtp:"Ο κωδικός που εισαγάγατε δεν είναι έγκυρος. Παρακαλώ προσπαθήστε ξανά.",accountBlocked:"Πάρα πολλές προσπάθειες OTP. Ο λογαριασμός σας έχει αποκλειστεί για μία ώρα.",submissionError:"Κάτι πήγε στραβά. Παρακαλώ προσπαθήστε ξανά.",otpExpiredMessage:"Ο κωδικός επαλήθευσης έχει λήξει, παρακαλώ ζητήστε έναν νέο για να συνεχίσετε.",otpDigit:"Ψηφίο OTP",verifying:"Επαλήθευση...",otpVerified:"Το OTP επαληθεύτηκε με επιτυχία!"},es:{popupMessage:"Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.",popupMessageLastWarning:"Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",minutes:"minutos",errorHeader:"Error",configError:"No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.",otpHeading:"Introducir OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresaste no es válido. Por favor, inténtalo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo.",otpExpiredMessage:"El código de validación ha expirado, por favor solicite uno nuevo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"¡OTP verificado exitosamente!"},pt:{popupMessage:"Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.",popupMessageLastWarning:"Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Insira o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código inserido não é válido. Por favor, tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente.",otpExpiredMessage:"O código de validação expirou, por favor solicite um novo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"OTP verificado com sucesso!"},hr:{popupMessage:"Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.",popupMessageLastWarning:"Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.",minutes:"minute",errorHeader:"Greška",configError:"Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.",otpHeading:"Unesite OTP",resendOtp:"Ponovno pošalji OTP",submit:"Pošalji",close:"Zatvori",invalidOtp:"Uneseni kod nije valjan. Molimo pokušajte ponovo.",accountBlocked:"Previše pokušaja unosa OTP-a. Vaš račun je blokiran na jedan sat.",submissionError:"Nešto je pošlo po zlu. Molimo pokušajte ponovo.",otpExpiredMessage:"Kod za potvrdu je istekao, molimo zatražite novi kako biste nastavili.",otpDigit:"OTP znamenka",verifying:"Provjera...",otpVerified:"OTP uspješno potvrđen!"},de:{popupMessage:"Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.",popupMessageLastWarning:"Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.",minutes:"Minuten",errorHeader:"Fehler",configError:"OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.",otpHeading:"OTP eingeben",resendOtp:"OTP erneut senden",submit:"Absenden",close:"Schließen",invalidOtp:"Der eingegebene Code ist ungültig. Bitte versuchen Sie es erneut.",accountBlocked:"Zu viele OTP-Versuche. Ihr Konto wurde für eine Stunde gesperrt.",submissionError:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",otpExpiredMessage:"Der Bestätigungscode ist abgelaufen, bitte fordern Sie einen neuen an, um fortzufahren.",otpDigit:"OTP-Ziffer",verifying:"Wird geprüft...",otpVerified:"OTP erfolgreich verifiziert!"},"es-mx":{popupMessage:"Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.",popupMessageLastWarning:"Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",minutes:"minutos",errorHeader:"Error",configError:"No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.",otpHeading:"Ingrese OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresó no es válido. Inténtelo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo.",otpExpiredMessage:"El código de validación ha expirado, por favor solicite uno nuevo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"¡OTP verificado exitosamente!"},"pt-br":{popupMessage:"Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.",popupMessageLastWarning:"Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Digite o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código informado não é válido. Tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente.",otpExpiredMessage:"O código de validação expirou, por favor solicite um novo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"OTP verificado com sucesso!"}},l=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])n[t][i]=e[t][i]})),t(!0)}))})),d=(e,t)=>n[void 0!==t?t:"en"][e],p=class{handleNewTranslations(){l(this.translationUrl)}handleClientStylingChange(e,t){e!==t&&o(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}async handleStepUpAuthEvent(e){var t;if(null===(t=e.detail)||void 0===t?void 0:t["x-step-up-required"]){if(this.hasConfigErrors=!1,this.hasErrors=!1,this.errorMessage="",this.showPopup=!0,this.token=e.detail["x-step-up-token"],this.flow=e.detail.flow,!this.token||!this.flow)return this.isLoading=!1,this.hasConfigErrors=!0,void(this.errorMessage=d("configError",this.language));await this.getConfig()}}handleCloseWidget(){this.countdownTimer&&(clearInterval(this.countdownTimer),this.countdownTimer=null),this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.showPopup=!1,this.isLastWarning=!1}constructor(t){e(this,t),this.otpInputs=[],this.countdownTimer=null,this.expirationTimestamp=0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.endpoint=void 0,this.userSession=void 0,this.translationUrl="",this.mode="numeric",this.showPopup=!1,this.otp=void 0,this.isLoading=!0,this.config=null,this.timeLeft=0,this.expirationTime="",this.serverTime="",this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.token="",this.flow="",this.showResendOtp=!1,this.isLastWarning=!1,this.inputDisabled=!1,this.isValidating=!1,this.isSuccess=!1,this.shakeError=!1,this.handleResendOtp=this.handleResendOtp.bind(this),this.submitOtp=this.submitOtp.bind(this),this.handleCloseWidget=this.handleCloseWidget.bind(this),this.manualClosePopup=this.manualClosePopup.bind(this)}async getConfig(){if(this.endpoint)try{const e=new URL(`/api/v1/mfa/challenge/${this.token}/config`,this.endpoint);this.isLoading=!0;const t=await fetch(e.href),i=await t.json();if(t.ok)this.config=i,this.otp=Array(this.config.inputLength).fill(""),this.isLoading=!1,this.showResendOtp=!1,this.expirationTime=this.config.expirationTime,this.serverTime=this.config.serverTime,0!==this.config.numberOfValidateAttempts&&(this.hasErrors=!0,this.errorMessage=d("invalidOtp",this.language)),this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-1&&(this.isLastWarning=!0),this.calculateTimeLeft(),this.startCountdown();else{if(!i||"gm.twofa.token_max_attempts_exceeded"!==i.details){const e=i&&i.message||`Failed to load config. Status: ${t.status}`;throw new Error(e)}this.handleCloseWidget()}}catch(e){this.isLoading=!1,this.hasConfigErrors=!0,this.errorMessage=d("configError",this.language),console.error("Error loading 2FA config:",e)}}calculateTimeLeft(){const e=new Date(this.expirationTime),t=new Date(this.serverTime),i=new Date,r=t.getTime()-i.getTime();this.expirationTimestamp=e.getTime()-r;const s=Date.now(),o=Math.max(0,Math.floor((this.expirationTimestamp-s)/1e3));this.timeLeft=o}startCountdown(){this.countdownTimer&&clearInterval(this.countdownTimer),this.countdownTimer=setInterval((()=>{const e=Date.now(),t=Math.max(0,Math.floor((this.expirationTimestamp-e)/1e3));this.timeLeft=t,this.inputDisabled=t<=0,t<=0&&(clearInterval(this.countdownTimer),this.countdownTimer=null,this.showResendOtp=!0,this.hasErrors=!1,this.isLastWarning=!1)}),1e3)}formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}setOtpInputRef(e,t){e&&(this.otpInputs[t]=e)}updateOtpState(e,t){const i=[...this.otp];i[e]=t.toUpperCase(),this.otp=i}handleOnPasteOtp(e){var t,i,r;e.preventDefault();const s=((null===(i=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text"))||void 0===i?void 0:i.trim())||"").slice(0,this.config.inputLength).split("");this.otp=[...s,...Array(this.config.inputLength-s.length).fill("")],null===(r=this.otpInputs[s.length])||void 0===r||r.focus(),s.length===this.config.inputLength&&this.submitOtp()}handleOtpInput(e,t){const i=e.target,r=i.value;if(/^[a-z0-9]$/i.test(r)){this.updateOtpState(t,r);const e=this.otpInputs[t+1];null==e||e.focus()}i.value=""}handleKeyDown(e,t){const i=e.key,r=e.ctrlKey||e.metaKey;if(/^[a-z0-9]$/i.test(i)){if(r&&"v"===i.toLowerCase())return;e.preventDefault(),this.updateOtpState(t,i);const s=this.otpInputs[t+1];null==s||s.focus()}else if("Backspace"===i){e.preventDefault(),""!==this.otp[t]&&this.updateOtpState(t,"");const i=this.otpInputs[t-1];null==i||i.focus()}}handleResendOtp(){const e=new CustomEvent("otpResendRequested");window.dispatchEvent(e)}async submitOtp(){if(this.otp.join("").length!==this.config.inputLength)return this.hasErrors=!0,this.errorMessage=d("invalidOtp",this.language),void this.triggerShakeAnimation();if(this.timeLeft<=0)return this.hasErrors=!0,this.errorMessage=d("otpExpiredMessage",this.language),this.triggerShakeAnimation(),void await this.getConfig();this.isLoading=!0,this.isValidating=!0,this.hasErrors=!1,this.errorMessage="";const e=this.otp.join("");"stateless"===this.flow&&this.handleOtpStateless(e),"stateful"===this.flow&&await this.handleOtpStateful(e)}handleOtpStateless(e){window.dispatchEvent(new CustomEvent("otpSubmitted",{detail:{code:e,maxAttempts:this.config.maxValidationAttempts,validatedAttempts:this.config.numberOfValidateAttempts}}))}async handleOtpStateful(e){const t=new URL(`/api/v1/mfa/challenge/${this.token}/validate`,this.endpoint);t.searchParams.append("input",e);try{const e=await fetch(t.href,{method:"POST"});if(200===e.status)return void this.handleSuccess();const i=(await e.json()).message||"";if(i.toLowerCase().includes("expired"))return this.hasErrors=!0,this.errorMessage=d("otpExpiredMessage",this.language),this.triggerShakeAnimation(),void await this.getConfig();throw new Error(i)}catch(e){if("gm.multifactorauthentication.challenge_internal_server_error"===e.message||"gm.multifactorauthentication.internal_server_error"===e.message)return this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-1?(window.dispatchEvent(new CustomEvent("otpSetTimeout")),window.postMessage({type:"WidgetNotification",data:{type:"error",message:d("accountBlocked",this.language)}},window.location.href),void this.handleCloseWidget()):(this.hasErrors=!0,this.errorMessage=d("invalidOtp",this.language),this.triggerShakeAnimation(),void this.getConfig());console.error("OTP submission failed:",e),this.hasErrors=!0,this.errorMessage=d("submissionError",this.language),this.triggerShakeAnimation()}finally{this.isLoading=!1,this.isValidating=!1}}async handleSuccess(){this.isSuccess=!0,await new Promise((e=>setTimeout(e,1200))),window.dispatchEvent(new CustomEvent("otpSuccess",{detail:{message:"User successfully authenticated"}})),this.handleCloseWidget()}triggerShakeAnimation(){this.shakeError=!0,setTimeout((()=>{this.shakeError=!1}),650)}manualClosePopup(){window.dispatchEvent(new CustomEvent("manualClosePopup")),this.handleCloseWidget()}disconnectedCallback(){var e;this.countdownTimer&&clearInterval(this.countdownTimer),null===(e=this.stylingSubscription)||void 0===e||e.unsubscribe()}async componentWillLoad(){this.translationUrl.length>2&&await l(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,t,i,r=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!r)return function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t);window[s]||(window[s]={});const o=(i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const r=e.getRootNode(),o=window[s];let a=o[t]&&o[t].sheet;a?o[t].refCount=o[t].refCount+1:(a=new CSSStyleSheet,a.replaceSync(i),o[t]={sheet:a,refCount:1});const n=r.adoptedStyleSheets||[];n.includes(a)||(r.adoptedStyleSheets=[...n,a])}))}(e,t)).unsubscribe.bind(i);i.unsubscribe=()=>{if(window[s][t]){const e=window[s][t];e.refCount>1?e.refCount=e.refCount-1:delete window[s][t]}o()}}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}render(){return t("div",{key:"767f774b7244dbe264590e32364f17d7fcde0fa5",ref:e=>this.stylingContainer=e},this.showPopup&&t("div",{key:"ed8bd21c48b9afa91bca17568bd90dcb26d1d171",class:"OtpPopupOverlay"},t("div",{key:"2047ade4a5f2d62576f15368c86359c0c88014f7",class:"OtpPopupContent "+(this.shakeError?"shake":"")},this.isLoading?t("div",{class:"OtpLoaderContainer"},t("span",{class:"OtpLoader"})):this.hasConfigErrors?t("div",{class:"OtpError"},t("div",{class:"OtpErrorHeader"},t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"})),t("h2",null,d("errorHeader",this.language))),t("p",null,this.errorMessage),t("button",{class:"OtpButton error",onClick:this.manualClosePopup,"aria-label":d("close",this.language)},d("close",this.language))):t(i,null,t("div",{class:"otp-description"},this.showResendOtp?t("p",{class:"OtpNoticeMessage",role:"alert"},d("otpExpiredMessage",this.language)):t(i,null,t("p",{class:this.isLastWarning?"LastWarningMessage":""},d(this.isLastWarning?"popupMessageLastWarning":"popupMessage",this.language)),this.hasErrors&&t("p",{class:"OtpErrorMessage",role:"alert"},this.errorMessage))),t("div",{class:"OtpFieldWrapper"},t("h2",null,d("otpHeading",this.language)),t("div",{class:"OtpField"},this.otp.map(((e,i)=>t("input",{key:i,ref:e=>this.setOtpInputRef(e,i),id:`otp-input-${i}`,type:"text",inputmode:this.mode,pattern:"numeric"===this.mode?"[0-9]":void 0,class:`otp-box ${this.config.inputLength%2==0&&i===this.config.inputLength/2-1?"space":""} ${e?"filled":""} ${this.hasErrors?"error":""}`,maxLength:1,value:e,onInput:e=>this.handleOtpInput(e,i),onKeyDown:e=>this.handleKeyDown(e,i),onPaste:e=>this.handleOnPasteOtp(e),disabled:this.inputDisabled,autoComplete:"off","aria-label":`${d("otpDigit",this.language)} ${i+1}`,"aria-invalid":this.hasErrors})))),t("div",{class:"OtpTimerContainer"},t("div",{class:`OtpTimer ${this.isLastWarning?"warning":""} ${this.timeLeft<60?"critical":""}`,role:"timer","aria-live":"polite"},t("svg",{class:"timer-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"})),t("span",{class:"timer-text"},this.formatTime(this.timeLeft)," ",d("minutes",this.language))))),this.isSuccess&&t("div",{class:"OtpSuccessOverlay"},t("svg",{class:"success-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"})),t("span",null,d("otpVerified",this.language))),t("div",{class:"OtpActionButtons"},this.showResendOtp?t("button",{class:"OtpButton primary",onClick:this.handleResendOtp,disabled:this.isLoading,"aria-label":d("resendOtp",this.language)},d("resendOtp",this.language)):t("button",{class:"OtpButton primary "+(this.isValidating?"loading":""),onClick:this.submitOtp,disabled:this.otp.join("").length!==this.config.inputLength||this.isValidating||this.isLoading,"aria-label":d("submit",this.language),"aria-busy":this.isValidating},this.isValidating?t(i,null,t("span",{class:"button-spinner"}),t("span",{class:"button-text"},d("verifying",this.language))):t("span",{class:"button-text"},d("submit",this.language))),t("button",{class:"OtpButton secondary",onClick:this.manualClosePopup,disabled:this.isValidating,"aria-label":d("close",this.language)},d("close",this.language)))))))}get el(){return r(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};p.style=".OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center;justify-content:center}.OtpButton{font-family:var(--emw--button-typography);border:var(--emw--button-border, none);border-radius:var(--emw--button-border-radius, 3px);border-color:var(--emw--button-border-color);background-color:var(--emw--button-background-color, var(--emw--color-primary, #007bff));color:var(--emw--button-typography, var(--emw--color-white, #fff));padding:10px 20px;cursor:pointer;font-size:16px}.OtpButton.error{background:var(--emw--color-error, #dd3434)}.OtpPopupContent{position:relative;background:var(--emw--color-white, #fff);padding:20px;border-radius:5px;text-align:center;min-width:25%;min-height:200px;display:flex;flex-direction:column;justify-content:center;gap:20px}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:center}.OtpField input{width:24px;font-size:32px;padding:10px;text-align:center;border-radius:5px;margin:2px;border:2px solid var(--emw--otp-border-color, #55525c);font-weight:bold;outline:none;transition:all 0.1s}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{border:2px solid var(--emw--color-primary, #007bff);box-shadow:0 0 2px 2px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}.OtpSuccessOverlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(var(--emw--color-green-rgb, 255, 255, 255), 0.95);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;z-index:10}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{p as P}
@@ -1 +1 @@
1
- export{P as player_step_up_auth}from"./player-step-up-auth-9d437b84.js";import"./index-c6eee6d8.js";
1
+ export{P as player_step_up_auth}from"./player-step-up-auth-b54fc2e5.js";import"./index-c6eee6d8.js";
@@ -1 +1 @@
1
- import{p as e,b as n}from"./index-c6eee6d8.js";export{s as setNonce}from"./index-c6eee6d8.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,t={};return""!==n&&(t.resourcesUrl=new URL(".",n).href),e(t)})().then((async e=>(await t(),n([["player-step-up-auth",[[1,"player-step-up-auth",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],endpoint:[513],userSession:[513,"user-session"],translationUrl:[513,"translation-url"],showPopup:[32],otp:[32],isLoading:[32],config:[32],timeLeft:[32],expirationTime:[32],serverTime:[32],hasErrors:[32],hasConfigErrors:[32],errorMessage:[32],token:[32],flow:[32],showResendOtp:[32],isLastWarning:[32],inputDisabled:[32],isValidating:[32],isSuccess:[32],shakeError:[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
1
+ import{p as e,b as n}from"./index-c6eee6d8.js";export{s as setNonce}from"./index-c6eee6d8.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,t={};return""!==n&&(t.resourcesUrl=new URL(".",n).href),e(t)})().then((async e=>(await t(),n([["player-step-up-auth",[[1,"player-step-up-auth",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],endpoint:[513],userSession:[513,"user-session"],translationUrl:[513,"translation-url"],mode:[513],showPopup:[32],otp:[32],isLoading:[32],config:[32],timeLeft:[32],expirationTime:[32],serverTime:[32],hasErrors:[32],hasConfigErrors:[32],errorMessage:[32],token:[32],flow:[32],showResendOtp:[32],isLastWarning:[32],inputDisabled:[32],isValidating:[32],isSuccess:[32],shakeError:[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
@@ -28,6 +28,7 @@ export declare class PlayerStepUpAuth {
28
28
  * URL for fetching translation files to support multiple languages.
29
29
  */
30
30
  translationUrl: string;
31
+ mode: string;
31
32
  showPopup: boolean;
32
33
  otp: string[];
33
34
  isLoading: boolean;
@@ -27,6 +27,7 @@ export namespace Components {
27
27
  * Message bus source identifier, used for styling and communication.
28
28
  */
29
29
  "mbSource": string;
30
+ "mode": string;
30
31
  /**
31
32
  * URL for fetching translation files to support multiple languages.
32
33
  */
@@ -70,6 +71,7 @@ declare namespace LocalJSX {
70
71
  * Message bus source identifier, used for styling and communication.
71
72
  */
72
73
  "mbSource"?: string;
74
+ "mode"?: string;
73
75
  /**
74
76
  * URL for fetching translation files to support multiple languages.
75
77
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-step-up-auth",
3
- "version": "1.88.21",
3
+ "version": "1.88.23",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as e,h as t,F as i,g as r}from"./index-c6eee6d8.js";const s="__WIDGET_GLOBAL_STYLE_CACHE__";function o(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function a(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const n={en:{popupMessage:"Please enter the security code received on your email address to perform the update.",popupMessageLastWarning:"If the next validation attempt is failed, you will be logged out and blocked temporarily.",minutes:"minutes",errorHeader:"Error",configError:"Unable to load OTP data. Please try again later.",otpHeading:"Enter OTP",resendOtp:"Resend OTP",submit:"Submit",close:"Close",invalidOtp:"The code you've sent is not valid. Please try again.",accountBlocked:"Too many attempts for OTP. Your account has been blocked for one hour.",submissionError:"Something went wrong. Please try again.",otpExpiredMessage:"Validation code has expired, please request a new one to continue.",otpDigit:"OTP digit",verifying:"Verifying...",otpVerified:"OTP Verified Successfully!"},ro:{popupMessage:"Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.",popupMessageLastWarning:"Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.",minutes:"minute",errorHeader:"Eroare",configError:"Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.",otpHeading:"Introduceți OTP",resendOtp:"Retrimitere OTP",submit:"Trimite",close:"Închide",invalidOtp:"Codul introdus nu este valid. Vă rugăm să încercați din nou.",accountBlocked:"Prea multe încercări de OTP. Contul dvs. a fost blocat timp de o oră.",submissionError:"Ceva a mers prost. Vă rugăm să încercați din nou.",otpExpiredMessage:"Codul de validare a expirat, vă rugăm să solicitați unul nou pentru a continua.",otpDigit:"Cifră OTP",verifying:"Se verifică...",otpVerified:"OTP verificat cu succes!"},fr:{popupMessage:"Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.",popupMessageLastWarning:"Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.",minutes:"minutes",errorHeader:"Erreur",configError:"Impossible de charger les données OTP. Veuillez réessayer plus tard.",otpHeading:"Entrez OTP",resendOtp:"Renvoyer OTP",submit:"Soumettre",close:"Fermer",invalidOtp:"Le code que vous avez saisi n’est pas valide. Veuillez réessayer.",accountBlocked:"Trop de tentatives OTP. Votre compte a été bloqué pendant une heure.",submissionError:"Quelque chose s'est mal passé. Veuillez réessayer.",otpExpiredMessage:"Le code de validation a expiré, veuillez en demander un nouveau pour continuer.",otpDigit:"Chiffre OTP",verifying:"Vérification...",otpVerified:"OTP vérifié avec succès!"},hu:{popupMessage:"Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.",popupMessageLastWarning:"Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.",minutes:"perc",errorHeader:"Hiba",configError:"Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.",otpHeading:"OTP megadása",resendOtp:"Újraküldés",submit:"Beküldés",close:"Bezárás",invalidOtp:"A megadott kód érvénytelen. Kérjük, próbálja újra.",accountBlocked:"Túl sok OTP próbálkozás. A fiókja egy órára zárolva lett.",submissionError:"Valami hiba történt. Kérjük, próbálja újra.",otpExpiredMessage:"A megerősítő kód lejárt, kérjük, kérjen egy újat a folytatáshoz.",otpDigit:"OTP számjegy",verifying:"Ellenőrzés...",otpVerified:"OTP sikeresen ellenőrizve!"},tr:{popupMessage:"Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.",popupMessageLastWarning:"Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",minutes:"dakika",errorHeader:"Hata",configError:"OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.",otpHeading:"OTP Girin",resendOtp:"OTP'yi Yeniden Gönder",submit:"Gönder",close:"Kapat",invalidOtp:"Gönderdiğiniz kod geçersiz. Lütfen tekrar deneyin.",accountBlocked:"Çok fazla OTP denemesi yapıldı. Hesabınız bir saat boyunca kilitlendi.",submissionError:"Bir şeyler yanlış gitti. Lütfen tekrar deneyin.",otpExpiredMessage:"Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir tane isteyin.",otpDigit:"OTP rakamı",verifying:"Doğrulanıyor...",otpVerified:"OTP başarıyla doğrulandı!"},el:{popupMessage:"Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.",popupMessageLastWarning:"Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.",minutes:"λεπτά",errorHeader:"Σφάλμα",configError:"Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.",otpHeading:"Εισαγωγή OTP",resendOtp:"Αποστολή ξανά OTP",submit:"Υποβολή",close:"Κλείσιμο",invalidOtp:"Ο κωδικός που εισαγάγατε δεν είναι έγκυρος. Παρακαλώ προσπαθήστε ξανά.",accountBlocked:"Πάρα πολλές προσπάθειες OTP. Ο λογαριασμός σας έχει αποκλειστεί για μία ώρα.",submissionError:"Κάτι πήγε στραβά. Παρακαλώ προσπαθήστε ξανά.",otpExpiredMessage:"Ο κωδικός επαλήθευσης έχει λήξει, παρακαλώ ζητήστε έναν νέο για να συνεχίσετε.",otpDigit:"Ψηφίο OTP",verifying:"Επαλήθευση...",otpVerified:"Το OTP επαληθεύτηκε με επιτυχία!"},es:{popupMessage:"Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.",popupMessageLastWarning:"Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",minutes:"minutos",errorHeader:"Error",configError:"No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.",otpHeading:"Introducir OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresaste no es válido. Por favor, inténtalo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo.",otpExpiredMessage:"El código de validación ha expirado, por favor solicite uno nuevo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"¡OTP verificado exitosamente!"},pt:{popupMessage:"Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.",popupMessageLastWarning:"Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Insira o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código inserido não é válido. Por favor, tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente.",otpExpiredMessage:"O código de validação expirou, por favor solicite um novo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"OTP verificado com sucesso!"},hr:{popupMessage:"Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.",popupMessageLastWarning:"Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.",minutes:"minute",errorHeader:"Greška",configError:"Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.",otpHeading:"Unesite OTP",resendOtp:"Ponovno pošalji OTP",submit:"Pošalji",close:"Zatvori",invalidOtp:"Uneseni kod nije valjan. Molimo pokušajte ponovo.",accountBlocked:"Previše pokušaja unosa OTP-a. Vaš račun je blokiran na jedan sat.",submissionError:"Nešto je pošlo po zlu. Molimo pokušajte ponovo.",otpExpiredMessage:"Kod za potvrdu je istekao, molimo zatražite novi kako biste nastavili.",otpDigit:"OTP znamenka",verifying:"Provjera...",otpVerified:"OTP uspješno potvrđen!"},de:{popupMessage:"Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.",popupMessageLastWarning:"Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.",minutes:"Minuten",errorHeader:"Fehler",configError:"OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.",otpHeading:"OTP eingeben",resendOtp:"OTP erneut senden",submit:"Absenden",close:"Schließen",invalidOtp:"Der eingegebene Code ist ungültig. Bitte versuchen Sie es erneut.",accountBlocked:"Zu viele OTP-Versuche. Ihr Konto wurde für eine Stunde gesperrt.",submissionError:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",otpExpiredMessage:"Der Bestätigungscode ist abgelaufen, bitte fordern Sie einen neuen an, um fortzufahren.",otpDigit:"OTP-Ziffer",verifying:"Wird geprüft...",otpVerified:"OTP erfolgreich verifiziert!"},"es-mx":{popupMessage:"Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.",popupMessageLastWarning:"Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",minutes:"minutos",errorHeader:"Error",configError:"No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.",otpHeading:"Ingrese OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresó no es válido. Inténtelo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo.",otpExpiredMessage:"El código de validación ha expirado, por favor solicite uno nuevo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"¡OTP verificado exitosamente!"},"pt-br":{popupMessage:"Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.",popupMessageLastWarning:"Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Digite o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código informado não é válido. Tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente.",otpExpiredMessage:"O código de validação expirou, por favor solicite um novo para continuar.",otpDigit:"Dígito OTP",verifying:"Verificando...",otpVerified:"OTP verificado com sucesso!"}},l=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])n[t][i]=e[t][i]})),t(!0)}))})),d=(e,t)=>n[void 0!==t?t:"en"][e],p=class{handleNewTranslations(){l(this.translationUrl)}handleClientStylingChange(e,t){e!==t&&o(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}async handleStepUpAuthEvent(e){var t;if(null===(t=e.detail)||void 0===t?void 0:t["x-step-up-required"]){if(this.hasConfigErrors=!1,this.hasErrors=!1,this.errorMessage="",this.showPopup=!0,this.token=e.detail["x-step-up-token"],this.flow=e.detail.flow,!this.token||!this.flow)return this.isLoading=!1,this.hasConfigErrors=!0,void(this.errorMessage=d("configError",this.language));await this.getConfig()}}handleCloseWidget(){this.countdownTimer&&(clearInterval(this.countdownTimer),this.countdownTimer=null),this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.showPopup=!1,this.isLastWarning=!1}constructor(t){e(this,t),this.otpInputs=[],this.countdownTimer=null,this.expirationTimestamp=0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.endpoint=void 0,this.userSession=void 0,this.translationUrl="",this.showPopup=!1,this.otp=void 0,this.isLoading=!0,this.config=null,this.timeLeft=0,this.expirationTime="",this.serverTime="",this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.token="",this.flow="",this.showResendOtp=!1,this.isLastWarning=!1,this.inputDisabled=!1,this.isValidating=!1,this.isSuccess=!1,this.shakeError=!1,this.handleResendOtp=this.handleResendOtp.bind(this),this.submitOtp=this.submitOtp.bind(this),this.handleCloseWidget=this.handleCloseWidget.bind(this),this.manualClosePopup=this.manualClosePopup.bind(this)}async getConfig(){if(this.endpoint)try{const e=new URL(`/api/v1/mfa/challenge/${this.token}/config`,this.endpoint);this.isLoading=!0;const t=await fetch(e.href),i=await t.json();if(t.ok)this.config=i,this.otp=Array(this.config.inputLength).fill(""),this.isLoading=!1,this.showResendOtp=!1,this.expirationTime=this.config.expirationTime,this.serverTime=this.config.serverTime,0!==this.config.numberOfValidateAttempts&&(this.hasErrors=!0,this.errorMessage=d("invalidOtp",this.language)),this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-1&&(this.isLastWarning=!0),this.calculateTimeLeft(),this.startCountdown();else{if(!i||"gm.twofa.token_max_attempts_exceeded"!==i.details){const e=i&&i.message||`Failed to load config. Status: ${t.status}`;throw new Error(e)}this.handleCloseWidget()}}catch(e){this.isLoading=!1,this.hasConfigErrors=!0,this.errorMessage=d("configError",this.language),console.error("Error loading 2FA config:",e)}}calculateTimeLeft(){const e=new Date(this.expirationTime),t=new Date(this.serverTime),i=new Date,r=t.getTime()-i.getTime();this.expirationTimestamp=e.getTime()-r;const s=Date.now(),o=Math.max(0,Math.floor((this.expirationTimestamp-s)/1e3));this.timeLeft=o}startCountdown(){this.countdownTimer&&clearInterval(this.countdownTimer),this.countdownTimer=setInterval((()=>{const e=Date.now(),t=Math.max(0,Math.floor((this.expirationTimestamp-e)/1e3));this.timeLeft=t,this.inputDisabled=t<=0,t<=0&&(clearInterval(this.countdownTimer),this.countdownTimer=null,this.showResendOtp=!0,this.hasErrors=!1,this.isLastWarning=!1)}),1e3)}formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}setOtpInputRef(e,t){e&&(this.otpInputs[t]=e)}updateOtpState(e,t){const i=[...this.otp];i[e]=t.toUpperCase(),this.otp=i}handleOnPasteOtp(e){var t,i,r;e.preventDefault();const s=((null===(i=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text"))||void 0===i?void 0:i.trim())||"").slice(0,this.config.inputLength).split("");this.otp=[...s,...Array(this.config.inputLength-s.length).fill("")],null===(r=this.otpInputs[s.length])||void 0===r||r.focus(),s.length===this.config.inputLength&&this.submitOtp()}handleOtpInput(e,t){const i=e.target,r=i.value;if(/^[a-z0-9]$/i.test(r)){this.updateOtpState(t,r);const e=this.otpInputs[t+1];null==e||e.focus()}i.value=""}handleKeyDown(e,t){const i=e.key,r=e.ctrlKey||e.metaKey;if(/^[a-z0-9]$/i.test(i)){if(r&&"v"===i.toLowerCase())return;e.preventDefault(),this.updateOtpState(t,i);const s=this.otpInputs[t+1];null==s||s.focus()}else if("Backspace"===i){e.preventDefault(),""!==this.otp[t]&&this.updateOtpState(t,"");const i=this.otpInputs[t-1];null==i||i.focus()}}handleResendOtp(){const e=new CustomEvent("otpResendRequested");window.dispatchEvent(e)}async submitOtp(){if(this.otp.join("").length!==this.config.inputLength)return this.hasErrors=!0,this.errorMessage=d("invalidOtp",this.language),void this.triggerShakeAnimation();if(this.timeLeft<=0)return this.hasErrors=!0,this.errorMessage=d("otpExpiredMessage",this.language),this.triggerShakeAnimation(),void await this.getConfig();this.isLoading=!0,this.isValidating=!0,this.hasErrors=!1,this.errorMessage="";const e=this.otp.join("");"stateless"===this.flow&&this.handleOtpStateless(e),"stateful"===this.flow&&await this.handleOtpStateful(e)}handleOtpStateless(e){window.dispatchEvent(new CustomEvent("otpSubmitted",{detail:{code:e,maxAttempts:this.config.maxValidationAttempts,validatedAttempts:this.config.numberOfValidateAttempts}}))}async handleOtpStateful(e){const t=new URL(`/api/v1/mfa/challenge/${this.token}/validate`,this.endpoint);t.searchParams.append("input",e);try{const e=await fetch(t.href,{method:"POST"});if(200===e.status)return void this.handleSuccess();const i=(await e.json()).message||"";if(i.toLowerCase().includes("expired"))return this.hasErrors=!0,this.errorMessage=d("otpExpiredMessage",this.language),this.triggerShakeAnimation(),void await this.getConfig();throw new Error(i)}catch(e){if("gm.multifactorauthentication.challenge_internal_server_error"===e.message||"gm.multifactorauthentication.internal_server_error"===e.message)return this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-1?(window.dispatchEvent(new CustomEvent("otpSetTimeout")),window.postMessage({type:"WidgetNotification",data:{type:"error",message:d("accountBlocked",this.language)}},window.location.href),void this.handleCloseWidget()):(this.hasErrors=!0,this.errorMessage=d("invalidOtp",this.language),this.triggerShakeAnimation(),void this.getConfig());console.error("OTP submission failed:",e),this.hasErrors=!0,this.errorMessage=d("submissionError",this.language),this.triggerShakeAnimation()}finally{this.isLoading=!1,this.isValidating=!1}}async handleSuccess(){this.isSuccess=!0,await new Promise((e=>setTimeout(e,1200))),window.dispatchEvent(new CustomEvent("otpSuccess",{detail:{message:"User successfully authenticated"}})),this.handleCloseWidget()}triggerShakeAnimation(){this.shakeError=!0,setTimeout((()=>{this.shakeError=!1}),650)}manualClosePopup(){window.dispatchEvent(new CustomEvent("manualClosePopup")),this.handleCloseWidget()}disconnectedCallback(){var e;this.countdownTimer&&clearInterval(this.countdownTimer),null===(e=this.stylingSubscription)||void 0===e||e.unsubscribe()}async componentWillLoad(){this.translationUrl.length>2&&await l(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,t,i,r=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!r)return function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t);window[s]||(window[s]={});const o=(i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const r=e.getRootNode(),o=window[s];let a=o[t]&&o[t].sheet;a?o[t].refCount=o[t].refCount+1:(a=new CSSStyleSheet,a.replaceSync(i),o[t]={sheet:a,refCount:1});const n=r.adoptedStyleSheets||[];n.includes(a)||(r.adoptedStyleSheets=[...n,a])}))}(e,t)).unsubscribe.bind(i);i.unsubscribe=()=>{if(window[s][t]){const e=window[s][t];e.refCount>1?e.refCount=e.refCount-1:delete window[s][t]}o()}}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}render(){return t("div",{key:"31703a17e1f7b44ca4ebe5520f2fe129a309671a",ref:e=>this.stylingContainer=e},this.showPopup&&t("div",{key:"3e1f12aa2eccd8494268f03b53aaa9411a52c7be",class:"OtpPopupOverlay"},t("div",{key:"7ebfaab2f0798ea661d8a8a9021a7c2e14da1896",class:"OtpPopupContent "+(this.shakeError?"shake":"")},this.isLoading?t("div",{class:"OtpLoaderContainer"},t("span",{class:"OtpLoader"})):this.hasConfigErrors?t("div",{class:"OtpError"},t("div",{class:"OtpErrorHeader"},t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"})),t("h2",null,d("errorHeader",this.language))),t("p",null,this.errorMessage),t("button",{class:"OtpButton error",onClick:this.manualClosePopup,"aria-label":d("close",this.language)},d("close",this.language))):t(i,null,t("div",{class:"otp-description"},this.showResendOtp?t("p",{class:"OtpNoticeMessage",role:"alert"},d("otpExpiredMessage",this.language)):t(i,null,t("p",{class:this.isLastWarning?"LastWarningMessage":""},d(this.isLastWarning?"popupMessageLastWarning":"popupMessage",this.language)),this.hasErrors&&t("p",{class:"OtpErrorMessage",role:"alert"},this.errorMessage))),t("div",{class:"OtpFieldWrapper"},t("h2",null,d("otpHeading",this.language)),t("div",{class:"OtpField"},this.otp.map(((e,i)=>t("input",{key:i,ref:e=>this.setOtpInputRef(e,i),id:`otp-input-${i}`,type:"text",class:`otp-box ${this.config.inputLength%2==0&&i===this.config.inputLength/2-1?"space":""} ${e?"filled":""} ${this.hasErrors?"error":""}`,maxLength:1,value:e,onInput:e=>this.handleOtpInput(e,i),onKeyDown:e=>this.handleKeyDown(e,i),onPaste:e=>this.handleOnPasteOtp(e),disabled:this.inputDisabled,autoComplete:"off","aria-label":`${d("otpDigit",this.language)} ${i+1}`,"aria-invalid":this.hasErrors})))),t("div",{class:"OtpTimerContainer"},t("div",{class:`OtpTimer ${this.isLastWarning?"warning":""} ${this.timeLeft<60?"critical":""}`,role:"timer","aria-live":"polite"},t("svg",{class:"timer-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"})),t("span",{class:"timer-text"},this.formatTime(this.timeLeft)," ",d("minutes",this.language))))),this.isSuccess&&t("div",{class:"OtpSuccessOverlay"},t("svg",{class:"success-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"})),t("span",null,d("otpVerified",this.language))),t("div",{class:"OtpActionButtons"},this.showResendOtp?t("button",{class:"OtpButton primary",onClick:this.handleResendOtp,disabled:this.isLoading,"aria-label":d("resendOtp",this.language)},d("resendOtp",this.language)):t("button",{class:"OtpButton primary "+(this.isValidating?"loading":""),onClick:this.submitOtp,disabled:this.otp.join("").length!==this.config.inputLength||this.isValidating||this.isLoading,"aria-label":d("submit",this.language),"aria-busy":this.isValidating},this.isValidating?t(i,null,t("span",{class:"button-spinner"}),t("span",{class:"button-text"},d("verifying",this.language))):t("span",{class:"button-text"},d("submit",this.language))),t("button",{class:"OtpButton secondary",onClick:this.manualClosePopup,disabled:this.isValidating,"aria-label":d("close",this.language)},d("close",this.language)))))))}get el(){return r(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};p.style=".OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center;justify-content:center}.OtpButton{font-family:var(--emw--button-typography);border:var(--emw--button-border, none);border-radius:var(--emw--button-border-radius, 3px);border-color:var(--emw--button-border-color);background-color:var(--emw--button-background-color, var(--emw--color-primary, #007bff));color:var(--emw--button-typography, var(--emw--color-white, #fff));padding:10px 20px;cursor:pointer;font-size:16px}.OtpButton.error{background:var(--emw--color-error, #dd3434)}.OtpPopupContent{position:relative;background:var(--emw--color-white, #fff);padding:20px;border-radius:5px;text-align:center;min-width:25%;min-height:200px;display:flex;flex-direction:column;justify-content:center;gap:20px}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:center}.OtpField input{width:24px;font-size:32px;padding:10px;text-align:center;border-radius:5px;margin:2px;border:2px solid var(--emw--otp-border-color, #55525c);font-weight:bold;outline:none;transition:all 0.1s}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{border:2px solid var(--emw--color-primary, #007bff);box-shadow:0 0 2px 2px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}.OtpSuccessOverlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(var(--emw--color-green-rgb, 255, 255, 255), 0.95);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;z-index:10}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{p as P}