@everymatrix/general-input 1.90.6 → 1.90.8

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.
Files changed (41) hide show
  1. package/dist/cjs/checkbox-group-input_14.cjs.entry.js +373 -345
  2. package/dist/cjs/general-input.cjs.js +2 -2
  3. package/dist/cjs/{index-3b546c2c.js → index-7a4b2771.js} +1 -4
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +34 -20
  6. package/dist/collection/components/checkbox-input/checkbox-input.js +33 -19
  7. package/dist/collection/components/date-input/date-input.js +34 -20
  8. package/dist/collection/components/email-input/email-input.js +34 -20
  9. package/dist/collection/components/general-input/general-input.js +35 -64
  10. package/dist/collection/components/number-input/number-input.js +34 -20
  11. package/dist/collection/components/password-input/password-input.js +34 -20
  12. package/dist/collection/components/postalcode-input/postalcode-input.js +35 -19
  13. package/dist/collection/components/radio-input/radio-input.js +36 -20
  14. package/dist/collection/components/select-input/select-input.js +35 -21
  15. package/dist/collection/components/tel-input/tel-input.js +34 -20
  16. package/dist/collection/components/text-input/text-input.js +36 -22
  17. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +34 -20
  18. package/dist/collection/components/twofa-input/twofa-input.js +26 -59
  19. package/dist/esm/checkbox-group-input_14.entry.js +373 -345
  20. package/dist/esm/general-input.js +3 -3
  21. package/dist/esm/{index-ca174b7a.js → index-9174417a.js} +1 -4
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/general-input/checkbox-group-input_14.entry.js +242 -242
  24. package/dist/general-input/general-input.esm.js +1 -1
  25. package/dist/general-input/{index-ca174b7a.js → index-9174417a.js} +2 -2
  26. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +7 -4
  27. package/dist/types/components/checkbox-input/checkbox-input.d.ts +7 -4
  28. package/dist/types/components/date-input/date-input.d.ts +7 -4
  29. package/dist/types/components/email-input/email-input.d.ts +7 -4
  30. package/dist/types/components/general-input/general-input.d.ts +4 -6
  31. package/dist/types/components/number-input/number-input.d.ts +7 -4
  32. package/dist/types/components/password-input/password-input.d.ts +7 -4
  33. package/dist/types/components/postalcode-input/postalcode-input.d.ts +7 -4
  34. package/dist/types/components/radio-input/radio-input.d.ts +8 -4
  35. package/dist/types/components/select-input/select-input.d.ts +7 -4
  36. package/dist/types/components/tel-input/tel-input.d.ts +7 -4
  37. package/dist/types/components/text-input/text-input.d.ts +7 -4
  38. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +7 -4
  39. package/dist/types/components/twofa-input/twofa-input.d.ts +3 -7
  40. package/dist/types/components.d.ts +96 -0
  41. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-ca174b7a.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-9174417a.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
@@ -374,6 +374,124 @@ const validateID = (id) => {
374
374
 
375
375
  const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
376
376
 
377
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
378
+
379
+ /**
380
+ * @name setClientStyling
381
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
382
+ * @param {HTMLElement} stylingContainer The reference element of the widget
383
+ * @param {string} clientStyling The style content
384
+ */
385
+ function setClientStyling(stylingContainer, clientStyling) {
386
+ if (stylingContainer) {
387
+ const sheet = document.createElement('style');
388
+ sheet.innerHTML = clientStyling;
389
+ stylingContainer.appendChild(sheet);
390
+ }
391
+ }
392
+
393
+ /**
394
+ * @name setClientStylingURL
395
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
396
+ * @param {HTMLElement} stylingContainer The reference element of the widget
397
+ * @param {string} clientStylingUrl The URL of the style content
398
+ */
399
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
400
+ if (!stylingContainer || !clientStylingUrl) return;
401
+
402
+ const url = new URL(clientStylingUrl);
403
+
404
+ fetch(url.href)
405
+ .then((res) => res.text())
406
+ .then((data) => {
407
+ const cssFile = document.createElement('style');
408
+ cssFile.innerHTML = data;
409
+ if (stylingContainer) {
410
+ stylingContainer.appendChild(cssFile);
411
+ }
412
+ })
413
+ .catch((err) => {
414
+ console.error('There was an error while trying to load client styling from URL', err);
415
+ });
416
+ }
417
+
418
+ /**
419
+ * @name setStreamLibrary
420
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
421
+ * @param {HTMLElement} stylingContainer The highest element of the widget
422
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
423
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
424
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
425
+ */
426
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
427
+ if (!window.emMessageBus) return;
428
+
429
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
430
+
431
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
432
+ subscription = getStyleTagSubscription(stylingContainer, domain);
433
+
434
+ return subscription;
435
+ }
436
+
437
+ if (!window[StyleCacheKey]) {
438
+ window[StyleCacheKey] = {};
439
+ }
440
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
441
+
442
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
443
+ const wrappedUnsubscribe = () => {
444
+ if (window[StyleCacheKey][domain]) {
445
+ const cachedObject = window[StyleCacheKey][domain];
446
+ cachedObject.refCount > 1
447
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
448
+ : delete window[StyleCacheKey][domain];
449
+ }
450
+
451
+ originalUnsubscribe();
452
+ };
453
+ subscription.unsubscribe = wrappedUnsubscribe;
454
+
455
+ return subscription;
456
+ }
457
+
458
+ function getStyleTagSubscription(stylingContainer, domain) {
459
+ const sheet = document.createElement('style');
460
+
461
+ return window.emMessageBus.subscribe(domain, (data) => {
462
+ if (stylingContainer) {
463
+ sheet.innerHTML = data;
464
+ stylingContainer.appendChild(sheet);
465
+ }
466
+ });
467
+ }
468
+
469
+ function getAdoptStyleSubscription(stylingContainer, domain) {
470
+ return window.emMessageBus.subscribe(domain, (data) => {
471
+ if (!stylingContainer) return;
472
+
473
+ const shadowRoot = stylingContainer.getRootNode();
474
+ const cacheStyleObject = window[StyleCacheKey];
475
+ let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
476
+
477
+ if (!cachedStyle) {
478
+ cachedStyle = new CSSStyleSheet();
479
+ cachedStyle.replaceSync(data);
480
+ cacheStyleObject[domain] = {
481
+ sheet: cachedStyle,
482
+ refCount: 1
483
+ };
484
+ } else {
485
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
486
+ }
487
+
488
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
489
+ if (!currentSheets.includes(cachedStyle)) {
490
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
491
+ }
492
+ });
493
+ }
494
+
377
495
  const checkboxGroupInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}vaadin-checkbox-group{margin-top:5px;margin-left:40px}.checkboxgroup{font-family:\"Roboto\";font-style:normal;font-size:15px}.checkboxgroup__wrapper{position:relative}.checkboxgroup__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.checkboxgroup__wrapper--relative{position:relative;display:inline}.checkboxgroup__input{vertical-align:baseline}.checkboxgroup__input[indeterminate]::part(checkbox)::after,.checkboxgroup__input[indeterminate]::part(checkbox),.checkboxgroup__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emw--registration-typography, var(--emw--color-black, #000000));line-height:1.5;padding-left:10px;vertical-align:baseline}.checkboxgroup__label-text{font-size:16px}.checkboxgroup__label a{color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.checkboxgroup__tooltip-icon{width:16px;height:auto}.checkboxgroup__tooltip{position:absolute;top:0;right:0;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkboxgroup__tooltip.visible{opacity:1}.checkbox__input::part(checkbox){background-color:var(--emw--color-white, #FFFFFF);transform:scale(0.8, 0.8);border-radius:var(--emw--border-radius-small, 2px);box-shadow:0 0px 0px 2px var(--emw--color-gray, #7a7a7a)}.checkbox__input[indeterminate]::part(checkbox),.checkbox__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));box-shadow:none}";
378
496
  const CheckboxGroupInputStyle0 = checkboxGroupInputCss;
379
497
 
@@ -383,11 +501,6 @@ const CheckboxGroupInput = class {
383
501
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
384
502
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
385
503
  this.value = null;
386
- this.setClientStyling = () => {
387
- let sheet = document.createElement('style');
388
- sheet.innerHTML = this.clientStyling;
389
- this.stylingContainer.prepend(sheet);
390
- };
391
504
  this.name = undefined;
392
505
  this.displayName = undefined;
393
506
  this.defaultValue = '';
@@ -398,16 +511,17 @@ const CheckboxGroupInput = class {
398
511
  this.language = undefined;
399
512
  this.emitValue = undefined;
400
513
  this.clientStyling = '';
514
+ this.mbSource = undefined;
401
515
  this.errorMessage = undefined;
402
516
  this.isValid = undefined;
403
- this.limitStylingAppends = false;
404
517
  this.showTooltip = false;
405
518
  this.selectedValues = [];
406
519
  this.showCheckboxes = false;
407
520
  }
408
- handleStylingChange(newValue, oldValue) {
409
- if (newValue !== oldValue)
410
- this.setClientStyling();
521
+ handleClientStylingChange(newValue, oldValue) {
522
+ if (newValue !== oldValue) {
523
+ setClientStyling(this.stylingContainer, this.clientStyling);
524
+ }
411
525
  }
412
526
  validityChanged() {
413
527
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -439,16 +553,17 @@ const CheckboxGroupInput = class {
439
553
  this.showTooltip = false;
440
554
  }
441
555
  }
442
- componentDidRender() {
443
- // start custom styling area
444
- if (!this.limitStylingAppends && this.stylingContainer) {
445
- if (this.clientStyling)
446
- this.setClientStyling();
447
- this.limitStylingAppends = true;
556
+ handleClientStyling() {
557
+ if (window.emMessageBus !== undefined) {
558
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
559
+ return;
560
+ }
561
+ if (this.clientStyling) {
562
+ setClientStyling(this.stylingContainer, this.clientStyling);
448
563
  }
449
- // end custom styling area
450
564
  }
451
565
  componentDidLoad() {
566
+ this.handleClientStyling();
452
567
  this.inputReference = this.element.shadowRoot.querySelector('input');
453
568
  // For now this input has no validation. Send isValid as true immediately.
454
569
  //@TODO: add validation logic to it, if business reason arises.
@@ -485,14 +600,14 @@ const CheckboxGroupInput = class {
485
600
  return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
486
601
  }
487
602
  render() {
488
- return h("div", { key: '9985f4050655bc2233090f63abb0e22f2fe0b556', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '9922e45ae7ee74b137ffc8552b3d714b7e3b1f59', class: 'checkboxgroup__wrapper--flex' }, h("vaadin-checkbox", { key: 'f18bae7c3ee6df76edcde75924eb1ad51a227443', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
489
- h("img", { key: '3dc2ce07e4d5f8de7ed4707b5e140fb4752ca86b', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: 'd55f25f75aa20007ff58cf45b6632517f49b6c00', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (h("vaadin-checkbox-group", { key: '210c3cc2868a07a403494e04336c4f3091eea0e4', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
603
+ return h("div", { key: '342900ae923094f2746fd43917743d01efba942e', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '8f3b470274047b355741b438a4e15c7c46504f5a', class: 'checkboxgroup__wrapper--flex' }, h("vaadin-checkbox", { key: 'c7a74f9da877304f4d71607d58eba90dd0a29de7', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
604
+ h("img", { key: '75d807ad544e043a2e3beed46bf0c7dfa2125324', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: '4b17e1e613c7561fb3c99f334926544ef2ba787a', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (h("vaadin-checkbox-group", { key: '9a8d573a7cb48bb2d68cceec5f39f1e0886ea05f', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
490
605
  this.selectedValues = event.detail.value;
491
606
  } }, this.options.map((checkbox) => h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName })))));
492
607
  }
493
608
  get element() { return getElement(this); }
494
609
  static get watchers() { return {
495
- "clientStyling": ["handleStylingChange"],
610
+ "clientStyling": ["handleClientStylingChange"],
496
611
  "isValid": ["validityChanged"],
497
612
  "selectedValues": ["setValue"],
498
613
  "emitValue": ["emitValueHandler"]
@@ -509,11 +624,6 @@ const CheckboxInput = class {
509
624
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
510
625
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
511
626
  this.value = '';
512
- this.setClientStyling = () => {
513
- let sheet = document.createElement('style');
514
- sheet.innerHTML = this.clientStyling;
515
- this.stylingContainer.prepend(sheet);
516
- };
517
627
  this.name = undefined;
518
628
  this.displayName = undefined;
519
629
  this.defaultValue = '';
@@ -523,14 +633,15 @@ const CheckboxInput = class {
523
633
  this.language = undefined;
524
634
  this.emitValue = undefined;
525
635
  this.clientStyling = '';
636
+ this.mbSource = undefined;
526
637
  this.errorMessage = undefined;
527
638
  this.isValid = undefined;
528
- this.limitStylingAppends = false;
529
639
  this.showTooltip = false;
530
640
  }
531
- handleStylingChange(newValue, oldValue) {
532
- if (newValue !== oldValue)
533
- this.setClientStyling();
641
+ handleClientStylingChange(newValue, oldValue) {
642
+ if (newValue !== oldValue) {
643
+ setClientStyling(this.stylingContainer, this.clientStyling);
644
+ }
534
645
  }
535
646
  validityChanged() {
536
647
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -555,16 +666,17 @@ const CheckboxInput = class {
555
666
  this.showTooltip = false;
556
667
  }
557
668
  }
558
- componentDidRender() {
559
- // start custom styling area
560
- if (!this.limitStylingAppends && this.stylingContainer) {
561
- if (this.clientStyling)
562
- this.setClientStyling();
563
- this.limitStylingAppends = true;
669
+ handleClientStyling() {
670
+ if (window.emMessageBus !== undefined) {
671
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
672
+ return;
673
+ }
674
+ if (this.clientStyling) {
675
+ setClientStyling(this.stylingContainer, this.clientStyling);
564
676
  }
565
- // end custom styling area
566
677
  }
567
678
  componentDidLoad() {
679
+ this.handleClientStyling();
568
680
  this.inputReference = this.vaadinCheckbox.querySelector('input');
569
681
  if (this.defaultValue) {
570
682
  this.value = this.defaultValue;
@@ -599,10 +711,10 @@ const CheckboxInput = class {
599
711
  return null;
600
712
  }
601
713
  render() {
602
- return (h("div", { key: '80ed581cec5bb009ea5ea009f11c6453fe24ef7b', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, h("vaadin-checkbox", { key: '42d793f607af77435f629218f9bdac7736522bc3', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (h("img", { key: 'ce3870810ede8f3905fd8c07c0892ab0d909bab5', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
714
+ return (h("div", { key: 'a8d8bf6aa2001b6aee44d728a198244819ae169e', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, h("vaadin-checkbox", { key: '13a5589a78bef4277922535e59c5718d36b1f318', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (h("img", { key: '008bb9a318c914b4b40e80b15080f7f174cc1262', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
603
715
  }
604
716
  static get watchers() { return {
605
- "clientStyling": ["handleStylingChange"],
717
+ "clientStyling": ["handleClientStylingChange"],
606
718
  "isValid": ["validityChanged"],
607
719
  "emitValue": ["emitValueHandler"]
608
720
  }; }
@@ -5993,11 +6105,6 @@ const DateInput = class {
5993
6105
  const date = parse(inputValue, this.dateFormat, new Date());
5994
6106
  return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
5995
6107
  };
5996
- this.setClientStyling = () => {
5997
- let sheet = document.createElement('style');
5998
- sheet.innerHTML = this.clientStyling;
5999
- this.stylingContainer.prepend(sheet);
6000
- };
6001
6108
  this.handleDocumentIdUpdate = (e) => {
6002
6109
  if (this.name !== CONSTANTS.BIRTHDATE) {
6003
6110
  return;
@@ -6084,9 +6191,9 @@ const DateInput = class {
6084
6191
  this.emitOnClick = false;
6085
6192
  this.enableSouthAfricanMode = undefined;
6086
6193
  this.enableManualDateInput = false;
6194
+ this.mbSource = undefined;
6087
6195
  this.errorMessage = undefined;
6088
6196
  this.isValid = undefined;
6089
- this.limitStylingAppends = false;
6090
6197
  this.showTooltip = false;
6091
6198
  }
6092
6199
  get formattedValue() {
@@ -6095,9 +6202,10 @@ const DateInput = class {
6095
6202
  const parsedDate = parse(this.value, 'yyyy-MM-dd', new Date());
6096
6203
  return format(parsedDate, this.dateFormat);
6097
6204
  }
6098
- handleStylingChange(newValue, oldValue) {
6099
- if (newValue !== oldValue)
6100
- this.setClientStyling();
6205
+ handleClientStylingChange(newValue, oldValue) {
6206
+ if (newValue !== oldValue) {
6207
+ setClientStyling(this.stylingContainer, this.clientStyling);
6208
+ }
6101
6209
  }
6102
6210
  validityChanged() {
6103
6211
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -6135,17 +6243,18 @@ const DateInput = class {
6135
6243
  this.minDate = parse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
6136
6244
  this.maxDate = parse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
6137
6245
  }
6138
- componentDidRender() {
6139
- // start custom styling area
6140
- if (!this.limitStylingAppends && this.stylingContainer) {
6141
- if (this.clientStyling)
6142
- this.setClientStyling();
6143
- this.limitStylingAppends = true;
6246
+ handleClientStyling() {
6247
+ if (window.emMessageBus !== undefined) {
6248
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
6249
+ return;
6250
+ }
6251
+ if (this.clientStyling) {
6252
+ setClientStyling(this.stylingContainer, this.clientStyling);
6144
6253
  }
6145
- // end custom styling area
6146
6254
  }
6147
6255
  componentDidLoad() {
6148
6256
  var _a;
6257
+ this.handleClientStyling();
6149
6258
  this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
6150
6259
  this.inputReference = this.element.shadowRoot.querySelector('input');
6151
6260
  if (this.datePicker) {
@@ -6300,12 +6409,12 @@ const DateInput = class {
6300
6409
  if (this.touched) {
6301
6410
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6302
6411
  }
6303
- return h("div", { key: 'f8011520dee6f11203da18cc27a6f278283daace', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("label", { key: 'e1e21a234b5f20f05a5c2d6eb38095bb50748ad6', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '8dbd7ecb2e8fc686afc02a15a247f5f78484ec22', class: this.validation.mandatory ? 'date__label--required' : '' })), h("vaadin-date-picker", { key: '40b5106d0b80799cd81b154889461fa5378264b8', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), h("small", { key: 'cd96dd3bb68896ea44d5071d783a7a2e2d75738f', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
6304
- h("img", { key: '971aeba271d68264bb9ff23b86bed878699d81b1', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
6412
+ return h("div", { key: 'ffff8be16fb22a41ea8c5168a79e40b9f410c63b', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("label", { key: '60da1ad0bc4cc7757e6f1096866667a97bd146b5', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '450b4638efa34f4490035b0d99b0b186f053a2d0', class: this.validation.mandatory ? 'date__label--required' : '' })), h("vaadin-date-picker", { key: '421875a710bb4508e3218d28bf2c28dcd0e9793b', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), h("small", { key: '33a6fed8057a84cb648f94a318c3ec0b1e495fff', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
6413
+ h("img", { key: 'd91fcd13e1ae384b67b6d478834b65136ab77b77', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
6305
6414
  }
6306
6415
  get element() { return getElement(this); }
6307
6416
  static get watchers() { return {
6308
- "clientStyling": ["handleStylingChange"],
6417
+ "clientStyling": ["handleClientStylingChange"],
6309
6418
  "isValid": ["validityChanged"],
6310
6419
  "emitValue": ["emitValueHandler"],
6311
6420
  "enableSouthAfricanMode": ["handleCustomRegistrationChange"]
@@ -6340,11 +6449,6 @@ const EmailInput = class {
6340
6449
  this.errorMessage = this.setErrorMessage();
6341
6450
  this.touched = true;
6342
6451
  };
6343
- this.setClientStyling = () => {
6344
- let sheet = document.createElement('style');
6345
- sheet.innerHTML = this.clientStyling;
6346
- this.stylingContainer.prepend(sheet);
6347
- };
6348
6452
  this.name = undefined;
6349
6453
  this.displayName = undefined;
6350
6454
  this.placeholder = undefined;
@@ -6356,14 +6460,15 @@ const EmailInput = class {
6356
6460
  this.emitValue = undefined;
6357
6461
  this.isDuplicateInput = undefined;
6358
6462
  this.clientStyling = '';
6463
+ this.mbSource = undefined;
6359
6464
  this.errorMessage = undefined;
6360
6465
  this.isValid = undefined;
6361
- this.limitStylingAppends = false;
6362
6466
  this.showTooltip = false;
6363
6467
  }
6364
- handleStylingChange(newValue, oldValue) {
6365
- if (newValue !== oldValue)
6366
- this.setClientStyling();
6468
+ handleClientStylingChange(newValue, oldValue) {
6469
+ if (newValue !== oldValue) {
6470
+ setClientStyling(this.stylingContainer, this.clientStyling);
6471
+ }
6367
6472
  }
6368
6473
  validityChanged() {
6369
6474
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -6398,16 +6503,17 @@ const EmailInput = class {
6398
6503
  connectedCallback() {
6399
6504
  this.validationPattern = this.setPattern();
6400
6505
  }
6401
- componentDidRender() {
6402
- // start custom styling area
6403
- if (!this.limitStylingAppends && this.stylingContainer) {
6404
- if (this.clientStyling)
6405
- this.setClientStyling();
6406
- this.limitStylingAppends = true;
6506
+ handleClientStyling() {
6507
+ if (window.emMessageBus !== undefined) {
6508
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
6509
+ return;
6510
+ }
6511
+ if (this.clientStyling) {
6512
+ setClientStyling(this.stylingContainer, this.clientStyling);
6407
6513
  }
6408
- // end custom styling area
6409
6514
  }
6410
6515
  componentDidLoad() {
6516
+ this.handleClientStyling();
6411
6517
  this.isValid = this.setValidity();
6412
6518
  if (this.defaultValue) {
6413
6519
  this.value = this.defaultValue;
@@ -6453,11 +6559,11 @@ const EmailInput = class {
6453
6559
  if (this.touched) {
6454
6560
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6455
6561
  }
6456
- return h("div", { key: '723df8f3a6e8c57fe19082400971daf50f5c981d', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '581d6e02b63d1c659ae44424518f64db450d5365', class: 'email__wrapper--flex' }, h("label", { key: '11e6a848f6f04903989b3ab2075865f6e279c087', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '73e11520cffbddda1a2aeb4b560e7f4cf456e2fb', class: 'email__wrapper--relative' }, this.tooltip &&
6457
- h("img", { key: 'e8571ce14b9b98311daf1712ebde7d6da9b5a6a6', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'dd05ef0b4d906598c6d5775a78ccbdc9ea81cb8c', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '0d2d41207f8274d8c6f69143131265ef5b458689', class: 'email__error-message' }, this.errorMessage));
6562
+ return h("div", { key: 'f852525fe8d8b695e638fdd83e8b0c2c20d98771', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'd6a6dec4e76ba1fbe15bed09f82cecde12cabe1a', class: 'email__wrapper--flex' }, h("label", { key: '4498ae1bac287cb80544c4d743afad2ec678e3bd', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e54d1258e48f54304a553cffb83466e4a4fadb4c', class: 'email__wrapper--relative' }, this.tooltip &&
6563
+ h("img", { key: '29d7b95f22c8cb70d505f74a7ea18284faa908ee', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '08754b178e395f26c1d8a61ff667b91df3fb0ec7', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '3024a57f5d0897f34013eb4397d78babc2333192', class: 'email__error-message' }, this.errorMessage));
6458
6564
  }
6459
6565
  static get watchers() { return {
6460
- "clientStyling": ["handleStylingChange"],
6566
+ "clientStyling": ["handleClientStylingChange"],
6461
6567
  "isValid": ["validityChanged"],
6462
6568
  "emitValue": ["emitValueHandler"]
6463
6569
  }; }
@@ -13131,32 +13237,6 @@ const GeneralInput = class {
13131
13237
  constructor(hostRef) {
13132
13238
  registerInstance(this, hostRef);
13133
13239
  this.registrationWidgetLoaded = createEvent(this, "registrationWidgetLoaded", 7);
13134
- this.setClientStyling = () => {
13135
- let sheet = document.createElement('style');
13136
- sheet.innerHTML = this.clientStyling;
13137
- this.host.shadowRoot.prepend(sheet);
13138
- };
13139
- this.setStreamStyling = (domain) => {
13140
- if (window.emMessageBus) {
13141
- const sheet = document.createElement('style');
13142
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
13143
- sheet.innerHTML = data;
13144
- this.clientStyling = data;
13145
- this.host.shadowRoot.prepend(sheet);
13146
- });
13147
- }
13148
- };
13149
- this.setClientStylingURL = () => {
13150
- let url = new URL(this.clientStylingUrl);
13151
- let cssFile = document.createElement('style');
13152
- fetch(url.href)
13153
- .then((res) => res.text())
13154
- .then((data) => {
13155
- cssFile.innerHTML = data;
13156
- this.clientStyling = data;
13157
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
13158
- });
13159
- };
13160
13240
  this.handleClick = (event) => {
13161
13241
  if (this.emitOnClick) {
13162
13242
  event.stopPropagation();
@@ -13193,15 +13273,17 @@ const GeneralInput = class {
13193
13273
  this.enableManualDateInput = false;
13194
13274
  this.pinAttemptsExceeded = undefined;
13195
13275
  this.mbSource = undefined;
13196
- this.limitStylingAppends = false;
13197
13276
  }
13198
- handleStylingChange(newValue, oldValue) {
13199
- if (newValue !== oldValue)
13200
- this.setClientStyling();
13277
+ handleClientStylingChange(newValue, oldValue) {
13278
+ if (newValue !== oldValue) {
13279
+ setClientStyling(this.stylingContainer, this.clientStyling);
13280
+ }
13201
13281
  }
13202
- handleStylingUrlChange(newValue, oldValue) {
13203
- if (newValue !== oldValue)
13204
- this.setClientStylingURL();
13282
+ handleClientStylingChangeURL(newValue, oldValue) {
13283
+ if (newValue !== oldValue) {
13284
+ if (this.clientStylingUrl)
13285
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
13286
+ }
13205
13287
  }
13206
13288
  connectedCallback() {
13207
13289
  if (this.translationUrl) {
@@ -13212,51 +13294,50 @@ const GeneralInput = class {
13212
13294
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
13213
13295
  }
13214
13296
  componentDidLoad() {
13297
+ this.handleClientStyling();
13215
13298
  this.registrationWidgetLoaded.emit();
13216
13299
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
13217
- if (!this.limitStylingAppends && this.host) {
13218
- if (window.emMessageBus != undefined) {
13219
- this.setStreamStyling(`${this.mbSource}.Style`);
13220
- }
13221
- else {
13222
- if (this.clientStyling)
13223
- this.setClientStyling();
13224
- if (this.clientStylingUrl)
13225
- this.setClientStylingURL();
13226
- this.limitStylingAppends = true;
13227
- }
13300
+ }
13301
+ handleClientStyling() {
13302
+ if (window.emMessageBus !== undefined) {
13303
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
13304
+ return;
13228
13305
  }
13306
+ if (this.clientStyling)
13307
+ setClientStyling(this.stylingContainer, this.clientStyling);
13308
+ if (this.clientStylingUrl)
13309
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
13229
13310
  }
13230
13311
  renderInput() {
13231
13312
  var _a;
13232
13313
  switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
13233
13314
  case 'text':
13234
13315
  if (this.haspostalcodelookup && this.name === 'PostalCode') {
13235
- return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry });
13316
+ return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry, "mb-source": this.mbSource });
13236
13317
  }
13237
13318
  else {
13238
- return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode });
13319
+ return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
13239
13320
  }
13240
13321
  case 'email':
13241
- return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13322
+ return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13242
13323
  case 'number':
13243
- return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13324
+ return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13244
13325
  case 'checkbox':
13245
- return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
13326
+ return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, "mb-source": this.mbSource });
13246
13327
  case 'checkboxgroup':
13247
- return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
13328
+ return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "mb-source": this.mbSource });
13248
13329
  case 'togglecheckbox':
13249
- return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick });
13330
+ return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick, "mb-source": this.mbSource });
13250
13331
  case 'datetime':
13251
- return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput });
13332
+ return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput, "mb-source": this.mbSource });
13252
13333
  case 'password':
13253
- return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode });
13334
+ return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
13254
13335
  case 'radio':
13255
- return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling });
13336
+ return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, "mb-source": this.mbSource });
13256
13337
  case 'tel':
13257
- return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13338
+ return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13258
13339
  case 'dropdown':
13259
- return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13340
+ return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13260
13341
  case 'twofa':
13261
13342
  return h("twofa-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, destination: this.twofaDestination, "resend-interval-seconds": this.twofaResendIntervalSeconds, "enable-south-african-mode": this.enableSouthAfricanMode, "pin-attempts-exceeded": this.pinAttemptsExceeded, "mb-source": this.mbSource });
13262
13343
  case 'label':
@@ -13271,12 +13352,12 @@ const GeneralInput = class {
13271
13352
  }
13272
13353
  }
13273
13354
  render() {
13274
- return (h(Host, { key: '7a7805c641082de9c5da4859187765002ab6f32d', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13355
+ return (h(Host, { key: '12e3e43442ba3fd4a47bbc5c05456eb019405b1e', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13275
13356
  }
13276
13357
  get host() { return getElement(this); }
13277
13358
  static get watchers() { return {
13278
- "clientStyling": ["handleStylingChange"],
13279
- "clientStylingUrl": ["handleStylingUrlChange"]
13359
+ "clientStyling": ["handleClientStylingChange"],
13360
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
13280
13361
  }; }
13281
13362
  };
13282
13363
  GeneralInput.style = GeneralInputStyle0;
@@ -13308,11 +13389,6 @@ const NumberInput = class {
13308
13389
  this.errorMessage = this.setErrorMessage();
13309
13390
  this.touched = true;
13310
13391
  };
13311
- this.setClientStyling = () => {
13312
- let sheet = document.createElement('style');
13313
- sheet.innerHTML = this.clientStyling;
13314
- this.stylingContainer.prepend(sheet);
13315
- };
13316
13392
  this.name = undefined;
13317
13393
  this.displayName = undefined;
13318
13394
  this.placeholder = undefined;
@@ -13323,14 +13399,15 @@ const NumberInput = class {
13323
13399
  this.language = undefined;
13324
13400
  this.emitValue = undefined;
13325
13401
  this.clientStyling = '';
13402
+ this.mbSource = undefined;
13326
13403
  this.errorMessage = undefined;
13327
13404
  this.isValid = undefined;
13328
- this.limitStylingAppends = false;
13329
13405
  this.showTooltip = false;
13330
13406
  }
13331
- handleStylingChange(newValue, oldValue) {
13332
- if (newValue !== oldValue)
13333
- this.setClientStyling();
13407
+ handleClientStylingChange(newValue, oldValue) {
13408
+ if (newValue !== oldValue) {
13409
+ setClientStyling(this.stylingContainer, this.clientStyling);
13410
+ }
13334
13411
  }
13335
13412
  validityChanged() {
13336
13413
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -13358,16 +13435,17 @@ const NumberInput = class {
13358
13435
  connectedCallback() {
13359
13436
  this.validationPattern = this.setPattern();
13360
13437
  }
13361
- componentDidRender() {
13362
- // start custom styling area
13363
- if (!this.limitStylingAppends && this.stylingContainer) {
13364
- if (this.clientStyling)
13365
- this.setClientStyling();
13366
- this.limitStylingAppends = true;
13438
+ handleClientStyling() {
13439
+ if (window.emMessageBus !== undefined) {
13440
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
13441
+ return;
13442
+ }
13443
+ if (this.clientStyling) {
13444
+ setClientStyling(this.stylingContainer, this.clientStyling);
13367
13445
  }
13368
- // end custom styling area
13369
13446
  }
13370
13447
  componentDidLoad() {
13448
+ this.handleClientStyling();
13371
13449
  this.isValid = this.setValidity();
13372
13450
  if (this.defaultValue) {
13373
13451
  this.value = this.defaultValue;
@@ -13408,11 +13486,11 @@ const NumberInput = class {
13408
13486
  if (this.touched) {
13409
13487
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
13410
13488
  }
13411
- return h("div", { key: 'aea370172d0e55d32dc665a1c340c734334e1caf', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '10e16d10b956c5a647bc68ecffbc2eb0b06fa92a', class: 'number__wrapper--flex' }, h("label", { key: '0827d47c7278c6fdf8ebdd1dff03b91c39be6812', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'cb868d01e8555f5e3333240f54d86f0a56641d0f', class: 'number__wrapper--relative' }, this.tooltip &&
13412
- h("img", { key: '1aa2b16b59f4bfd4b1dadf2641ec6cb4cfc251bf', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '365b70a2eb333878d367d1d414ee0e296c91b3ec', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: 'a8639df7ef1e98807a7daffc9da4afd347b1c292', class: 'number__error-message' }, this.errorMessage));
13489
+ return h("div", { key: 'bd11140dc6c8ddb6b800d4fe6544df733c5157c4', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'c8318c687bc471fc225b9aba52686e38ecb400de', class: 'number__wrapper--flex' }, h("label", { key: '7eaf64057ef71b07a0defc1e372fd85baab2bd68', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '99f4151f50a7fb0abb9a8e53bacc8c8bd303d659', class: 'number__wrapper--relative' }, this.tooltip &&
13490
+ h("img", { key: '875d6284697dc06ac05c682509856faeade3d8be', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'f1f563567cde4a744c68e27ab91a3d795f596be6', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '0226f04a059fd8763822483de42bd7e647040bf3', class: 'number__error-message' }, this.errorMessage));
13413
13491
  }
13414
13492
  static get watchers() { return {
13415
- "clientStyling": ["handleStylingChange"],
13493
+ "clientStyling": ["handleClientStylingChange"],
13416
13494
  "isValid": ["validityChanged"],
13417
13495
  "emitValue": ["emitValueHandler"]
13418
13496
  }; }
@@ -13461,11 +13539,6 @@ const PasswordInput = class {
13461
13539
  this.showPopup = true;
13462
13540
  this.calculateComplexity(this.value);
13463
13541
  };
13464
- this.setClientStyling = () => {
13465
- let sheet = document.createElement('style');
13466
- sheet.innerHTML = this.clientStyling;
13467
- this.stylingContainer.prepend(sheet);
13468
- };
13469
13542
  this.name = undefined;
13470
13543
  this.displayName = undefined;
13471
13544
  this.placeholder = undefined;
@@ -13480,17 +13553,18 @@ const PasswordInput = class {
13480
13553
  this.hidePasswordComplexity = false;
13481
13554
  this.clientStyling = '';
13482
13555
  this.enableSouthAfricanMode = undefined;
13556
+ this.mbSource = undefined;
13483
13557
  this.isValid = undefined;
13484
13558
  this.errorMessage = undefined;
13485
- this.limitStylingAppends = false;
13486
13559
  this.showTooltip = false;
13487
13560
  this.passwordComplexity = undefined;
13488
13561
  this.showPopup = undefined;
13489
13562
  this.value = '';
13490
13563
  }
13491
- handleStylingChange(newValue, oldValue) {
13492
- if (newValue !== oldValue)
13493
- this.setClientStyling();
13564
+ handleClientStylingChange(newValue, oldValue) {
13565
+ if (newValue !== oldValue) {
13566
+ setClientStyling(this.stylingContainer, this.clientStyling);
13567
+ }
13494
13568
  }
13495
13569
  validityChanged() {
13496
13570
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -13551,16 +13625,17 @@ const PasswordInput = class {
13551
13625
  this.showTooltip = false;
13552
13626
  }
13553
13627
  }
13554
- componentDidRender() {
13555
- // start custom styling area
13556
- if (!this.limitStylingAppends && this.stylingContainer) {
13557
- if (this.clientStyling)
13558
- this.setClientStyling();
13559
- this.limitStylingAppends = true;
13628
+ handleClientStyling() {
13629
+ if (window.emMessageBus !== undefined) {
13630
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
13631
+ return;
13632
+ }
13633
+ if (this.clientStyling) {
13634
+ setClientStyling(this.stylingContainer, this.clientStyling);
13560
13635
  }
13561
- // end custom styling area
13562
13636
  }
13563
13637
  componentDidLoad() {
13638
+ this.handleClientStyling();
13564
13639
  this.inputReference = this.element.shadowRoot.querySelector('input');
13565
13640
  this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
13566
13641
  this.passwordButton.tabIndex = -1;
@@ -13667,8 +13742,8 @@ const PasswordInput = class {
13667
13742
  if (this.touched) {
13668
13743
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
13669
13744
  }
13670
- return h("div", { key: 'fe895585dd908f75eee4ba797dc9c02b237bed7f', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '844bdb3dab98e62cc5d92a761b85adcdc44831d0', class: 'password__wrapper--flex' }, h("label", { key: '28041267a6df666e7df3660a907f995eff092ae1', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '79c300643134802f04d8f909fe7bb3895911c88a', class: 'password__wrapper--relative' }, this.tooltip &&
13671
- h("img", { key: '43ae58549e42ba59054162c25887ec36eb826aaa', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: '0edcfed0ea65666537240f531e5239bd5b11181e', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && h("small", { key: 'c8aeba074e66b771d745194fec535aa0b82de6d8', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
13745
+ return h("div", { key: '18213d251639938165f3e4ad58bdc904fb953fe2', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '092c431b178682d0006cf6ad5c14b0a7e6fb5569', class: 'password__wrapper--flex' }, h("label", { key: '64c101b7d70305ecf09735234d902a6b33823551', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '189929eefa1caf71a1be39f0d663eef914d241d5', class: 'password__wrapper--relative' }, this.tooltip &&
13746
+ h("img", { key: '95ee0d824b5be14ab4e62fc0b5f1731fe6ca5775', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: 'bf85dde83305233c566b1c50d0286548ba0f48a5', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && h("small", { key: '3acbe164ff532bcfcd9e4a237a6f352df0cfdc2d', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
13672
13747
  this.showPopup &&
13673
13748
  !this.hidePasswordComplexity &&
13674
13749
  !this.isDuplicateInput &&
@@ -13678,7 +13753,7 @@ const PasswordInput = class {
13678
13753
  }
13679
13754
  get element() { return getElement(this); }
13680
13755
  static get watchers() { return {
13681
- "clientStyling": ["handleStylingChange"],
13756
+ "clientStyling": ["handleClientStylingChange"],
13682
13757
  "isValid": ["validityChanged"],
13683
13758
  "value": ["valueChanged"],
13684
13759
  "emitValue": ["emitValueHandler"]
@@ -13828,11 +13903,6 @@ const PostalCodeInput = class {
13828
13903
  targetInput.focus();
13829
13904
  }
13830
13905
  };
13831
- this.setClientStyling = () => {
13832
- let sheet = document.createElement('style');
13833
- sheet.innerHTML = this.clientStyling;
13834
- this.stylingContainer.prepend(sheet);
13835
- };
13836
13906
  this.handleOutsideClick = (event) => {
13837
13907
  if (!this.openAddressDropdown)
13838
13908
  return;
@@ -13858,9 +13928,9 @@ const PostalCodeInput = class {
13858
13928
  this.postalcodelength = undefined;
13859
13929
  this.addresses = undefined;
13860
13930
  this.ignoreCountry = false;
13931
+ this.mbSource = undefined;
13861
13932
  this.isValid = undefined;
13862
13933
  this.errorMessage = '';
13863
- this.limitStylingAppends = false;
13864
13934
  this.showTooltip = false;
13865
13935
  this.selectedCountryCode = '';
13866
13936
  this.currentPostalCode = '';
@@ -13869,9 +13939,10 @@ const PostalCodeInput = class {
13869
13939
  this.refreshTrigger = 0;
13870
13940
  this.isFetchingAddresses = false;
13871
13941
  }
13872
- handleStylingChange(newValue, oldValue) {
13873
- if (newValue !== oldValue)
13874
- this.setClientStyling();
13942
+ handleClientStylingChange(newValue, oldValue) {
13943
+ if (newValue !== oldValue) {
13944
+ setClientStyling(this.stylingContainer, this.clientStyling);
13945
+ }
13875
13946
  }
13876
13947
  validityChanged() {
13877
13948
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -13932,19 +14003,22 @@ const PostalCodeInput = class {
13932
14003
  connectedCallback() {
13933
14004
  this.validationPattern = this.setPattern();
13934
14005
  }
13935
- componentDidRender() {
13936
- if (!this.limitStylingAppends && this.stylingContainer) {
13937
- if (this.clientStyling)
13938
- this.setClientStyling();
13939
- this.limitStylingAppends = true;
13940
- }
13941
- }
13942
14006
  componentWillLoad() {
13943
14007
  if (this.defaultValue) {
13944
14008
  this.value = this.defaultValue;
13945
14009
  }
13946
14010
  }
14011
+ handleClientStyling() {
14012
+ if (window.emMessageBus !== undefined) {
14013
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14014
+ return;
14015
+ }
14016
+ if (this.clientStyling) {
14017
+ setClientStyling(this.stylingContainer, this.clientStyling);
14018
+ }
14019
+ }
13947
14020
  componentDidLoad() {
14021
+ this.handleClientStyling();
13948
14022
  if (this.defaultValue) {
13949
14023
  this.valueHandler({ name: this.name, value: this.value });
13950
14024
  }
@@ -14036,10 +14110,10 @@ const PostalCodeInput = class {
14036
14110
  let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
14037
14111
  this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
14038
14112
  let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
14039
- return (h("div", { key: 'e358dddfc4b20b0847d03e3f12ff637922470105', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: 'b806cac9ad62480a1be6bf802528c60c79804e94', class: 'text__wrapper--flex' }, h("label", { key: '4fb327989e8b828559c01601eea47bdd58da4bd3', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '6c293495a8935db477cbcac2eb9102bffeb85ddb', class: 'text__wrapper--relative' }, this.tooltip && (h("img", { key: '848bb5b44d834c4f0e4a78cfebef0ecf1b88fd2e', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), h("div", { key: '7f6195e5cfc5bfabc9854ec6acc19c1e52e70f1b', class: 'input__text-wrapper' }, h("input", { key: '4369b4a99016a7aebbb396bdda35c31d92e4d557', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (h("p", { key: '0e3c0fcb974d2f3dae76f9afdbf173fcc25d258f', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate('enterIEAddressManually', this.language))), showAddressesDropdown && (h("div", { key: '1c644f87f2617180e6356c724d72b6d3fc8e472e', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, h("div", { key: 'f2a7b8133908441a3cf67eb48928a2d61d17e32f', class: "options" }, this.addresses.map((addr, index) => (h("div", { key: index, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (h("div", { key: 'c0cb29f7d174ca8981c8b9dfd2ee9b972b0fd1ea', class: "postalcode__loading-spinner" }, h("div", { key: '76f17cb0a440f7ed9cc8de3620b55136549586e6', class: "loading-spinner" }), h("span", { key: 'e10c4177fb0f21f142fd3120177e450413687cf3' }, translate('searchingForAddresses', this.language)))), shouldShowNoResults && (h("div", { key: 'f729f6206cc900a2c94e3df0e8b08cc3dc5b751f', class: "postalcode__no-results-message" }, translate('postalLookUpNoAddressFound', this.language)))), h("small", { key: 'c8a79e601f22444b34dc7d037c94f92875f51aad', class: 'text__error-message' }, this.errorMessage)));
14113
+ return (h("div", { key: 'f0dda39cf9a02d53213848926908c0cb39d1cd3f', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '5e1c51af264392d2be986e305e6526310f55f40b', class: 'text__wrapper--flex' }, h("label", { key: 'c12c45d88bdf42aeb6be505d473ab0f55da2be87', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '7b93a75f19590b445227fa1a64c90fd20c0afd5d', class: 'text__wrapper--relative' }, this.tooltip && (h("img", { key: '504004a13595694307c1e3450b69982150dc55fd', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), h("div", { key: '19de66fd72fd0a6befe3bbaebb6c8f99ec5f850b', class: 'input__text-wrapper' }, h("input", { key: '78cd4229ed5104518b991df0bc6bf527df2ec3e2', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (h("p", { key: '6b9e307d59fb9fed93f4df6c07a091d299844c62', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate('enterIEAddressManually', this.language))), showAddressesDropdown && (h("div", { key: 'ecb7892a9a8d967540d8fd013518ae19498fcd48', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, h("div", { key: 'a5ef3f81a85207a821964e23b21aaf783be807cc', class: "options" }, this.addresses.map((addr, index) => (h("div", { key: index, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (h("div", { key: '338c17e484721efb387e608f3ce4416a0e47b8af', class: "postalcode__loading-spinner" }, h("div", { key: '7638cea4fba975e3a27d4cb00bce217129bd0750', class: "loading-spinner" }), h("span", { key: 'b59a8a9c3d7ecf209a68717346d1d29062994f79' }, translate('searchingForAddresses', this.language)))), shouldShowNoResults && (h("div", { key: '212a74fed94b3ee089aed5c9afb544966b5f11cd', class: "postalcode__no-results-message" }, translate('postalLookUpNoAddressFound', this.language)))), h("small", { key: '4f66e97dd811b9917c92ff4bcbf236817ac57933', class: 'text__error-message' }, this.errorMessage)));
14040
14114
  }
14041
14115
  static get watchers() { return {
14042
- "clientStyling": ["handleStylingChange"],
14116
+ "clientStyling": ["handleClientStylingChange"],
14043
14117
  "isValid": ["validityChanged"],
14044
14118
  "emitValue": ["emitValueHandler"],
14045
14119
  "addresses": ["handleAddresses"]
@@ -14055,11 +14129,6 @@ const RadioInput = class {
14055
14129
  registerInstance(this, hostRef);
14056
14130
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
14057
14131
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
14058
- this.setClientStyling = () => {
14059
- let sheet = document.createElement('style');
14060
- sheet.innerHTML = this.clientStyling;
14061
- this.stylingContainer.prepend(sheet);
14062
- };
14063
14132
  this.name = undefined;
14064
14133
  this.displayName = undefined;
14065
14134
  this.optionsGroup = undefined;
@@ -14068,14 +14137,15 @@ const RadioInput = class {
14068
14137
  this.language = undefined;
14069
14138
  this.emitValue = undefined;
14070
14139
  this.clientStyling = '';
14140
+ this.mbSource = undefined;
14071
14141
  this.errorMessage = undefined;
14072
14142
  this.isValid = undefined;
14073
- this.limitStylingAppends = false;
14074
14143
  this.showTooltip = false;
14075
14144
  }
14076
- handleStylingChange(newValue, oldValue) {
14077
- if (newValue !== oldValue)
14078
- this.setClientStyling();
14145
+ handleClientStylingChange(newValue, oldValue) {
14146
+ if (newValue !== oldValue) {
14147
+ setClientStyling(this.stylingContainer, this.clientStyling);
14148
+ }
14079
14149
  }
14080
14150
  validityChanged() {
14081
14151
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -14100,14 +14170,17 @@ const RadioInput = class {
14100
14170
  this.showTooltip = false;
14101
14171
  }
14102
14172
  }
14103
- componentDidRender() {
14104
- // start custom styling area
14105
- if (!this.limitStylingAppends && this.stylingContainer) {
14106
- if (this.clientStyling)
14107
- this.setClientStyling();
14108
- this.limitStylingAppends = true;
14173
+ handleClientStyling() {
14174
+ if (window.emMessageBus !== undefined) {
14175
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14176
+ return;
14109
14177
  }
14110
- // end custom styling area
14178
+ if (this.clientStyling) {
14179
+ setClientStyling(this.stylingContainer, this.clientStyling);
14180
+ }
14181
+ }
14182
+ componentDidLoad() {
14183
+ this.handleClientStyling();
14111
14184
  }
14112
14185
  handleClick(event) {
14113
14186
  this.value = event.target.value;
@@ -14130,11 +14203,11 @@ const RadioInput = class {
14130
14203
  return null;
14131
14204
  }
14132
14205
  render() {
14133
- return h("fieldset", { key: '33493de460303a32a37d253a0fd5f9da59676542', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '8aef7aa84a119742e05d72d976c936a560154b3f', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: 'bec44ed4007e408ddeb0b0293b82e034c8e165f2', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
14134
- h("img", { key: 'a3b0a041beabe3f14661c0af8cd970040d060435', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
14206
+ return h("fieldset", { key: '7048de0e37c9541af1c9788e8b46c789ca788c31', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '403b739c966d510740ca59621c094872b93e2cba', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: '46dce1082a6aa9f2a5bdc3e3654c924fcd2a8357', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
14207
+ h("img", { key: 'dfe155a429485b5c891db2943d9115cdc40e169b', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
14135
14208
  }
14136
14209
  static get watchers() { return {
14137
- "clientStyling": ["handleStylingChange"],
14210
+ "clientStyling": ["handleClientStylingChange"],
14138
14211
  "isValid": ["validityChanged"],
14139
14212
  "emitValue": ["emitValueHandler"]
14140
14213
  }; }
@@ -14183,11 +14256,6 @@ const SelectInput = class {
14183
14256
  this.validityStateHandler({ valid: this.isValid, name: this.name });
14184
14257
  this.emitValueHandler(true);
14185
14258
  };
14186
- this.setClientStyling = () => {
14187
- let sheet = document.createElement('style');
14188
- sheet.innerHTML = this.clientStyling;
14189
- this.stylingContainer.prepend(sheet);
14190
- };
14191
14259
  this.name = undefined;
14192
14260
  this.displayName = undefined;
14193
14261
  this.placeholder = undefined;
@@ -14200,14 +14268,15 @@ const SelectInput = class {
14200
14268
  this.language = undefined;
14201
14269
  this.emitValue = undefined;
14202
14270
  this.clientStyling = '';
14271
+ this.mbSource = undefined;
14203
14272
  this.errorMessage = undefined;
14204
14273
  this.isValid = undefined;
14205
- this.limitStylingAppends = false;
14206
14274
  this.showTooltip = false;
14207
14275
  }
14208
- handleStylingChange(newValue, oldValue) {
14209
- if (newValue !== oldValue)
14210
- this.setClientStyling();
14276
+ handleClientStylingChange(newValue, oldValue) {
14277
+ if (newValue !== oldValue) {
14278
+ setClientStyling(this.stylingContainer, this.clientStyling);
14279
+ }
14211
14280
  }
14212
14281
  validityChanged() {
14213
14282
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -14257,16 +14326,17 @@ const SelectInput = class {
14257
14326
  }
14258
14327
  }
14259
14328
  }
14260
- componentDidRender() {
14261
- // start custom styling area
14262
- if (!this.limitStylingAppends && this.stylingContainer) {
14263
- if (this.clientStyling)
14264
- this.setClientStyling();
14265
- this.limitStylingAppends = true;
14329
+ handleClientStyling() {
14330
+ if (window.emMessageBus !== undefined) {
14331
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14332
+ return;
14333
+ }
14334
+ if (this.clientStyling) {
14335
+ setClientStyling(this.stylingContainer, this.clientStyling);
14266
14336
  }
14267
- // end custom styling area
14268
14337
  }
14269
14338
  componentDidLoad() {
14339
+ this.handleClientStyling();
14270
14340
  this.inputReference = this.vaadinCombo.querySelector('input');
14271
14341
  if (this.defaultValue) {
14272
14342
  this.value = this.defaultValue;
@@ -14331,13 +14401,13 @@ const SelectInput = class {
14331
14401
  if (this.touched) {
14332
14402
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
14333
14403
  }
14334
- return h("div", { key: 'b0ed504667761e5fd77e0ac13382b467448a1944', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'b48d38dc4c2cb3442ff6773a1b1d13191ec4d0e6', class: 'select__wrapper--flex' }, h("label", { key: 'ad592c8c98ecbec1961d22cdfeb8cec910291ea8', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: 'b3c0f2fe9a2d26ade1626878ed9bc1f0b86a23ad', class: this.validation.mandatory ? 'select__label--required' : '' })), h("div", { key: '29d0f504d0f51175818dffffb882ac4e6e9c3bde', class: 'select__wrapper--relative' }, this.tooltip &&
14335
- h("img", { key: '66e524ffebc43f9418e90b3bd2d7ae62eba47da3', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
14404
+ return h("div", { key: 'eb6c9d7d85546159d44d06a0635f173263edd7d1', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '0fd71c528870966fdb23049b1806a267e9e6ca5c', class: 'select__wrapper--flex' }, h("label", { key: '44aeb4e50ab2f79df06741ff07ac03131c987447', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '796a83aeadd480a571b6bae035a46138d7b10b24', class: this.validation.mandatory ? 'select__label--required' : '' })), h("div", { key: '6d7b2d785c6b0bdd05c7444f563b21cedf26ff7c', class: 'select__wrapper--relative' }, this.tooltip &&
14405
+ h("img", { key: 'f33e43a9d42e8b8d1cf136374505eeaedcbede26', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
14336
14406
  :
14337
- h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), h("small", { key: '0143b538740c3a8e9bfcab6bbb44660355c40cf7', class: 'select__error-message' }, this.errorMessage));
14407
+ h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), h("small", { key: '261b3c4abc9b360e6b937d851f8bfc810280a8c6', class: 'select__error-message' }, this.errorMessage));
14338
14408
  }
14339
14409
  static get watchers() { return {
14340
- "clientStyling": ["handleStylingChange"],
14410
+ "clientStyling": ["handleClientStylingChange"],
14341
14411
  "isValid": ["validityChanged"],
14342
14412
  "emitValue": ["emitValueHandler"]
14343
14413
  }; }
@@ -14372,11 +14442,6 @@ const TelInput = class {
14372
14442
  this.isValid = this.isValidValue();
14373
14443
  this.errorMessage = this.setErrorMessage();
14374
14444
  };
14375
- this.setClientStyling = () => {
14376
- let sheet = document.createElement('style');
14377
- sheet.innerHTML = this.clientStyling;
14378
- this.stylingContainer.prepend(sheet);
14379
- };
14380
14445
  this.name = undefined;
14381
14446
  this.displayName = undefined;
14382
14447
  this.placeholder = undefined;
@@ -14389,9 +14454,9 @@ const TelInput = class {
14389
14454
  this.language = undefined;
14390
14455
  this.emitValue = undefined;
14391
14456
  this.clientStyling = '';
14457
+ this.mbSource = undefined;
14392
14458
  this.isValid = undefined;
14393
14459
  this.errorMessage = undefined;
14394
- this.limitStylingAppends = false;
14395
14460
  this.showTooltip = false;
14396
14461
  this.disablePhonePrefix = false;
14397
14462
  this.phoneValue = '';
@@ -14403,9 +14468,10 @@ const TelInput = class {
14403
14468
  if (this.inputReference)
14404
14469
  this.inputReference.value = this.phoneValue;
14405
14470
  }
14406
- handleStylingChange(newValue, oldValue) {
14407
- if (newValue !== oldValue)
14408
- this.setClientStyling();
14471
+ handleClientStylingChange(newValue, oldValue) {
14472
+ if (newValue !== oldValue) {
14473
+ setClientStyling(this.stylingContainer, this.clientStyling);
14474
+ }
14409
14475
  }
14410
14476
  validityChanged() {
14411
14477
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -14456,16 +14522,17 @@ const TelInput = class {
14456
14522
  }
14457
14523
  }
14458
14524
  }
14459
- componentDidRender() {
14460
- // start custom styling area
14461
- if (!this.limitStylingAppends && this.stylingContainer) {
14462
- if (this.clientStyling)
14463
- this.setClientStyling();
14464
- this.limitStylingAppends = true;
14525
+ handleClientStyling() {
14526
+ if (window.emMessageBus !== undefined) {
14527
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14528
+ return;
14529
+ }
14530
+ if (this.clientStyling) {
14531
+ setClientStyling(this.stylingContainer, this.clientStyling);
14465
14532
  }
14466
- // end custom styling area
14467
14533
  }
14468
14534
  componentDidLoad() {
14535
+ this.handleClientStyling();
14469
14536
  this.isValid = this.isValidValue();
14470
14537
  if (this.defaultValue) {
14471
14538
  this.value = this.defaultValue;
@@ -14557,11 +14624,11 @@ const TelInput = class {
14557
14624
  if (this.touched) {
14558
14625
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
14559
14626
  }
14560
- return h("div", { key: 'bf824bf310bec50746fb6b82cd8f7decbcfc284b', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '0b6c42e7aca5686f310ffdcecb96cf909e83521f', class: 'tel__wrapper--flex-label' }, h("label", { key: 'ddf2fa885ac53e7f337525357a7dce52f911213d', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e21a84509b32f379bb3ce92137255caf99a86dc5', class: 'tel__wrapper--relative' }, this.tooltip &&
14561
- h("img", { key: '9ff0a8c19aa067c1e7799227617405e373b344e4', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: '5db13af7e421480b89253970a5f2470f999c922d', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '164fe2bd2940bd5a251fda48b28f1af1bc3e78be', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: '90ae038a383645d6579fb68bc5adbe8a2b1d676c', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: 'a68f95384965384a67d042b89264dbda03f25b7a', class: 'tel__error-message' }, this.errorMessage));
14627
+ return h("div", { key: '9cf9eb751bca1978d8554fffc912ef2039c42e41', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'cc88d6e9aa7a0f3801fad75e3ca509fbd01b0538', class: 'tel__wrapper--flex-label' }, h("label", { key: 'c8a35af4ddd2d4f9751d7f60c9e075ae8eccb441', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '73fcdcc25dde1be087ee60062dc5eee2d1e5d29e', class: 'tel__wrapper--relative' }, this.tooltip &&
14628
+ h("img", { key: '56df66fddf599fbafb179c7cd90ea7d58b008ea6', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: '20eb5689932c2f71322102229cc7346d18e9bc87', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '9ec4142dc84e0022ced7e34248d5f4f8f59c34af', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: 'c083b17f71de36b84892a8080f776debf1fe7351', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: '2201c2d7b968731042624b265cf535c656c86933', class: 'tel__error-message' }, this.errorMessage));
14562
14629
  }
14563
14630
  static get watchers() { return {
14564
- "clientStyling": ["handleStylingChange"],
14631
+ "clientStyling": ["handleClientStylingChange"],
14565
14632
  "isValid": ["validityChanged"],
14566
14633
  "emitValue": ["emitValueHandler"]
14567
14634
  }; }
@@ -14605,11 +14672,6 @@ const TextInput = class {
14605
14672
  this.touched = true;
14606
14673
  this.updateValidationState();
14607
14674
  };
14608
- this.setClientStyling = () => {
14609
- let sheet = document.createElement('style');
14610
- sheet.innerHTML = this.clientStyling;
14611
- this.stylingContainer.prepend(sheet);
14612
- };
14613
14675
  this.name = undefined;
14614
14676
  this.displayName = undefined;
14615
14677
  this.placeholder = undefined;
@@ -14624,15 +14686,16 @@ const TextInput = class {
14624
14686
  this.clientStyling = '';
14625
14687
  this.haspostalcodelookup = undefined;
14626
14688
  this.enableSouthAfricanMode = undefined;
14689
+ this.mbSource = undefined;
14627
14690
  this.isValid = undefined;
14628
14691
  this.errorMessage = '';
14629
- this.limitStylingAppends = false;
14630
14692
  this.showTooltip = false;
14631
14693
  this.selectedCountryCode = '';
14632
14694
  }
14633
- handleStylingChange(newValue, oldValue) {
14634
- if (newValue !== oldValue)
14635
- this.setClientStyling();
14695
+ handleClientStylingChange(newValue, oldValue) {
14696
+ if (newValue !== oldValue) {
14697
+ setClientStyling(this.stylingContainer, this.clientStyling);
14698
+ }
14636
14699
  }
14637
14700
  validityChanged() {
14638
14701
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -14744,21 +14807,22 @@ const TextInput = class {
14744
14807
  }
14745
14808
  this.validityStateHandler({ valid: false, name: this.name });
14746
14809
  }
14747
- componentDidRender() {
14748
- // start custom styling area
14749
- if (!this.limitStylingAppends && this.stylingContainer) {
14750
- if (this.clientStyling)
14751
- this.setClientStyling();
14752
- this.limitStylingAppends = true;
14753
- }
14754
- // end custom styling area
14755
- }
14756
14810
  componentWillLoad() {
14757
14811
  if (this.defaultValue) {
14758
14812
  this.value = this.defaultValue;
14759
14813
  }
14760
14814
  }
14815
+ handleClientStyling() {
14816
+ if (window.emMessageBus !== undefined) {
14817
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14818
+ return;
14819
+ }
14820
+ if (this.clientStyling) {
14821
+ setClientStyling(this.stylingContainer, this.clientStyling);
14822
+ }
14823
+ }
14761
14824
  componentDidLoad() {
14825
+ this.handleClientStyling();
14762
14826
  if (this.defaultValue) {
14763
14827
  this.value = this.defaultValue;
14764
14828
  this.valueHandler({ name: this.name, value: this.value });
@@ -14870,11 +14934,11 @@ const TextInput = class {
14870
14934
  if (this.touched) {
14871
14935
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
14872
14936
  }
14873
- return h("div", { key: 'aacb35e1808720cfdb24708254c01cb5be0fe6b6', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '14a292cc7661d663698384d989d57d21786210b9', class: 'text__wrapper--flex' }, h("label", { key: 'c04b29364c4b54e9aad3036264044177e4a2dc51', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'eb8aee30e47241b533c7ca8fcb354c782b4e2be1', class: 'text__wrapper--relative' }, this.tooltip &&
14874
- h("img", { key: '23d4b70d93910f43ce0ea54c1bcffd81dfc54ebc', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '3f901d85111256370811f4abe51bcd5b2971b60c', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '1661215687f1eecd622b2610c3e056f45944fee3', class: 'text__error-message' }, this.errorMessage));
14937
+ return h("div", { key: 'f48e592bac049022b283bac917c095772b1508f5', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: 'fe3626ead38dd18dfa14795ee2332e93f5f09652', class: 'text__wrapper--flex' }, h("label", { key: '6b2854b460e0ac7d4ae0ebccc06dbe64770581d5', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'f29d266973bd700a4270495bc4eb6e8296b6eeaf', class: 'text__wrapper--relative' }, this.tooltip &&
14938
+ h("img", { key: '68e69abbb78250e763822608e963bc16d702f099', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '99b8eab15ab32656f86fedd3f36a09a5bbe108d3', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: 'cc28c1c19370faa94fa1f738066042dce8d694ce', class: 'text__error-message' }, this.errorMessage));
14875
14939
  }
14876
14940
  static get watchers() { return {
14877
- "clientStyling": ["handleStylingChange"],
14941
+ "clientStyling": ["handleClientStylingChange"],
14878
14942
  "isValid": ["validityChanged"],
14879
14943
  "emitValue": ["emitValueHandler"]
14880
14944
  }; }
@@ -14896,11 +14960,6 @@ const ToggleCheckboxInput = class {
14896
14960
  event.stopPropagation();
14897
14961
  window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
14898
14962
  };
14899
- this.setClientStyling = () => {
14900
- let sheet = document.createElement('style');
14901
- sheet.innerHTML = this.clientStyling;
14902
- this.stylingContainer.prepend(sheet);
14903
- };
14904
14963
  this.name = undefined;
14905
14964
  this.displayName = undefined;
14906
14965
  this.defaultValue = '';
@@ -14911,15 +14970,16 @@ const ToggleCheckboxInput = class {
14911
14970
  this.language = undefined;
14912
14971
  this.emitValue = undefined;
14913
14972
  this.clientStyling = '';
14973
+ this.mbSource = undefined;
14914
14974
  this.errorMessage = undefined;
14915
14975
  this.isValid = undefined;
14916
- this.limitStylingAppends = false;
14917
14976
  this.showTooltip = false;
14918
14977
  this.showFields = this.defaultValue === 'true';
14919
14978
  }
14920
- handleStylingChange(newValue, oldValue) {
14921
- if (newValue !== oldValue)
14922
- this.setClientStyling();
14979
+ handleClientStylingChange(newValue, oldValue) {
14980
+ if (newValue !== oldValue) {
14981
+ setClientStyling(this.stylingContainer, this.clientStyling);
14982
+ }
14923
14983
  }
14924
14984
  validityStateHandler(inputStateEvent) {
14925
14985
  this.sendValidityState.emit(inputStateEvent);
@@ -14933,16 +14993,17 @@ const ToggleCheckboxInput = class {
14933
14993
  this.showTooltip = false;
14934
14994
  }
14935
14995
  }
14936
- componentDidRender() {
14937
- // start custom styling area
14938
- if (!this.limitStylingAppends && this.stylingContainer) {
14939
- if (this.clientStyling)
14940
- this.setClientStyling();
14941
- this.limitStylingAppends = true;
14996
+ handleClientStyling() {
14997
+ if (window.emMessageBus !== undefined) {
14998
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14999
+ return;
15000
+ }
15001
+ if (this.clientStyling) {
15002
+ setClientStyling(this.stylingContainer, this.clientStyling);
14942
15003
  }
14943
- // end custom styling area
14944
15004
  }
14945
15005
  componentDidLoad() {
15006
+ this.handleClientStyling();
14946
15007
  if (this.options.length === 0)
14947
15008
  return;
14948
15009
  this.options.forEach((subField) => {
@@ -14979,13 +15040,13 @@ const ToggleCheckboxInput = class {
14979
15040
  return null;
14980
15041
  }
14981
15042
  render() {
14982
- return h("div", { key: '828751327e59e9649afc04c6c9f7a02ef7dcae8d', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'd02a2a6ef595aaf7142cbc6e9681394ee4db8fee', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: 'fca6401ef6eb178f53471362444d54ed69086429', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: '3781a8fdfeb719422693bcd541a4a3fe708e705a', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '27a4c6b047cd332407ee40c82cf7be1914ed34c9', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
14983
- h("img", { key: 'f1367d7e061d20ad68c24dfbe3147e6b67df746f', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '98d42103554de4d14a65eafd1722bf9d587a27f1', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
15043
+ return h("div", { key: '31cd24b5da24368eef2f53952714395d6d9f6285', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'aa14784bd8a3870f7015db79d23226521706ad58', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: '0237f06c99b8b2ed7de80433f5b93b9eae7c25f5', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: '7e26bea1cfcc725d5aa5a795fd0f999d99abe39d', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '4256fc552545b7a1050ff5cdeb005f5ea83cc5c1', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
15044
+ h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '2d61bedaac02f21116318b10a21b361e70e0213f', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
14984
15045
  return h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
14985
15046
  })));
14986
15047
  }
14987
15048
  static get watchers() { return {
14988
- "clientStyling": ["handleStylingChange"]
15049
+ "clientStyling": ["handleClientStylingChange"]
14989
15050
  }; }
14990
15051
  };
14991
15052
  ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
@@ -15011,17 +15072,6 @@ const TwofaInput = class {
15011
15072
  this.triggerResendInterval();
15012
15073
  this.resendCode.emit();
15013
15074
  };
15014
- this.setClientStylingURL = () => {
15015
- let url = new URL(this.clientStylingUrl);
15016
- let cssFile = document.createElement('style');
15017
- fetch(url.href)
15018
- .then((res) => res.text())
15019
- .then((data) => {
15020
- cssFile.innerHTML = data;
15021
- this.clientStyling = data;
15022
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
15023
- });
15024
- };
15025
15075
  this.setInputRef = (el, idx) => {
15026
15076
  if (el) {
15027
15077
  this.inputRefs[idx] = el;
@@ -15077,21 +15127,6 @@ const TwofaInput = class {
15077
15127
  this.setValidity();
15078
15128
  this.setErrorMessage();
15079
15129
  };
15080
- this.setClientStyling = () => {
15081
- let sheet = document.createElement('style');
15082
- sheet.innerHTML = this.clientStyling;
15083
- this.stylingContainer.prepend(sheet);
15084
- };
15085
- this.setStreamStyling = (domain) => {
15086
- if (window.emMessageBus) {
15087
- const sheet = document.createElement('style');
15088
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
15089
- sheet.innerHTML = data;
15090
- this.clientStyling = data;
15091
- this.host.shadowRoot.prepend(sheet);
15092
- });
15093
- }
15094
- };
15095
15130
  this.name = '';
15096
15131
  this.displayName = '';
15097
15132
  this.placeholder = '';
@@ -15106,7 +15141,6 @@ const TwofaInput = class {
15106
15141
  this.pinAttemptsExceeded = undefined;
15107
15142
  this.clientStylingUrl = '';
15108
15143
  this.mbSource = undefined;
15109
- this.limitStylingAppends = false;
15110
15144
  this.isValid = false;
15111
15145
  this.isResendButtonAvailable = true;
15112
15146
  this.showTooltip = false;
@@ -15126,9 +15160,16 @@ const TwofaInput = class {
15126
15160
  this.valueHandler({ name: this.name, value: this.code.join('') });
15127
15161
  }
15128
15162
  }
15129
- handleStylingUrlChange(newValue, oldValue) {
15130
- if (newValue !== oldValue)
15131
- this.setClientStylingURL();
15163
+ handleClientStylingChange(newValue, oldValue) {
15164
+ if (newValue !== oldValue) {
15165
+ setClientStyling(this.stylingContainer, this.clientStyling);
15166
+ }
15167
+ }
15168
+ handleClientStylingChangeURL(newValue, oldValue) {
15169
+ if (newValue !== oldValue) {
15170
+ if (this.clientStylingUrl)
15171
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
15172
+ }
15132
15173
  }
15133
15174
  validityStateHandler(inputStateEvent) {
15134
15175
  this.sendValidityState.emit(inputStateEvent);
@@ -15142,10 +15183,6 @@ const TwofaInput = class {
15142
15183
  this.showTooltip = false;
15143
15184
  }
15144
15185
  }
15145
- handleStylingChange(newValue, oldValue) {
15146
- if (newValue !== oldValue)
15147
- this.setClientStyling();
15148
- }
15149
15186
  connectedCallback() {
15150
15187
  this.validationPattern = this.setPattern();
15151
15188
  this.code = new Array(this.validation.maxLength).fill('');
@@ -15153,30 +15190,21 @@ const TwofaInput = class {
15153
15190
  disconnectedCallback() {
15154
15191
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
15155
15192
  }
15156
- componentDidRender() {
15157
- if (!this.limitStylingAppends && this.stylingContainer) {
15158
- if (this.clientStyling) {
15159
- this.setClientStyling();
15160
- }
15161
- this.limitStylingAppends = true;
15193
+ handleClientStyling() {
15194
+ if (window.emMessageBus !== undefined) {
15195
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
15196
+ return;
15162
15197
  }
15198
+ if (this.clientStyling)
15199
+ setClientStyling(this.stylingContainer, this.clientStyling);
15200
+ if (this.clientStylingUrl)
15201
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
15163
15202
  }
15164
15203
  componentDidLoad() {
15165
15204
  this.setValidity();
15166
15205
  this.registrationWidgetLoaded.emit();
15167
15206
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
15168
- if (!this.limitStylingAppends && this.host) {
15169
- if (window.emMessageBus != undefined) {
15170
- this.setStreamStyling(`${this.mbSource}.Style`);
15171
- }
15172
- else {
15173
- if (this.clientStyling)
15174
- this.setClientStyling();
15175
- if (this.clientStylingUrl)
15176
- this.setClientStylingURL();
15177
- this.limitStylingAppends = true;
15178
- }
15179
- }
15207
+ this.handleClientStyling();
15180
15208
  }
15181
15209
  handleKeyDown(e, idx) {
15182
15210
  if (e.key === 'Backspace') {
@@ -15267,9 +15295,9 @@ const TwofaInput = class {
15267
15295
  return current;
15268
15296
  }
15269
15297
  render() {
15270
- return (h("div", { key: '08b9139f1c2236dd40a045517a9623ad966f29d3', class: "twofa", ref: el => this.stylingContainer = el }, h("div", { key: '7528885100be3d450ec52aafd6085a4c852710c8', class: 'twofa__error-message' }, h("p", { key: '51dab3f02156b5eb3b7408f06f2d359cfbda11a7' }, this.errorMessage)), h("div", { key: 'f336f89ecee0724663b1bbb4d443bb834336b5c1', class: "twofa__description", innerHTML: translate('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '5127127ccc8e50428f8319fddc9e21606f3b4148', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
15298
+ return (h("div", { key: 'cd5396afccaf4016201281f5cc53898c0a2052ed', class: "twofa", ref: el => this.stylingContainer = el }, h("div", { key: '008dd54682a0d93190e9e5b2b49673262ed01763', class: 'twofa__error-message' }, h("p", { key: '41db51d6b396ccd1f3149e4473e96960e92d05ca' }, this.errorMessage)), h("div", { key: '67e9e4ac90cf95f2269e75b121ed220a02c5f139', class: "twofa__description", innerHTML: translate('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '702c342eb7be0001ab8de310cadd7e8684a8025d', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
15271
15299
  return (h("input", { key: idx, ref: el => this.setInputRef(el, idx), id: `otp-input-${idx}`, type: "text", maxLength: 2, value: this.getInputDisplayValue(idx), onInput: (event) => this.handleInput(event, idx), onKeyDown: (event) => this.handleKeyDown(event, idx), onPaste: (event) => this.handlePaste(event) }));
15272
- })), h("div", { key: 'be82ae1192129d571275b78c8097c3023468cf3e', class: "twofa__button-wrapper" }, h("p", { key: '11de61d738ffa74bfd44f0d7c88fc4e456647d0c', class: "twofa__resend-message" }, translate('twofaResendMessage', this.language)), h("button", { key: '84d5c55c4d9bf024164ec52e2100cfcc8c236ac2', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
15300
+ })), h("div", { key: '63564bd4a0442232f81058ba914ee86c537ce85a', class: "twofa__button-wrapper" }, h("p", { key: '219f5005c0d03189df48f05c5e0cd980eb0e1979', class: "twofa__resend-message" }, translate('twofaResendMessage', this.language)), h("button", { key: '12b7b4bc3ea165994f2c50107f406c64e708cf4d', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
15273
15301
  ? translate('twofaResendButton', this.language)
15274
15302
  : this.formatTime()))));
15275
15303
  }
@@ -15277,8 +15305,8 @@ const TwofaInput = class {
15277
15305
  static get watchers() { return {
15278
15306
  "isValid": ["validityChanged"],
15279
15307
  "emitValue": ["emitValueHandler"],
15280
- "clientStylingUrl": ["handleStylingUrlChange"],
15281
- "clientStyling": ["handleStylingChange"]
15308
+ "clientStyling": ["handleClientStylingChange"],
15309
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
15282
15310
  }; }
15283
15311
  };
15284
15312
  TwofaInput.style = TwofaInputStyle0;