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