@schukai/monster 4.46.0 → 4.46.1

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.
@@ -13,13 +13,13 @@
13
13
  import { instanceSymbol } from "../../constants.mjs";
14
14
  import { addAttributeToken } from "../../dom/attributes.mjs";
15
15
  import {
16
- ATTRIBUTE_ERRORMESSAGE,
17
- ATTRIBUTE_ROLE,
16
+ ATTRIBUTE_ERRORMESSAGE,
17
+ ATTRIBUTE_ROLE,
18
18
  } from "../../dom/constants.mjs";
19
19
  import { CustomElement } from "../../dom/customelement.mjs";
20
20
  import {
21
- assembleMethodSymbol,
22
- registerCustomElement,
21
+ assembleMethodSymbol,
22
+ registerCustomElement,
23
23
  } from "../../dom/customelement.mjs";
24
24
  import { findTargetElementFromEvent, fireEvent } from "../../dom/events.mjs";
25
25
  import { isFunction } from "../../types/is.mjs";
@@ -124,919 +124,929 @@ const digitsCollapseSymbol = Symbol("digitsCollapse");
124
124
  * @fragments /fragments/components/form/login/
125
125
  *
126
126
  * @example /examples/components/form/login-simple
127
+ * @example /examples/components/form/login-with-forgot-password
128
+ * @example /examples/components/form/login-with-second-factor
129
+ * @example /examples/components/form/login-with-success-redirect
130
+ * @example /examples/components/form/login-with-actions
131
+ * @example /examples/components/form/login-custom-callbacks
132
+ * @example /examples/components/form/login-multilingual
133
+ * @example /examples/components/form/login-custom-buttons
134
+ * @example /examples/components/form/login-accessibility
135
+ * @example /examples/components/form/login-style-overrides
127
136
  *
128
137
  * @since 3.113.0
129
138
  * @copyright schukai GmbH
130
- * @summary A beautiful Login that can make your life easier and also looks good. It supports a lot of features.
139
+ * @summary A modular and accessible login control for Monster.js applications.
131
140
  *
132
- * @fires login-success
133
- * @fires redirect-to-first-success-url
134
- * @fires second-factor-success
135
- * @fires digits-success
136
- * @fires monster-login-clicked
141
+ * @fires login-success Fired after successful login (always)
142
+ * @fires redirect-to-first-success-url Fired if feature redirectToFirstSuccessUrl is enabled
143
+ * @fires second-factor-success Fired after successful second factor validation
144
+ * @fires digits-success Fired after successful password reset code validation
145
+ * @fires monster-login-clicked Fired on any click inside the login control (before internal handling)
137
146
  */
147
+
138
148
  class Login extends CustomElement {
139
- /**
140
- * This method is called by the `instanceof` operator.
141
- * @returns {symbol}
142
- */
143
- static get [instanceSymbol]() {
144
- return Symbol.for("@schukai/monster/components/form/login@@instance");
145
- }
146
-
147
- /**
148
- * @return {void}
149
- */
150
- [assembleMethodSymbol]() {
151
- super[assembleMethodSymbol]();
152
-
153
- setTimeout(() => {
154
- initControlReferences.call(this);
155
- initEventHandler.call(this);
156
-
157
- setTimeout(() => {
158
- this.shadowRoot.querySelector("input[name='username']").focus();
159
- }, 100);
160
- }, 0);
161
- }
162
-
163
- /**
164
- * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
165
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
166
- *
167
- * The individual configuration values can be found in the table.
168
- *
169
- * @property {Object} templates Template definitions
170
- * @property {string} templates.main The main HTML template used for rendering the login form
171
- * @property {Object} labels Label definitions used for localization and form messages
172
- * @property {string} labels.username Label for the username or email field
173
- * @property {string} labels.password Label for the password field
174
- * @property {string} labels.login Label for the login button
175
- * @property {string} labels.forgotPasswordLink Text for the "forgot password" link
176
- * @property {string} labels.mailAddress Label for the email input in password reset flow
177
- * @property {string} labels.requestLink Label for the button that sends a password reset code
178
- * @property {string} labels.digits Label for the digits input field
179
- * @property {string} labels.loginLink Label for the back-to-login link
180
- * @property {string} labels.secondFactor Label for the second factor authentication input
181
- * @property {string} labels.sendDigits Label for the button that submits the digits input
182
- * @property {string} labels.sendSecondFactorDigits Label for the button that submits the second factor code
183
- * @property {string} labels.resetLoginProcess Label for the link to return to the login form
184
- * @property {string} labels.messageEmptyUserName Message shown when username is empty
185
- * @property {string} labels.messageEmptyPassword Message shown when password is empty
186
- * @property {string} labels.messageEmptyBoth Message shown when both username and password are empty
187
- * @property {string} labels.messageEmptyEmail Message shown when email field is empty
188
- * @property {string} labels.messageInvalidEmail Message shown when an invalid email address is entered
189
- * @property {string} labels.digitsEmpty Message shown when digits field is empty
190
- * @property {string} labels.digitsInvalid Message shown when digits input is invalid
191
- * @property {string} labels.messageLoginFailed Message shown on failed login attempt
192
- * @property {string} labels.messageForbidden Message shown on successful login with insufficient permissions
193
- * @property {string} labels.messageSomethingWentWrong Fallback error message
194
- * @property {string} labels.messageThisFormIsNotConfigured Message shown if no backend URL is configured
195
- * @property {string} labels.messagePasswordResetDisabled Message shown if password reset is disabled due to 2FA
196
- * @property {Object} classes Class definitions for visual styling
197
- * @property {string} classes.usernameInvalid CSS class applied when username is invalid
198
- * @property {string} classes.passwordInvalid CSS class applied when password is invalid
199
- * @property {string} classes.emailInvalid CSS class applied when email input is invalid
200
- * @property {string} classes.button CSS class applied to all form buttons
201
- * @property {boolean} disabled If true, disables interaction with the component
202
- * @property {Object} features Feature flags to toggle optional behavior
203
- * @property {boolean} features.forgotPassword Enables the forgot password flow
204
- * @property {boolean} features.redirectToFirstSuccessUrl If true, redirects to the first success URL after login
205
- * @property {Object} actions Action definitions for custom event handling
206
- * @property {Function} actions.click Callback function for generic click actions within the login component
207
- * @property {Object} callbacks Optional callback hooks for modifying internal behavior
208
- * @property {Function} callbacks.username A function that receives and can transform the entered username before submission
209
- * @property {Function} callbacks.forgotPassword A function that receives and can transform the entered email before submission
210
- * @property {number} digits Number of digits required for second factor or password reset code input
211
- * @property {Object[]} successUrls List of URLs shown after successful login (e.g., home or logout)
212
- * @property {string} successUrls.label Label for the success URL (displayed)
213
- * @property {string} successUrls.url Actual target URL
214
- * @property {number} timeoutForMessage Duration in milliseconds to show error messages
215
- * @property {number} timeoutForSuccess Duration in milliseconds before triggering the post-login success state
216
- * @property {Object} accessKeys Keyboard access keys for accessibility and shortcuts
217
- * @property {string} accessKeys.loginLink Access key for switching to login form
218
- * @property {string} accessKeys.username Access key for focusing the username field
219
- * @property {string} accessKeys.password Access key for focusing the password field
220
- * @property {Object} fetch Definitions for backend requests to support login workflows
221
- * @property {Object} placeholder Placeholder text for input fields
222
- * @property {string} placeholder.username Placeholder for the username field
223
- * @property {string} placeholder.password Placeholder for the password field
224
- * @property {string} placeholder.email Placeholder for the email field
225
- * @property {Object} fetch.login Fetch config for login request
226
- * @property {string} fetch.login.url Endpoint to post login credentials to
227
- * @property {string} fetch.login.method HTTP method for login (e.g., "POST")
228
- * @property {string} fetch.login.mode Fetch mode (e.g., "same-origin")
229
- * @property {Object} fetch.login.headers HTTP headers to be sent with the login request
230
- * @property {string} fetch.login.headers.accept Accept header value
231
- * @property {string} fetch.login.headers.Content-Type Content-Type header value
232
- * @property {string} fetch.login.credentials Credential mode (e.g., "same-origin")
233
- * @property {Object} fetch.forgotPassword Fetch config for password reset code request
234
- * @property {string} fetch.forgotPassword.url Endpoint to request a reset link/code
235
- * @property {string} fetch.forgotPassword.method HTTP method
236
- * @property {string} fetch.forgotPassword.mode Fetch mode
237
- * @property {Object} fetch.forgotPassword.headers Headers
238
- * @property {string} fetch.forgotPassword.headers.accept Accept header
239
- * @property {string} fetch.forgotPassword.headers.Content-Type Content-Type header
240
- * @property {string} fetch.forgotPassword.credentials Credential mode
241
- * @property {Object} fetch.digits Fetch config for submitting password reset code
242
- * @property {string} fetch.digits.url Endpoint for validating the code
243
- * @property {string} fetch.digits.method HTTP method
244
- * @property {string} fetch.digits.mode Fetch mode
245
- * @property {Object} fetch.digits.headers Headers
246
- * @property {string} fetch.digits.headers.accept Accept header
247
- * @property {string} fetch.digits.headers.Content-Type Content-Type header
248
- * @property {string} fetch.digits.credentials Credential mode
249
- * @property {Object} fetch.secondFactor Fetch config for submitting second factor code
250
- * @property {string} fetch.secondFactor.url Endpoint to validate second factor code
251
- * @property {string} fetch.secondFactor.method HTTP method
252
- * @property {string} fetch.secondFactor.mode Fetch mode
253
- * @property {Object} fetch.secondFactor.headers Headers
254
- * @property {string} fetch.secondFactor.headers.accept Accept header
255
- * @property {string} fetch.secondFactor.headers.Content-Type Content-Type header
256
- * @property {string} fetch.secondFactor.credentials Credential mode
257
- */
258
- get defaults() {
259
- return Object.assign({}, super.defaults, {
260
- templates: {
261
- main: getTemplate(),
262
- },
263
- labels: getTranslations(),
264
- classes: {
265
- usernameInvalid: "",
266
- passwordInvalid: "",
267
- emailInvalid: "",
268
- button: "monster-button-outline-primary",
269
- },
270
- disabled: false,
271
- features: {
272
- forgotPassword: true,
273
- redirectToFirstSuccessUrl: false,
274
- },
275
- actions: {},
276
-
277
- callbacks: {
278
- username: null,
279
- forgotPassword: null,
280
- },
281
-
282
- digits: 6,
283
-
284
- successUrls: [
285
- {
286
- label: "Home",
287
- url: "/",
288
- },
289
- {
290
- label: "Logout",
291
- url: "/logout",
292
- },
293
- ],
294
-
295
- timeoutForMessage: 3500,
296
- timeoutForSuccess: 1000,
297
-
298
- accessKeys: {
299
- loginLink: "x",
300
- username: "u",
301
- password: "p",
302
- },
303
-
304
- placeholder: {
305
- username: "",
306
- password: "",
307
- email: "",
308
- },
309
-
310
- fetch: {
311
- login: {
312
- url: "",
313
- method: "POST",
314
- mode: "same-origin",
315
- headers: {
316
- Accept: "application/json",
317
- "Content-Type": "application/json; charset=utf-8",
318
- },
319
- credentials: "same-origin",
320
- },
321
- forgotPassword: {
322
- url: "",
323
- method: "POST",
324
- mode: "same-origin",
325
- headers: {
326
- Accept: "application/json",
327
- "Content-Type": "application/json; charset=utf-8",
328
- },
329
- credentials: "same-origin",
330
- },
331
- digits: {
332
- url: "",
333
- method: "POST",
334
- mode: "same-origin",
335
- headers: {
336
- Accept: "application/json",
337
- "Content-Type": "application/json; charset=utf-8",
338
- },
339
- credentials: "same-origin",
340
- },
341
- secondFactor: {
342
- url: "",
343
- method: "POST",
344
- mode: "same-origin",
345
- headers: {
346
- Accept: "application/json",
347
- "Content-Type": "application/json; charset=utf-8",
348
- },
349
- credentials: "same-origin",
350
- },
351
- },
352
- });
353
- }
354
-
355
- /**
356
- * Opens the login collapse and focuses the username control.
357
- *
358
- * @returns {Login}
359
- */
360
- openLogin() {
361
- this[loginCollapseSymbol].open();
362
- this.shadowRoot.querySelector("input[name='username']").focus();
363
- return this;
364
- }
365
-
366
- /**
367
- * Opens the forgot password collapse. If the feature `forgotPassword` is not enabled, an error will be thrown.
368
- *
369
- * @returns {Login}
370
- * @throws {Error} If the feature is not enabled
371
- */
372
- openForgotPassword() {
373
- if (!this.getOption("features.forgotPassword")) {
374
- throw new Error("Forgot Password is not enabled");
375
- }
376
-
377
- this[forgotPasswordCollapseSymbol].open();
378
- return this;
379
- }
380
-
381
- /**
382
- * Opens the second factor collapse and focuses the second factor control.
383
- * @returns {Login}
384
- */
385
- openSecondFactor() {
386
- this[secondFactorCollapseSymbol].open();
387
- this.shadowRoot.getElementById("secondFactorButton").focus();
388
- return this;
389
- }
390
-
391
- /**
392
- * Opens the digits collapse and focuses the digit control.
393
- * @returns {Login}
394
- */
395
- openDigits() {
396
- this[digitsCollapseSymbol].open();
397
- this.shadowRoot.getElementById("digitsControl").focus();
398
- return this;
399
- }
400
-
401
- /**
402
- * Opens the logged in collapse. If the feature `redirectToFirstSuccessUrl` is enabled, the user will be redirected to the first success URL.
403
- *
404
- * @returns {Login}
405
- */
406
- openLoggedIn() {
407
- fireEvent(this, "login-success");
408
-
409
- if (this.getOption("features.redirectToFirstSuccessUrl")) {
410
- setTimeout(() => {
411
- fireEvent(this, "redirect-to-first-success-url");
412
-
413
- const successUrl = this.getOption("successUrls");
414
- if (successUrl.length > 0) {
415
- const success = successUrl[0].url;
416
- if (success) {
417
- getWindow().location.href = success;
418
- }
419
- }
420
- }, this.getOption("timeoutForSuccess"));
421
-
422
- return;
423
- }
424
-
425
- this[loggedInCollapseSymbol].open();
426
-
427
- return this;
428
- }
429
-
430
- /**
431
- * @return {string}
432
- */
433
- static getTag() {
434
- return "monster-login";
435
- }
436
-
437
- /**
438
- * @return {CSSStyleSheet[]}
439
- */
440
- static getCSSStyleSheet() {
441
- return [LoginStyleSheet, InvalidStyleSheet];
442
- }
149
+ /**
150
+ * This method is called by the `instanceof` operator.
151
+ * @returns {symbol}
152
+ */
153
+ static get [instanceSymbol]() {
154
+ return Symbol.for("@schukai/monster/components/form/login@@instance");
155
+ }
156
+
157
+ /**
158
+ * @return {void}
159
+ */
160
+ [assembleMethodSymbol]() {
161
+ super[assembleMethodSymbol]();
162
+
163
+ setTimeout(() => {
164
+ initControlReferences.call(this);
165
+ initEventHandler.call(this);
166
+
167
+ setTimeout(() => {
168
+ this.shadowRoot.querySelector("input[name='username']").focus();
169
+ }, 100);
170
+ }, 0);
171
+ }
172
+
173
+ /**
174
+ * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
175
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
176
+ *
177
+ * The individual configuration values can be found in the table.
178
+ *
179
+ * @property {Object} templates Template definitions
180
+ * @property {string} templates.main The main HTML template used for rendering the login form
181
+ * @property {Object} labels Label definitions used for localization and form messages
182
+ * @property {string} labels.username Label for the username or email field
183
+ * @property {string} labels.password Label for the password field
184
+ * @property {string} labels.login Label for the login button
185
+ * @property {string} labels.forgotPasswordLink Text for the "forgot password" link
186
+ * @property {string} labels.mailAddress Label for the email input in password reset flow
187
+ * @property {string} labels.requestLink Label for the button that sends a password reset code
188
+ * @property {string} labels.digits Label for the digits input field
189
+ * @property {string} labels.loginLink Label for the back-to-login link
190
+ * @property {string} labels.secondFactor Label for the second factor authentication input
191
+ * @property {string} labels.sendDigits Label for the button that submits the digits input
192
+ * @property {string} labels.sendSecondFactorDigits Label for the button that submits the second factor code
193
+ * @property {string} labels.resetLoginProcess Label for the link to return to the login form
194
+ * @property {string} labels.messageEmptyUserName Message shown when username is empty
195
+ * @property {string} labels.messageEmptyPassword Message shown when password is empty
196
+ * @property {string} labels.messageEmptyBoth Message shown when both username and password are empty
197
+ * @property {string} labels.messageEmptyEmail Message shown when email field is empty
198
+ * @property {string} labels.messageInvalidEmail Message shown when an invalid email address is entered
199
+ * @property {string} labels.digitsEmpty Message shown when digits field is empty
200
+ * @property {string} labels.digitsInvalid Message shown when digits input is invalid
201
+ * @property {string} labels.messageLoginFailed Message shown on failed login attempt
202
+ * @property {string} labels.messageForbidden Message shown on successful login with insufficient permissions
203
+ * @property {string} labels.messageSomethingWentWrong Fallback error message
204
+ * @property {string} labels.messageThisFormIsNotConfigured Message shown if no backend URL is configured
205
+ * @property {string} labels.messagePasswordResetDisabled Message shown if password reset is disabled due to 2FA
206
+ * @property {Object} classes Class definitions for visual styling
207
+ * @property {string} classes.usernameInvalid CSS class applied when username is invalid
208
+ * @property {string} classes.passwordInvalid CSS class applied when password is invalid
209
+ * @property {string} classes.emailInvalid CSS class applied when email input is invalid
210
+ * @property {string} classes.button CSS class applied to all form buttons
211
+ * @property {boolean} disabled If true, disables interaction with the component
212
+ * @property {Object} features Feature flags to toggle optional behavior
213
+ * @property {boolean} features.forgotPassword Enables the forgot password flow
214
+ * @property {boolean} features.redirectToFirstSuccessUrl If true, redirects to the first success URL after login
215
+ * @property {Object} actions Action definitions for custom event handling
216
+ * @property {Function} actions.click Callback function for generic click actions within the login component
217
+ * @property {Object} callbacks Optional callback hooks for modifying internal behavior
218
+ * @property {Function} callbacks.username A function that receives and can transform the entered username before submission
219
+ * @property {Function} callbacks.forgotPassword A function that receives and can transform the entered email before submission
220
+ * @property {number} digits Number of digits required for second factor or password reset code input
221
+ * @property {Object[]} successUrls List of URLs shown after successful login (e.g., home or logout)
222
+ * @property {string} successUrls.label Label for the success URL (displayed)
223
+ * @property {string} successUrls.url Actual target URL
224
+ * @property {number} timeoutForMessage Duration in milliseconds to show error messages
225
+ * @property {number} timeoutForSuccess Duration in milliseconds before triggering the post-login success state
226
+ * @property {Object} accessKeys Keyboard access keys for accessibility and shortcuts
227
+ * @property {string} accessKeys.loginLink Access key for switching to login form
228
+ * @property {string} accessKeys.username Access key for focusing the username field
229
+ * @property {string} accessKeys.password Access key for focusing the password field
230
+ * @property {Object} fetch Definitions for backend requests to support login workflows
231
+ * @property {Object} placeholder Placeholder text for input fields
232
+ * @property {string} placeholder.username Placeholder for the username field
233
+ * @property {string} placeholder.password Placeholder for the password field
234
+ * @property {string} placeholder.email Placeholder for the email field
235
+ * @property {Object} fetch.login Fetch config for login request
236
+ * @property {string} fetch.login.url Endpoint to post login credentials to
237
+ * @property {string} fetch.login.method HTTP method for login (e.g., "POST")
238
+ * @property {string} fetch.login.mode Fetch mode (e.g., "same-origin")
239
+ * @property {Object} fetch.login.headers HTTP headers to be sent with the login request
240
+ * @property {string} fetch.login.headers.accept Accept header value
241
+ * @property {string} fetch.login.headers.Content-Type Content-Type header value
242
+ * @property {string} fetch.login.credentials Credential mode (e.g., "same-origin")
243
+ * @property {Object} fetch.forgotPassword Fetch config for password reset code request
244
+ * @property {string} fetch.forgotPassword.url Endpoint to request a reset link/code
245
+ * @property {string} fetch.forgotPassword.method HTTP method
246
+ * @property {string} fetch.forgotPassword.mode Fetch mode
247
+ * @property {Object} fetch.forgotPassword.headers Headers
248
+ * @property {string} fetch.forgotPassword.headers.accept Accept header
249
+ * @property {string} fetch.forgotPassword.headers.Content-Type Content-Type header
250
+ * @property {string} fetch.forgotPassword.credentials Credential mode
251
+ * @property {Object} fetch.digits Fetch config for submitting password reset code
252
+ * @property {string} fetch.digits.url Endpoint for validating the code
253
+ * @property {string} fetch.digits.method HTTP method
254
+ * @property {string} fetch.digits.mode Fetch mode
255
+ * @property {Object} fetch.digits.headers Headers
256
+ * @property {string} fetch.digits.headers.accept Accept header
257
+ * @property {string} fetch.digits.headers.Content-Type Content-Type header
258
+ * @property {string} fetch.digits.credentials Credential mode
259
+ * @property {Object} fetch.secondFactor Fetch config for submitting second factor code
260
+ * @property {string} fetch.secondFactor.url Endpoint to validate second factor code
261
+ * @property {string} fetch.secondFactor.method HTTP method
262
+ * @property {string} fetch.secondFactor.mode Fetch mode
263
+ * @property {Object} fetch.secondFactor.headers Headers
264
+ * @property {string} fetch.secondFactor.headers.accept Accept header
265
+ * @property {string} fetch.secondFactor.headers.Content-Type Content-Type header
266
+ * @property {string} fetch.secondFactor.credentials Credential mode
267
+ */
268
+ get defaults() {
269
+ return Object.assign({}, super.defaults, {
270
+ templates: {
271
+ main: getTemplate(),
272
+ },
273
+ labels: getTranslations(),
274
+ classes: {
275
+ usernameInvalid: "",
276
+ passwordInvalid: "",
277
+ emailInvalid: "",
278
+ button: "monster-button-outline-primary",
279
+ },
280
+ disabled: false,
281
+ features: {
282
+ forgotPassword: true,
283
+ redirectToFirstSuccessUrl: false,
284
+ },
285
+ actions: {},
286
+
287
+ callbacks: {
288
+ username: null,
289
+ forgotPassword: null,
290
+ },
291
+
292
+ digits: 6,
293
+
294
+ successUrls: [
295
+ {
296
+ label: "Home",
297
+ url: "/",
298
+ },
299
+ {
300
+ label: "Logout",
301
+ url: "/logout",
302
+ },
303
+ ],
304
+
305
+ timeoutForMessage: 3500,
306
+ timeoutForSuccess: 1000,
307
+
308
+ accessKeys: {
309
+ loginLink: "x",
310
+ username: "u",
311
+ password: "p",
312
+ },
313
+
314
+ placeholder: {
315
+ username: "",
316
+ password: "",
317
+ email: "",
318
+ },
319
+
320
+ fetch: {
321
+ login: {
322
+ url: "",
323
+ method: "POST",
324
+ mode: "same-origin",
325
+ headers: {
326
+ Accept: "application/json",
327
+ "Content-Type": "application/json; charset=utf-8",
328
+ },
329
+ credentials: "same-origin",
330
+ },
331
+ forgotPassword: {
332
+ url: "",
333
+ method: "POST",
334
+ mode: "same-origin",
335
+ headers: {
336
+ Accept: "application/json",
337
+ "Content-Type": "application/json; charset=utf-8",
338
+ },
339
+ credentials: "same-origin",
340
+ },
341
+ digits: {
342
+ url: "",
343
+ method: "POST",
344
+ mode: "same-origin",
345
+ headers: {
346
+ Accept: "application/json",
347
+ "Content-Type": "application/json; charset=utf-8",
348
+ },
349
+ credentials: "same-origin",
350
+ },
351
+ secondFactor: {
352
+ url: "",
353
+ method: "POST",
354
+ mode: "same-origin",
355
+ headers: {
356
+ Accept: "application/json",
357
+ "Content-Type": "application/json; charset=utf-8",
358
+ },
359
+ credentials: "same-origin",
360
+ },
361
+ },
362
+ });
363
+ }
364
+
365
+ /**
366
+ * Opens the login collapse and focuses the username control.
367
+ *
368
+ * @returns {Login}
369
+ */
370
+ openLogin() {
371
+ this[loginCollapseSymbol].open();
372
+ this.shadowRoot.querySelector("input[name='username']").focus();
373
+ return this;
374
+ }
375
+
376
+ /**
377
+ * Opens the forgot password collapse. If the feature `forgotPassword` is not enabled, an error will be thrown.
378
+ *
379
+ * @returns {Login}
380
+ * @throws {Error} If the feature is not enabled
381
+ */
382
+ openForgotPassword() {
383
+ if (!this.getOption("features.forgotPassword")) {
384
+ throw new Error("Forgot Password is not enabled");
385
+ }
386
+
387
+ this[forgotPasswordCollapseSymbol].open();
388
+ return this;
389
+ }
390
+
391
+ /**
392
+ * Opens the second factor collapse and focuses the second factor control.
393
+ * @returns {Login}
394
+ */
395
+ openSecondFactor() {
396
+ this[secondFactorCollapseSymbol].open();
397
+ this.shadowRoot.getElementById("secondFactorButton").focus();
398
+ return this;
399
+ }
400
+
401
+ /**
402
+ * Opens the digits collapse and focuses the digit control.
403
+ * @returns {Login}
404
+ */
405
+ openDigits() {
406
+ this[digitsCollapseSymbol].open();
407
+ this.shadowRoot.getElementById("digitsControl").focus();
408
+ return this;
409
+ }
410
+
411
+ /**
412
+ * Opens the logged in collapse. If the feature `redirectToFirstSuccessUrl` is enabled, the user will be redirected to the first success URL.
413
+ *
414
+ * @returns {Login}
415
+ */
416
+ openLoggedIn() {
417
+ fireEvent(this, "login-success");
418
+
419
+ if (this.getOption("features.redirectToFirstSuccessUrl")) {
420
+ setTimeout(() => {
421
+ fireEvent(this, "redirect-to-first-success-url");
422
+
423
+ const successUrl = this.getOption("successUrls");
424
+ if (successUrl.length > 0) {
425
+ const success = successUrl[0].url;
426
+ if (success) {
427
+ getWindow().location.href = success;
428
+ }
429
+ }
430
+ }, this.getOption("timeoutForSuccess"));
431
+
432
+ return;
433
+ }
434
+
435
+ this[loggedInCollapseSymbol].open();
436
+
437
+ return this;
438
+ }
439
+
440
+ /**
441
+ * @return {string}
442
+ */
443
+ static getTag() {
444
+ return "monster-login";
445
+ }
446
+
447
+ /**
448
+ * @return {CSSStyleSheet[]}
449
+ */
450
+ static getCSSStyleSheet() {
451
+ return [LoginStyleSheet, InvalidStyleSheet];
452
+ }
443
453
  }
444
454
 
445
455
  function getTranslations() {
446
- const locale = getLocaleOfDocument();
447
- switch (locale.language) {
448
- case "de":
449
- return {
450
- username: "Benutzername oder E-Mail",
451
- password: "Passwort",
452
- login: "Anmelden",
453
- forgotPasswordLink: "Passwort vergessen?",
454
- mailAddress: "E-Mail-Adresse",
455
- requestLink: "Code anfordern",
456
- digits: "Code",
457
- loginLink: "Anmelden",
458
- secondFactor: "Zweiter Faktor Code",
459
- sendDigits: "Code senden",
460
- sendSecondFactorDigits: "Code senden",
461
- resetLoginProcess: "Zurück zum Login",
462
- messageEmptyUserName: "Bitte geben Sie Ihren Benutzernamen ein",
463
- messageEmptyPassword: "Bitte geben Sie Ihr Passwort ein",
464
- messageEmptyBoth:
465
- "Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein",
466
- messageEmptyEmail: "Bitte geben Sie Ihre E-Mail-Adresse ein",
467
- messageInvalidEmail: "Bitte geben Sie eine gültige E-Mail-Adresse ein",
468
- digitsEmpty: "Bitte geben Sie Ihren Code ein",
469
- digitsInvalid: "Bitte geben Sie einen gültigen Code ein",
470
- messageLoginFailed:
471
- "Anmeldung fehlgeschlagen, bitte überprüfen Sie Ihre Eingaben.",
472
- messageForbidden:
473
- "Die Anmeldung war erfolgreich, aber Sie haben keine Berechtigung. Sie können sich <b>nicht</b> anmelden.<br>Sie können einen anderen Benutzer auswählen oder sich an den Administrator wenden.",
474
- messageSomethingWentWrong:
475
- "Etwas ist schief gelaufen, bitte versuchen Sie es später erneut",
476
- messageThisFormIsNotConfigured:
477
- "Dieses Formular ist nicht konfiguriert.",
478
- messagePasswordResetDisabled:
479
- "Sie können keinen Code anfordern, da die<br>Zwei-Faktor-Authentifizierung bei Ihrem Konto aktiviert ist.<br>Bitte kontaktieren Sie den Administrator.",
480
- };
481
- case "es":
482
- return {
483
- username: "Nombre de usuario o correo electrónico",
484
- password: "Contraseña",
485
- login: "Iniciar sesión",
486
- forgotPasswordLink: "¿Olvidaste tu contraseña?",
487
- mailAddress: "Dirección de correo electrónico",
488
- requestLink: "Solicitar enlace",
489
- digits: "Código",
490
- loginLink: "Iniciar sesión",
491
- secondFactor: "Código de segundo factor",
492
- sendDigits: "Enviar código",
493
- sendSecondFactorDigits: "Enviar código",
494
- resetLoginProcess: "Volver al inicio de sesión",
495
- messageEmptyUserName: "Por favor ingrese su nombre de usuario",
496
- messageEmptyPassword: "Por favor ingrese su contraseña",
497
- messageEmptyBoth: "Por favor ingrese su nombre de usuario y contraseña",
498
- messageEmptyEmail:
499
- "Por favor ingrese su dirección de correo electrónico",
500
- messageInvalidEmail:
501
- "Por favor ingrese una dirección de correo electrónico válida",
502
- digitsEmpty: "Por favor ingrese su código",
503
- digitsInvalid: "Por favor ingrese un código válido",
504
- messageLoginFailed:
505
- "Error al iniciar sesión, por favor verifique sus datos.",
506
- messageForbidden:
507
- "El inicio de sesión fue exitoso, pero no tienes permisos. <b>No puedes</b> iniciar sesión.<br>Puedes seleccionar otro usuario o contactar al administrador.",
508
- messageSomethingWentWrong:
509
- "Algo salió mal, por favor intenta de nuevo más tarde.",
510
- messageThisFormIsNotConfigured: "Este formulario no está configurado.",
511
- messagePasswordResetDisabled:
512
- "Esta función no funciona porque la autenticación de dos factores está activada en su cuenta. Por favor, póngase en contacto con el administrador.",
513
- };
514
- case "zh":
515
- return {
516
- username: "用户名或电子邮箱",
517
- password: "密码",
518
- login: "登录",
519
- forgotPasswordLink: "忘记密码?",
520
- mailAddress: "电子邮件地址",
521
- requestLink: "请求链接",
522
- digits: "验证码",
523
- loginLink: "登录",
524
- secondFactor: "二次验证码",
525
- sendDigits: "发送验证码",
526
- sendSecondFactorDigits: "发送验证码",
527
- resetLoginProcess: "返回登录",
528
- messageEmptyUserName: "请输入用户名",
529
- messageEmptyPassword: "请输入密码",
530
- messageEmptyBoth: "请输入用户名和密码",
531
- messageEmptyEmail: "请输入电子邮件地址",
532
- messageInvalidEmail: "请输入有效的电子邮件地址",
533
- digitsEmpty: "请输入验证码",
534
- digitsInvalid: "请输入有效的验证码",
535
- messageLoginFailed: "登录失败,请检查您的输入。",
536
- messageForbidden:
537
- "登录成功,但您没有权限。您<b>不能</b>登录。<br>您可以选择其他用户或联系管理员。",
538
- messageSomethingWentWrong: "出了点问题,请稍后再试。",
539
- messageThisFormIsNotConfigured: "此表单尚未配置。",
540
- messagePasswordResetDisabled:
541
- "此功能无法使用,因为您的帐户启用了二因素身份验证。请联系管理员。",
542
- };
543
-
544
- case "hi":
545
- return {
546
- username: "उपयगकर नम य ई-मल",
547
- password: "पसवर",
548
- login: "लग इन कर",
549
- forgotPasswordLink: "पसवर भल गए?",
550
- mailAddress: "ई-मल पत",
551
- requestLink: "लक क अनरध कर",
552
- digits: "कड",
553
- loginLink: "लग इन कर",
554
- secondFactor: "दसर फकर कड",
555
- sendDigits: "कड भज",
556
- sendSecondFactorDigits: "कड भज",
557
- resetLoginProcess: "लगन पर वपस जए",
558
- messageEmptyUserName: "कपय अपन उपयगकर नम दर कर",
559
- messageEmptyPassword: "कपय अपन पसवर दर कर",
560
- messageEmptyBoth: "कपय अपन उपयगकर नम और पसवर दर कर",
561
- messageEmptyEmail: "कपय अपन ई-मल पत दर कर",
562
- messageInvalidEmail: "कपय एक वध ई-मल पत दर कर",
563
- digitsEmpty: "कपय अपन कड दर कर",
564
- digitsInvalid: "कपय एक वध कड दर कर",
565
- messageLoginFailed: "लगन वफल हआ, कपय अपन जनकर क जच कर।",
566
- messageForbidden:
567
- "लगन सफल रह लकन आपक पस अनमत नह ह। आप <b>लगन नह</b> कर सकत।<br>आप दसर उपयगकर चन सकत ह य पशसक स सपर कर सकत ह।",
568
- messageSomethingWentWrong: "कछ गलत हआ, कपय बद म पन पयस कर।",
569
- messageThisFormIsNotConfigured: "यह फर कनगर नह ह।",
570
- messagePasswordResetDisabled:
571
- "यह सवध कम नह करत कक आपक खत म द घटक पमणकरण सकम ह। कपय पशसक स सपर कर।",
572
- };
573
-
574
- case "bn":
575
- return {
576
- username: "ইউজরনম ব ই-মইল",
577
- password: "পসওযর",
578
- login: "লগইন করন",
579
- forgotPasswordLink: "পসওযর ভল গছন?",
580
- mailAddress: "ই-মইল ঠকন",
581
- requestLink: "লক অনরধ করন",
582
- digits: "কড",
583
- loginLink: "লগইন করন",
584
- secondFactor: "দতয ফকর কড",
585
- sendDigits: "কড পঠন",
586
- sendSecondFactorDigits: "কড পঠন",
587
- resetLoginProcess: "লগইন ফর যন",
588
- messageEmptyUserName: "দয কর আপনর ইউজরনম লখন",
589
- messageEmptyPassword: "দয কর আপনর পসওযর লখন",
590
- messageEmptyBoth: "দয কর আপনর ইউজরনম এব পসওযর লখন",
591
- messageEmptyEmail: "দয কর আপনর ই-মইল ঠকন লখন",
592
- messageInvalidEmail: "দয কর একট বধ ই-মইল ঠকন লখন",
593
- digitsEmpty: "দয কর আপনর কড লখন",
594
- digitsInvalid: "দয কর একট বধ কড লখন",
595
- messageLoginFailed: "লগইন বর হযছ, দয কর আপনর ইনপট পরক করন।",
596
- messageForbidden:
597
- "লগইন সফল হযছ, কন আপনর অনমত নই। আপন <b>লগইন করত পরবন ন</b>।<br>আপন অন ইউজর নরচন করত পরন অথব অযডমনসটরর সথ যগযগ করত পরন।",
598
- messageSomethingWentWrong: "কছ ভল হযছ, দয কর পর আবর চষ করন।",
599
- messageThisFormIsNotConfigured: "এই ফরট কনফগর কর হযন।",
600
- messagePasswordResetDisabled:
601
- "এই ফশনট করকর নয করণ আপনর অযকউন দট ফকর পমণকরণ সকয কর আছ। দয কর পশসকর সথ যগযগ করন।",
602
- };
603
-
604
- case "pt": // Portuguese
605
- return {
606
- username: "Nome de usuário ou e-mail",
607
- password: "Senha",
608
- login: "Entrar",
609
- forgotPasswordLink: "Esqueceu a senha?",
610
- mailAddress: "Endereço de e-mail",
611
- requestLink: "Solicitar link",
612
- digits: "Código",
613
- loginLink: "Entrar",
614
- secondFactor: "Código do segundo fator",
615
- sendDigits: "Enviar código",
616
- sendSecondFactorDigits: "Enviar código",
617
- resetLoginProcess: "Voltar ao login",
618
- messageEmptyUserName: "Por favor, insira seu nome de usuário",
619
- messageEmptyPassword: "Por favor, insira sua senha",
620
- messageEmptyBoth: "Por favor, insira seu nome de usuário e senha",
621
- messageEmptyEmail: "Por favor, insira seu endereço de e-mail",
622
- messageInvalidEmail: "Por favor, insira um endereço de e-mail válido",
623
- digitsEmpty: "Por favor, insira seu código",
624
- digitsInvalid: "Por favor, insira um código válido",
625
- messageLoginFailed: "Falha no login, verifique suas informações.",
626
- messageForbidden:
627
- "Login foi bem-sucedido, mas você não tem permissão. Você <b>não pode</b> entrar.<br>Você pode escolher outro usuário ou entrar em contato com o administrador.",
628
- messageSomethingWentWrong:
629
- "Algo deu errado, tente novamente mais tarde.",
630
- messageThisFormIsNotConfigured: "Este formulário não está configurado.",
631
- messagePasswordResetDisabled:
632
- "Esta função não funciona porque a autenticação de dois fatores<br>está ativada em sua conta. Por favor, entre em contato com o administrador.",
633
- };
634
-
635
- case "ru": // Russian
636
- return {
637
- username: "Имя пользователя или электронная почта",
638
- password: "Пароль",
639
- login: "Войти",
640
- forgotPasswordLink: "Забыли пароль?",
641
- mailAddress: "Адрес электронной почты",
642
- requestLink: "Запросить ссылку",
643
- digits: "Код",
644
- loginLink: "Войти",
645
- secondFactor: "Код второго фактора",
646
- sendDigits: "Отправить код",
647
- sendSecondFactorDigits: "Отправить код",
648
- resetLoginProcess: "Вернуться к входу",
649
- messageEmptyUserName: "Пожалуйста, введите имя пользователя",
650
- messageEmptyPassword: "Пожалуйста, введите пароль",
651
- messageEmptyBoth: "Пожалуйста, введите имя пользователя и пароль",
652
- messageEmptyEmail: "Пожалуйста, введите адрес электронной почты",
653
- messageInvalidEmail:
654
- "Пожалуйста, введите действительный адрес электронной почты",
655
- digitsEmpty: "Пожалуйста, введите код",
656
- digitsInvalid: "Пожалуйста, введите действительный код",
657
- messageLoginFailed: "Ошибка входа, проверьте введенные данные.",
658
- messageForbidden:
659
- "Вход выполнен, но у вас нет прав. Вы <b>не можете</b> войти.<br>Вы можете выбрать другого пользователя или связаться с администратором.",
660
- messageSomethingWentWrong: "Что-то пошло не так, попробуйте позже.",
661
- messageThisFormIsNotConfigured: "Эта форма не настроена.",
662
- messagePasswordResetDisabled:
663
- "Эта функция не работает, потому что двухфакторная аутентификация<br> включена в вашей учетной записи. Пожалуйста, свяжитесь с администратором.",
664
- };
665
-
666
- case "ja": // Japanese
667
- return {
668
- username: "ユーザー名またはメールアドレス",
669
- password: "パスワード",
670
- login: "ログイン",
671
- forgotPasswordLink: "パスワードを忘れましたか?",
672
- mailAddress: "メールアドレス",
673
- requestLink: "リンクをリクエスト",
674
- digits: "コード",
675
- loginLink: "ログイン",
676
- secondFactor: "二要素コード",
677
- sendDigits: "コードを送信",
678
- sendSecondFactorDigits: "コードを送信",
679
- resetLoginProcess: "ログインに戻る",
680
- messageEmptyUserName: "ユーザー名を入力してください",
681
- messageEmptyPassword: "パスワードを入力してください",
682
- messageEmptyBoth: "ユーザー名とパスワードを入力してください",
683
- messageEmptyEmail: "メールアドレスを入力してください",
684
- messageInvalidEmail: "有効なメールアドレスを入力してください",
685
- digitsEmpty: "コードを入力してください",
686
- digitsInvalid: "有効なコードを入力してください",
687
- messageLoginFailed:
688
- "ログインに失敗しました。入力内容をご確認ください。",
689
- messageForbidden:
690
- "ログイン成功しましたが、権限がありません。<b>ログインできません</b>。<br>他のユーザーを選択するか、管理者に連絡してください。",
691
- messageSomethingWentWrong:
692
- "問題が発生しました。後でもう一度お試しください。",
693
- messageThisFormIsNotConfigured: "このフォームは設定されていません。",
694
- messagePasswordResetDisabled:
695
- "この機能は使用できません。アカウントで二要素認証が有効になっているため、管理者に連絡してください。",
696
- };
697
-
698
- case "pa": // Western Punjabi
699
- return {
700
- username: "ਵਰਤਕਰ ਨਮ ਜ ਈ-ਮਲ",
701
- password: "ਪਸਵਰਡ",
702
- login: "ਲਗਨ ਕਰ",
703
- forgotPasswordLink: "ਪਸਵਰਡ ਭਲ ਗਏ?",
704
- mailAddress: "ਈ-ਮਲ ਪਤ",
705
- requestLink: "ਲਕ ਦ ਬਨਤ ਕਰ",
706
- digits: "ਕਡ",
707
- loginLink: "ਲਗਨ ਕਰ",
708
- secondFactor: "ਦਜ ਫਕਟਰ ਕਡ",
709
- sendDigits: "ਕਡ ਭਜ",
710
- sendSecondFactorDigits: "ਕਡ ਭਜ",
711
- resetLoginProcess: "ਲਗਨ 'ਤ ਵਪਸ ਜਓ",
712
- messageEmptyUserName: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਦਰਜ ਕਰ",
713
- messageEmptyPassword: "ਕਰਪ ਕਰਕ ਆਪਣ ਪਸਵਰਡ ਦਰਜ ਕਰ",
714
- messageEmptyBoth: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਤ ਪਸਵਰਡ ਦਰਜ ਕਰ",
715
- messageEmptyEmail: "ਕਰਪ ਕਰਕ ਆਪਣ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
716
- messageInvalidEmail: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
717
- digitsEmpty: "ਕਰਪ ਕਰਕ ਆਪਣ ਕਡ ਦਰਜ ਕਰ",
718
- digitsInvalid: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਕਡ ਦਰਜ ਕਰ",
719
- messageLoginFailed: "ਲਗਨ ਅਸਫਲ ਹਇਆ, ਕਰਪ ਕਰਕ ਆਪਣ ਜਣਕਰ ਦ ਜਚ ਕਰ।",
720
- messageForbidden:
721
- "ਲਗਨ ਸਫਲ ਹਇਆ, ਪਰ ਤਹਡ ਕਲ ਅਧਕਰ ਨਹ ਹਨ। ਤਸ <b>ਲਗਨ ਨਹ</b> ਕਰ ਸਕਦ।<br>ਤਸ ਹਰ ਵਰਤਕਰ ਚਣ सकत ਹ ਜ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ ਸਕਦ ਹ।",
722
- messageSomethingWentWrong: "ਕਝ ਗਲਤ ਹ ਗਆ, ਕਰਪ ਕਰਕ ਬਅਦ ਵਚ ਮੜ ਕਸਸ ਕਰ।",
723
- messageThisFormIsNotConfigured: "ਇਸ ਫਰਮ ਨ ਸਰਚਤ ਨਹ ਕਤ ਗਆ ਹ।",
724
- messagePasswordResetDisabled:
725
- "ਇਹ ਫਕਸਨ ਕਮ ਨਹ ਕਰਦ ਕਉਕ ਤਹਡ ਖਤ ਵਚ ਦ ਫਕਟਰ ਪਰਮਣਕਰਣ ਸਰਗਰਮ ਹ। ਕਰਪ ਕਰਕ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ।",
726
- };
727
-
728
- case "mr": // Marathi
729
- return {
730
- username: "वपरकरनव कव ईमल",
731
- password: "सकतशब",
732
- login: "पवश कर",
733
- forgotPasswordLink: "सकतशब वसरलत क?",
734
- mailAddress: "ईमल पत",
735
- requestLink: "लकच वनत कर",
736
- digits: "कड",
737
- loginLink: "पवश कर",
738
- secondFactor: "दसर घटक कड",
739
- sendDigits: "कड पठव",
740
- sendSecondFactorDigits: "कड पठव",
741
- resetLoginProcess: "पवशवर परत ज",
742
- messageEmptyUserName: "कपय आपल वपरकरनव पवष कर",
743
- messageEmptyPassword: "कपय आपल सकतशब पवष कर",
744
- messageEmptyBoth: "कपय आपल वपरकरनव आण सकतशब पवष कर",
745
- messageEmptyEmail: "कपय आपल ईमल पत पवष कर",
746
- messageInvalidEmail: "कपय वध ईमल पत पवष कर",
747
- digitsEmpty: "कपय आपल कड पवष कर",
748
- digitsInvalid: "कपय वध कड पवष कर",
749
- messageLoginFailed: "पवश अयशस, कपय आपल महत तपस.",
750
- messageForbidden:
751
- "पवश यशस झल, परत आपलकड परवन नह. आपण <b>पवश कर शकत नह</b>.<br>आपण दसर वपरकर नवड शकत कव ववसपकश सपर सध शकत.",
752
- messageSomethingWentWrong: "कहतर चकल, कपय नतर पन पयत कर.",
753
- messageThisFormIsNotConfigured: "ह फर सरचत कलल नह.",
754
- messagePasswordResetDisabled:
755
- "य करच कमगर करत नह करण आपल खतत दन घटक पमणकरण सकय कल आह. कपय ववसपकश सपर सध.",
756
- };
757
-
758
- case "fr": // French
759
- return {
760
- username: "Nom d'utilisateur ou e-mail",
761
- password: "Mot de passe",
762
- login: "Connexion",
763
- forgotPasswordLink: "Mot de passe oublié ?",
764
- mailAddress: "Adresse e-mail",
765
- requestLink: "Demander un lien",
766
- digits: "Code",
767
- loginLink: "Connexion",
768
- secondFactor: "Code du deuxième facteur",
769
- sendDigits: "Envoyer le code",
770
- sendSecondFactorDigits: "Envoyer le code",
771
- resetLoginProcess: "Retour à la connexion",
772
- messageEmptyUserName: "Veuillez entrer votre nom d'utilisateur",
773
- messageEmptyPassword: "Veuillez entrer votre mot de passe",
774
- messageEmptyBoth:
775
- "Veuillez entrer votre nom d'utilisateur et votre mot de passe",
776
- messageEmptyEmail: "Veuillez entrer votre adresse e-mail",
777
- messageInvalidEmail: "Veuillez entrer une adresse e-mail valide",
778
- digitsEmpty: "Veuillez entrer votre code",
779
- digitsInvalid: "Veuillez entrer un code valide",
780
- messageLoginFailed:
781
- "Échec de la connexion, veuillez vérifier vos informations.",
782
- messageForbidden:
783
- "La connexion a réussi, mais vous n'avez pas les permissions. Vous <b>ne pouvez pas</b> vous connecter.<br>Vous pouvez choisir un autre utilisateur ou contacter l'administrateur.",
784
- messageSomethingWentWrong:
785
- "Une erreur s'est produite, veuillez réessayer plus tard.",
786
- messageThisFormIsNotConfigured: "Ce formulaire n'est pas configuré.",
787
- messagePasswordResetDisabled:
788
- "Cette fonctionnalité ne fonctionne pas car l'authentification à deux facteurs est activée sur<br>votre compte. Veuillez contacter l'administrateur.",
789
- };
790
-
791
- case "it": // Italian
792
- return {
793
- username: "Nome utente o e-mail",
794
- password: "Password",
795
- login: "Accedi",
796
- forgotPasswordLink: "Password dimenticata?",
797
- mailAddress: "Indirizzo e-mail",
798
- requestLink: "Richiedi link",
799
- digits: "Codice",
800
- loginLink: "Accedi",
801
- secondFactor: "Codice a due fattori",
802
- sendDigits: "Invia codice",
803
- sendSecondFactorDigits: "Invia codice",
804
- resetLoginProcess: "Torna al login",
805
- messageEmptyUserName: "Per favore, inserisci il tuo nome utente",
806
- messageEmptyPassword: "Per favore, inserisci la tua password",
807
- messageEmptyBoth:
808
- "Per favore, inserisci il tuo nome utente e la tua password",
809
- messageEmptyEmail: "Per favore, inserisci il tuo indirizzo e-mail",
810
- messageInvalidEmail: "Per favore, inserisci un indirizzo e-mail valido",
811
- digitsEmpty: "Per favore, inserisci il tuo codice",
812
- digitsInvalid: "Per favore, inserisci un codice valido",
813
- messageLoginFailed: "Accesso fallito, verifica i tuoi dati.",
814
- messageForbidden:
815
- "Accesso riuscito, ma non hai i permessi. Non puoi accedere.<br>Puoi scegliere un altro account o contattare l'amministratore.",
816
- messageSomethingWentWrong:
817
- "Qualcosa è andato storto, riprova più tardi.",
818
- messageThisFormIsNotConfigured: "Questo modulo non è configurato.",
819
- messagePasswordResetDisabled:
820
- "Questa funzione non funziona perché l'autenticazione a due<br>fattori è attiva sul tuo account. Contatta l'amministratore.",
821
- };
822
-
823
- case "nl": // Dutch
824
- return {
825
- username: "Gebruikersnaam of e-mail",
826
- password: "Wachtwoord",
827
- login: "Inloggen",
828
- forgotPasswordLink: "Wachtwoord vergeten?",
829
- mailAddress: "E-mailadres",
830
- requestLink: "Link aanvragen",
831
- digits: "Code",
832
- loginLink: "Inloggen",
833
- secondFactor: "Tweede factor code",
834
- sendDigits: "Code verzenden",
835
- sendSecondFactorDigits: "Code verzenden",
836
- resetLoginProcess: "Terug naar inloggen",
837
- messageEmptyUserName: "Voer uw gebruikersnaam in",
838
- messageEmptyPassword: "Voer uw wachtwoord in",
839
- messageEmptyBoth: "Voer uw gebruikersnaam en wachtwoord in",
840
- messageEmptyEmail: "Voer uw e-mailadres in",
841
- messageInvalidEmail: "Voer een geldig e-mailadres in",
842
- digitsEmpty: "Voer uw code in",
843
- digitsInvalid: "Voer een geldige code in",
844
- messageLoginFailed: "Inloggen mislukt, controleer uw gegevens.",
845
- messageForbidden:
846
- "Inloggen geslaagd, maar u heeft geen permissies. U <b>kunt niet</b> inloggen.<br>U kunt een andere gebruiker selecteren of de beheerder contacteren.",
847
- messageSomethingWentWrong:
848
- "Er is iets fout gegaan, probeer het later opnieuw.",
849
- messageThisFormIsNotConfigured: "Dit formulier is niet geconfigureerd.",
850
- messagePasswordResetDisabled:
851
- "Deze functie werkt niet omdat tweefactorauthenticatie is<br>ingeschakeld op uw account. Neem contact op met de beheerder.",
852
- };
853
-
854
- case "sv": // Swedish
855
- return {
856
- username: "Användarnamn eller e-post",
857
- password: "Lösenord",
858
- login: "Logga in",
859
- forgotPasswordLink: "Glömt lösenord?",
860
- mailAddress: "E-postadress",
861
- requestLink: "Begär länk",
862
- digits: "Kod",
863
- loginLink: "Logga in",
864
- secondFactor: "Tvåfaktorkod",
865
- sendDigits: "Skicka kod",
866
- sendSecondFactorDigits: "Skicka kod",
867
- resetLoginProcess: "Tillbaka till inloggning",
868
- messageEmptyUserName: "Ange ditt användarnamn",
869
- messageEmptyPassword: "Ange ditt lösenord",
870
- messageEmptyBoth: "Ange ditt användarnamn och lösenord",
871
- messageEmptyEmail: "Ange din e-postadress",
872
- messageInvalidEmail: "Ange en giltig e-postadress",
873
- digitsEmpty: "Ange din kod",
874
- digitsInvalid: "Ange en giltig kod",
875
- messageLoginFailed:
876
- "Inloggning misslyckades, kontrollera dina uppgifter.",
877
- messageForbidden:
878
- "Inloggningen lyckades, men du har inte behörighet. Du <b>kan inte</b> logga in.<br>Du kan välja en annan användare eller kontakta administratören.",
879
- messageSomethingWentWrong: "Något gick fel, försök igen senare.",
880
- messageThisFormIsNotConfigured: "Detta formulär är inte konfigurerat.",
881
- messagePasswordResetDisabled:
882
- "Denna funktion fungerar inte eftersom tvåfaktorsautentisering är aktiverad på ditt konto. Kontakta administratören.",
883
- };
884
-
885
- case "pl": // Polish
886
- return {
887
- username: "Nazwa użytkownika lub e-mail",
888
- password: "Hasło",
889
- login: "Zaloguj się",
890
- forgotPasswordLink: "Zapomniałeś hasła?",
891
- mailAddress: "Adres e-mail",
892
- requestLink: "Zażądaj linku",
893
- digits: "Kod",
894
- loginLink: "Zaloguj się",
895
- secondFactor: "Kod drugiego czynnika",
896
- sendDigits: "Wyślij kod",
897
- sendSecondFactorDigits: "Wyślij kod",
898
- resetLoginProcess: "Powrót do logowania",
899
- messageEmptyUserName: "Wprowadź swoją nazwę użytkownika",
900
- messageEmptyPassword: "Wprowadź swoje hasło",
901
- messageEmptyBoth: "Wprowadź swoją nazwę użytkownika i hasło",
902
- messageEmptyEmail: "Wprowadź swój adres e-mail",
903
- messageInvalidEmail: "Wprowadź prawidłowy adres e-mail",
904
- digitsEmpty: "Wprowadź swój kod",
905
- digitsInvalid: "Wprowadź prawidłowy kod",
906
- messageLoginFailed: "Logowanie nie powiodło się, sprawdź swoje dane.",
907
- messageForbidden:
908
- "Logowanie powiodło się, ale nie masz uprawnień. <b>Nie możesz</b> się zalogować.<br>Możesz wybrać innego użytkownika lub skontaktować się z administratorem.",
909
- messageSomethingWentWrong:
910
- "Coś poszło nie tak, spróbuj ponownie później.",
911
- messageThisFormIsNotConfigured:
912
- "Ten formularz nie jest skonfigurowany.",
913
- messagePasswordResetDisabled:
914
- "Ta funkcja nie działa, ponieważ włączona jest autoryzacja dwuetapowa na twoim koncie. Skontaktuj się z administratorem.",
915
- };
916
-
917
- case "da": // Danish
918
- return {
919
- username: "Brugernavn eller e-mail",
920
- password: "Adgangskode",
921
- login: "Log ind",
922
- forgotPasswordLink: "Glemt adgangskode?",
923
- mailAddress: "E-mail-adresse",
924
- requestLink: "Anmod om link",
925
- digits: "Kode",
926
- loginLink: "Log ind",
927
- secondFactor: "Tofaktorkode",
928
- sendDigits: "Send kode",
929
- sendSecondFactorDigits: "Send kode",
930
- resetLoginProcess: "Tilbage til log ind",
931
- messageEmptyUserName: "Indtast dit brugernavn",
932
- messageEmptyPassword: "Indtast din adgangskode",
933
- messageEmptyBoth: "Indtast dit brugernavn og din adgangskode",
934
- messageEmptyEmail: "Indtast din e-mail-adresse",
935
- messageInvalidEmail: "Indtast en gyldig e-mail-adresse",
936
- digitsEmpty: "Indtast din kode",
937
- digitsInvalid: "Indtast en gyldig kode",
938
- messageLoginFailed: "Login mislykkedes, kontrollér dine oplysninger.",
939
- messageForbidden:
940
- "Login lykkedes, men du har ikke tilladelse. Du <b>kan ikke</b> logge ind.<br>Du kan vælge en anden bruger eller kontakte administratoren.",
941
- messageSomethingWentWrong: "Noget gik galt, prøv igen senere.",
942
- messageThisFormIsNotConfigured: "Denne formular er ikke konfigureret.",
943
- messagePasswordResetDisabled:
944
- "Denne funktion fungerer ikke, fordi tofaktorautentificering<br>er aktiveret på din konto. Kontakt administratoren.",
945
- };
946
-
947
- case "no": // Norwegian
948
- return {
949
- username: "Brukernavn eller e-post",
950
- password: "Passord",
951
- login: "Logg inn",
952
- forgotPasswordLink: "Glemt passord?",
953
- mailAddress: "E-postadresse",
954
- requestLink: "Be om lenke",
955
- digits: "Kode",
956
- loginLink: "Logg inn",
957
- secondFactor: "Tofaktorkode",
958
- sendDigits: "Send kode",
959
- sendSecondFactorDigits: "Send kode",
960
- resetLoginProcess: "Tilbake til innlogging",
961
- messageEmptyUserName: "Vennligst skriv inn brukernavnet ditt",
962
- messageEmptyPassword: "Vennligst skriv inn passordet ditt",
963
- messageEmptyBoth: "Vennligst skriv inn brukernavn og passord",
964
- messageEmptyEmail: "Vennligst skriv inn e-postadressen din",
965
- messageInvalidEmail: "Vennligst skriv inn en gyldig e-postadresse",
966
- digitsEmpty: "Vennligst skriv inn koden din",
967
- digitsInvalid: "Vennligst skriv inn en gyldig kode",
968
- messageLoginFailed:
969
- "Innlogging mislyktes, vennligst sjekk informasjonen din.",
970
- messageForbidden:
971
- "Innloggingen var vellykket, men du har ikke tillatelse. Du <b>kan ikke</b> logge inn.<br>Du kan velge en annen bruker eller kontakte administratoren.",
972
- messageSomethingWentWrong:
973
- "Noe gikk galt, vennligst prøv igjen senere.",
974
- messageThisFormIsNotConfigured: "Dette skjemaet er ikke konfigurert.",
975
- messagePasswordResetDisabled:
976
- "Denne funksjonen fungerer ikke fordi<br>tofaktorautentisering er aktivert på kontoen din. Kontakt administratoren.",
977
- };
978
-
979
- case "cs": // Czech
980
- return {
981
- username: "Uživatelské jméno nebo e-mail",
982
- password: "Heslo",
983
- login: "Přihlásit se",
984
- forgotPasswordLink: "Zapomněli jste heslo?",
985
- mailAddress: "E-mailová adresa",
986
- requestLink: "Požádat o odkaz",
987
- digits: "Kód",
988
- loginLink: "Přihlásit se",
989
- secondFactor: "Dvoufázový kód",
990
- sendDigits: "Odeslat kód",
991
- sendSecondFactorDigits: "Odeslat kód",
992
- resetLoginProcess: "Zpět na přihlášení",
993
- messageEmptyUserName: "Zadejte své uživatelské jméno",
994
- messageEmptyPassword: "Zadejte své heslo",
995
- messageEmptyBoth: "Zadejte své uživatelské jméno a heslo",
996
- messageEmptyEmail: "Zadejte svou e-mailovou adresu",
997
- messageInvalidEmail: "Zadejte platnou e-mailovou adresu",
998
- digitsEmpty: "Zadejte svůj kód",
999
- digitsInvalid: "Zadejte platný kód",
1000
- messageLoginFailed: "Přihlášení se nezdařilo, zkontrolujte své údaje.",
1001
- messageForbidden:
1002
- "Přihlášení bylo úspěšné, ale nemáte oprávnění. Nemůžete se přihlásit.<br>Vyberte jiného uživatele nebo kontaktujte správce.",
1003
- messageSomethingWentWrong: "Něco se pokazilo, zkuste to později.",
1004
- messageThisFormIsNotConfigured: "Tento formulář není nakonfigurován.",
1005
- messagePasswordResetDisabled:
1006
- "Tato funkce nefunguje, protože je na vašem<br>účtu aktivováno dvoufaktorové ověřování. Kontaktujte správce.",
1007
- };
1008
-
1009
- default:
1010
- return {
1011
- username: "Username or E-Mail",
1012
- password: "Password",
1013
- login: "Login",
1014
- forgotPasswordLink: "Forgot Password?",
1015
- mailAddress: "E-Mail-Address",
1016
- requestLink: "Request Link",
1017
- digits: "Code",
1018
- loginLink: "Login",
1019
- secondFactor: "Second Factor Code",
1020
- sendDigits: "Send Code",
1021
- sendSecondFactorDigits: "Send Code",
1022
- resetLoginProcess: "Back to Login",
1023
- messageEmptyUserName: "Please enter your username",
1024
- messageEmptyPassword: "Please enter your password",
1025
- messageEmptyBoth: "Please enter your username and password",
1026
- messageEmptyEmail: "Please enter your email address",
1027
- messageInvalidEmail: "Please enter a valid email address",
1028
- digitsEmpty: "Please enter your code",
1029
- digitsInvalid: "Please enter a valid code",
1030
- messageLoginFailed: "Login failed, please check your input.",
1031
- messageForbidden:
1032
- "Login was successful, but you have no permission. You <b>cannot</b> login.<br>You can select another user or contact the administrator.",
1033
- messageSomethingWentWrong:
1034
- "Something went wrong, please try again later.",
1035
- messageThisFormIsNotConfigured: "This form is not configured.",
1036
- messagePasswordResetDisabled:
1037
- "This function does not work because two-factor<br>authentication is enabled on your account.<br>Please contact the administrator.",
1038
- };
1039
- }
456
+ const locale = getLocaleOfDocument();
457
+ switch (locale.language) {
458
+ case "de":
459
+ return {
460
+ username: "Benutzername oder E-Mail",
461
+ password: "Passwort",
462
+ login: "Anmelden",
463
+ forgotPasswordLink: "Passwort vergessen?",
464
+ mailAddress: "E-Mail-Adresse",
465
+ requestLink: "Code anfordern",
466
+ digits: "Code",
467
+ loginLink: "Anmelden",
468
+ secondFactor: "Zweiter Faktor Code",
469
+ sendDigits: "Code senden",
470
+ sendSecondFactorDigits: "Code senden",
471
+ resetLoginProcess: "Zurück zum Login",
472
+ messageEmptyUserName: "Bitte geben Sie Ihren Benutzernamen ein",
473
+ messageEmptyPassword: "Bitte geben Sie Ihr Passwort ein",
474
+ messageEmptyBoth:
475
+ "Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein",
476
+ messageEmptyEmail: "Bitte geben Sie Ihre E-Mail-Adresse ein",
477
+ messageInvalidEmail: "Bitte geben Sie eine gültige E-Mail-Adresse ein",
478
+ digitsEmpty: "Bitte geben Sie Ihren Code ein",
479
+ digitsInvalid: "Bitte geben Sie einen gültigen Code ein",
480
+ messageLoginFailed:
481
+ "Anmeldung fehlgeschlagen, bitte überprüfen Sie Ihre Eingaben.",
482
+ messageForbidden:
483
+ "Die Anmeldung war erfolgreich, aber Sie haben keine Berechtigung. Sie können sich <b>nicht</b> anmelden.<br>Sie können einen anderen Benutzer auswählen oder sich an den Administrator wenden.",
484
+ messageSomethingWentWrong:
485
+ "Etwas ist schief gelaufen, bitte versuchen Sie es später erneut",
486
+ messageThisFormIsNotConfigured:
487
+ "Dieses Formular ist nicht konfiguriert.",
488
+ messagePasswordResetDisabled:
489
+ "Sie können keinen Code anfordern, da die<br>Zwei-Faktor-Authentifizierung bei Ihrem Konto aktiviert ist.<br>Bitte kontaktieren Sie den Administrator.",
490
+ };
491
+ case "es":
492
+ return {
493
+ username: "Nombre de usuario o correo electrónico",
494
+ password: "Contraseña",
495
+ login: "Iniciar sesión",
496
+ forgotPasswordLink: "¿Olvidaste tu contraseña?",
497
+ mailAddress: "Dirección de correo electrónico",
498
+ requestLink: "Solicitar enlace",
499
+ digits: "Código",
500
+ loginLink: "Iniciar sesión",
501
+ secondFactor: "Código de segundo factor",
502
+ sendDigits: "Enviar código",
503
+ sendSecondFactorDigits: "Enviar código",
504
+ resetLoginProcess: "Volver al inicio de sesión",
505
+ messageEmptyUserName: "Por favor ingrese su nombre de usuario",
506
+ messageEmptyPassword: "Por favor ingrese su contraseña",
507
+ messageEmptyBoth: "Por favor ingrese su nombre de usuario y contraseña",
508
+ messageEmptyEmail:
509
+ "Por favor ingrese su dirección de correo electrónico",
510
+ messageInvalidEmail:
511
+ "Por favor ingrese una dirección de correo electrónico válida",
512
+ digitsEmpty: "Por favor ingrese su código",
513
+ digitsInvalid: "Por favor ingrese un código válido",
514
+ messageLoginFailed:
515
+ "Error al iniciar sesión, por favor verifique sus datos.",
516
+ messageForbidden:
517
+ "El inicio de sesión fue exitoso, pero no tienes permisos. <b>No puedes</b> iniciar sesión.<br>Puedes seleccionar otro usuario o contactar al administrador.",
518
+ messageSomethingWentWrong:
519
+ "Algo salió mal, por favor intenta de nuevo más tarde.",
520
+ messageThisFormIsNotConfigured: "Este formulario no está configurado.",
521
+ messagePasswordResetDisabled:
522
+ "Esta función no funciona porque la autenticación de dos factores está activada en su cuenta. Por favor, póngase en contacto con el administrador.",
523
+ };
524
+ case "zh":
525
+ return {
526
+ username: "用户名或电子邮箱",
527
+ password: "密码",
528
+ login: "登录",
529
+ forgotPasswordLink: "忘记密码?",
530
+ mailAddress: "电子邮件地址",
531
+ requestLink: "请求链接",
532
+ digits: "验证码",
533
+ loginLink: "登录",
534
+ secondFactor: "二次验证码",
535
+ sendDigits: "发送验证码",
536
+ sendSecondFactorDigits: "发送验证码",
537
+ resetLoginProcess: "返回登录",
538
+ messageEmptyUserName: "请输入用户名",
539
+ messageEmptyPassword: "请输入密码",
540
+ messageEmptyBoth: "请输入用户名和密码",
541
+ messageEmptyEmail: "请输入电子邮件地址",
542
+ messageInvalidEmail: "请输入有效的电子邮件地址",
543
+ digitsEmpty: "请输入验证码",
544
+ digitsInvalid: "请输入有效的验证码",
545
+ messageLoginFailed: "登录失败,请检查您的输入。",
546
+ messageForbidden:
547
+ "登录成功,但您没有权限。您<b>不能</b>登录。<br>您可以选择其他用户或联系管理员。",
548
+ messageSomethingWentWrong: "出了点问题,请稍后再试。",
549
+ messageThisFormIsNotConfigured: "此表单尚未配置。",
550
+ messagePasswordResetDisabled:
551
+ "此功能无法使用,因为您的帐户启用了二因素身份验证。请联系管理员。",
552
+ };
553
+
554
+ case "hi":
555
+ return {
556
+ username: "उपयगकर नम य ई-मल",
557
+ password: "पसवर",
558
+ login: "लग इन कर",
559
+ forgotPasswordLink: "पसवर भल गए?",
560
+ mailAddress: "ई-मल पत",
561
+ requestLink: "लक क अनरध कर",
562
+ digits: "कड",
563
+ loginLink: "लग इन कर",
564
+ secondFactor: "दसर फकर कड",
565
+ sendDigits: "कड भज",
566
+ sendSecondFactorDigits: "कड भज",
567
+ resetLoginProcess: "लगन पर वपस जए",
568
+ messageEmptyUserName: "कपय अपन उपयगकर नम दर कर",
569
+ messageEmptyPassword: "कपय अपन पसवर दर कर",
570
+ messageEmptyBoth: "कपय अपन उपयगकर नम और पसवर दर कर",
571
+ messageEmptyEmail: "कपय अपन ई-मल पत दर कर",
572
+ messageInvalidEmail: "कपय एक वध ई-मल पत दर कर",
573
+ digitsEmpty: "कपय अपन कड दर कर",
574
+ digitsInvalid: "कपय एक वध कड दर कर",
575
+ messageLoginFailed: "लगन वफल हआ, कपय अपन जनकर क जच कर।",
576
+ messageForbidden:
577
+ "लगन सफल रह लकन आपक पस अनमत नह ह। आप <b>लगन नह</b> कर सकत।<br>आप दसर उपयगकर चन सकत ह य पशसक स सपर कर सकत ह।",
578
+ messageSomethingWentWrong: "कछ गलत हआ, कपय बद म पन पयस कर।",
579
+ messageThisFormIsNotConfigured: "यह फर कनगर नह ह।",
580
+ messagePasswordResetDisabled:
581
+ "यह सवध कम नह करत कक आपक खत म द घटक पमणकरण सकम ह। कपय पशसक स सपर कर।",
582
+ };
583
+
584
+ case "bn":
585
+ return {
586
+ username: "ইউজরনম ব ই-মইল",
587
+ password: "পসওযর",
588
+ login: "লগইন করন",
589
+ forgotPasswordLink: "পসওযর ভল গছন?",
590
+ mailAddress: "ই-মইল ঠকন",
591
+ requestLink: "লক অনরধ করন",
592
+ digits: "কড",
593
+ loginLink: "লগইন করন",
594
+ secondFactor: "দতয ফকর কড",
595
+ sendDigits: "কড পঠন",
596
+ sendSecondFactorDigits: "কড পঠন",
597
+ resetLoginProcess: "লগইন ফর যন",
598
+ messageEmptyUserName: "দয কর আপনর ইউজরনম লখন",
599
+ messageEmptyPassword: "দয কর আপনর পসওযর লখন",
600
+ messageEmptyBoth: "দয কর আপনর ইউজরনম এব পসওযর লখন",
601
+ messageEmptyEmail: "দয কর আপনর ই-মইল ঠকন লখন",
602
+ messageInvalidEmail: "দয কর একট বধ ই-মইল ঠকন লখন",
603
+ digitsEmpty: "দয কর আপনর কড লখন",
604
+ digitsInvalid: "দয কর একট বধ কড লখন",
605
+ messageLoginFailed: "লগইন বর হযছ, দয কর আপনর ইনপট পরক করন।",
606
+ messageForbidden:
607
+ "লগইন সফল হযছ, কন আপনর অনমত নই। আপন <b>লগইন করত পরবন ন</b>।<br>আপন অন ইউজর নরচন করত পরন অথব অযডমনসটরর সথ যগযগ করত পরন।",
608
+ messageSomethingWentWrong: "কছ ভল হযছ, দয কর পর আবর চষ করন।",
609
+ messageThisFormIsNotConfigured: "এই ফরট কনফগর কর হযন।",
610
+ messagePasswordResetDisabled:
611
+ "এই ফশনট করকর নয করণ আপনর অযকউন দট ফকর পমণকরণ সকয কর আছ। দয কর পশসকর সথ যগযগ করন।",
612
+ };
613
+
614
+ case "pt": // Portuguese
615
+ return {
616
+ username: "Nome de usuário ou e-mail",
617
+ password: "Senha",
618
+ login: "Entrar",
619
+ forgotPasswordLink: "Esqueceu a senha?",
620
+ mailAddress: "Endereço de e-mail",
621
+ requestLink: "Solicitar link",
622
+ digits: "Código",
623
+ loginLink: "Entrar",
624
+ secondFactor: "Código do segundo fator",
625
+ sendDigits: "Enviar código",
626
+ sendSecondFactorDigits: "Enviar código",
627
+ resetLoginProcess: "Voltar ao login",
628
+ messageEmptyUserName: "Por favor, insira seu nome de usuário",
629
+ messageEmptyPassword: "Por favor, insira sua senha",
630
+ messageEmptyBoth: "Por favor, insira seu nome de usuário e senha",
631
+ messageEmptyEmail: "Por favor, insira seu endereço de e-mail",
632
+ messageInvalidEmail: "Por favor, insira um endereço de e-mail válido",
633
+ digitsEmpty: "Por favor, insira seu código",
634
+ digitsInvalid: "Por favor, insira um código válido",
635
+ messageLoginFailed: "Falha no login, verifique suas informações.",
636
+ messageForbidden:
637
+ "Login foi bem-sucedido, mas você não tem permissão. Você <b>não pode</b> entrar.<br>Você pode escolher outro usuário ou entrar em contato com o administrador.",
638
+ messageSomethingWentWrong:
639
+ "Algo deu errado, tente novamente mais tarde.",
640
+ messageThisFormIsNotConfigured: "Este formulário não está configurado.",
641
+ messagePasswordResetDisabled:
642
+ "Esta função não funciona porque a autenticação de dois fatores<br>está ativada em sua conta. Por favor, entre em contato com o administrador.",
643
+ };
644
+
645
+ case "ru": // Russian
646
+ return {
647
+ username: "Имя пользователя или электронная почта",
648
+ password: "Пароль",
649
+ login: "Войти",
650
+ forgotPasswordLink: "Забыли пароль?",
651
+ mailAddress: "Адрес электронной почты",
652
+ requestLink: "Запросить ссылку",
653
+ digits: "Код",
654
+ loginLink: "Войти",
655
+ secondFactor: "Код второго фактора",
656
+ sendDigits: "Отправить код",
657
+ sendSecondFactorDigits: "Отправить код",
658
+ resetLoginProcess: "Вернуться к входу",
659
+ messageEmptyUserName: "Пожалуйста, введите имя пользователя",
660
+ messageEmptyPassword: "Пожалуйста, введите пароль",
661
+ messageEmptyBoth: "Пожалуйста, введите имя пользователя и пароль",
662
+ messageEmptyEmail: "Пожалуйста, введите адрес электронной почты",
663
+ messageInvalidEmail:
664
+ "Пожалуйста, введите действительный адрес электронной почты",
665
+ digitsEmpty: "Пожалуйста, введите код",
666
+ digitsInvalid: "Пожалуйста, введите действительный код",
667
+ messageLoginFailed: "Ошибка входа, проверьте введенные данные.",
668
+ messageForbidden:
669
+ "Вход выполнен, но у вас нет прав. Вы <b>не можете</b> войти.<br>Вы можете выбрать другого пользователя или связаться с администратором.",
670
+ messageSomethingWentWrong: "Что-то пошло не так, попробуйте позже.",
671
+ messageThisFormIsNotConfigured: "Эта форма не настроена.",
672
+ messagePasswordResetDisabled:
673
+ "Эта функция не работает, потому что двухфакторная аутентификация<br> включена в вашей учетной записи. Пожалуйста, свяжитесь с администратором.",
674
+ };
675
+
676
+ case "ja": // Japanese
677
+ return {
678
+ username: "ユーザー名またはメールアドレス",
679
+ password: "パスワード",
680
+ login: "ログイン",
681
+ forgotPasswordLink: "パスワードを忘れましたか?",
682
+ mailAddress: "メールアドレス",
683
+ requestLink: "リンクをリクエスト",
684
+ digits: "コード",
685
+ loginLink: "ログイン",
686
+ secondFactor: "二要素コード",
687
+ sendDigits: "コードを送信",
688
+ sendSecondFactorDigits: "コードを送信",
689
+ resetLoginProcess: "ログインに戻る",
690
+ messageEmptyUserName: "ユーザー名を入力してください",
691
+ messageEmptyPassword: "パスワードを入力してください",
692
+ messageEmptyBoth: "ユーザー名とパスワードを入力してください",
693
+ messageEmptyEmail: "メールアドレスを入力してください",
694
+ messageInvalidEmail: "有効なメールアドレスを入力してください",
695
+ digitsEmpty: "コードを入力してください",
696
+ digitsInvalid: "有効なコードを入力してください",
697
+ messageLoginFailed:
698
+ "ログインに失敗しました。入力内容をご確認ください。",
699
+ messageForbidden:
700
+ "ログイン成功しましたが、権限がありません。<b>ログインできません</b>。<br>他のユーザーを選択するか、管理者に連絡してください。",
701
+ messageSomethingWentWrong:
702
+ "問題が発生しました。後でもう一度お試しください。",
703
+ messageThisFormIsNotConfigured: "このフォームは設定されていません。",
704
+ messagePasswordResetDisabled:
705
+ "この機能は使用できません。アカウントで二要素認証が有効になっているため、管理者に連絡してください。",
706
+ };
707
+
708
+ case "pa": // Western Punjabi
709
+ return {
710
+ username: "ਵਰਤਕਰ ਨਮ ਜ ਈ-ਮਲ",
711
+ password: "ਪਸਵਰਡ",
712
+ login: "ਲਗਨ ਕਰ",
713
+ forgotPasswordLink: "ਪਸਵਰਡ ਭਲ ਗਏ?",
714
+ mailAddress: "ਈ-ਮਲ ਪਤ",
715
+ requestLink: "ਲਕ ਦ ਬਨਤ ਕਰ",
716
+ digits: "ਕਡ",
717
+ loginLink: "ਲਗਨ ਕਰ",
718
+ secondFactor: "ਦਜ ਫਕਟਰ ਕਡ",
719
+ sendDigits: "ਕਡ ਭਜ",
720
+ sendSecondFactorDigits: "ਕਡ ਭਜ",
721
+ resetLoginProcess: "ਲਗਨ 'ਤ ਵਪਸ ਜਓ",
722
+ messageEmptyUserName: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਦਰਜ ਕਰ",
723
+ messageEmptyPassword: "ਕਰਪ ਕਰਕ ਆਪਣ ਪਸਵਰਡ ਦਰਜ ਕਰ",
724
+ messageEmptyBoth: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਤ ਪਸਵਰਡ ਦਰਜ ਕਰ",
725
+ messageEmptyEmail: "ਕਰਪ ਕਰਕ ਆਪਣ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
726
+ messageInvalidEmail: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
727
+ digitsEmpty: "ਕਰਪ ਕਰਕ ਆਪਣ ਕਡ ਦਰਜ ਕਰ",
728
+ digitsInvalid: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਕਡ ਦਰਜ ਕਰ",
729
+ messageLoginFailed: "ਲਗਨ ਅਸਫਲ ਹਇਆ, ਕਰਪ ਕਰਕ ਆਪਣ ਜਣਕਰ ਦ ਜਚ ਕਰ।",
730
+ messageForbidden:
731
+ "ਲਗਨ ਸਫਲ ਹਇਆ, ਪਰ ਤਹਡ ਕਲ ਅਧਕਰ ਨਹ ਹਨ। ਤਸ <b>ਲਗਨ ਨਹ</b> ਕਰ ਸਕਦ।<br>ਤਸ ਹਰ ਵਰਤਕਰ ਚਣ सकत ਹ ਜ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ ਸਕਦ ਹ।",
732
+ messageSomethingWentWrong: "ਕਝ ਗਲਤ ਹ ਗਆ, ਕਰਪ ਕਰਕ ਬਅਦ ਵਚ ਮੜ ਕਸਸ ਕਰ।",
733
+ messageThisFormIsNotConfigured: "ਇਸ ਫਰਮ ਨ ਸਰਚਤ ਨਹ ਕਤ ਗਆ ਹ।",
734
+ messagePasswordResetDisabled:
735
+ "ਇਹ ਫਕਸਨ ਕਮ ਨਹ ਕਰਦ ਕਉਕ ਤਹਡ ਖਤ ਵਚ ਦ ਫਕਟਰ ਪਰਮਣਕਰਣ ਸਰਗਰਮ ਹ। ਕਰਪ ਕਰਕ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ।",
736
+ };
737
+
738
+ case "mr": // Marathi
739
+ return {
740
+ username: "वपरकरनव कव ईमल",
741
+ password: "सकतशब",
742
+ login: "पवश कर",
743
+ forgotPasswordLink: "सकतशब वसरलत क?",
744
+ mailAddress: "ईमल पत",
745
+ requestLink: "लकच वनत कर",
746
+ digits: "कड",
747
+ loginLink: "पवश कर",
748
+ secondFactor: "दसर घटक कड",
749
+ sendDigits: "कड पठव",
750
+ sendSecondFactorDigits: "कड पठव",
751
+ resetLoginProcess: "पवशवर परत ज",
752
+ messageEmptyUserName: "कपय आपल वपरकरनव पवष कर",
753
+ messageEmptyPassword: "कपय आपल सकतशब पवष कर",
754
+ messageEmptyBoth: "कपय आपल वपरकरनव आण सकतशब पवष कर",
755
+ messageEmptyEmail: "कपय आपल ईमल पत पवष कर",
756
+ messageInvalidEmail: "कपय वध ईमल पत पवष कर",
757
+ digitsEmpty: "कपय आपल कड पवष कर",
758
+ digitsInvalid: "कपय वध कड पवष कर",
759
+ messageLoginFailed: "पवश अयशस, कपय आपल महत तपस.",
760
+ messageForbidden:
761
+ "पवश यशस झल, परत आपलकड परवन नह. आपण <b>पवश कर शकत नह</b>.<br>आपण दसर वपरकर नवड शकत कव ववसपकश सपर सध शकत.",
762
+ messageSomethingWentWrong: "कहतर चकल, कपय नतर पन पयत कर.",
763
+ messageThisFormIsNotConfigured: "ह फर सरचत कलल नह.",
764
+ messagePasswordResetDisabled:
765
+ "य करच कमगर करत नह करण आपल खतत दन घटक पमणकरण सकय कल आह. कपय ववसपकश सपर सध.",
766
+ };
767
+
768
+ case "fr": // French
769
+ return {
770
+ username: "Nom d'utilisateur ou e-mail",
771
+ password: "Mot de passe",
772
+ login: "Connexion",
773
+ forgotPasswordLink: "Mot de passe oublié ?",
774
+ mailAddress: "Adresse e-mail",
775
+ requestLink: "Demander un lien",
776
+ digits: "Code",
777
+ loginLink: "Connexion",
778
+ secondFactor: "Code du deuxième facteur",
779
+ sendDigits: "Envoyer le code",
780
+ sendSecondFactorDigits: "Envoyer le code",
781
+ resetLoginProcess: "Retour à la connexion",
782
+ messageEmptyUserName: "Veuillez entrer votre nom d'utilisateur",
783
+ messageEmptyPassword: "Veuillez entrer votre mot de passe",
784
+ messageEmptyBoth:
785
+ "Veuillez entrer votre nom d'utilisateur et votre mot de passe",
786
+ messageEmptyEmail: "Veuillez entrer votre adresse e-mail",
787
+ messageInvalidEmail: "Veuillez entrer une adresse e-mail valide",
788
+ digitsEmpty: "Veuillez entrer votre code",
789
+ digitsInvalid: "Veuillez entrer un code valide",
790
+ messageLoginFailed:
791
+ "Échec de la connexion, veuillez vérifier vos informations.",
792
+ messageForbidden:
793
+ "La connexion a réussi, mais vous n'avez pas les permissions. Vous <b>ne pouvez pas</b> vous connecter.<br>Vous pouvez choisir un autre utilisateur ou contacter l'administrateur.",
794
+ messageSomethingWentWrong:
795
+ "Une erreur s'est produite, veuillez réessayer plus tard.",
796
+ messageThisFormIsNotConfigured: "Ce formulaire n'est pas configuré.",
797
+ messagePasswordResetDisabled:
798
+ "Cette fonctionnalité ne fonctionne pas car l'authentification à deux facteurs est activée sur<br>votre compte. Veuillez contacter l'administrateur.",
799
+ };
800
+
801
+ case "it": // Italian
802
+ return {
803
+ username: "Nome utente o e-mail",
804
+ password: "Password",
805
+ login: "Accedi",
806
+ forgotPasswordLink: "Password dimenticata?",
807
+ mailAddress: "Indirizzo e-mail",
808
+ requestLink: "Richiedi link",
809
+ digits: "Codice",
810
+ loginLink: "Accedi",
811
+ secondFactor: "Codice a due fattori",
812
+ sendDigits: "Invia codice",
813
+ sendSecondFactorDigits: "Invia codice",
814
+ resetLoginProcess: "Torna al login",
815
+ messageEmptyUserName: "Per favore, inserisci il tuo nome utente",
816
+ messageEmptyPassword: "Per favore, inserisci la tua password",
817
+ messageEmptyBoth:
818
+ "Per favore, inserisci il tuo nome utente e la tua password",
819
+ messageEmptyEmail: "Per favore, inserisci il tuo indirizzo e-mail",
820
+ messageInvalidEmail: "Per favore, inserisci un indirizzo e-mail valido",
821
+ digitsEmpty: "Per favore, inserisci il tuo codice",
822
+ digitsInvalid: "Per favore, inserisci un codice valido",
823
+ messageLoginFailed: "Accesso fallito, verifica i tuoi dati.",
824
+ messageForbidden:
825
+ "Accesso riuscito, ma non hai i permessi. Non puoi accedere.<br>Puoi scegliere un altro account o contattare l'amministratore.",
826
+ messageSomethingWentWrong:
827
+ "Qualcosa è andato storto, riprova più tardi.",
828
+ messageThisFormIsNotConfigured: "Questo modulo non è configurato.",
829
+ messagePasswordResetDisabled:
830
+ "Questa funzione non funziona perché l'autenticazione a due<br>fattori è attiva sul tuo account. Contatta l'amministratore.",
831
+ };
832
+
833
+ case "nl": // Dutch
834
+ return {
835
+ username: "Gebruikersnaam of e-mail",
836
+ password: "Wachtwoord",
837
+ login: "Inloggen",
838
+ forgotPasswordLink: "Wachtwoord vergeten?",
839
+ mailAddress: "E-mailadres",
840
+ requestLink: "Link aanvragen",
841
+ digits: "Code",
842
+ loginLink: "Inloggen",
843
+ secondFactor: "Tweede factor code",
844
+ sendDigits: "Code verzenden",
845
+ sendSecondFactorDigits: "Code verzenden",
846
+ resetLoginProcess: "Terug naar inloggen",
847
+ messageEmptyUserName: "Voer uw gebruikersnaam in",
848
+ messageEmptyPassword: "Voer uw wachtwoord in",
849
+ messageEmptyBoth: "Voer uw gebruikersnaam en wachtwoord in",
850
+ messageEmptyEmail: "Voer uw e-mailadres in",
851
+ messageInvalidEmail: "Voer een geldig e-mailadres in",
852
+ digitsEmpty: "Voer uw code in",
853
+ digitsInvalid: "Voer een geldige code in",
854
+ messageLoginFailed: "Inloggen mislukt, controleer uw gegevens.",
855
+ messageForbidden:
856
+ "Inloggen geslaagd, maar u heeft geen permissies. U <b>kunt niet</b> inloggen.<br>U kunt een andere gebruiker selecteren of de beheerder contacteren.",
857
+ messageSomethingWentWrong:
858
+ "Er is iets fout gegaan, probeer het later opnieuw.",
859
+ messageThisFormIsNotConfigured: "Dit formulier is niet geconfigureerd.",
860
+ messagePasswordResetDisabled:
861
+ "Deze functie werkt niet omdat tweefactorauthenticatie is<br>ingeschakeld op uw account. Neem contact op met de beheerder.",
862
+ };
863
+
864
+ case "sv": // Swedish
865
+ return {
866
+ username: "Användarnamn eller e-post",
867
+ password: "Lösenord",
868
+ login: "Logga in",
869
+ forgotPasswordLink: "Glömt lösenord?",
870
+ mailAddress: "E-postadress",
871
+ requestLink: "Begär länk",
872
+ digits: "Kod",
873
+ loginLink: "Logga in",
874
+ secondFactor: "Tvåfaktorkod",
875
+ sendDigits: "Skicka kod",
876
+ sendSecondFactorDigits: "Skicka kod",
877
+ resetLoginProcess: "Tillbaka till inloggning",
878
+ messageEmptyUserName: "Ange ditt användarnamn",
879
+ messageEmptyPassword: "Ange ditt lösenord",
880
+ messageEmptyBoth: "Ange ditt användarnamn och lösenord",
881
+ messageEmptyEmail: "Ange din e-postadress",
882
+ messageInvalidEmail: "Ange en giltig e-postadress",
883
+ digitsEmpty: "Ange din kod",
884
+ digitsInvalid: "Ange en giltig kod",
885
+ messageLoginFailed:
886
+ "Inloggning misslyckades, kontrollera dina uppgifter.",
887
+ messageForbidden:
888
+ "Inloggningen lyckades, men du har inte behörighet. Du <b>kan inte</b> logga in.<br>Du kan välja en annan användare eller kontakta administratören.",
889
+ messageSomethingWentWrong: "Något gick fel, försök igen senare.",
890
+ messageThisFormIsNotConfigured: "Detta formulär är inte konfigurerat.",
891
+ messagePasswordResetDisabled:
892
+ "Denna funktion fungerar inte eftersom tvåfaktorsautentisering är aktiverad på ditt konto. Kontakta administratören.",
893
+ };
894
+
895
+ case "pl": // Polish
896
+ return {
897
+ username: "Nazwa użytkownika lub e-mail",
898
+ password: "Hasło",
899
+ login: "Zaloguj się",
900
+ forgotPasswordLink: "Zapomniałeś hasła?",
901
+ mailAddress: "Adres e-mail",
902
+ requestLink: "Zażądaj linku",
903
+ digits: "Kod",
904
+ loginLink: "Zaloguj się",
905
+ secondFactor: "Kod drugiego czynnika",
906
+ sendDigits: "Wyślij kod",
907
+ sendSecondFactorDigits: "Wyślij kod",
908
+ resetLoginProcess: "Powrót do logowania",
909
+ messageEmptyUserName: "Wprowadź swoją nazwę użytkownika",
910
+ messageEmptyPassword: "Wprowadź swoje hasło",
911
+ messageEmptyBoth: "Wprowadź swoją nazwę użytkownika i hasło",
912
+ messageEmptyEmail: "Wprowadź swój adres e-mail",
913
+ messageInvalidEmail: "Wprowadź prawidłowy adres e-mail",
914
+ digitsEmpty: "Wprowadź swój kod",
915
+ digitsInvalid: "Wprowadź prawidłowy kod",
916
+ messageLoginFailed: "Logowanie nie powiodło się, sprawdź swoje dane.",
917
+ messageForbidden:
918
+ "Logowanie powiodło się, ale nie masz uprawnień. <b>Nie możesz</b> się zalogować.<br>Możesz wybrać innego użytkownika lub skontaktować się z administratorem.",
919
+ messageSomethingWentWrong:
920
+ "Coś poszło nie tak, spróbuj ponownie później.",
921
+ messageThisFormIsNotConfigured:
922
+ "Ten formularz nie jest skonfigurowany.",
923
+ messagePasswordResetDisabled:
924
+ "Ta funkcja nie działa, ponieważ włączona jest autoryzacja dwuetapowa na twoim koncie. Skontaktuj się z administratorem.",
925
+ };
926
+
927
+ case "da": // Danish
928
+ return {
929
+ username: "Brugernavn eller e-mail",
930
+ password: "Adgangskode",
931
+ login: "Log ind",
932
+ forgotPasswordLink: "Glemt adgangskode?",
933
+ mailAddress: "E-mail-adresse",
934
+ requestLink: "Anmod om link",
935
+ digits: "Kode",
936
+ loginLink: "Log ind",
937
+ secondFactor: "Tofaktorkode",
938
+ sendDigits: "Send kode",
939
+ sendSecondFactorDigits: "Send kode",
940
+ resetLoginProcess: "Tilbage til log ind",
941
+ messageEmptyUserName: "Indtast dit brugernavn",
942
+ messageEmptyPassword: "Indtast din adgangskode",
943
+ messageEmptyBoth: "Indtast dit brugernavn og din adgangskode",
944
+ messageEmptyEmail: "Indtast din e-mail-adresse",
945
+ messageInvalidEmail: "Indtast en gyldig e-mail-adresse",
946
+ digitsEmpty: "Indtast din kode",
947
+ digitsInvalid: "Indtast en gyldig kode",
948
+ messageLoginFailed: "Login mislykkedes, kontrollér dine oplysninger.",
949
+ messageForbidden:
950
+ "Login lykkedes, men du har ikke tilladelse. Du <b>kan ikke</b> logge ind.<br>Du kan vælge en anden bruger eller kontakte administratoren.",
951
+ messageSomethingWentWrong: "Noget gik galt, prøv igen senere.",
952
+ messageThisFormIsNotConfigured: "Denne formular er ikke konfigureret.",
953
+ messagePasswordResetDisabled:
954
+ "Denne funktion fungerer ikke, fordi tofaktorautentificering<br>er aktiveret på din konto. Kontakt administratoren.",
955
+ };
956
+
957
+ case "no": // Norwegian
958
+ return {
959
+ username: "Brukernavn eller e-post",
960
+ password: "Passord",
961
+ login: "Logg inn",
962
+ forgotPasswordLink: "Glemt passord?",
963
+ mailAddress: "E-postadresse",
964
+ requestLink: "Be om lenke",
965
+ digits: "Kode",
966
+ loginLink: "Logg inn",
967
+ secondFactor: "Tofaktorkode",
968
+ sendDigits: "Send kode",
969
+ sendSecondFactorDigits: "Send kode",
970
+ resetLoginProcess: "Tilbake til innlogging",
971
+ messageEmptyUserName: "Vennligst skriv inn brukernavnet ditt",
972
+ messageEmptyPassword: "Vennligst skriv inn passordet ditt",
973
+ messageEmptyBoth: "Vennligst skriv inn brukernavn og passord",
974
+ messageEmptyEmail: "Vennligst skriv inn e-postadressen din",
975
+ messageInvalidEmail: "Vennligst skriv inn en gyldig e-postadresse",
976
+ digitsEmpty: "Vennligst skriv inn koden din",
977
+ digitsInvalid: "Vennligst skriv inn en gyldig kode",
978
+ messageLoginFailed:
979
+ "Innlogging mislyktes, vennligst sjekk informasjonen din.",
980
+ messageForbidden:
981
+ "Innloggingen var vellykket, men du har ikke tillatelse. Du <b>kan ikke</b> logge inn.<br>Du kan velge en annen bruker eller kontakte administratoren.",
982
+ messageSomethingWentWrong:
983
+ "Noe gikk galt, vennligst prøv igjen senere.",
984
+ messageThisFormIsNotConfigured: "Dette skjemaet er ikke konfigurert.",
985
+ messagePasswordResetDisabled:
986
+ "Denne funksjonen fungerer ikke fordi<br>tofaktorautentisering er aktivert på kontoen din. Kontakt administratoren.",
987
+ };
988
+
989
+ case "cs": // Czech
990
+ return {
991
+ username: "Uživatelské jméno nebo e-mail",
992
+ password: "Heslo",
993
+ login: "Přihlásit se",
994
+ forgotPasswordLink: "Zapomněli jste heslo?",
995
+ mailAddress: "E-mailová adresa",
996
+ requestLink: "Požádat o odkaz",
997
+ digits: "Kód",
998
+ loginLink: "Přihlásit se",
999
+ secondFactor: "Dvoufázový kód",
1000
+ sendDigits: "Odeslat kód",
1001
+ sendSecondFactorDigits: "Odeslat kód",
1002
+ resetLoginProcess: "Zpět na přihlášení",
1003
+ messageEmptyUserName: "Zadejte své uživatelské jméno",
1004
+ messageEmptyPassword: "Zadejte své heslo",
1005
+ messageEmptyBoth: "Zadejte své uživatelské jméno a heslo",
1006
+ messageEmptyEmail: "Zadejte svou e-mailovou adresu",
1007
+ messageInvalidEmail: "Zadejte platnou e-mailovou adresu",
1008
+ digitsEmpty: "Zadejte svůj kód",
1009
+ digitsInvalid: "Zadejte platný kód",
1010
+ messageLoginFailed: "Přihlášení se nezdařilo, zkontrolujte své údaje.",
1011
+ messageForbidden:
1012
+ "Přihlášení bylo úspěšné, ale nemáte oprávnění. Nemůžete se přihlásit.<br>Vyberte jiného uživatele nebo kontaktujte správce.",
1013
+ messageSomethingWentWrong: "Něco se pokazilo, zkuste to později.",
1014
+ messageThisFormIsNotConfigured: "Tento formulář není nakonfigurován.",
1015
+ messagePasswordResetDisabled:
1016
+ "Tato funkce nefunguje, protože je na vašem<br>účtu aktivováno dvoufaktorové ověřování. Kontaktujte správce.",
1017
+ };
1018
+
1019
+ default:
1020
+ return {
1021
+ username: "Username or E-Mail",
1022
+ password: "Password",
1023
+ login: "Login",
1024
+ forgotPasswordLink: "Forgot Password?",
1025
+ mailAddress: "E-Mail-Address",
1026
+ requestLink: "Request Link",
1027
+ digits: "Code",
1028
+ loginLink: "Login",
1029
+ secondFactor: "Second Factor Code",
1030
+ sendDigits: "Send Code",
1031
+ sendSecondFactorDigits: "Send Code",
1032
+ resetLoginProcess: "Back to Login",
1033
+ messageEmptyUserName: "Please enter your username",
1034
+ messageEmptyPassword: "Please enter your password",
1035
+ messageEmptyBoth: "Please enter your username and password",
1036
+ messageEmptyEmail: "Please enter your email address",
1037
+ messageInvalidEmail: "Please enter a valid email address",
1038
+ digitsEmpty: "Please enter your code",
1039
+ digitsInvalid: "Please enter a valid code",
1040
+ messageLoginFailed: "Login failed, please check your input.",
1041
+ messageForbidden:
1042
+ "Login was successful, but you have no permission. You <b>cannot</b> login.<br>You can select another user or contact the administrator.",
1043
+ messageSomethingWentWrong:
1044
+ "Something went wrong, please try again later.",
1045
+ messageThisFormIsNotConfigured: "This form is not configured.",
1046
+ messagePasswordResetDisabled:
1047
+ "This function does not work because two-factor<br>authentication is enabled on your account.<br>Please contact the administrator.",
1048
+ };
1049
+ }
1040
1050
  }
1041
1051
 
1042
1052
  /**
@@ -1054,46 +1064,46 @@ function getTranslations() {
1054
1064
  * @return {{ value: string, valid: (boolean|undefined), message: (string|undefined), stop: boolean, raw: * }}
1055
1065
  */
1056
1066
  function normalizeCallbackResult(callbackResult, currentValue) {
1057
- const normalized = {
1058
- value: currentValue,
1059
- valid: undefined,
1060
- message: undefined,
1061
- stop: false,
1062
- raw: callbackResult,
1063
- };
1064
-
1065
- if (callbackResult === undefined) {
1066
- return normalized;
1067
- }
1068
-
1069
- if (typeof callbackResult === "string") {
1070
- normalized.value = callbackResult;
1071
- return normalized;
1072
- }
1073
-
1074
- if (callbackResult === false) {
1075
- normalized.valid = false;
1076
- return normalized;
1077
- }
1078
-
1079
- if (callbackResult && typeof callbackResult === "object") {
1080
- if (Object.prototype.hasOwnProperty.call(callbackResult, "value")) {
1081
- normalized.value = callbackResult.value;
1082
- }
1083
- if (Object.prototype.hasOwnProperty.call(callbackResult, "valid")) {
1084
- normalized.valid = callbackResult.valid;
1085
- }
1086
- if (Object.prototype.hasOwnProperty.call(callbackResult, "message")) {
1087
- normalized.message = callbackResult.message;
1088
- }
1089
- if (Object.prototype.hasOwnProperty.call(callbackResult, "stop")) {
1090
- normalized.stop = Boolean(callbackResult.stop);
1091
- }
1092
-
1093
- return normalized;
1094
- }
1095
-
1096
- return normalized;
1067
+ const normalized = {
1068
+ value: currentValue,
1069
+ valid: undefined,
1070
+ message: undefined,
1071
+ stop: false,
1072
+ raw: callbackResult,
1073
+ };
1074
+
1075
+ if (callbackResult === undefined) {
1076
+ return normalized;
1077
+ }
1078
+
1079
+ if (typeof callbackResult === "string") {
1080
+ normalized.value = callbackResult;
1081
+ return normalized;
1082
+ }
1083
+
1084
+ if (callbackResult === false) {
1085
+ normalized.valid = false;
1086
+ return normalized;
1087
+ }
1088
+
1089
+ if (callbackResult && typeof callbackResult === "object") {
1090
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "value")) {
1091
+ normalized.value = callbackResult.value;
1092
+ }
1093
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "valid")) {
1094
+ normalized.valid = callbackResult.valid;
1095
+ }
1096
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "message")) {
1097
+ normalized.message = callbackResult.message;
1098
+ }
1099
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "stop")) {
1100
+ normalized.stop = Boolean(callbackResult.stop);
1101
+ }
1102
+
1103
+ return normalized;
1104
+ }
1105
+
1106
+ return normalized;
1097
1107
  }
1098
1108
 
1099
1109
  /**
@@ -1101,549 +1111,549 @@ function normalizeCallbackResult(callbackResult, currentValue) {
1101
1111
  * @return {initEventHandler}
1102
1112
  */
1103
1113
  function initEventHandler() {
1104
- const self = this;
1105
- const element = this[loginElementSymbol];
1106
-
1107
- const type = "click";
1108
-
1109
- element.addEventListener(type, function (event) {
1110
- const callback = self.getOption("actions.click");
1111
-
1112
- fireCustomEvent(self, "monster-login-clicked", {
1113
- element: self,
1114
- });
1115
-
1116
- if (!isFunction(callback)) {
1117
- return;
1118
- }
1119
-
1120
- const element = findTargetElementFromEvent(
1121
- event,
1122
- ATTRIBUTE_ROLE,
1123
- "control",
1124
- );
1125
-
1126
- if (!(element instanceof Node && self.hasNode(element))) {
1127
- return;
1128
- }
1129
-
1130
- callback.call(self, event);
1131
- });
1132
-
1133
- this[forgotPasswordLinkSymbol].addEventListener(type, (event) => {
1134
- event.preventDefault();
1135
- this[forgotPasswordCollapseSymbol].open();
1136
- setTimeout(() => {
1137
- this.shadowRoot.querySelector("input[name='email']").focus();
1138
- }, 0);
1139
- });
1140
-
1141
- this[loginLinkSymbol].addEventListener(type, (event) => {
1142
- event.preventDefault();
1143
- this[loginCollapseSymbol].open();
1144
-
1145
- setTimeout(() => {
1146
- this.shadowRoot.querySelector("input[name='username']").focus();
1147
- }, 0);
1148
- });
1149
-
1150
- for (const e of this[resetLoginProcessLinksSymbol]) {
1151
- e.addEventListener(type, (event) => {
1152
- event.preventDefault();
1153
- this[loginCollapseSymbol].open();
1154
- setTimeout(() => {
1155
- this.shadowRoot.querySelector("input[name='username']").focus();
1156
- }, 0);
1157
- });
1158
- }
1159
-
1160
- this[loginCollapseSymbol].addEventListener("keydown", (event) => {
1161
- if (event.key === "Enter") {
1162
- this[loginButtonSymbol].click();
1163
- }
1164
- });
1165
-
1166
- this[secondFactorCollapseSymbol].addEventListener("keydown", (event) => {
1167
- if (event.key === "Enter") {
1168
- this[secondFactorButtonSymbol].click();
1169
- }
1170
- });
1171
-
1172
- this[forgotPasswordCollapseSymbol].addEventListener("keydown", (event) => {
1173
- if (event.key === "Enter") {
1174
- this[requestLinkButtonSymbol].click();
1175
- }
1176
- });
1177
-
1178
- this[digitsCollapseSymbol].addEventListener("keydown", (event) => {
1179
- if (event.key === "Enter") {
1180
- this[digitsButtonSymbol].click();
1181
- }
1182
- });
1183
-
1184
- this[loginButtonSymbol].setOption("actions.click", (event) => {
1185
- let username = this.shadowRoot.querySelector(
1186
- "input[name='username']",
1187
- ).value;
1188
-
1189
- // New structured callback handling for username (backwards compatible)
1190
- const userCallback = this.getOption("callbacks.username");
1191
- if (isFunction(userCallback)) {
1192
- const result = normalizeCallbackResult(
1193
- userCallback.call(this, username),
1194
- username,
1195
- );
1196
- username = result.value;
1197
-
1198
- // If callback explicitly marks invalid or wants to stop, handle immediately
1199
- if (result.valid === false || result.stop === true) {
1200
- const timeout = this.getOption("timeoutForMessage");
1201
- const msg =
1202
- result.message || this.getOption("labels.messageEmptyUserName");
1203
-
1204
- this.setOption("classes.usernameInvalid", "invalid");
1205
- this[loginButtonSymbol].setMessage(msg);
1206
- this[loginButtonSymbol].showMessage(timeout);
1207
- this[loginButtonSymbol].setState("failed", timeout);
1208
-
1209
- setTimeout(() => {
1210
- this.shadowRoot.querySelector("input[name='username']").focus();
1211
- }, 0);
1212
- return;
1213
- }
1214
- }
1215
-
1216
- const password = this.shadowRoot.querySelector("monster-password").value;
1217
-
1218
- let missingBits = 0;
1219
- if (username === "" || username === null) {
1220
- this.setOption("classes.usernameInvalid", "invalid");
1221
- missingBits |= 1; // Set bit 1 for username
1222
- } else {
1223
- this.setOption("classes.usernameInvalid", "");
1224
- }
1225
-
1226
- if (password === "" || password === null) {
1227
- this.setOption("classes.passwordInvalid", "invalid");
1228
- missingBits |= 2; // Set bit 2 for password
1229
- } else {
1230
- this.setOption("classes.passwordInvalid", "");
1231
- }
1232
-
1233
- let msg = null;
1234
- if (missingBits === 1) {
1235
- // missing username
1236
- msg = this.getOption("labels.messageEmptyUserName");
1237
-
1238
- setTimeout(() => {
1239
- this.shadowRoot.querySelector("input[name='username']").focus();
1240
- }, 0);
1241
- } else if (missingBits === 2) {
1242
- // missing password
1243
- msg = this.getOption("labels.messageEmptyPassword");
1244
-
1245
- setTimeout(() => {
1246
- this.shadowRoot.querySelector("monster-password").focus();
1247
- });
1248
- } else if (missingBits === 3) {
1249
- msg = this.getOption("labels.messageEmptyBoth");
1250
-
1251
- setTimeout(() => {
1252
- this.shadowRoot.querySelector("input[name='username']").focus();
1253
- }, 0);
1254
- }
1255
-
1256
- const timeout = this.getOption("timeoutForMessage");
1257
-
1258
- if (msg !== null && msg !== undefined) {
1259
- this[loginButtonSymbol].setMessage(msg);
1260
- this[loginButtonSymbol].showMessage(timeout);
1261
- this[loginButtonSymbol].setState("failed", timeout);
1262
- return;
1263
- }
1264
-
1265
- const url = this.getOption("fetch.login.url");
1266
-
1267
- if (url === "" || url === null || url === undefined) {
1268
- this[loginButtonSymbol].setMessage(
1269
- this.getOption("labels.messageThisFormIsNotConfigured"),
1270
- );
1271
- this[loginButtonSymbol].showMessage(timeout);
1272
- this[loginButtonSymbol].setState("failed", timeout);
1273
- return;
1274
- }
1275
-
1276
- const options = {
1277
- method: this.getOption("fetch.login.method"),
1278
- mode: this.getOption("fetch.login.mode"),
1279
- headers: this.getOption("fetch.login.headers"),
1280
- credentials: this.getOption("fetch.login.credentials"),
1281
- body: JSON.stringify({ username, password }),
1282
- };
1283
-
1284
- getWindow()
1285
- .fetch(url, options)
1286
- .then((response) => {
1287
- if (response.ok) {
1288
- this[loginButtonSymbol].setState("successful", timeout);
1289
- setTimeout(() => {
1290
- this.openLoggedIn();
1291
- }, 1200);
1292
- } else {
1293
- if (response.status === 403) {
1294
- this[loginButtonSymbol].setMessage(
1295
- this.getOption("labels.messageForbidden"),
1296
- );
1297
- } else if (response.status === 401) {
1298
- const wwwAuthenticateHeader =
1299
- response.headers.get("www-authenticate");
1300
- if (wwwAuthenticateHeader) {
1301
- const wwwAuthenticateParts = wwwAuthenticateHeader
1302
- .split(/,\s*/)
1303
- .map((part) => {
1304
- const [key, value] = part.split("=");
1305
- return {
1306
- key: key.trim(),
1307
- value: value ? value.trim().replace(/^"|"$/g, "") : null,
1308
- };
1309
- });
1310
-
1311
- const filteredParts = wwwAuthenticateParts.filter(
1312
- (part) => part.key.toLowerCase() === "2fa",
1313
- );
1314
- if (filteredParts.length > 0) {
1315
- const timeout = this.getOption("timeoutForSuccess");
1316
- this[loginButtonSymbol].setState("successful", timeout);
1317
- setTimeout(() => {
1318
- this.openSecondFactor();
1319
- const digitsElement = this.shadowRoot.getElementById(
1320
- "secondFactorControl",
1321
- );
1322
- digitsElement.focus();
1323
- }, timeout);
1324
- return;
1325
- }
1326
- }
1327
-
1328
- this[loginButtonSymbol].setMessage(
1329
- this.getOption("labels.messageLoginFailed"),
1330
- );
1331
- } else {
1332
- this[loginButtonSymbol].setMessage(
1333
- this.getOption("labels.messageSomethingWentWrong"),
1334
- );
1335
- }
1336
- this[loginButtonSymbol].showMessage(timeout);
1337
- this[loginButtonSymbol].setState("failed", timeout);
1338
-
1339
- setTimeout(() => {
1340
- this.shadowRoot.querySelector("input[name='username']").focus();
1341
- }, 0);
1342
- }
1343
- })
1344
- .catch((error) => {
1345
- this[loginButtonSymbol].setMessage(
1346
- this.getOption("labels.messageSomethingWentWrong"),
1347
- );
1348
- this[loginButtonSymbol].showMessage(timeout);
1349
- this[loginButtonSymbol].setState("failed", timeout);
1350
-
1351
- setTimeout(() => {
1352
- this.shadowRoot.querySelector("input[name='username']").focus();
1353
- }, 0);
1354
- });
1355
- });
1356
-
1357
- this[requestLinkButtonSymbol].setOption("actions.click", (event) => {
1358
- const emailElement = this.shadowRoot.querySelector("input[name='email']");
1359
-
1360
- // get email value and HTML validity
1361
- let mail = emailElement.value;
1362
- let valid = emailElement.checkValidity();
1363
-
1364
- const timeout = this.getOption("timeoutForMessage");
1365
-
1366
- // New structured callback handling for forgotPassword (backwards compatible)
1367
- const mailCallback = this.getOption("callbacks.forgotPassword");
1368
- if (isFunction(mailCallback)) {
1369
- const result = normalizeCallbackResult(
1370
- mailCallback.call(this, mail),
1371
- mail,
1372
- );
1373
-
1374
- mail = result.value;
1375
-
1376
- if (result.valid !== undefined) {
1377
- valid = result.valid;
1378
- }
1379
-
1380
- if (result.valid === false || result.stop === true) {
1381
- this.setOption("classes.emailInvalid", "invalid");
1382
-
1383
- const msg =
1384
- result.message ||
1385
- (mail === "" || mail === null
1386
- ? this.getOption("labels.messageEmptyEmail")
1387
- : this.getOption("labels.messageInvalidEmail"));
1388
-
1389
- this[requestLinkButtonSymbol].setMessage(msg);
1390
- this[requestLinkButtonSymbol].showMessage(timeout);
1391
- this[requestLinkButtonSymbol].setState("failed", timeout);
1392
- return;
1393
- }
1394
- }
1395
-
1396
- let msg = null;
1397
- if (mail === "" || mail === null) {
1398
- this.setOption("classes.emailInvalid", "invalid");
1399
- msg = this.getOption("labels.messageEmptyEmail");
1400
- } else if (!valid) {
1401
- this.setOption("classes.emailInvalid", "invalid");
1402
- msg = this.getOption("labels.messageInvalidEmail");
1403
- } else {
1404
- this.setOption("classes.emailInvalid", "");
1405
- }
1406
-
1407
- if (msg !== null && msg !== undefined) {
1408
- this[requestLinkButtonSymbol].setMessage(msg);
1409
- this[requestLinkButtonSymbol].showMessage(timeout);
1410
- this[requestLinkButtonSymbol].setState("failed", timeout);
1411
- return;
1412
- }
1413
-
1414
- const url = this.getOption("fetch.forgotPassword.url");
1415
-
1416
- if (url === "" || url === null || url === undefined) {
1417
- this[requestLinkButtonSymbol].setMessage(
1418
- this.getOption("labels.messageThisFormIsNotConfigured"),
1419
- );
1420
- this[requestLinkButtonSymbol].showMessage(timeout);
1421
- this[requestLinkButtonSymbol].setState("failed", timeout);
1422
- return;
1423
- }
1424
-
1425
- const options = {
1426
- method: this.getOption("fetch.forgotPassword.method"),
1427
- mode: this.getOption("fetch.forgotPassword.mode"),
1428
- headers: this.getOption("fetch.forgotPassword.headers"),
1429
- credentials: this.getOption("fetch.forgotPassword.credentials"),
1430
- body: JSON.stringify({ mail }),
1431
- };
1432
-
1433
- getWindow()
1434
- .fetch(url, options)
1435
- .then((response) => {
1436
- if (response.ok) {
1437
- const timeoutSuccess = this.getOption("timeoutForSuccess");
1438
- this[requestLinkButtonSymbol].setState("successful", timeoutSuccess);
1439
- setTimeout(() => {
1440
- this.openDigits();
1441
- }, timeoutSuccess);
1442
- } else {
1443
- if (response.status === 403) {
1444
- this[requestLinkButtonSymbol].setMessage(
1445
- this.getOption("labels.messageForbidden"),
1446
- );
1447
- } else if (response.status === 401) {
1448
- if (
1449
- response.headers.has("x-password-reset") &&
1450
- response.headers.get("x-password-reset").includes("disabled")
1451
- ) {
1452
- this[requestLinkButtonSymbol].setMessage(
1453
- this.getOption("labels.messagePasswordResetDisabled"),
1454
- );
1455
- } else {
1456
- this[requestLinkButtonSymbol].setMessage(
1457
- this.getOption("labels.messageLoginFailed"),
1458
- );
1459
- }
1460
- } else {
1461
- this[requestLinkButtonSymbol].setMessage(
1462
- this.getOption("labels.messageSomethingWentWrong"),
1463
- );
1464
- }
1465
- this[requestLinkButtonSymbol].showMessage(timeout);
1466
- this[requestLinkButtonSymbol].setState("failed", timeout);
1467
- }
1468
- })
1469
- .catch(() => {
1470
- this[requestLinkButtonSymbol].setMessage(
1471
- this.getOption("labels.messageSomethingWentWrong"),
1472
- );
1473
- this[requestLinkButtonSymbol].showMessage(timeout);
1474
- this[requestLinkButtonSymbol].setState("failed", timeout);
1475
- });
1476
- });
1477
-
1478
- this[secondFactorButtonSymbol].setOption("actions.click", (event) => {
1479
- const digitsElement = this.shadowRoot.getElementById("secondFactorControl");
1480
-
1481
- const digits = digitsElement.value;
1482
- const valid = digitsElement.checkValidity();
1483
-
1484
- let msg = null;
1485
- if (digits === "" || digits === null) {
1486
- msg = this.getOption("labels.digitsEmpty");
1487
- } else if (!valid) {
1488
- msg = this.getOption("labels.digitsInvalid");
1489
- }
1490
-
1491
- const timeout = this.getOption("timeoutForMessage");
1492
-
1493
- if (msg !== null && msg !== undefined) {
1494
- this[secondFactorButtonSymbol].setMessage(msg);
1495
- this[secondFactorButtonSymbol].showMessage(timeout);
1496
- this[secondFactorButtonSymbol].setState("failed", timeout);
1497
- return;
1498
- }
1499
-
1500
- const url = this.getOption("fetch.secondFactor.url");
1501
-
1502
- if (url === "" || url === null || url === undefined) {
1503
- this[secondFactorButtonSymbol].setMessage(
1504
- this.getOption("labels.messageThisFormIsNotConfigured"),
1505
- );
1506
- this[secondFactorButtonSymbol].showMessage(timeout);
1507
- this[secondFactorButtonSymbol].setState("failed", timeout);
1508
- return;
1509
- }
1510
-
1511
- const options = {
1512
- method: this.getOption("fetch.secondFactor.method"),
1513
- mode: this.getOption("fetch.secondFactor.mode"),
1514
- headers: this.getOption("fetch.secondFactor.headers"),
1515
- credentials: this.getOption("fetch.secondFactor.credentials"),
1516
- body: JSON.stringify({ digits }),
1517
- };
1518
-
1519
- getWindow()
1520
- .fetch(url, options)
1521
- .then((response) => {
1522
- if (response.ok) {
1523
- const timeoutSuccess = this.getOption("timeoutForSuccess");
1524
- this[secondFactorButtonSymbol].setState("successful", timeoutSuccess);
1525
- fireEvent(this, "second-factor-success");
1526
- setTimeout(() => {
1527
- this.openLoggedIn();
1528
- }, timeoutSuccess);
1529
- } else {
1530
- if (response.status === 403) {
1531
- this[secondFactorButtonSymbol].setMessage(
1532
- this.getOption("labels.messageForbidden"),
1533
- );
1534
- } else if (response.status === 401) {
1535
- this[secondFactorButtonSymbol].setMessage(
1536
- this.getOption("labels.messageLoginFailed"),
1537
- );
1538
- } else {
1539
- this[secondFactorButtonSymbol].setMessage(
1540
- this.getOption("labels.messageSomethingWentWrong"),
1541
- );
1542
- }
1543
- this[secondFactorButtonSymbol].showMessage(timeout);
1544
- this[secondFactorButtonSymbol].setState("failed", timeout);
1545
- setTimeout(() => {
1546
- digitsElement.focus();
1547
- }, 0);
1548
- }
1549
- })
1550
- .catch(() => {
1551
- this[secondFactorButtonSymbol].setMessage(
1552
- this.getOption("labels.messageSomethingWentWrong"),
1553
- );
1554
- this[secondFactorButtonSymbol].showMessage(timeout);
1555
- this[secondFactorButtonSymbol].setState("failed", timeout);
1556
- setTimeout(() => {
1557
- digitsElement.focus();
1558
- }, 0);
1559
- });
1560
- });
1561
-
1562
- this[digitsButtonSymbol].setOption("actions.click", (event) => {
1563
- const digitsElement = this.shadowRoot.getElementById("digitsControl");
1564
-
1565
- const digits = digitsElement.value;
1566
- const valid = digitsElement.checkValidity();
1567
-
1568
- let msg = null;
1569
- if (digits === "" || digits === null || digits === undefined) {
1570
- msg = this.getOption("labels.digitsEmpty");
1571
- } else if (!valid) {
1572
- msg = this.getOption("labels.digitsInvalid");
1573
- }
1574
-
1575
- const timeout = this.getOption("timeoutForMessage");
1576
- if (msg !== null && msg !== undefined) {
1577
- this[digitsButtonSymbol].setMessage(msg);
1578
- this[digitsButtonSymbol].showMessage(timeout);
1579
- this[digitsButtonSymbol].setState("failed", timeout);
1580
- return;
1581
- }
1582
-
1583
- const url = this.getOption("fetch.digits.url");
1584
-
1585
- if (url === "" || url === null || url === undefined) {
1586
- this[digitsButtonSymbol].setMessage(
1587
- this.getOption("labels.messageThisFormIsNotConfigured"),
1588
- );
1589
- this[digitsButtonSymbol].showMessage(timeout);
1590
- this[digitsButtonSymbol].setState("failed", timeout);
1591
- return;
1592
- }
1593
-
1594
- const options = {
1595
- method: this.getOption("fetch.digits.method"),
1596
- mode: this.getOption("fetch.digits.mode"),
1597
- headers: this.getOption("fetch.digits.headers"),
1598
- credentials: this.getOption("fetch.digits.credentials"),
1599
- body: JSON.stringify({ digits }),
1600
- };
1601
-
1602
- getWindow()
1603
- .fetch(url, options)
1604
- .then((response) => {
1605
- const timeoutSuccess = this.getOption("timeoutForSuccess");
1606
-
1607
- if (response.ok) {
1608
- this[digitsButtonSymbol].setState("successful", timeoutSuccess);
1609
- fireEvent(this, "digits-success");
1610
- setTimeout(() => {
1611
- this.openLoggedIn();
1612
- }, timeoutSuccess);
1613
- } else {
1614
- if (response.status === 403) {
1615
- this[digitsButtonSymbol].setMessage(
1616
- this.getOption("labels.messageForbidden"),
1617
- );
1618
- } else if (response.status === 401) {
1619
- this[digitsButtonSymbol].setMessage(
1620
- this.getOption("labels.messageLoginFailed"),
1621
- );
1622
- } else {
1623
- this[digitsButtonSymbol].setMessage(
1624
- this.getOption("labels.messageSomethingWentWrong"),
1625
- );
1626
- }
1627
- this[digitsButtonSymbol].showMessage(timeout);
1628
- this[digitsButtonSymbol].setState("failed", timeout);
1629
- setTimeout(() => {
1630
- digitsElement.focus();
1631
- }, 0);
1632
- }
1633
- })
1634
- .catch(() => {
1635
- this[digitsButtonSymbol].setMessage(
1636
- this.getOption("labels.messageSomethingWentWrong"),
1637
- );
1638
- this[digitsButtonSymbol].showMessage(timeout);
1639
- this[digitsButtonSymbol].setState("failed", timeout);
1640
- setTimeout(() => {
1641
- digitsElement.focus();
1642
- }, 0);
1643
- });
1644
- });
1645
-
1646
- return this;
1114
+ const self = this;
1115
+ const element = this[loginElementSymbol];
1116
+
1117
+ const type = "click";
1118
+
1119
+ element.addEventListener(type, function (event) {
1120
+ const callback = self.getOption("actions.click");
1121
+
1122
+ fireCustomEvent(self, "monster-login-clicked", {
1123
+ element: self,
1124
+ });
1125
+
1126
+ if (!isFunction(callback)) {
1127
+ return;
1128
+ }
1129
+
1130
+ const element = findTargetElementFromEvent(
1131
+ event,
1132
+ ATTRIBUTE_ROLE,
1133
+ "control",
1134
+ );
1135
+
1136
+ if (!(element instanceof Node && self.hasNode(element))) {
1137
+ return;
1138
+ }
1139
+
1140
+ callback.call(self, event);
1141
+ });
1142
+
1143
+ this[forgotPasswordLinkSymbol].addEventListener(type, (event) => {
1144
+ event.preventDefault();
1145
+ this[forgotPasswordCollapseSymbol].open();
1146
+ setTimeout(() => {
1147
+ this.shadowRoot.querySelector("input[name='email']").focus();
1148
+ }, 0);
1149
+ });
1150
+
1151
+ this[loginLinkSymbol].addEventListener(type, (event) => {
1152
+ event.preventDefault();
1153
+ this[loginCollapseSymbol].open();
1154
+
1155
+ setTimeout(() => {
1156
+ this.shadowRoot.querySelector("input[name='username']").focus();
1157
+ }, 0);
1158
+ });
1159
+
1160
+ for (const e of this[resetLoginProcessLinksSymbol]) {
1161
+ e.addEventListener(type, (event) => {
1162
+ event.preventDefault();
1163
+ this[loginCollapseSymbol].open();
1164
+ setTimeout(() => {
1165
+ this.shadowRoot.querySelector("input[name='username']").focus();
1166
+ }, 0);
1167
+ });
1168
+ }
1169
+
1170
+ this[loginCollapseSymbol].addEventListener("keydown", (event) => {
1171
+ if (event.key === "Enter") {
1172
+ this[loginButtonSymbol].click();
1173
+ }
1174
+ });
1175
+
1176
+ this[secondFactorCollapseSymbol].addEventListener("keydown", (event) => {
1177
+ if (event.key === "Enter") {
1178
+ this[secondFactorButtonSymbol].click();
1179
+ }
1180
+ });
1181
+
1182
+ this[forgotPasswordCollapseSymbol].addEventListener("keydown", (event) => {
1183
+ if (event.key === "Enter") {
1184
+ this[requestLinkButtonSymbol].click();
1185
+ }
1186
+ });
1187
+
1188
+ this[digitsCollapseSymbol].addEventListener("keydown", (event) => {
1189
+ if (event.key === "Enter") {
1190
+ this[digitsButtonSymbol].click();
1191
+ }
1192
+ });
1193
+
1194
+ this[loginButtonSymbol].setOption("actions.click", (event) => {
1195
+ let username = this.shadowRoot.querySelector(
1196
+ "input[name='username']",
1197
+ ).value;
1198
+
1199
+ // New structured callback handling for username (backwards compatible)
1200
+ const userCallback = this.getOption("callbacks.username");
1201
+ if (isFunction(userCallback)) {
1202
+ const result = normalizeCallbackResult(
1203
+ userCallback.call(this, username),
1204
+ username,
1205
+ );
1206
+ username = result.value;
1207
+
1208
+ // If callback explicitly marks invalid or wants to stop, handle immediately
1209
+ if (result.valid === false || result.stop === true) {
1210
+ const timeout = this.getOption("timeoutForMessage");
1211
+ const msg =
1212
+ result.message || this.getOption("labels.messageEmptyUserName");
1213
+
1214
+ this.setOption("classes.usernameInvalid", "invalid");
1215
+ this[loginButtonSymbol].setMessage(msg);
1216
+ this[loginButtonSymbol].showMessage(timeout);
1217
+ this[loginButtonSymbol].setState("failed", timeout);
1218
+
1219
+ setTimeout(() => {
1220
+ this.shadowRoot.querySelector("input[name='username']").focus();
1221
+ }, 0);
1222
+ return;
1223
+ }
1224
+ }
1225
+
1226
+ const password = this.shadowRoot.querySelector("monster-password").value;
1227
+
1228
+ let missingBits = 0;
1229
+ if (username === "" || username === null) {
1230
+ this.setOption("classes.usernameInvalid", "invalid");
1231
+ missingBits |= 1; // Set bit 1 for username
1232
+ } else {
1233
+ this.setOption("classes.usernameInvalid", "");
1234
+ }
1235
+
1236
+ if (password === "" || password === null) {
1237
+ this.setOption("classes.passwordInvalid", "invalid");
1238
+ missingBits |= 2; // Set bit 2 for password
1239
+ } else {
1240
+ this.setOption("classes.passwordInvalid", "");
1241
+ }
1242
+
1243
+ let msg = null;
1244
+ if (missingBits === 1) {
1245
+ // missing username
1246
+ msg = this.getOption("labels.messageEmptyUserName");
1247
+
1248
+ setTimeout(() => {
1249
+ this.shadowRoot.querySelector("input[name='username']").focus();
1250
+ }, 0);
1251
+ } else if (missingBits === 2) {
1252
+ // missing password
1253
+ msg = this.getOption("labels.messageEmptyPassword");
1254
+
1255
+ setTimeout(() => {
1256
+ this.shadowRoot.querySelector("monster-password").focus();
1257
+ });
1258
+ } else if (missingBits === 3) {
1259
+ msg = this.getOption("labels.messageEmptyBoth");
1260
+
1261
+ setTimeout(() => {
1262
+ this.shadowRoot.querySelector("input[name='username']").focus();
1263
+ }, 0);
1264
+ }
1265
+
1266
+ const timeout = this.getOption("timeoutForMessage");
1267
+
1268
+ if (msg !== null && msg !== undefined) {
1269
+ this[loginButtonSymbol].setMessage(msg);
1270
+ this[loginButtonSymbol].showMessage(timeout);
1271
+ this[loginButtonSymbol].setState("failed", timeout);
1272
+ return;
1273
+ }
1274
+
1275
+ const url = this.getOption("fetch.login.url");
1276
+
1277
+ if (url === "" || url === null || url === undefined) {
1278
+ this[loginButtonSymbol].setMessage(
1279
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1280
+ );
1281
+ this[loginButtonSymbol].showMessage(timeout);
1282
+ this[loginButtonSymbol].setState("failed", timeout);
1283
+ return;
1284
+ }
1285
+
1286
+ const options = {
1287
+ method: this.getOption("fetch.login.method"),
1288
+ mode: this.getOption("fetch.login.mode"),
1289
+ headers: this.getOption("fetch.login.headers"),
1290
+ credentials: this.getOption("fetch.login.credentials"),
1291
+ body: JSON.stringify({ username, password }),
1292
+ };
1293
+
1294
+ getWindow()
1295
+ .fetch(url, options)
1296
+ .then((response) => {
1297
+ if (response.ok) {
1298
+ this[loginButtonSymbol].setState("successful", timeout);
1299
+ setTimeout(() => {
1300
+ this.openLoggedIn();
1301
+ }, 1200);
1302
+ } else {
1303
+ if (response.status === 403) {
1304
+ this[loginButtonSymbol].setMessage(
1305
+ this.getOption("labels.messageForbidden"),
1306
+ );
1307
+ } else if (response.status === 401) {
1308
+ const wwwAuthenticateHeader =
1309
+ response.headers.get("www-authenticate");
1310
+ if (wwwAuthenticateHeader) {
1311
+ const wwwAuthenticateParts = wwwAuthenticateHeader
1312
+ .split(/,\s*/)
1313
+ .map((part) => {
1314
+ const [key, value] = part.split("=");
1315
+ return {
1316
+ key: key.trim(),
1317
+ value: value ? value.trim().replace(/^"|"$/g, "") : null,
1318
+ };
1319
+ });
1320
+
1321
+ const filteredParts = wwwAuthenticateParts.filter(
1322
+ (part) => part.key.toLowerCase() === "2fa",
1323
+ );
1324
+ if (filteredParts.length > 0) {
1325
+ const timeout = this.getOption("timeoutForSuccess");
1326
+ this[loginButtonSymbol].setState("successful", timeout);
1327
+ setTimeout(() => {
1328
+ this.openSecondFactor();
1329
+ const digitsElement = this.shadowRoot.getElementById(
1330
+ "secondFactorControl",
1331
+ );
1332
+ digitsElement.focus();
1333
+ }, timeout);
1334
+ return;
1335
+ }
1336
+ }
1337
+
1338
+ this[loginButtonSymbol].setMessage(
1339
+ this.getOption("labels.messageLoginFailed"),
1340
+ );
1341
+ } else {
1342
+ this[loginButtonSymbol].setMessage(
1343
+ this.getOption("labels.messageSomethingWentWrong"),
1344
+ );
1345
+ }
1346
+ this[loginButtonSymbol].showMessage(timeout);
1347
+ this[loginButtonSymbol].setState("failed", timeout);
1348
+
1349
+ setTimeout(() => {
1350
+ this.shadowRoot.querySelector("input[name='username']").focus();
1351
+ }, 0);
1352
+ }
1353
+ })
1354
+ .catch((error) => {
1355
+ this[loginButtonSymbol].setMessage(
1356
+ this.getOption("labels.messageSomethingWentWrong"),
1357
+ );
1358
+ this[loginButtonSymbol].showMessage(timeout);
1359
+ this[loginButtonSymbol].setState("failed", timeout);
1360
+
1361
+ setTimeout(() => {
1362
+ this.shadowRoot.querySelector("input[name='username']").focus();
1363
+ }, 0);
1364
+ });
1365
+ });
1366
+
1367
+ this[requestLinkButtonSymbol].setOption("actions.click", (event) => {
1368
+ const emailElement = this.shadowRoot.querySelector("input[name='email']");
1369
+
1370
+ // get email value and HTML validity
1371
+ let mail = emailElement.value;
1372
+ let valid = emailElement.checkValidity();
1373
+
1374
+ const timeout = this.getOption("timeoutForMessage");
1375
+
1376
+ // New structured callback handling for forgotPassword (backwards compatible)
1377
+ const mailCallback = this.getOption("callbacks.forgotPassword");
1378
+ if (isFunction(mailCallback)) {
1379
+ const result = normalizeCallbackResult(
1380
+ mailCallback.call(this, mail),
1381
+ mail,
1382
+ );
1383
+
1384
+ mail = result.value;
1385
+
1386
+ if (result.valid !== undefined) {
1387
+ valid = result.valid;
1388
+ }
1389
+
1390
+ if (result.valid === false || result.stop === true) {
1391
+ this.setOption("classes.emailInvalid", "invalid");
1392
+
1393
+ const msg =
1394
+ result.message ||
1395
+ (mail === "" || mail === null
1396
+ ? this.getOption("labels.messageEmptyEmail")
1397
+ : this.getOption("labels.messageInvalidEmail"));
1398
+
1399
+ this[requestLinkButtonSymbol].setMessage(msg);
1400
+ this[requestLinkButtonSymbol].showMessage(timeout);
1401
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1402
+ return;
1403
+ }
1404
+ }
1405
+
1406
+ let msg = null;
1407
+ if (mail === "" || mail === null) {
1408
+ this.setOption("classes.emailInvalid", "invalid");
1409
+ msg = this.getOption("labels.messageEmptyEmail");
1410
+ } else if (!valid) {
1411
+ this.setOption("classes.emailInvalid", "invalid");
1412
+ msg = this.getOption("labels.messageInvalidEmail");
1413
+ } else {
1414
+ this.setOption("classes.emailInvalid", "");
1415
+ }
1416
+
1417
+ if (msg !== null && msg !== undefined) {
1418
+ this[requestLinkButtonSymbol].setMessage(msg);
1419
+ this[requestLinkButtonSymbol].showMessage(timeout);
1420
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1421
+ return;
1422
+ }
1423
+
1424
+ const url = this.getOption("fetch.forgotPassword.url");
1425
+
1426
+ if (url === "" || url === null || url === undefined) {
1427
+ this[requestLinkButtonSymbol].setMessage(
1428
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1429
+ );
1430
+ this[requestLinkButtonSymbol].showMessage(timeout);
1431
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1432
+ return;
1433
+ }
1434
+
1435
+ const options = {
1436
+ method: this.getOption("fetch.forgotPassword.method"),
1437
+ mode: this.getOption("fetch.forgotPassword.mode"),
1438
+ headers: this.getOption("fetch.forgotPassword.headers"),
1439
+ credentials: this.getOption("fetch.forgotPassword.credentials"),
1440
+ body: JSON.stringify({ mail }),
1441
+ };
1442
+
1443
+ getWindow()
1444
+ .fetch(url, options)
1445
+ .then((response) => {
1446
+ if (response.ok) {
1447
+ const timeoutSuccess = this.getOption("timeoutForSuccess");
1448
+ this[requestLinkButtonSymbol].setState("successful", timeoutSuccess);
1449
+ setTimeout(() => {
1450
+ this.openDigits();
1451
+ }, timeoutSuccess);
1452
+ } else {
1453
+ if (response.status === 403) {
1454
+ this[requestLinkButtonSymbol].setMessage(
1455
+ this.getOption("labels.messageForbidden"),
1456
+ );
1457
+ } else if (response.status === 401) {
1458
+ if (
1459
+ response.headers.has("x-password-reset") &&
1460
+ response.headers.get("x-password-reset").includes("disabled")
1461
+ ) {
1462
+ this[requestLinkButtonSymbol].setMessage(
1463
+ this.getOption("labels.messagePasswordResetDisabled"),
1464
+ );
1465
+ } else {
1466
+ this[requestLinkButtonSymbol].setMessage(
1467
+ this.getOption("labels.messageLoginFailed"),
1468
+ );
1469
+ }
1470
+ } else {
1471
+ this[requestLinkButtonSymbol].setMessage(
1472
+ this.getOption("labels.messageSomethingWentWrong"),
1473
+ );
1474
+ }
1475
+ this[requestLinkButtonSymbol].showMessage(timeout);
1476
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1477
+ }
1478
+ })
1479
+ .catch(() => {
1480
+ this[requestLinkButtonSymbol].setMessage(
1481
+ this.getOption("labels.messageSomethingWentWrong"),
1482
+ );
1483
+ this[requestLinkButtonSymbol].showMessage(timeout);
1484
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1485
+ });
1486
+ });
1487
+
1488
+ this[secondFactorButtonSymbol].setOption("actions.click", (event) => {
1489
+ const digitsElement = this.shadowRoot.getElementById("secondFactorControl");
1490
+
1491
+ const digits = digitsElement.value;
1492
+ const valid = digitsElement.checkValidity();
1493
+
1494
+ let msg = null;
1495
+ if (digits === "" || digits === null) {
1496
+ msg = this.getOption("labels.digitsEmpty");
1497
+ } else if (!valid) {
1498
+ msg = this.getOption("labels.digitsInvalid");
1499
+ }
1500
+
1501
+ const timeout = this.getOption("timeoutForMessage");
1502
+
1503
+ if (msg !== null && msg !== undefined) {
1504
+ this[secondFactorButtonSymbol].setMessage(msg);
1505
+ this[secondFactorButtonSymbol].showMessage(timeout);
1506
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1507
+ return;
1508
+ }
1509
+
1510
+ const url = this.getOption("fetch.secondFactor.url");
1511
+
1512
+ if (url === "" || url === null || url === undefined) {
1513
+ this[secondFactorButtonSymbol].setMessage(
1514
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1515
+ );
1516
+ this[secondFactorButtonSymbol].showMessage(timeout);
1517
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1518
+ return;
1519
+ }
1520
+
1521
+ const options = {
1522
+ method: this.getOption("fetch.secondFactor.method"),
1523
+ mode: this.getOption("fetch.secondFactor.mode"),
1524
+ headers: this.getOption("fetch.secondFactor.headers"),
1525
+ credentials: this.getOption("fetch.secondFactor.credentials"),
1526
+ body: JSON.stringify({ digits }),
1527
+ };
1528
+
1529
+ getWindow()
1530
+ .fetch(url, options)
1531
+ .then((response) => {
1532
+ if (response.ok) {
1533
+ const timeoutSuccess = this.getOption("timeoutForSuccess");
1534
+ this[secondFactorButtonSymbol].setState("successful", timeoutSuccess);
1535
+ fireEvent(this, "second-factor-success");
1536
+ setTimeout(() => {
1537
+ this.openLoggedIn();
1538
+ }, timeoutSuccess);
1539
+ } else {
1540
+ if (response.status === 403) {
1541
+ this[secondFactorButtonSymbol].setMessage(
1542
+ this.getOption("labels.messageForbidden"),
1543
+ );
1544
+ } else if (response.status === 401) {
1545
+ this[secondFactorButtonSymbol].setMessage(
1546
+ this.getOption("labels.messageLoginFailed"),
1547
+ );
1548
+ } else {
1549
+ this[secondFactorButtonSymbol].setMessage(
1550
+ this.getOption("labels.messageSomethingWentWrong"),
1551
+ );
1552
+ }
1553
+ this[secondFactorButtonSymbol].showMessage(timeout);
1554
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1555
+ setTimeout(() => {
1556
+ digitsElement.focus();
1557
+ }, 0);
1558
+ }
1559
+ })
1560
+ .catch(() => {
1561
+ this[secondFactorButtonSymbol].setMessage(
1562
+ this.getOption("labels.messageSomethingWentWrong"),
1563
+ );
1564
+ this[secondFactorButtonSymbol].showMessage(timeout);
1565
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1566
+ setTimeout(() => {
1567
+ digitsElement.focus();
1568
+ }, 0);
1569
+ });
1570
+ });
1571
+
1572
+ this[digitsButtonSymbol].setOption("actions.click", (event) => {
1573
+ const digitsElement = this.shadowRoot.getElementById("digitsControl");
1574
+
1575
+ const digits = digitsElement.value;
1576
+ const valid = digitsElement.checkValidity();
1577
+
1578
+ let msg = null;
1579
+ if (digits === "" || digits === null || digits === undefined) {
1580
+ msg = this.getOption("labels.digitsEmpty");
1581
+ } else if (!valid) {
1582
+ msg = this.getOption("labels.digitsInvalid");
1583
+ }
1584
+
1585
+ const timeout = this.getOption("timeoutForMessage");
1586
+ if (msg !== null && msg !== undefined) {
1587
+ this[digitsButtonSymbol].setMessage(msg);
1588
+ this[digitsButtonSymbol].showMessage(timeout);
1589
+ this[digitsButtonSymbol].setState("failed", timeout);
1590
+ return;
1591
+ }
1592
+
1593
+ const url = this.getOption("fetch.digits.url");
1594
+
1595
+ if (url === "" || url === null || url === undefined) {
1596
+ this[digitsButtonSymbol].setMessage(
1597
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1598
+ );
1599
+ this[digitsButtonSymbol].showMessage(timeout);
1600
+ this[digitsButtonSymbol].setState("failed", timeout);
1601
+ return;
1602
+ }
1603
+
1604
+ const options = {
1605
+ method: this.getOption("fetch.digits.method"),
1606
+ mode: this.getOption("fetch.digits.mode"),
1607
+ headers: this.getOption("fetch.digits.headers"),
1608
+ credentials: this.getOption("fetch.digits.credentials"),
1609
+ body: JSON.stringify({ digits }),
1610
+ };
1611
+
1612
+ getWindow()
1613
+ .fetch(url, options)
1614
+ .then((response) => {
1615
+ const timeoutSuccess = this.getOption("timeoutForSuccess");
1616
+
1617
+ if (response.ok) {
1618
+ this[digitsButtonSymbol].setState("successful", timeoutSuccess);
1619
+ fireEvent(this, "digits-success");
1620
+ setTimeout(() => {
1621
+ this.openLoggedIn();
1622
+ }, timeoutSuccess);
1623
+ } else {
1624
+ if (response.status === 403) {
1625
+ this[digitsButtonSymbol].setMessage(
1626
+ this.getOption("labels.messageForbidden"),
1627
+ );
1628
+ } else if (response.status === 401) {
1629
+ this[digitsButtonSymbol].setMessage(
1630
+ this.getOption("labels.messageLoginFailed"),
1631
+ );
1632
+ } else {
1633
+ this[digitsButtonSymbol].setMessage(
1634
+ this.getOption("labels.messageSomethingWentWrong"),
1635
+ );
1636
+ }
1637
+ this[digitsButtonSymbol].showMessage(timeout);
1638
+ this[digitsButtonSymbol].setState("failed", timeout);
1639
+ setTimeout(() => {
1640
+ digitsElement.focus();
1641
+ }, 0);
1642
+ }
1643
+ })
1644
+ .catch(() => {
1645
+ this[digitsButtonSymbol].setMessage(
1646
+ this.getOption("labels.messageSomethingWentWrong"),
1647
+ );
1648
+ this[digitsButtonSymbol].showMessage(timeout);
1649
+ this[digitsButtonSymbol].setState("failed", timeout);
1650
+ setTimeout(() => {
1651
+ digitsElement.focus();
1652
+ }, 0);
1653
+ });
1654
+ });
1655
+
1656
+ return this;
1647
1657
  }
1648
1658
 
1649
1659
  /**
@@ -1651,50 +1661,50 @@ function initEventHandler() {
1651
1661
  * @return {void}
1652
1662
  */
1653
1663
  function initControlReferences() {
1654
- this[loginElementSymbol] = this.shadowRoot.querySelector(
1655
- `[${ATTRIBUTE_ROLE}="control"]`,
1656
- );
1657
-
1658
- // data-monster-role="forgot-password-link"
1659
-
1660
- this[forgotPasswordLinkSymbol] = this.shadowRoot.querySelector(
1661
- `[data-monster-role="forgot-password-link"]`,
1662
- );
1663
-
1664
- this[forgotPasswordCollapseSymbol] = this.shadowRoot.querySelector(
1665
- `[data-monster-role="forgot-password-collapse"]`,
1666
- );
1667
-
1668
- this[loginCollapseSymbol] = this.shadowRoot.querySelector(
1669
- `[data-monster-role="login-collapse"]`,
1670
- );
1671
-
1672
- this[loginLinkSymbol] = this.shadowRoot.querySelector(
1673
- `[data-monster-role="login-link"]`,
1674
- );
1675
-
1676
- this[secondFactorCollapseSymbol] = this.shadowRoot.querySelector(
1677
- `[data-monster-role="second-factor-collapse"]`,
1678
- );
1679
-
1680
- this[resetLoginProcessLinksSymbol] = this.shadowRoot.querySelectorAll(
1681
- `[data-monster-role="reset-login-process-link"]`,
1682
- );
1683
-
1684
- this[loggedInCollapseSymbol] = this.shadowRoot.querySelector(
1685
- `[data-monster-role="logged-in-collapse"]`,
1686
- );
1687
-
1688
- this[digitsCollapseSymbol] = this.shadowRoot.querySelector(
1689
- `[data-monster-role="digits-collapse"]`,
1690
- );
1691
-
1692
- this[loginButtonSymbol] = this.shadowRoot.getElementById("loginButton");
1693
- this[requestLinkButtonSymbol] =
1694
- this.shadowRoot.getElementById("requestLinkButton");
1695
- this[secondFactorButtonSymbol] =
1696
- this.shadowRoot.getElementById("secondFactorButton");
1697
- this[digitsButtonSymbol] = this.shadowRoot.getElementById("digitsButton");
1664
+ this[loginElementSymbol] = this.shadowRoot.querySelector(
1665
+ `[${ATTRIBUTE_ROLE}="control"]`,
1666
+ );
1667
+
1668
+ // data-monster-role="forgot-password-link"
1669
+
1670
+ this[forgotPasswordLinkSymbol] = this.shadowRoot.querySelector(
1671
+ `[data-monster-role="forgot-password-link"]`,
1672
+ );
1673
+
1674
+ this[forgotPasswordCollapseSymbol] = this.shadowRoot.querySelector(
1675
+ `[data-monster-role="forgot-password-collapse"]`,
1676
+ );
1677
+
1678
+ this[loginCollapseSymbol] = this.shadowRoot.querySelector(
1679
+ `[data-monster-role="login-collapse"]`,
1680
+ );
1681
+
1682
+ this[loginLinkSymbol] = this.shadowRoot.querySelector(
1683
+ `[data-monster-role="login-link"]`,
1684
+ );
1685
+
1686
+ this[secondFactorCollapseSymbol] = this.shadowRoot.querySelector(
1687
+ `[data-monster-role="second-factor-collapse"]`,
1688
+ );
1689
+
1690
+ this[resetLoginProcessLinksSymbol] = this.shadowRoot.querySelectorAll(
1691
+ `[data-monster-role="reset-login-process-link"]`,
1692
+ );
1693
+
1694
+ this[loggedInCollapseSymbol] = this.shadowRoot.querySelector(
1695
+ `[data-monster-role="logged-in-collapse"]`,
1696
+ );
1697
+
1698
+ this[digitsCollapseSymbol] = this.shadowRoot.querySelector(
1699
+ `[data-monster-role="digits-collapse"]`,
1700
+ );
1701
+
1702
+ this[loginButtonSymbol] = this.shadowRoot.getElementById("loginButton");
1703
+ this[requestLinkButtonSymbol] =
1704
+ this.shadowRoot.getElementById("requestLinkButton");
1705
+ this[secondFactorButtonSymbol] =
1706
+ this.shadowRoot.getElementById("secondFactorButton");
1707
+ this[digitsButtonSymbol] = this.shadowRoot.getElementById("digitsButton");
1698
1708
  }
1699
1709
 
1700
1710
  /**
@@ -1702,8 +1712,8 @@ function initControlReferences() {
1702
1712
  * @return {string}
1703
1713
  */
1704
1714
  function getTemplate() {
1705
- // language=HTML
1706
- return `
1715
+ // language=HTML
1716
+ return `
1707
1717
 
1708
1718
  <template id="urls">
1709
1719
  <li><a data-monster-attributes="href path:urls.url"