@everymatrix/user-login 1.31.0 → 1.31.2

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.
@@ -691,6 +691,9 @@ const postUpdateComponent = (hostRef) => {
691
691
  // DOM WRITE!
692
692
  addHydratedFlag(elm);
693
693
  }
694
+ {
695
+ safeCall(instance, 'componentDidLoad');
696
+ }
694
697
  endPostUpdate();
695
698
  {
696
699
  hostRef.$onReadyResolve$(elm);
@@ -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-c277c06d.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -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-c277c06d.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
@@ -158,6 +158,33 @@ const UserLogin = class {
158
158
  this.limitStylingAppends = false;
159
159
  this.errorMessage = '';
160
160
  this.hasError = false;
161
+ this.setClientStyling = () => {
162
+ let sheet = document.createElement('style');
163
+ sheet.innerHTML = this.clientStyling;
164
+ this.stylingContainer.appendChild(sheet);
165
+ };
166
+ this.setClientStylingURL = () => {
167
+ let url = new URL(this.clientStylingUrl);
168
+ let cssFile = document.createElement('style');
169
+ fetch(url.href)
170
+ .then((res) => res.text())
171
+ .then((data) => {
172
+ cssFile.innerHTML = data;
173
+ setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
174
+ });
175
+ };
176
+ this.messageHandler = (e) => {
177
+ switch (e.data.type) {
178
+ case 'SendLoginCredentials':
179
+ this.userNameEmail = e.data.data.userNameEmail;
180
+ this.userPassword = e.data.data.userPassword;
181
+ this.userLogin({
182
+ username: this.userNameEmail,
183
+ password: this.userPassword
184
+ });
185
+ break;
186
+ }
187
+ };
161
188
  this.userLogin = async ({ username, password }) => {
162
189
  let headers = {
163
190
  'Content-Type': 'application/json'
@@ -214,21 +241,6 @@ const UserLogin = class {
214
241
  password: this.userPassword
215
242
  });
216
243
  };
217
- this.setClientStyling = () => {
218
- let sheet = document.createElement('style');
219
- sheet.innerHTML = this.clientStyling;
220
- this.stylingContainer.appendChild(sheet);
221
- };
222
- this.setClientStylingURL = () => {
223
- let url = new URL(this.clientStylingUrl);
224
- let cssFile = document.createElement('style');
225
- fetch(url.href)
226
- .then((res) => res.text())
227
- .then((data) => {
228
- cssFile.innerHTML = data;
229
- setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
230
- });
231
- };
232
244
  this.handleInputChange = (event, location) => {
233
245
  this.hasError = false;
234
246
  const inputValue = event.target.value;
@@ -264,6 +276,20 @@ const UserLogin = class {
264
276
  await getTranslations(this.translationUrl);
265
277
  }
266
278
  }
279
+ componentDidLoad() {
280
+ window.addEventListener('message', this.messageHandler);
281
+ }
282
+ componentDidRender() {
283
+ // start custom styling area
284
+ if (!this.limitStylingAppends && this.stylingContainer) {
285
+ if (this.clientStyling)
286
+ this.setClientStyling();
287
+ if (this.clientStylingUrl)
288
+ this.setClientStylingURL();
289
+ this.limitStylingAppends = true;
290
+ }
291
+ // end custom styling area
292
+ }
267
293
  sendErrorNotification(errorMessage) {
268
294
  window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
269
295
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -280,17 +306,6 @@ const UserLogin = class {
280
306
  }, delay);
281
307
  };
282
308
  }
283
- componentDidRender() {
284
- // start custom styling area
285
- if (!this.limitStylingAppends && this.stylingContainer) {
286
- if (this.clientStyling)
287
- this.setClientStyling();
288
- if (this.clientStylingUrl)
289
- this.setClientStylingURL();
290
- this.limitStylingAppends = true;
291
- }
292
- // end custom styling area
293
- }
294
309
  render() {
295
310
  let visibilityIcon = index.h("span", { class: "InputIcon" }, this.isPasswordVisible &&
296
311
  index.h("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" }, index.h("g", { transform: "translate(-110.856 -23.242)" }, index.h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { transform: "translate(117.499 27.37)" }, index.h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), index.h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), index.h("g", { transform: "translate(110.856 24.899)" }, index.h("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)" }), index.h("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)" })), index.h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-fe0c4e58.js');
3
+ const index = require('./index-c277c06d.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -48,6 +48,33 @@ export class UserLogin {
48
48
  this.limitStylingAppends = false;
49
49
  this.errorMessage = '';
50
50
  this.hasError = false;
51
+ this.setClientStyling = () => {
52
+ let sheet = document.createElement('style');
53
+ sheet.innerHTML = this.clientStyling;
54
+ this.stylingContainer.appendChild(sheet);
55
+ };
56
+ this.setClientStylingURL = () => {
57
+ let url = new URL(this.clientStylingUrl);
58
+ let cssFile = document.createElement('style');
59
+ fetch(url.href)
60
+ .then((res) => res.text())
61
+ .then((data) => {
62
+ cssFile.innerHTML = data;
63
+ setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
64
+ });
65
+ };
66
+ this.messageHandler = (e) => {
67
+ switch (e.data.type) {
68
+ case 'SendLoginCredentials':
69
+ this.userNameEmail = e.data.data.userNameEmail;
70
+ this.userPassword = e.data.data.userPassword;
71
+ this.userLogin({
72
+ username: this.userNameEmail,
73
+ password: this.userPassword
74
+ });
75
+ break;
76
+ }
77
+ };
51
78
  this.userLogin = async ({ username, password }) => {
52
79
  let headers = {
53
80
  'Content-Type': 'application/json'
@@ -104,21 +131,6 @@ export class UserLogin {
104
131
  password: this.userPassword
105
132
  });
106
133
  };
107
- this.setClientStyling = () => {
108
- let sheet = document.createElement('style');
109
- sheet.innerHTML = this.clientStyling;
110
- this.stylingContainer.appendChild(sheet);
111
- };
112
- this.setClientStylingURL = () => {
113
- let url = new URL(this.clientStylingUrl);
114
- let cssFile = document.createElement('style');
115
- fetch(url.href)
116
- .then((res) => res.text())
117
- .then((data) => {
118
- cssFile.innerHTML = data;
119
- setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
120
- });
121
- };
122
134
  this.handleInputChange = (event, location) => {
123
135
  this.hasError = false;
124
136
  const inputValue = event.target.value;
@@ -154,6 +166,20 @@ export class UserLogin {
154
166
  await getTranslations(this.translationUrl);
155
167
  }
156
168
  }
169
+ componentDidLoad() {
170
+ window.addEventListener('message', this.messageHandler);
171
+ }
172
+ componentDidRender() {
173
+ // start custom styling area
174
+ if (!this.limitStylingAppends && this.stylingContainer) {
175
+ if (this.clientStyling)
176
+ this.setClientStyling();
177
+ if (this.clientStylingUrl)
178
+ this.setClientStylingURL();
179
+ this.limitStylingAppends = true;
180
+ }
181
+ // end custom styling area
182
+ }
157
183
  sendErrorNotification(errorMessage) {
158
184
  window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
159
185
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -170,17 +196,6 @@ export class UserLogin {
170
196
  }, delay);
171
197
  };
172
198
  }
173
- componentDidRender() {
174
- // start custom styling area
175
- if (!this.limitStylingAppends && this.stylingContainer) {
176
- if (this.clientStyling)
177
- this.setClientStyling();
178
- if (this.clientStylingUrl)
179
- this.setClientStylingURL();
180
- this.limitStylingAppends = true;
181
- }
182
- // end custom styling area
183
- }
184
199
  render() {
185
200
  let visibilityIcon = h("span", { class: "InputIcon" },
186
201
  this.isPasswordVisible &&
@@ -156,6 +156,33 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
156
156
  this.limitStylingAppends = false;
157
157
  this.errorMessage = '';
158
158
  this.hasError = false;
159
+ this.setClientStyling = () => {
160
+ let sheet = document.createElement('style');
161
+ sheet.innerHTML = this.clientStyling;
162
+ this.stylingContainer.appendChild(sheet);
163
+ };
164
+ this.setClientStylingURL = () => {
165
+ let url = new URL(this.clientStylingUrl);
166
+ let cssFile = document.createElement('style');
167
+ fetch(url.href)
168
+ .then((res) => res.text())
169
+ .then((data) => {
170
+ cssFile.innerHTML = data;
171
+ setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
172
+ });
173
+ };
174
+ this.messageHandler = (e) => {
175
+ switch (e.data.type) {
176
+ case 'SendLoginCredentials':
177
+ this.userNameEmail = e.data.data.userNameEmail;
178
+ this.userPassword = e.data.data.userPassword;
179
+ this.userLogin({
180
+ username: this.userNameEmail,
181
+ password: this.userPassword
182
+ });
183
+ break;
184
+ }
185
+ };
159
186
  this.userLogin = async ({ username, password }) => {
160
187
  let headers = {
161
188
  'Content-Type': 'application/json'
@@ -212,21 +239,6 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
212
239
  password: this.userPassword
213
240
  });
214
241
  };
215
- this.setClientStyling = () => {
216
- let sheet = document.createElement('style');
217
- sheet.innerHTML = this.clientStyling;
218
- this.stylingContainer.appendChild(sheet);
219
- };
220
- this.setClientStylingURL = () => {
221
- let url = new URL(this.clientStylingUrl);
222
- let cssFile = document.createElement('style');
223
- fetch(url.href)
224
- .then((res) => res.text())
225
- .then((data) => {
226
- cssFile.innerHTML = data;
227
- setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
228
- });
229
- };
230
242
  this.handleInputChange = (event, location) => {
231
243
  this.hasError = false;
232
244
  const inputValue = event.target.value;
@@ -262,6 +274,20 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
262
274
  await getTranslations(this.translationUrl);
263
275
  }
264
276
  }
277
+ componentDidLoad() {
278
+ window.addEventListener('message', this.messageHandler);
279
+ }
280
+ componentDidRender() {
281
+ // start custom styling area
282
+ if (!this.limitStylingAppends && this.stylingContainer) {
283
+ if (this.clientStyling)
284
+ this.setClientStyling();
285
+ if (this.clientStylingUrl)
286
+ this.setClientStylingURL();
287
+ this.limitStylingAppends = true;
288
+ }
289
+ // end custom styling area
290
+ }
265
291
  sendErrorNotification(errorMessage) {
266
292
  window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
267
293
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -278,17 +304,6 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
278
304
  }, delay);
279
305
  };
280
306
  }
281
- componentDidRender() {
282
- // start custom styling area
283
- if (!this.limitStylingAppends && this.stylingContainer) {
284
- if (this.clientStyling)
285
- this.setClientStyling();
286
- if (this.clientStylingUrl)
287
- this.setClientStylingURL();
288
- this.limitStylingAppends = true;
289
- }
290
- // end custom styling area
291
- }
292
307
  render() {
293
308
  let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
294
309
  h("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" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { transform: "translate(110.856 24.899)" }, h("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)" }), h("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)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
@@ -669,6 +669,9 @@ const postUpdateComponent = (hostRef) => {
669
669
  // DOM WRITE!
670
670
  addHydratedFlag(elm);
671
671
  }
672
+ {
673
+ safeCall(instance, 'componentDidLoad');
674
+ }
672
675
  endPostUpdate();
673
676
  {
674
677
  hostRef.$onReadyResolve$(elm);
@@ -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-adf399de.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-eac3e5db.js';
1
+ import { r as registerInstance, h } from './index-adf399de.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
@@ -154,6 +154,33 @@ const UserLogin = class {
154
154
  this.limitStylingAppends = false;
155
155
  this.errorMessage = '';
156
156
  this.hasError = false;
157
+ this.setClientStyling = () => {
158
+ let sheet = document.createElement('style');
159
+ sheet.innerHTML = this.clientStyling;
160
+ this.stylingContainer.appendChild(sheet);
161
+ };
162
+ this.setClientStylingURL = () => {
163
+ let url = new URL(this.clientStylingUrl);
164
+ let cssFile = document.createElement('style');
165
+ fetch(url.href)
166
+ .then((res) => res.text())
167
+ .then((data) => {
168
+ cssFile.innerHTML = data;
169
+ setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
170
+ });
171
+ };
172
+ this.messageHandler = (e) => {
173
+ switch (e.data.type) {
174
+ case 'SendLoginCredentials':
175
+ this.userNameEmail = e.data.data.userNameEmail;
176
+ this.userPassword = e.data.data.userPassword;
177
+ this.userLogin({
178
+ username: this.userNameEmail,
179
+ password: this.userPassword
180
+ });
181
+ break;
182
+ }
183
+ };
157
184
  this.userLogin = async ({ username, password }) => {
158
185
  let headers = {
159
186
  'Content-Type': 'application/json'
@@ -210,21 +237,6 @@ const UserLogin = class {
210
237
  password: this.userPassword
211
238
  });
212
239
  };
213
- this.setClientStyling = () => {
214
- let sheet = document.createElement('style');
215
- sheet.innerHTML = this.clientStyling;
216
- this.stylingContainer.appendChild(sheet);
217
- };
218
- this.setClientStylingURL = () => {
219
- let url = new URL(this.clientStylingUrl);
220
- let cssFile = document.createElement('style');
221
- fetch(url.href)
222
- .then((res) => res.text())
223
- .then((data) => {
224
- cssFile.innerHTML = data;
225
- setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
226
- });
227
- };
228
240
  this.handleInputChange = (event, location) => {
229
241
  this.hasError = false;
230
242
  const inputValue = event.target.value;
@@ -260,6 +272,20 @@ const UserLogin = class {
260
272
  await getTranslations(this.translationUrl);
261
273
  }
262
274
  }
275
+ componentDidLoad() {
276
+ window.addEventListener('message', this.messageHandler);
277
+ }
278
+ componentDidRender() {
279
+ // start custom styling area
280
+ if (!this.limitStylingAppends && this.stylingContainer) {
281
+ if (this.clientStyling)
282
+ this.setClientStyling();
283
+ if (this.clientStylingUrl)
284
+ this.setClientStylingURL();
285
+ this.limitStylingAppends = true;
286
+ }
287
+ // end custom styling area
288
+ }
263
289
  sendErrorNotification(errorMessage) {
264
290
  window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
265
291
  window.postMessage({ type: 'WidgetNotification', data: {
@@ -276,17 +302,6 @@ const UserLogin = class {
276
302
  }, delay);
277
303
  };
278
304
  }
279
- componentDidRender() {
280
- // start custom styling area
281
- if (!this.limitStylingAppends && this.stylingContainer) {
282
- if (this.clientStyling)
283
- this.setClientStyling();
284
- if (this.clientStylingUrl)
285
- this.setClientStylingURL();
286
- this.limitStylingAppends = true;
287
- }
288
- // end custom styling area
289
- }
290
305
  render() {
291
306
  let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
292
307
  h("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" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { transform: "translate(110.856 24.899)" }, h("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)" }), h("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)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
@@ -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-adf399de.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -53,9 +53,14 @@ export declare class UserLogin {
53
53
  private limitStylingAppends;
54
54
  private errorMessage;
55
55
  private hasError;
56
+ private stylingContainer;
56
57
  handleNewTranslations(): void;
57
58
  componentWillLoad(): Promise<void>;
58
- private stylingContainer;
59
+ componentDidLoad(): void;
60
+ componentDidRender(): void;
61
+ setClientStyling: () => void;
62
+ setClientStylingURL: () => void;
63
+ messageHandler: (e: any) => void;
59
64
  userLogin: ({ username, password }: {
60
65
  username: any;
61
66
  password: any;
@@ -64,13 +69,10 @@ export declare class UserLogin {
64
69
  debounce(func: any, delay: any): (...args: any[]) => void;
65
70
  debouncedUserLogin: (...args: any[]) => void;
66
71
  handleLogin: () => void;
67
- setClientStyling: () => void;
68
- setClientStylingURL: () => void;
69
72
  handleInputChange: (event: Event, location: string) => void;
70
73
  userEmailValidation: (input: any) => boolean;
71
74
  passwordValidation: (input: any) => boolean;
72
75
  togglePassword: () => void;
73
76
  resetPassword: () => void;
74
- componentDidRender(): void;
75
77
  render(): any;
76
78
  }
@@ -0,0 +1 @@
1
+ import{r as s,h as i}from"./p-f775dfb7.js";const o=["ro","en","cz","de","hr"],t={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:"Ovo polje je nevažeće",forgotPassword:"Zaboravljena lozinka",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"Došlo je do neočekivane pogreške",successMessage:"Prijava uspješna"},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"},"pt-br":{invalidField:"O campo é inválido",forgotPassword:"Esqueceu sua senha",userEmail:"Usuário ou e-mail",Password:"Senha",login:"Entrem",genericError:"Ocorreu um erro inesperado",successMessage:"Você fez login com sucesso"},"es-mx":{invalidField:"El campo es inválido",forgotPassword:"Olvidó contraseña",userEmail:"Usuario o Correo Electrónico",Password:"Contraseña",login:"Entrar",genericError:"Ha ocurrido un error inesperado",successMessage:"Ha ingreasado de forma exitosa"}},e=s=>new Promise((i=>{fetch(s).then((s=>s.json())).then((s=>{Object.keys(s).forEach((i=>{for(let o in s[i])t[i][o]=s[i][o]})),i(!0)}))})),r=(s,i,e)=>{const r=i;let n=t[void 0!==r&&o.includes(r)?r:"en"][s];if(void 0!==e)for(const[s,i]of Object.entries(e.values)){const o=new RegExp(`{${s}}`,"g");n=n.replace(o,i)}return n},n=class{constructor(i){s(this,i),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.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.messageHandler=s=>{switch(s.data.type){case"SendLoginCredentials":this.userNameEmail=s.data.data.userNameEmail,this.userPassword=s.data.data.userPassword,this.userLogin({username:this.userNameEmail,password:this.userPassword})}},this.userLogin=async({username:s,password:i})=>{let o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:i})};fetch(`${this.endpoint}/v1/player/legislation/login`,o).then((s=>s.json())).then((s=>{var i,o;(null===(i=s.sessionBlockers)||void 0===i?void 0:i.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==s?void 0:s.hasToSetPass)&&window.postMessage({type:"HasToSetPass"},window.location.href),s.sessionId?(window.postMessage({type:"UserSessionID",session:s.sessionId,userid:s.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:r("successMessage",this.lang)}},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorMessage=null===(o=null==s?void 0:s.thirdPartyResponse)||void 0===o?void 0:o.message,this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((s=>{console.error(s),this.hasError=!0,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}))},this.debouncedUserLogin=this.debounce(this.userLogin,850),this.handleLogin=()=>{this.debouncedUserLogin({username:this.userNameEmail,password:this.userPassword})},this.handleInputChange=(s,i)=>{this.hasError=!1;const o=s.target.value;"user"===i?(this.userNameEmail=o,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=o,this.isValidPassword=this.passwordValidation(o))},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(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}componentDidLoad(){window.addEventListener("message",this.messageHandler)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}sendErrorNotification(s){window.postMessage({type:"HasError",error:s},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:s}},window.location.href)}debounce(s,i){let o;return function(...t){clearTimeout(o),o=setTimeout((()=>{s.apply(this,t)}),i)}}render(){let s=i("span",{class:"InputIcon"},this.isPasswordVisible&&i("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"},i("g",{transform:"translate(-110.856 -23.242)"},i("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),i("g",{transform:"translate(117.499 27.37)"},i("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),i("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),i("g",{transform:"translate(110.856 24.899)"},i("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)"}),i("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)"})),i("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&i("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"},i("g",{transform:"translate(-14.185 -27.832)"},i("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)"}),i("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),o=i("div",{class:"FormBox"},i("div",{class:"FormValue"},i("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},i("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:s=>this.handleInputChange(s,"user"),onInput:s=>this.handleInputChange(s,"user"),required:!0}),i("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),i("div",{class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},s,i("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:s=>this.handleInputChange(s,"password"),onInput:s=>this.handleInputChange(s,"password"),required:!0}),i("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),"true"==this.passwordReset&&i("div",{class:"ForgotPassword"},i("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),i("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.handleLogin()},r("login",this.lang)),this.hasError&&i("p",{class:"CredentialsError"},this.errorMessage?this.errorMessage:r("genericError",this.lang))));return i("section",{ref:s=>this.stylingContainer=s},o)}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:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));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}
@@ -0,0 +1 @@
1
+ let e,t,n=!1,l=!1;const o="undefined"!=typeof window?window:{},s=o.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,o=!1,s=!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&&((o="function"!=typeof e&&!h(l))&&(l+=""),o&&s?r[r.length-1].i+=l:r.push(o?d(null,l):l),s=o)};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=d(e,null);return c.u=t,r.length>0&&(c.h=r),c},d=(e,t)=>({t:0,$:e,i:t,p:null,h:null,u:null}),p={},m=(e,t,n,l,s,i)=>{if(n!==l){let c=V(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,o=w(n),s=w(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const o=h(l);if((c||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{let o=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):V(o,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/,w=e=>e?e.split(y):[],b=(e,t,n,l)=>{const o=11===t.p.nodeType&&t.p.host?t.p.host:t.p,s=e&&e.u||f,r=t.u||f;for(l in s)l in r||m(o,l,s[l],void 0,n,t.t);for(l in r)m(o,l,s[l],r[l],n,t.t)},g=(t,l,o)=>{let r,i,c=l.h[o],u=0;if(null!==c.i)r=c.p=s.createTextNode(c.i);else{if(n||(n="svg"===c.$),r=c.p=s.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,o,s,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);s<=r;++s)o[s]&&(i=g(null,l,s),i&&(o[s].p=i,c.insertBefore(i,n)))},j=(e,t,n,l,o)=>{for(;t<=n;++t)(l=e[t])&&(o=l.p,M(l),o.remove())},v=(e,t)=>e.$===t.$,O=(e,t)=>{const l=t.p=e.p,o=e.h,s=t.h,r=t.$,i=t.i;null===i?(n="svg"===r||"foreignObject"!==r&&n,b(e,t,n),null!==o&&null!==s?((e,t,n,l)=>{let o,s=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],h=l[a];for(;s<=i&&r<=a;)null==c?c=t[++s]:null==u?u=t[--i]:null==f?f=l[++r]:null==h?h=l[--a]:v(c,f)?(O(c,f),c=t[++s],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[++s],h=l[--a]):v(u,f)?(O(u,f),e.insertBefore(u.p,c.p),u=t[--i],f=l[++r]):(o=g(t&&t[r],n,r),f=l[++r],o&&c.p.parentNode.insertBefore(o,c.p));s>i?S(e,null==l[a+1]?null:l[a+1].p,n,l,r,a):r>a&&j(t,s,i)})(l,o,t,s):null!==s?(null!==e.i&&(l.textContent=""),S(l,null,t,s,0,s.length-1)):null!==o&&j(o,0,o.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,(()=>L(e,n,t)))},L=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.v,n=e.j,l=t.t,o=((e,t)=>{let n=a(t),l=G.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=u.get(e=e.head||e);o||u.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.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"]=o,n.classList.add(o+"-h"))})(e);P(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},P=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const o=n.j,s=n.v,r=n.O||d(null,null),i=(e=>e&&e.$===p)(l)?l:$(null,null,l);t=o.tagName,s.M&&(i.u=i.u||{},s.M.map((([e,t])=>i.u[t]=o[e]))),i.$=null,i.t|=4,n.O=i,i.p=r.p=o.shadowRoot||o,e=o["s-sc"],O(r,i)})(n,l)}catch(e){_(e,n.j)}return null},E=e=>{const t=e.j,n=e.S,l=e.g;R(n,"componentDidRender"),64&e.t||(e.t|=64,W(t),R(n,"componentDidLoad"),e.k(t),l||N()),e.m&&(e.m(),e.m=void 0),512&e.t&&Y((()=>C(e,!1))),e.t&=-517},N=()=>{W(s.documentElement),Y((()=>(e=>{const t=r.ce("appload",{detail:{namespace:"user-login"}});return e.dispatchEvent(t),t})(o)))},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.L=e.watchers);const l=Object.entries(t.C),o=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,e,{get(){return((e,t)=>q(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=q(e),s=o.j,r=o.P.get(t),i=o.t,c=o.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))&&(o.P.set(t,n),c)){if(l.L&&128&i){const e=l.L[t];e&&e.map((e=>{try{c[e](n,r,t)}catch(e){_(e,s)}}))}2==(18&i)&&C(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){r.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.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 o=l[1]||e;return n.set(o,e),512&l[0]&&t.M.push([e,o]),o}))}}return e},D=(e,t={})=>{const n=[],l=t.exclude||[],i=o.customElements,u=s.head,f=u.querySelector("meta[charset]"),h=s.createElement("style"),$=[];let d,p=!0;Object.assign(r,t),r.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const o={t:t[0],o:t[1],C:t[2],N:t[3]};o.C=t[2],o.M=[],o.L={};const s=o.o,u=class extends HTMLElement{constructor(e){super(e),H(e=this,o),1&o.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),p?$.push(this):r.jmp((()=>(e=>{if(0==(1&r.t)){const t=q(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,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=B(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.L=o.watchers,A(o,n,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){_(e)}t.t&=-9,t.t|=128,e()}if(o.style){let e=o.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 s=t.g,r=()=>C(t,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){r.jmp((()=>{}))}componentOnReady(){return q(this).R}};o.T=e[0],l.includes(s)||i.get(s)||(n.push(s),i.define(s,A(u,o,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,f?f.nextSibling:u.firstChild),p=!1,$.length?$.map((e=>e.connectedCallback())):r.jmp((()=>d=setTimeout(N,30)))},U=new WeakMap,q=e=>U.get(e),F=(e,t)=>U.set(t.S=e,t),H=(e,t)=>{const n={t:0,j:e,v:t,P:new Map};return n.R=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],U.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{D as b,$ as h,i as p,F 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-72501aca",[[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-f775dfb7.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),s(r)})().then((s=>e([["p-05867322",[[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.31.0",
3
+ "version": "1.31.2",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;
@@ -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 s,h as i}from"./p-0c865c25.js";const o=["ro","en","cz","de","hr"],t={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:"Ovo polje je nevažeće",forgotPassword:"Zaboravljena lozinka",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"Došlo je do neočekivane pogreške",successMessage:"Prijava uspješna"},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"},"pt-br":{invalidField:"O campo é inválido",forgotPassword:"Esqueceu sua senha",userEmail:"Usuário ou e-mail",Password:"Senha",login:"Entrem",genericError:"Ocorreu um erro inesperado",successMessage:"Você fez login com sucesso"},"es-mx":{invalidField:"El campo es inválido",forgotPassword:"Olvidó contraseña",userEmail:"Usuario o Correo Electrónico",Password:"Contraseña",login:"Entrar",genericError:"Ha ocurrido un error inesperado",successMessage:"Ha ingreasado de forma exitosa"}},e=s=>new Promise((i=>{fetch(s).then((s=>s.json())).then((s=>{Object.keys(s).forEach((i=>{for(let o in s[i])t[i][o]=s[i][o]})),i(!0)}))})),r=(s,i,e)=>{const r=i;let n=t[void 0!==r&&o.includes(r)?r:"en"][s];if(void 0!==e)for(const[s,i]of Object.entries(e.values)){const o=new RegExp(`{${s}}`,"g");n=n.replace(o,i)}return n},n=class{constructor(i){s(this,i),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 o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:i})};fetch(`${this.endpoint}/v1/player/legislation/login`,o).then((s=>s.json())).then((s=>{var i,o;(null===(i=s.sessionBlockers)||void 0===i?void 0:i.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==s?void 0:s.hasToSetPass)&&window.postMessage({type:"HasToSetPass"},window.location.href),s.sessionId?(window.postMessage({type:"UserSessionID",session:s.sessionId,userid:s.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:r("successMessage",this.lang)}},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorMessage=null===(o=null==s?void 0:s.thirdPartyResponse)||void 0===o?void 0:o.message,this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((s=>{console.error(s),this.hasError=!0,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}))},this.debouncedUserLogin=this.debounce(this.userLogin,850),this.handleLogin=()=>{this.debouncedUserLogin({username:this.userNameEmail,password:this.userPassword})},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 o=s.target.value;"user"===i?(this.userNameEmail=o,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=o,this.isValidPassword=this.passwordValidation(o))},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(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}sendErrorNotification(s){window.postMessage({type:"HasError",error:s},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:s}},window.location.href)}debounce(s,i){let o;return function(...t){clearTimeout(o),o=setTimeout((()=>{s.apply(this,t)}),i)}}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let s=i("span",{class:"InputIcon"},this.isPasswordVisible&&i("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"},i("g",{transform:"translate(-110.856 -23.242)"},i("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),i("g",{transform:"translate(117.499 27.37)"},i("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),i("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),i("g",{transform:"translate(110.856 24.899)"},i("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)"}),i("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)"})),i("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&i("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"},i("g",{transform:"translate(-14.185 -27.832)"},i("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)"}),i("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),o=i("div",{class:"FormBox"},i("div",{class:"FormValue"},i("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},i("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:s=>this.handleInputChange(s,"user"),onInput:s=>this.handleInputChange(s,"user"),required:!0}),i("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),i("div",{class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},s,i("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:s=>this.handleInputChange(s,"password"),onInput:s=>this.handleInputChange(s,"password"),required:!0}),i("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),"true"==this.passwordReset&&i("div",{class:"ForgotPassword"},i("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),i("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.handleLogin()},r("login",this.lang)),this.hasError&&i("p",{class:"CredentialsError"},this.errorMessage?this.errorMessage:r("genericError",this.lang))));return i("section",{ref:s=>this.stylingContainer=s},o)}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:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));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}