@everymatrix/user-login 1.22.2 → 1.22.10

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.
@@ -572,6 +572,20 @@ const renderVdom = (hostRef, renderFnResults) => {
572
572
  // synchronous patch
573
573
  patch(oldVNode, rootVnode);
574
574
  };
575
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
576
+ const createEvent = (ref, name, flags) => {
577
+ const elm = getElement(ref);
578
+ return {
579
+ emit: (detail) => {
580
+ return emitEvent(elm, name, {
581
+ bubbles: !!(flags & 4 /* Bubbles */),
582
+ composed: !!(flags & 2 /* Composed */),
583
+ cancelable: !!(flags & 1 /* Cancellable */),
584
+ detail,
585
+ });
586
+ },
587
+ };
588
+ };
575
589
  /**
576
590
  * Helper function to create & dispatch a custom Event on a provided target
577
591
  * @param elm the target of the Event
@@ -1221,6 +1235,7 @@ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1221
1235
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1222
1236
 
1223
1237
  exports.bootstrapLazy = bootstrapLazy;
1238
+ exports.createEvent = createEvent;
1224
1239
  exports.h = h;
1225
1240
  exports.promiseResolve = promiseResolve;
1226
1241
  exports.registerInstance = registerInstance;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fe0c4e58.js');
5
+ const index = require('./index-82356713.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fe0c4e58.js');
5
+ const index = require('./index-82356713.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de'];
8
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
9
9
  const TRANSLATIONS = {
10
10
  en: {
11
11
  invalidField: 'This field is invalid',
@@ -13,7 +13,8 @@ const TRANSLATIONS = {
13
13
  userEmail: 'Username or Email',
14
14
  password: 'Password',
15
15
  login: 'Login',
16
- genericError: 'An unexpected error has occured'
16
+ genericError: 'An unexpected error has occured',
17
+ successMessage: 'Login successful'
17
18
  },
18
19
  ro: {
19
20
  invalidField: 'This field is invalid',
@@ -21,7 +22,17 @@ const TRANSLATIONS = {
21
22
  userEmail: 'Username or Email',
22
23
  password: 'Password',
23
24
  login: 'Login',
24
- genericError: 'An unexpected error has occured'
25
+ genericError: 'An unexpected error has occured',
26
+ successMessage: 'Login successful'
27
+ },
28
+ hr: {
29
+ invalidField: 'This field is invalid',
30
+ forgotPassword: 'Forgot Password',
31
+ userEmail: 'Username or Email',
32
+ password: 'Password',
33
+ login: 'Login',
34
+ genericError: 'An unexpected error has occured',
35
+ successMessage: 'Login successful'
25
36
  },
26
37
  fr: {
27
38
  invalidField: 'This field is invalid',
@@ -29,7 +40,8 @@ const TRANSLATIONS = {
29
40
  userEmail: 'Username or Email',
30
41
  password: 'Password',
31
42
  login: 'Login',
32
- genericError: 'An unexpected error has occured'
43
+ genericError: 'An unexpected error has occured',
44
+ successMessage: 'Login successful'
33
45
  },
34
46
  cs: {
35
47
  invalidField: 'Ovo polje je nevažeće.',
@@ -37,7 +49,8 @@ const TRANSLATIONS = {
37
49
  userEmail: 'Korisničko ime ili email',
38
50
  password: 'Lozinka',
39
51
  login: 'Prijava',
40
- genericError: 'An unexpected error has occured'
52
+ genericError: 'An unexpected error has occured',
53
+ successMessage: 'Login successful'
41
54
  },
42
55
  de: {
43
56
  invalidField: 'This field is invalid',
@@ -45,7 +58,8 @@ const TRANSLATIONS = {
45
58
  userEmail: 'Username or Email',
46
59
  password: 'Password',
47
60
  login: 'Login',
48
- genericError: 'An unexpected error has occured'
61
+ genericError: 'An unexpected error has occured',
62
+ successMessage: 'Login successful'
49
63
  },
50
64
  };
51
65
  const getTranslations = (url) => {
@@ -80,6 +94,7 @@ const userLoginCss = ":host{display:block;font-family:\"Roboto\", sans-serif}sec
80
94
  const UserLogin = class {
81
95
  constructor(hostRef) {
82
96
  index.registerInstance(this, hostRef);
97
+ this.hasToSetConsents = index.createEvent(this, "hasToSetConsents", 7);
83
98
  /**
84
99
  * Endpoint
85
100
  */
@@ -143,15 +158,22 @@ const UserLogin = class {
143
158
  .then((res) => {
144
159
  return res.json();
145
160
  }).then((data) => {
146
- var _a;
161
+ var _a, _b;
162
+ if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
163
+ this.hasToSetConsents.emit();
164
+ }
147
165
  if (data.sessionId) {
148
166
  window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
167
+ window.postMessage({ type: 'WidgetNotification', data: {
168
+ type: 'success',
169
+ message: translate('successMessage', this.lang)
170
+ } }, window.location.href);
149
171
  this.hasError = false;
150
172
  }
151
173
  else {
152
174
  // handles errors thrown by api
153
175
  this.hasError = true;
154
- this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
176
+ this.errorMessage = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message;
155
177
  console.error(this.errorMessage);
156
178
  window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
157
179
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-fe0c4e58.js');
3
+ const index = require('./index-82356713.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -1,4 +1,4 @@
1
- import { Component, Prop, State, Watch, h } from '@stencil/core';
1
+ import { Component, Prop, State, Watch, Event, h } from '@stencil/core';
2
2
  import { getTranslations, translate } from '../../utils/locale.utils';
3
3
  export class UserLogin {
4
4
  constructor() {
@@ -65,15 +65,22 @@ export class UserLogin {
65
65
  .then((res) => {
66
66
  return res.json();
67
67
  }).then((data) => {
68
- var _a;
68
+ var _a, _b;
69
+ if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
70
+ this.hasToSetConsents.emit();
71
+ }
69
72
  if (data.sessionId) {
70
73
  window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
74
+ window.postMessage({ type: 'WidgetNotification', data: {
75
+ type: 'success',
76
+ message: translate('successMessage', this.lang)
77
+ } }, window.location.href);
71
78
  this.hasError = false;
72
79
  }
73
80
  else {
74
81
  // handles errors thrown by api
75
82
  this.hasError = true;
76
- this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
83
+ this.errorMessage = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message;
77
84
  console.error(this.errorMessage);
78
85
  window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
79
86
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -392,6 +399,22 @@ export class UserLogin {
392
399
  "errorMessage": {},
393
400
  "hasError": {}
394
401
  }; }
402
+ static get events() { return [{
403
+ "method": "hasToSetConsents",
404
+ "name": "hasToSetConsents",
405
+ "bubbles": true,
406
+ "cancelable": true,
407
+ "composed": true,
408
+ "docs": {
409
+ "tags": [],
410
+ "text": ""
411
+ },
412
+ "complexType": {
413
+ "original": "boolean",
414
+ "resolved": "boolean",
415
+ "references": {}
416
+ }
417
+ }]; }
395
418
  static get watchers() { return [{
396
419
  "propName": "translationUrl",
397
420
  "methodName": "handleNewTranslations"
@@ -1,5 +1,5 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de'];
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
3
3
  const TRANSLATIONS = {
4
4
  en: {
5
5
  invalidField: 'This field is invalid',
@@ -7,7 +7,8 @@ const TRANSLATIONS = {
7
7
  userEmail: 'Username or Email',
8
8
  password: 'Password',
9
9
  login: 'Login',
10
- genericError: 'An unexpected error has occured'
10
+ genericError: 'An unexpected error has occured',
11
+ successMessage: 'Login successful'
11
12
  },
12
13
  ro: {
13
14
  invalidField: 'This field is invalid',
@@ -15,7 +16,17 @@ const TRANSLATIONS = {
15
16
  userEmail: 'Username or Email',
16
17
  password: 'Password',
17
18
  login: 'Login',
18
- genericError: 'An unexpected error has occured'
19
+ genericError: 'An unexpected error has occured',
20
+ successMessage: 'Login successful'
21
+ },
22
+ hr: {
23
+ invalidField: 'This field is invalid',
24
+ forgotPassword: 'Forgot Password',
25
+ userEmail: 'Username or Email',
26
+ password: 'Password',
27
+ login: 'Login',
28
+ genericError: 'An unexpected error has occured',
29
+ successMessage: 'Login successful'
19
30
  },
20
31
  fr: {
21
32
  invalidField: 'This field is invalid',
@@ -23,7 +34,8 @@ const TRANSLATIONS = {
23
34
  userEmail: 'Username or Email',
24
35
  password: 'Password',
25
36
  login: 'Login',
26
- genericError: 'An unexpected error has occured'
37
+ genericError: 'An unexpected error has occured',
38
+ successMessage: 'Login successful'
27
39
  },
28
40
  cs: {
29
41
  invalidField: 'Ovo polje je nevažeće.',
@@ -31,7 +43,8 @@ const TRANSLATIONS = {
31
43
  userEmail: 'Korisničko ime ili email',
32
44
  password: 'Lozinka',
33
45
  login: 'Prijava',
34
- genericError: 'An unexpected error has occured'
46
+ genericError: 'An unexpected error has occured',
47
+ successMessage: 'Login successful'
35
48
  },
36
49
  de: {
37
50
  invalidField: 'This field is invalid',
@@ -39,7 +52,8 @@ const TRANSLATIONS = {
39
52
  userEmail: 'Username or Email',
40
53
  password: 'Password',
41
54
  login: 'Login',
42
- genericError: 'An unexpected error has occured'
55
+ genericError: 'An unexpected error has occured',
56
+ successMessage: 'Login successful'
43
57
  },
44
58
  };
45
59
  export const getTranslations = (url) => {
@@ -1,7 +1,7 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de'];
4
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
5
5
  const TRANSLATIONS = {
6
6
  en: {
7
7
  invalidField: 'This field is invalid',
@@ -9,7 +9,8 @@ const TRANSLATIONS = {
9
9
  userEmail: 'Username or Email',
10
10
  password: 'Password',
11
11
  login: 'Login',
12
- genericError: 'An unexpected error has occured'
12
+ genericError: 'An unexpected error has occured',
13
+ successMessage: 'Login successful'
13
14
  },
14
15
  ro: {
15
16
  invalidField: 'This field is invalid',
@@ -17,7 +18,17 @@ const TRANSLATIONS = {
17
18
  userEmail: 'Username or Email',
18
19
  password: 'Password',
19
20
  login: 'Login',
20
- genericError: 'An unexpected error has occured'
21
+ genericError: 'An unexpected error has occured',
22
+ successMessage: 'Login successful'
23
+ },
24
+ hr: {
25
+ invalidField: 'This field is invalid',
26
+ forgotPassword: 'Forgot Password',
27
+ userEmail: 'Username or Email',
28
+ password: 'Password',
29
+ login: 'Login',
30
+ genericError: 'An unexpected error has occured',
31
+ successMessage: 'Login successful'
21
32
  },
22
33
  fr: {
23
34
  invalidField: 'This field is invalid',
@@ -25,7 +36,8 @@ const TRANSLATIONS = {
25
36
  userEmail: 'Username or Email',
26
37
  password: 'Password',
27
38
  login: 'Login',
28
- genericError: 'An unexpected error has occured'
39
+ genericError: 'An unexpected error has occured',
40
+ successMessage: 'Login successful'
29
41
  },
30
42
  cs: {
31
43
  invalidField: 'Ovo polje je nevažeće.',
@@ -33,7 +45,8 @@ const TRANSLATIONS = {
33
45
  userEmail: 'Korisničko ime ili email',
34
46
  password: 'Lozinka',
35
47
  login: 'Prijava',
36
- genericError: 'An unexpected error has occured'
48
+ genericError: 'An unexpected error has occured',
49
+ successMessage: 'Login successful'
37
50
  },
38
51
  de: {
39
52
  invalidField: 'This field is invalid',
@@ -41,7 +54,8 @@ const TRANSLATIONS = {
41
54
  userEmail: 'Username or Email',
42
55
  password: 'Password',
43
56
  login: 'Login',
44
- genericError: 'An unexpected error has occured'
57
+ genericError: 'An unexpected error has occured',
58
+ successMessage: 'Login successful'
45
59
  },
46
60
  };
47
61
  const getTranslations = (url) => {
@@ -78,6 +92,7 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
78
92
  super();
79
93
  this.__registerHost();
80
94
  this.__attachShadow();
95
+ this.hasToSetConsents = createEvent(this, "hasToSetConsents", 7);
81
96
  /**
82
97
  * Endpoint
83
98
  */
@@ -141,15 +156,22 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
141
156
  .then((res) => {
142
157
  return res.json();
143
158
  }).then((data) => {
144
- var _a;
159
+ var _a, _b;
160
+ if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
161
+ this.hasToSetConsents.emit();
162
+ }
145
163
  if (data.sessionId) {
146
164
  window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
165
+ window.postMessage({ type: 'WidgetNotification', data: {
166
+ type: 'success',
167
+ message: translate('successMessage', this.lang)
168
+ } }, window.location.href);
147
169
  this.hasError = false;
148
170
  }
149
171
  else {
150
172
  // handles errors thrown by api
151
173
  this.hasError = true;
152
- this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
174
+ this.errorMessage = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message;
153
175
  console.error(this.errorMessage);
154
176
  window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
155
177
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -550,6 +550,20 @@ const renderVdom = (hostRef, renderFnResults) => {
550
550
  // synchronous patch
551
551
  patch(oldVNode, rootVnode);
552
552
  };
553
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
554
+ const createEvent = (ref, name, flags) => {
555
+ const elm = getElement(ref);
556
+ return {
557
+ emit: (detail) => {
558
+ return emitEvent(elm, name, {
559
+ bubbles: !!(flags & 4 /* Bubbles */),
560
+ composed: !!(flags & 2 /* Composed */),
561
+ cancelable: !!(flags & 1 /* Cancellable */),
562
+ detail,
563
+ });
564
+ },
565
+ };
566
+ };
553
567
  /**
554
568
  * Helper function to create & dispatch a custom Event on a provided target
555
569
  * @param elm the target of the Event
@@ -1198,4 +1212,4 @@ const flush = () => {
1198
1212
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1199
1213
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1200
1214
 
1201
- export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };
1215
+ export { bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-eac3e5db.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-9a6bbcb2.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -1,7 +1,7 @@
1
- import { r as registerInstance, h } from './index-eac3e5db.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-9a6bbcb2.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de'];
4
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
5
5
  const TRANSLATIONS = {
6
6
  en: {
7
7
  invalidField: 'This field is invalid',
@@ -9,7 +9,8 @@ const TRANSLATIONS = {
9
9
  userEmail: 'Username or Email',
10
10
  password: 'Password',
11
11
  login: 'Login',
12
- genericError: 'An unexpected error has occured'
12
+ genericError: 'An unexpected error has occured',
13
+ successMessage: 'Login successful'
13
14
  },
14
15
  ro: {
15
16
  invalidField: 'This field is invalid',
@@ -17,7 +18,17 @@ const TRANSLATIONS = {
17
18
  userEmail: 'Username or Email',
18
19
  password: 'Password',
19
20
  login: 'Login',
20
- genericError: 'An unexpected error has occured'
21
+ genericError: 'An unexpected error has occured',
22
+ successMessage: 'Login successful'
23
+ },
24
+ hr: {
25
+ invalidField: 'This field is invalid',
26
+ forgotPassword: 'Forgot Password',
27
+ userEmail: 'Username or Email',
28
+ password: 'Password',
29
+ login: 'Login',
30
+ genericError: 'An unexpected error has occured',
31
+ successMessage: 'Login successful'
21
32
  },
22
33
  fr: {
23
34
  invalidField: 'This field is invalid',
@@ -25,7 +36,8 @@ const TRANSLATIONS = {
25
36
  userEmail: 'Username or Email',
26
37
  password: 'Password',
27
38
  login: 'Login',
28
- genericError: 'An unexpected error has occured'
39
+ genericError: 'An unexpected error has occured',
40
+ successMessage: 'Login successful'
29
41
  },
30
42
  cs: {
31
43
  invalidField: 'Ovo polje je nevažeće.',
@@ -33,7 +45,8 @@ const TRANSLATIONS = {
33
45
  userEmail: 'Korisničko ime ili email',
34
46
  password: 'Lozinka',
35
47
  login: 'Prijava',
36
- genericError: 'An unexpected error has occured'
48
+ genericError: 'An unexpected error has occured',
49
+ successMessage: 'Login successful'
37
50
  },
38
51
  de: {
39
52
  invalidField: 'This field is invalid',
@@ -41,7 +54,8 @@ const TRANSLATIONS = {
41
54
  userEmail: 'Username or Email',
42
55
  password: 'Password',
43
56
  login: 'Login',
44
- genericError: 'An unexpected error has occured'
57
+ genericError: 'An unexpected error has occured',
58
+ successMessage: 'Login successful'
45
59
  },
46
60
  };
47
61
  const getTranslations = (url) => {
@@ -76,6 +90,7 @@ const userLoginCss = ":host{display:block;font-family:\"Roboto\", sans-serif}sec
76
90
  const UserLogin = class {
77
91
  constructor(hostRef) {
78
92
  registerInstance(this, hostRef);
93
+ this.hasToSetConsents = createEvent(this, "hasToSetConsents", 7);
79
94
  /**
80
95
  * Endpoint
81
96
  */
@@ -139,15 +154,22 @@ const UserLogin = class {
139
154
  .then((res) => {
140
155
  return res.json();
141
156
  }).then((data) => {
142
- var _a;
157
+ var _a, _b;
158
+ if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
159
+ this.hasToSetConsents.emit();
160
+ }
143
161
  if (data.sessionId) {
144
162
  window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
163
+ window.postMessage({ type: 'WidgetNotification', data: {
164
+ type: 'success',
165
+ message: translate('successMessage', this.lang)
166
+ } }, window.location.href);
145
167
  this.hasError = false;
146
168
  }
147
169
  else {
148
170
  // handles errors thrown by api
149
171
  this.hasError = true;
150
- this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
172
+ this.errorMessage = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message;
151
173
  console.error(this.errorMessage);
152
174
  window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
153
175
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-eac3e5db.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-9a6bbcb2.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -1,3 +1,4 @@
1
+ import { Event, EventEmitter } from '../../stencil-public-runtime';
1
2
  export declare class UserLogin {
2
3
  /**
3
4
  * Endpoint
@@ -53,6 +54,7 @@ export declare class UserLogin {
53
54
  private limitStylingAppends;
54
55
  private errorMessage;
55
56
  private hasError;
57
+ hasToSetConsents: EventEmitter<boolean>;
56
58
  handleNewTranslations(): void;
57
59
  componentWillLoad(): Promise<void>;
58
60
  private stylingContainer;
@@ -78,6 +78,7 @@ declare namespace LocalJSX {
78
78
  * Language
79
79
  */
80
80
  "lang"?: string;
81
+ "onHasToSetConsents"?: (event: CustomEvent<boolean>) => void;
81
82
  /**
82
83
  * Password regex
83
84
  */
@@ -0,0 +1 @@
1
+ import{r as s,c as i,h as t}from"./p-8235eaf1.js";const o=["ro","en","cz","de","hr"],e={en:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},ro:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},hr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},fr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},cs:{invalidField:"Ovo polje je nevažeće.",forgotPassword:"Zaboravio sam lozinku ",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"An unexpected error has occured",successMessage:"Login successful"},de:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"}},r=s=>new Promise((i=>{fetch(s).then((s=>s.json())).then((s=>{Object.keys(s).forEach((i=>{for(let t in s[i])e[i][t]=s[i][t]})),i(!0)}))})),n=(s,i,t)=>{const r=i;let n=e[void 0!==r&&o.includes(r)?r:"en"][s];if(void 0!==t)for(const[s,i]of Object.entries(t.values)){const t=new RegExp(`{${s}}`,"g");n=n.replace(t,i)}return n},a=class{constructor(t){s(this,t),this.hasToSetConsents=i(this,"hasToSetConsents",7),this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegexOptions="i",this.passwordRegexOptions="",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.isValidPassword=!0,this.isPasswordVisible=!1,this.limitStylingAppends=!1,this.errorMessage="",this.hasError=!1,this.userLogin=async({username:s,password:i})=>{let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:i})};fetch(`${this.endpoint}/v1/player/legislation/login`,t).then((s=>s.json())).then((s=>{var i,t;(null===(i=s.sessionBlockers)||void 0===i?void 0:i.includes("has-to-set-consents"))&&this.hasToSetConsents.emit(),s.sessionId?(window.postMessage({type:"UserSessionID",session:s.sessionId,userid:s.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorMessage=null===(t=null==s?void 0:s.thirdPartyResponse)||void 0===t?void 0:t.message,console.error(this.errorMessage),window.postMessage({type:"HasError",error:this.errorMessage},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href))})).catch((s=>{console.error(s),this.hasError=!0,this.errorMessage=n("genericError",this.lang),window.postMessage({type:"HasError",error:this.errorMessage},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href)}))},this.setClientStyling=()=>{let s=document.createElement("style");s.innerHTML=this.clientStyling,this.stylingContainer.appendChild(s)},this.setClientStylingURL=()=>{let s=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(s.href).then((s=>s.text())).then((s=>{i.innerHTML=s,setTimeout((()=>{this.stylingContainer.appendChild(i)}),1)}))},this.handleInputChange=(s,i)=>{this.hasError=!1;const t=s.target.value;"user"===i?(this.userNameEmail=t,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=t,this.isValidPassword=this.passwordValidation(t))},this.userEmailValidation=s=>new RegExp(this.userEmailRegex,this.userEmailRegexOptions).test(s),this.passwordValidation=s=>new RegExp(this.passwordRegex,this.passwordRegexOptions).test(s),this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)}}handleNewTranslations(){r(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await r(this.translationUrl)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let s=t("span",{class:"InputIcon"},this.isPasswordVisible&&t("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.844",height:"12.887",viewBox:"0 0 18.844 12.887"},t("g",{transform:"translate(-110.856 -23.242)"},t("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),t("g",{transform:"translate(117.499 27.37)"},t("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),t("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),t("g",{transform:"translate(110.856 24.899)"},t("path",{class:"PasswordVisibilityIcon",d:"M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z",transform:"translate(-110.856 -33.157)"}),t("path",{class:"PasswordVisibilityIcon",d:"M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z",transform:"translate(-130.743 -29.617)"})),t("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&t("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility PasswordVisible",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.843",height:"10.5",viewBox:"0 0 18.843 10.5"},t("g",{transform:"translate(-14.185 -27.832)"},t("path",{class:"PasswordVisibilityIcon",d:"M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z",transform:"translate(0)"}),t("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=t("div",{class:"FormBox"},t("div",{class:"FormValue"},t("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},t("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:s=>this.handleInputChange(s,"user"),onInput:s=>this.handleInputChange(s,"user"),required:!0}),t("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},n("userEmail",this.lang)),!this.isValidUserEmail&&t("p",{class:"InvalidField"},n("invalidField",this.lang))),t("div",{class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},s,t("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:s=>this.handleInputChange(s,"password"),onInput:s=>this.handleInputChange(s,"password"),required:!0}),t("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},n("password",this.lang)),!this.isValidPassword&&t("p",{class:"InvalidField"},n("invalidField",this.lang))),"true"==this.passwordReset&&t("div",{class:"ForgotPassword"},t("button",{onClick:()=>this.resetPassword()},n("forgotPassword",this.lang))),t("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.userLogin({username:this.userNameEmail,password:this.userPassword})},n("login",this.lang)),this.hasError&&t("p",{class:"CredentialsError"},this.errorMessage?this.errorMessage:n("genericError",this.lang))));return t("section",{ref:s=>this.stylingContainer=s},i)}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};a.style=':host{display:block;font-family:"Roboto", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:#fff;background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{a as user_login}
@@ -0,0 +1 @@
1
+ let e,t,n=!1,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},r={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=new WeakMap,a=e=>"sc-"+e.o,f={},h=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!h(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?d(null,l):l),o=s)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=d(e,null);return i.u=t,r.length>0&&(i.h=r),i},d=(e,t)=>({t:0,$:e,i:t,m:null,h:null,u:null}),m={},p=(e,t,n,l,o,c)=>{if(n!==l){let i=z(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=b(n),o=b(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const s=h(l);if((i||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):z(s,u)?u.slice(2):u[2]+t.slice(3),n&&r.rel(e,t,n,!1),l&&r.ael(e,t,l,!1)}},y=/\s/,b=e=>e?e.split(y):[],w=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||f,r=t.u||f;for(l in o)l in r||p(s,l,o[l],void 0,n,t.t);for(l in r)p(s,l,o[l],r[l],n,t.t)},g=(t,l,s)=>{let r,c,i=l.h[s],u=0;if(null!==i.i)r=i.m=o.createTextNode(i.i);else{if(n||(n="svg"===i.$),r=i.m=o.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.$),n&&"foreignObject"===i.$&&(n=!1),w(null,i,n),null!=e&&r["s-si"]!==e&&r.classList.add(r["s-si"]=e),i.h)for(u=0;u<i.h.length;++u)c=g(t,i,u),c&&r.appendChild(c);"svg"===i.$?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},S=(e,n,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=g(null,l,o),c&&(s[o].m=c,i.insertBefore(c,n)))},j=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,M(l),s.remove())},v=(e,t)=>e.$===t.$,O=(e,t)=>{const l=t.m=e.m,s=e.h,o=t.h,r=t.$,c=t.i;null===c?(n="svg"===r||"foreignObject"!==r&&n,w(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o=0,r=0,c=t.length-1,i=t[0],u=t[c],a=l.length-1,f=l[0],h=l[a];for(;o<=c&&r<=a;)null==i?i=t[++o]:null==u?u=t[--c]:null==f?f=l[++r]:null==h?h=l[--a]:v(i,f)?(O(i,f),i=t[++o],f=l[++r]):v(u,h)?(O(u,h),u=t[--c],h=l[--a]):v(i,h)?(O(i,h),e.insertBefore(i.m,u.m.nextSibling),i=t[++o],h=l[--a]):v(u,f)?(O(u,f),e.insertBefore(u.m,i.m),u=t[--c],f=l[++r]):(s=g(t&&t[r],n,r),f=l[++r],s&&i.m.parentNode.insertBefore(s,i.m));o>c?S(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&j(t,o,c)})(l,s,t,o):null!==o?(null!==e.i&&(l.textContent=""),S(l,null,t,o,0,o.length-1)):null!==s&&j(s,0,s.length-1),n&&"svg"===r&&(n=!1)):e.i!==c&&(l.data=c)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(M)},k=(e,t,n)=>{const l=(e=>H(e).p)(e);return{emit:e=>C(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},C=(e,t,n)=>{const l=r.ce(t,n);return e.dispatchEvent(l),l},x=(e,t)=>{t&&!e.g&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.g=t)))},P=(e,t)=>{if(e.t|=16,!(4&e.t))return x(e,e.S),te((()=>E(e,t)));e.t|=512},E=(e,t)=>{const n=e.j;let l;return t&&(l=W(n,"componentWillLoad")),A(l,(()=>L(e,n,t)))},L=async(e,t,n)=>{const l=e.p,s=l["s-rc"];n&&(e=>{const t=e.v,n=e.p,l=t.t,s=((e,t)=>{let n=a(t),l=J.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=u.get(e=e.head||e);s||u.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);N(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>R(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},N=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.p,o=n.v,r=n.O||d(null,null),c=(e=>e&&e.$===m)(l)?l:$(null,null,l);t=s.tagName,o.M&&(c.u=c.u||{},o.M.map((([e,t])=>c.u[t]=s[e]))),c.$=null,c.t|=4,n.O=c,c.m=r.m=s.shadowRoot||s,e=s["s-sc"],O(r,c)})(n,l)}catch(e){B(e,n.p)}return null},R=e=>{const t=e.p,n=e.S;W(e.j,"componentDidRender"),64&e.t||(e.t|=64,U(t),e.k(t),n||T()),e.g&&(e.g(),e.g=void 0),512&e.t&&ee((()=>P(e,!1))),e.t&=-517},T=()=>{U(o.documentElement),ee((()=>C(s,"appload",{detail:{namespace:"user-login"}})))},W=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){B(e)}},A=(e,t)=>e&&e.then?e.then(t):t(),U=e=>e.classList.add("hydrated"),q=(e,t,n)=>{if(t.C){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>H(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=H(e),o=s.p,r=s.L.get(t),c=s.t,i=s.j;if(n=((e,t)=>null==e||h(e)?e:1&t?e+"":e)(n,l.C[t][0]),(!(8&c)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(s.L.set(t,n),i)){if(l.P&&128&c){const e=l.P[t];e&&e.map((e=>{try{i[e](n,r,t)}catch(e){B(e,o)}}))}2==(18&c)&&P(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){r.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.M.push([e,s]),s}))}}return e},D=(e,t={})=>{const n=[],l=t.exclude||[],c=s.customElements,u=o.head,f=u.querySelector("meta[charset]"),h=o.createElement("style"),$=[];let d,m=!0;Object.assign(r,t),r.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],o:t[1],C:t[2],N:t[3]};s.C=t[2],s.M=[],s.P={};const o=s.o,u=class extends HTMLElement{constructor(e){super(e),_(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),m?$.push(this):r.jmp((()=>(e=>{if(0==(1&r.t)){const t=H(e),n=t.v,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){x(t,t.S=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=I(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,q(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){B(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=a(n);if(!J.has(t)){const l=()=>{};((e,t,n)=>{let l=J.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,J.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.S,r=()=>P(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){r.jmp((()=>{}))}componentOnReady(){return H(this).R}};s.T=e[0],l.includes(o)||c.get(o)||(n.push(o),c.define(o,q(u,s,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,f?f.nextSibling:u.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):r.jmp((()=>d=setTimeout(T,30)))},F=new WeakMap,H=e=>F.get(e),V=(e,t)=>F.set(t.j=e,t),_=(e,t)=>{const n={t:0,p:e,v:t,L:new Map};return n.R=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],F.set(e,n)},z=(e,t)=>t in e,B=(e,t)=>(0,console.error)(e,t),G=new Map,I=e=>{const t=e.o.replace(/-/g,"_"),n=e.T,l=G.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(G.set(n,e),e[t])),B)},J=new Map,K=[],Q=[],X=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&r.t?ee(Z):r.raf(Z))},Y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){B(e)}e.length=0},Z=()=>{Y(K),Y(Q),(l=K.length>0)&&r.raf(Z)},ee=e=>c().then(e),te=X(Q,!0);export{D as b,k as c,$ as h,c as p,V as r}
@@ -1 +1 @@
1
- import{p as s,b as e}from"./p-0c865c25.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),s(r)})().then((s=>e([["p-a601ec59",[[1,"user-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],passwordReset:[513,"password-reset"],userEmailRegex:[513,"user-email-regex"],userEmailRegexOptions:[513,"user-email-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],isValidPassword:[32],isPasswordVisible:[32],limitStylingAppends:[32],errorMessage:[32],hasError:[32]}]]]],s)));
1
+ import{p as s,b as e}from"./p-8235eaf1.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),s(r)})().then((s=>e([["p-0851f4d7",[[1,"user-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],passwordReset:[513,"password-reset"],userEmailRegex:[513,"user-email-regex"],userEmailRegexOptions:[513,"user-email-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],isValidPassword:[32],isPasswordVisible:[32],limitStylingAppends:[32],errorMessage:[32],hasError:[32]}]]]],s)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-login",
3
- "version": "1.22.2",
3
+ "version": "1.22.10",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- let e,t,n=!1,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},r={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=new WeakMap,a=e=>"sc-"+e.o,f={},h=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!h(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?p(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.h=r),c},p=(e,t)=>({t:0,$:e,i:t,p:null,h:null,u:null}),y={},d=(e,t,n,l,o,i)=>{if(n!==l){let c=V(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=w(n),o=w(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const s=h(l);if((c||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):V(s,u)?u.slice(2):u[2]+t.slice(3),n&&r.rel(e,t,n,!1),l&&r.ael(e,t,l,!1)}},m=/\s/,w=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.p.nodeType&&t.p.host?t.p.host:t.p,o=e&&e.u||f,r=t.u||f;for(l in o)l in r||d(s,l,o[l],void 0,n,t.t);for(l in r)d(s,l,o[l],r[l],n,t.t)},g=(t,l,s)=>{let r,i,c=l.h[s],u=0;if(null!==c.i)r=c.p=o.createTextNode(c.i);else{if(n||(n="svg"===c.$),r=c.p=o.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.$),n&&"foreignObject"===c.$&&(n=!1),b(null,c,n),null!=e&&r["s-si"]!==e&&r.classList.add(r["s-si"]=e),c.h)for(u=0;u<c.h.length;++u)i=g(t,c,u),i&&r.appendChild(i);"svg"===c.$?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=g(null,l,o),i&&(s[o].p=i,c.insertBefore(i,n)))},j=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.p,M(l),s.remove())},v=(e,t)=>e.$===t.$,O=(e,t)=>{const l=t.p=e.p,s=e.h,o=t.h,r=t.$,i=t.i;null===i?(n="svg"===r||"foreignObject"!==r&&n,b(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],h=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==h?h=l[--a]:v(c,f)?(O(c,f),c=t[++o],f=l[++r]):v(u,h)?(O(u,h),u=t[--i],h=l[--a]):v(c,h)?(O(c,h),e.insertBefore(c.p,u.p.nextSibling),c=t[++o],h=l[--a]):v(u,f)?(O(u,f),e.insertBefore(u.p,c.p),u=t[--i],f=l[++r]):(s=g(t&&t[r],n,r),f=l[++r],s&&c.p.parentNode.insertBefore(s,c.p));o>i?S(e,null==l[a+1]?null:l[a+1].p,n,l,r,a):r>a&&j(t,o,i)})(l,s,t,o):null!==o?(null!==e.i&&(l.textContent=""),S(l,null,t,o,0,o.length-1)):null!==s&&j(s,0,s.length-1),n&&"svg"===r&&(n=!1)):e.i!==i&&(l.data=i)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(M)},k=(e,t)=>{t&&!e.m&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.m=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.g),Z((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.S;let l;return t&&(l=R(n,"componentWillLoad")),T(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.j,s=l["s-rc"];n&&(e=>{const t=e.v,n=e.j,l=t.t,s=((e,t)=>{let n=a(t),l=G.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=u.get(e=e.head||e);s||u.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);E(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},E=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.v,r=n.O||p(null,null),i=(e=>e&&e.$===y)(l)?l:$(null,null,l);t=s.tagName,o.M&&(i.u=i.u||{},o.M.map((([e,t])=>i.u[t]=s[e]))),i.$=null,i.t|=4,n.O=i,i.p=r.p=s.shadowRoot||s,e=s["s-sc"],O(r,i)})(n,l)}catch(e){_(e,n.j)}return null},L=e=>{const t=e.j,n=e.g;R(e.S,"componentDidRender"),64&e.t||(e.t|=64,W(t),e.k(t),n||N()),e.m&&(e.m(),e.m=void 0),512&e.t&&Y((()=>C(e,!1))),e.t&=-517},N=()=>{W(o.documentElement),Y((()=>(e=>{const t=r.ce("appload",{detail:{namespace:"user-login"}});return e.dispatchEvent(t),t})(s)))},R=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){_(e)}},T=(e,t)=>e&&e.then?e.then(t):t(),W=e=>e.classList.add("hydrated"),A=(e,t,n)=>{if(t.C){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>D(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=D(e),o=s.j,r=s.L.get(t),i=s.t,c=s.S;if(n=((e,t)=>null==e||h(e)?e:1&t?e+"":e)(n,l.C[t][0]),(!(8&i)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(s.L.set(t,n),c)){if(l.P&&128&i){const e=l.P[t];e&&e.map((e=>{try{c[e](n,r,t)}catch(e){_(e,o)}}))}2==(18&i)&&C(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){r.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.M.push([e,s]),s}))}}return e},U=(e,t={})=>{const n=[],l=t.exclude||[],i=s.customElements,u=o.head,f=u.querySelector("meta[charset]"),h=o.createElement("style"),$=[];let p,y=!0;Object.assign(r,t),r.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],o:t[1],C:t[2],N:t[3]};s.C=t[2],s.M=[],s.P={};const o=s.o,u=class extends HTMLElement{constructor(e){super(e),H(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),y?$.push(this):r.jmp((()=>(e=>{if(0==(1&r.t)){const t=D(e),n=t.v,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=B(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,A(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){_(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=a(n);if(!G.has(t)){const l=()=>{};((e,t,n)=>{let l=G.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,G.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>C(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){r.jmp((()=>{}))}componentOnReady(){return D(this).R}};s.T=e[0],l.includes(o)||i.get(o)||(n.push(o),i.define(o,A(u,s,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,f?f.nextSibling:u.firstChild),y=!1,$.length?$.map((e=>e.connectedCallback())):r.jmp((()=>p=setTimeout(N,30)))},q=new WeakMap,D=e=>q.get(e),F=(e,t)=>q.set(t.S=e,t),H=(e,t)=>{const n={t:0,j:e,v:t,L:new Map};return n.R=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],q.set(e,n)},V=(e,t)=>t in e,_=(e,t)=>(0,console.error)(e,t),z=new Map,B=e=>{const t=e.o.replace(/-/g,"_"),n=e.T,l=z.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(z.set(n,e),e[t])),_)},G=new Map,I=[],J=[],K=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&r.t?Y(X):r.raf(X))},Q=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){_(e)}e.length=0},X=()=>{Q(I),Q(J),(l=I.length>0)&&r.raf(X)},Y=e=>i().then(e),Z=K(J,!0);export{U as b,$ as h,i as p,F as r}
@@ -1 +0,0 @@
1
- import{r as i,h as s}from"./p-0c865c25.js";const t=["ro","en","cz","de"],o={en:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured"},ro:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured"},fr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured"},cs:{invalidField:"Ovo polje je nevažeće.",forgotPassword:"Zaboravio sam lozinku ",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"An unexpected error has occured"},de:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured"}},e=i=>new Promise((s=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((s=>{for(let t in i[s])o[s][t]=i[s][t]})),s(!0)}))})),r=(i,s,e)=>{const r=s;let n=o[void 0!==r&&t.includes(r)?r:"en"][i];if(void 0!==e)for(const[i,s]of Object.entries(e.values)){const t=new RegExp(`{${i}}`,"g");n=n.replace(t,s)}return n},n=class{constructor(s){i(this,s),this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegexOptions="i",this.passwordRegexOptions="",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.isValidPassword=!0,this.isPasswordVisible=!1,this.limitStylingAppends=!1,this.errorMessage="",this.hasError=!1,this.userLogin=async({username:i,password:s})=>{let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i,password:s})};fetch(`${this.endpoint}/v1/player/legislation/login`,t).then((i=>i.json())).then((i=>{var s;i.sessionId?(window.postMessage({type:"UserSessionID",session:i.sessionId,userid:i.userId},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorMessage=null===(s=null==i?void 0:i.thirdPartyResponse)||void 0===s?void 0:s.message,console.error(this.errorMessage),window.postMessage({type:"HasError",error:this.errorMessage},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href))})).catch((i=>{console.error(i),this.hasError=!0,this.errorMessage=r("genericError",this.lang),window.postMessage({type:"HasError",error:this.errorMessage},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href)}))},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.appendChild(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(i.href).then((i=>i.text())).then((i=>{s.innerHTML=i,setTimeout((()=>{this.stylingContainer.appendChild(s)}),1)}))},this.handleInputChange=(i,s)=>{this.hasError=!1;const t=i.target.value;"user"===s?(this.userNameEmail=t,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=t,this.isValidPassword=this.passwordValidation(t))},this.userEmailValidation=i=>new RegExp(this.userEmailRegex,this.userEmailRegexOptions).test(i),this.passwordValidation=i=>new RegExp(this.passwordRegex,this.passwordRegexOptions).test(i),this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)}}handleNewTranslations(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let i=s("span",{class:"InputIcon"},this.isPasswordVisible&&s("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.844",height:"12.887",viewBox:"0 0 18.844 12.887"},s("g",{transform:"translate(-110.856 -23.242)"},s("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),s("g",{transform:"translate(117.499 27.37)"},s("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),s("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),s("g",{transform:"translate(110.856 24.899)"},s("path",{class:"PasswordVisibilityIcon",d:"M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z",transform:"translate(-110.856 -33.157)"}),s("path",{class:"PasswordVisibilityIcon",d:"M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z",transform:"translate(-130.743 -29.617)"})),s("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&s("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility PasswordVisible",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.843",height:"10.5",viewBox:"0 0 18.843 10.5"},s("g",{transform:"translate(-14.185 -27.832)"},s("path",{class:"PasswordVisibilityIcon",d:"M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z",transform:"translate(0)"}),s("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),t=s("div",{class:"FormBox"},s("div",{class:"FormValue"},s("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},s("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:i=>this.handleInputChange(i,"user"),onInput:i=>this.handleInputChange(i,"user"),required:!0}),s("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&s("p",{class:"InvalidField"},r("invalidField",this.lang))),s("div",{class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},i,s("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:i=>this.handleInputChange(i,"password"),onInput:i=>this.handleInputChange(i,"password"),required:!0}),s("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&s("p",{class:"InvalidField"},r("invalidField",this.lang))),"true"==this.passwordReset&&s("div",{class:"ForgotPassword"},s("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),s("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.userLogin({username:this.userNameEmail,password:this.userPassword})},r("login",this.lang)),this.hasError&&s("p",{class:"CredentialsError"},this.errorMessage?this.errorMessage:r("genericError",this.lang))));return s("section",{ref:i=>this.stylingContainer=i},t)}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};n.style=':host{display:block;font-family:"Roboto", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:#fff;background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{n as user_login}