@webority/ui-elements 0.12.3 → 0.12.5

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.
@@ -527,7 +527,195 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
527
527
  disconnectedCallback() {
528
528
  this._teardown();
529
529
  }
530
- }, b = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), x = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), S = "\n:host {\n all: initial;\n position: fixed;\n bottom: 20px;\n left: 20px;\n right: auto;\n z-index: var(--wui-z-fixed, 1030);\n display: block;\n width: 420px;\n max-width: calc(100vw - 40px);\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n color: var(--color-text, #212529);\n}\n:host([position=\"bottom-right\"]) {\n right: 20px;\n left: auto;\n}\n:host(:not([open])) {\n pointer-events: none;\n}\n*, *::before, *::after {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\n\n.wui-consent-banner-panel {\n padding: 20px;\n background: var(--color-surface, #fff);\n border: 1px solid var(--color-border, #dee2e6);\n border-radius: var(--wui-radius-lg, 12px);\n box-shadow: var(--wui-shadow-overlay-lg, 0 12px 32px rgba(0, 0, 0, 0.16));\n text-align: start;\n pointer-events: auto;\n}\n.wui-consent-banner-heading {\n margin: 0 0 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 1.3;\n color: var(--color-text, #212529);\n}\n.wui-consent-banner-description {\n margin: 0 0 16px;\n font-size: 14px;\n line-height: 1.5;\n color: var(--color-text-muted, #6c757d);\n}\n.wui-consent-banner-policy {\n color: var(--color-primary, #0d6efd);\n font-weight: 500;\n}\n\n.wui-consent-banner-settings {\n display: grid;\n gap: 12px;\n max-height: 50vh;\n margin: 0 0 16px;\n padding: 12px 0;\n overflow-y: auto;\n border-top: 1px solid var(--color-border, #dee2e6);\n border-bottom: 1px solid var(--color-border, #dee2e6);\n}\n.wui-consent-banner-category-description {\n margin: 2px 0 0;\n padding-inline-start: 2.5em;\n font-size: 12px;\n line-height: 1.4;\n color: var(--color-text-muted, #6c757d);\n}\n\n.form-check {\n display: flex;\n align-items: center;\n gap: 0.5em;\n margin: 0;\n font-size: 14px;\n}\n.form-check-input {\n appearance: none;\n flex: none;\n width: 2em;\n height: 1em;\n margin: 0;\n border: 1px solid var(--color-border, #adb5bd);\n border-radius: 2em;\n background: var(--color-surface, #fff) radial-gradient(circle, var(--color-border, #adb5bd) 0.35em, transparent 0.4em) left / 1em 1em no-repeat;\n cursor: pointer;\n transition: background-position 0.15s ease-in-out;\n}\n.form-check-input:checked {\n border-color: var(--color-primary, #0d6efd);\n background: var(--color-primary, #0d6efd) radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat;\n}\n.form-check-input:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.form-check-input:focus-visible {\n outline: 2px solid var(--color-primary, #0d6efd);\n outline-offset: 2px;\n}\n.form-check-label {\n cursor: pointer;\n}\n\n.wui-consent-banner-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n}\n.btn {\n display: inline-block;\n padding: 4px 12px;\n border: 1px solid transparent;\n border-radius: var(--wui-radius, 6px);\n background: transparent;\n font: inherit;\n font-size: 14px;\n font-weight: 500;\n line-height: 1.5;\n text-align: center;\n white-space: nowrap;\n cursor: pointer;\n}\n.btn:focus-visible {\n outline: 2px solid var(--color-primary, #0d6efd);\n outline-offset: 2px;\n}\n.btn-primary {\n background: var(--color-primary, #0d6efd);\n border-color: var(--color-primary, #0d6efd);\n color: #fff;\n}\n.btn-primary:hover {\n background: var(--color-primary-hover, #0b5ed7);\n border-color: var(--color-primary-hover, #0b5ed7);\n}\n.btn-outline-secondary {\n border-color: var(--color-border, #6c757d);\n color: var(--color-text, #212529);\n}\n.btn-outline-secondary:hover {\n background: var(--color-bg-muted, #f1f3f5);\n}\n.btn-link {\n color: var(--color-primary, #0d6efd);\n text-decoration: underline;\n}\n.wui-consent-banner-settings-toggle {\n margin-inline-end: auto;\n padding-inline: 0;\n}\n.wui-consent-banner-save {\n flex: 1 1 100%;\n}\n\n@media (max-width: 480px) {\n :host,\n :host([position=\"bottom-right\"]) {\n left: 12px;\n right: 12px;\n bottom: 12px;\n width: auto;\n max-width: none;\n }\n}\n", ee = "wui-consent-save", te = "[data-consent-settings]", C = {
530
+ }, b = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), x = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), S = {
531
+ "--color-primary": "#4F46E5",
532
+ "--color-primary-hover": "#4338CA",
533
+ "--color-text": "#071437",
534
+ "--color-text-muted": "#4B5675",
535
+ "--color-border": "#EBEDF3",
536
+ "--color-surface": "#FFFFFF",
537
+ "--wui-radius-lg": "14px",
538
+ "--wui-shadow-overlay-lg": "0 24px 60px -16px rgba(7, 20, 55, 0.28)",
539
+ "--wui-z-fixed": "1030"
540
+ }, C = (e) => `var(${e}, ${S[e]})`, ee = `
541
+ :host {
542
+ all: initial;
543
+ position: fixed;
544
+ bottom: 20px;
545
+ left: 20px;
546
+ right: auto;
547
+ z-index: ${C("--wui-z-fixed")};
548
+ display: block;
549
+ width: 420px;
550
+ max-width: calc(100vw - 40px);
551
+ font-family: inherit;
552
+ font-size: 16px;
553
+ line-height: 1.5;
554
+ color: ${C("--color-text")};
555
+ }
556
+ :host([position="bottom-right"]) {
557
+ right: 20px;
558
+ left: auto;
559
+ }
560
+ :host(:not([open])) {
561
+ pointer-events: none;
562
+ }
563
+ *, *::before, *::after {
564
+ box-sizing: border-box;
565
+ }
566
+ [hidden] {
567
+ display: none !important;
568
+ }
569
+
570
+ .wui-consent-banner-panel {
571
+ padding: 20px;
572
+ background: ${C("--color-surface")};
573
+ border: 1px solid ${C("--color-border")};
574
+ border-radius: ${C("--wui-radius-lg")};
575
+ box-shadow: ${C("--wui-shadow-overlay-lg")};
576
+ text-align: start;
577
+ pointer-events: auto;
578
+ }
579
+ .wui-consent-banner-heading {
580
+ margin: 0 0 8px;
581
+ font-size: 18px;
582
+ font-weight: 600;
583
+ line-height: 1.3;
584
+ color: ${C("--color-text")};
585
+ }
586
+ .wui-consent-banner-description {
587
+ margin: 0 0 16px;
588
+ font-size: 14px;
589
+ line-height: 1.5;
590
+ color: ${C("--color-text-muted")};
591
+ }
592
+ .wui-consent-banner-policy {
593
+ color: ${C("--color-primary")};
594
+ font-weight: 500;
595
+ }
596
+
597
+ .wui-consent-banner-settings {
598
+ display: grid;
599
+ gap: 12px;
600
+ max-height: 50vh;
601
+ margin: 0 0 16px;
602
+ padding: 12px 0;
603
+ overflow-y: auto;
604
+ border-top: 1px solid ${C("--color-border")};
605
+ border-bottom: 1px solid ${C("--color-border")};
606
+ }
607
+ .wui-consent-banner-category-description {
608
+ margin: 2px 0 0;
609
+ padding-inline-start: 2.5em;
610
+ font-size: 12px;
611
+ line-height: 1.4;
612
+ color: ${C("--color-text-muted")};
613
+ }
614
+
615
+ .form-check {
616
+ display: flex;
617
+ align-items: center;
618
+ gap: 0.5em;
619
+ margin: 0;
620
+ font-size: 14px;
621
+ }
622
+ .form-check-input {
623
+ appearance: none;
624
+ flex: none;
625
+ width: 2em;
626
+ height: 1em;
627
+ margin: 0;
628
+ border: 1px solid rgba(0, 0, 0, 0.25);
629
+ border-radius: 2em;
630
+ background: ${C("--color-surface")} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat;
631
+ cursor: pointer;
632
+ transition: background-position 0.15s ease-in-out;
633
+ }
634
+ .form-check-input:checked {
635
+ border-color: ${C("--color-primary")};
636
+ background: ${C("--color-primary")} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat;
637
+ }
638
+ .form-check-input:disabled {
639
+ opacity: 0.5;
640
+ cursor: default;
641
+ }
642
+ .form-check-input:focus-visible {
643
+ outline: 2px solid ${C("--color-primary")};
644
+ outline-offset: 2px;
645
+ }
646
+ .form-check-label {
647
+ cursor: pointer;
648
+ }
649
+
650
+ .wui-consent-banner-actions {
651
+ display: flex;
652
+ flex-wrap: wrap;
653
+ align-items: center;
654
+ justify-content: flex-end;
655
+ gap: 8px;
656
+ }
657
+ .btn {
658
+ display: inline-block;
659
+ padding: 0.25rem 0.5rem;
660
+ border: 1px solid transparent;
661
+ border-radius: 0.375rem;
662
+ background: transparent;
663
+ font: inherit;
664
+ font-size: 0.875rem;
665
+ font-weight: 500;
666
+ line-height: 1.5;
667
+ text-align: center;
668
+ white-space: nowrap;
669
+ cursor: pointer;
670
+ }
671
+ .btn:focus-visible {
672
+ outline: 2px solid ${C("--color-primary")};
673
+ outline-offset: 2px;
674
+ }
675
+ .btn-primary {
676
+ background: ${C("--color-primary")};
677
+ border-color: ${C("--color-primary")};
678
+ color: #fff;
679
+ }
680
+ .btn-primary:hover {
681
+ background: ${C("--color-primary-hover")};
682
+ border-color: ${C("--color-primary-hover")};
683
+ }
684
+ .btn-outline-secondary {
685
+ border-color: ${C("--color-text-muted")};
686
+ color: ${C("--color-text-muted")};
687
+ }
688
+ .btn-outline-secondary:hover {
689
+ background: ${C("--color-text-muted")};
690
+ color: #fff;
691
+ }
692
+ .btn-link {
693
+ font-weight: 400;
694
+ color: ${C("--color-primary")};
695
+ text-decoration: underline;
696
+ }
697
+ .btn-link:hover {
698
+ color: ${C("--color-primary-hover")};
699
+ }
700
+ .wui-consent-banner-settings-toggle {
701
+ margin-inline-end: auto;
702
+ padding-inline: 0;
703
+ }
704
+ .wui-consent-banner-save {
705
+ flex: 1 1 100%;
706
+ }
707
+
708
+ @media (max-width: 480px) {
709
+ :host,
710
+ :host([position="bottom-right"]) {
711
+ left: 12px;
712
+ right: 12px;
713
+ bottom: 12px;
714
+ width: auto;
715
+ max-width: none;
716
+ }
717
+ }
718
+ `, w = "wui-consent-save", te = "[data-consent-settings]", T = {
531
719
  heading: "Cookies on this site",
532
720
  description: "We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.",
533
721
  policyLabel: "Cookie policy",
@@ -543,11 +731,11 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
543
731
  rejectLabel: "Reject all",
544
732
  acceptLabel: "Accept all",
545
733
  saveLabel: "Save preferences"
546
- }, w = [
734
+ }, ne = [
547
735
  "analytics",
548
736
  "functional",
549
737
  "marketing"
550
- ], T = 0, ne = class extends e {
738
+ ], re = 0, ie = class extends e {
551
739
  static get observedAttributes() {
552
740
  return [
553
741
  "heading",
@@ -560,7 +748,7 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
560
748
  ];
561
749
  }
562
750
  constructor() {
563
- super(), T += 1, this._uid = `wui-consent-${T}`, this._preferences = {
751
+ super(), re += 1, this._uid = `wui-consent-${re}`, this._preferences = {
564
752
  analytics: !1,
565
753
  functional: !1,
566
754
  marketing: !1
@@ -584,13 +772,13 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
584
772
  this.toggleAttribute("standalone", e === !0 || e === "" || e === "true");
585
773
  }
586
774
  get heading() {
587
- return this.getAttribute("heading") || C.heading;
775
+ return this.getAttribute("heading") || T.heading;
588
776
  }
589
777
  set heading(e) {
590
778
  this.setAttribute("heading", String(e ?? ""));
591
779
  }
592
780
  get description() {
593
- return this.getAttribute("description") || C.description;
781
+ return this.getAttribute("description") || T.description;
594
782
  }
595
783
  set description(e) {
596
784
  this.setAttribute("description", String(e ?? ""));
@@ -602,25 +790,25 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
602
790
  this.setAttribute("policy-href", String(e ?? ""));
603
791
  }
604
792
  get policyLabel() {
605
- return this.getAttribute("policy-label") || C.policyLabel;
793
+ return this.getAttribute("policy-label") || T.policyLabel;
606
794
  }
607
795
  set policyLabel(e) {
608
796
  this.setAttribute("policy-label", String(e ?? ""));
609
797
  }
610
798
  get analyticsDescription() {
611
- return this.getAttribute("analytics-description") || C.analyticsDescription;
799
+ return this.getAttribute("analytics-description") || T.analyticsDescription;
612
800
  }
613
801
  set analyticsDescription(e) {
614
802
  this.setAttribute("analytics-description", String(e ?? ""));
615
803
  }
616
804
  get functionalDescription() {
617
- return this.getAttribute("functional-description") || C.functionalDescription;
805
+ return this.getAttribute("functional-description") || T.functionalDescription;
618
806
  }
619
807
  set functionalDescription(e) {
620
808
  this.setAttribute("functional-description", String(e ?? ""));
621
809
  }
622
810
  get marketingDescription() {
623
- return this.getAttribute("marketing-description") || C.marketingDescription;
811
+ return this.getAttribute("marketing-description") || T.marketingDescription;
624
812
  }
625
813
  set marketingDescription(e) {
626
814
  this.setAttribute("marketing-description", String(e ?? ""));
@@ -648,22 +836,22 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
648
836
  this._rendered && this.render();
649
837
  }
650
838
  render() {
651
- let e = this.isOpen, t = this._uid, n = this.policyHref ? ` <a class="wui-consent-banner-policy" href="${re(this.policyHref)}">${D(this.policyLabel)}</a>` : "", r = this._root();
652
- r.innerHTML = `${r === this ? "" : `<style>${S}</style>`}
839
+ let e = this.isOpen, t = this._uid, n = this.policyHref ? ` <a class="wui-consent-banner-policy" href="${ae(this.policyHref)}">${D(this.policyLabel)}</a>` : "", r = this._root();
840
+ r.innerHTML = `${r === this ? "" : `<style>${ee}</style>`}
653
841
  <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden>
654
842
  <h2 class="wui-consent-banner-heading" id="${t}-heading">${D(this.heading)}</h2>
655
843
  <p class="wui-consent-banner-description" id="${t}-description">${D(this.description)}${n}</p>
656
844
  <div class="wui-consent-banner-settings" hidden>
657
- ${E(t, "essential", C.essentialLabel, C.essentialDescription, !0)}
658
- ${E(t, "analytics", C.analyticsLabel, this.analyticsDescription, !1)}
659
- ${E(t, "functional", C.functionalLabel, this.functionalDescription, !1)}
660
- ${E(t, "marketing", C.marketingLabel, this.marketingDescription, !1)}
845
+ ${E(t, "essential", T.essentialLabel, T.essentialDescription, !0)}
846
+ ${E(t, "analytics", T.analyticsLabel, this.analyticsDescription, !1)}
847
+ ${E(t, "functional", T.functionalLabel, this.functionalDescription, !1)}
848
+ ${E(t, "marketing", T.marketingLabel, this.marketingDescription, !1)}
661
849
  </div>
662
850
  <div class="wui-consent-banner-actions">
663
- <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${C.settingsLabel}</button>
664
- <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${C.rejectLabel}</button>
665
- <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${C.acceptLabel}</button>
666
- <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${C.saveLabel}</button>
851
+ <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${T.settingsLabel}</button>
852
+ <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${T.rejectLabel}</button>
853
+ <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${T.acceptLabel}</button>
854
+ <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${T.saveLabel}</button>
667
855
  </div>
668
856
  </div>`, this._rendered = !0, this._wire(), this._applyPreferences(), this._showSettings(this._settings), e && (this._panel().hidden = !1);
669
857
  }
@@ -693,7 +881,7 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
693
881
  })), e.querySelector(".wui-consent-banner-save")?.addEventListener("click", () => this._save(this._switchValues())), e.querySelector(".wui-consent-banner-settings-toggle")?.addEventListener("click", () => this._showSettings(!this._settings));
694
882
  }
695
883
  _save(e) {
696
- this._preferences = { ...e }, this.dispatchEvent(new CustomEvent(ee, {
884
+ this._preferences = { ...e }, this.dispatchEvent(new CustomEvent(w, {
697
885
  bubbles: !0,
698
886
  composed: !0,
699
887
  detail: { ...e }
@@ -701,11 +889,11 @@ var h = Symbol("wui.trustedHtml"), g = (e) => String(e ?? "").replace(/&/g, "&am
701
889
  }
702
890
  _switchValues() {
703
891
  let e = {};
704
- for (let t of w) e[t] = this._root().querySelector(`input[data-category="${t}"]`)?.checked === !0;
892
+ for (let t of ne) e[t] = this._root().querySelector(`input[data-category="${t}"]`)?.checked === !0;
705
893
  return e;
706
894
  }
707
895
  _applyPreferences() {
708
- for (let e of w) {
896
+ for (let e of ne) {
709
897
  let t = this._root().querySelector(`input[data-category="${e}"]`);
710
898
  t && (t.checked = this._preferences[e]);
711
899
  }
@@ -733,7 +921,7 @@ function E(e, t, n, r, i) {
733
921
  <p class="wui-consent-banner-category-description">${D(r)}</p>
734
922
  </div>`;
735
923
  }
736
- var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), re = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), O = [
924
+ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ae = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), O = [
737
925
  "January",
738
926
  "February",
739
927
  "March",
@@ -754,24 +942,24 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
754
942
  "Th",
755
943
  "Fr",
756
944
  "Sa"
757
- ], ie = (e) => String(e).padStart(2, "0"), A = (e, t, n) => `${e}-${ie(t + 1)}-${ie(n)}`, j = (e) => {
945
+ ], A = (e) => String(e).padStart(2, "0"), j = (e, t, n) => `${e}-${A(t + 1)}-${A(n)}`, M = (e) => {
758
946
  let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
759
947
  return t ? {
760
948
  y: +t[1],
761
949
  m: t[2] - 1,
762
950
  d: +t[3]
763
951
  } : null;
764
- }, M = (e) => {
765
- let t = j(e);
766
- return t ? `${ie(t.d)} ${O[t.m].slice(0, 3)} ${t.y}` : "";
767
- }, N = (e, t) => new Date(e, t + 1, 0).getDate(), P = (e, t) => {
952
+ }, N = (e) => {
953
+ let t = M(e);
954
+ return t ? `${A(t.d)} ${O[t.m].slice(0, 3)} ${t.y}` : "";
955
+ }, P = (e, t) => new Date(e, t + 1, 0).getDate(), F = (e, t) => {
768
956
  for (; t < 0;) t += 12, --e;
769
957
  for (; t > 11;) t -= 12, e += 1;
770
958
  return {
771
959
  y: e,
772
960
  m: t
773
961
  };
774
- }, ae = class extends e {
962
+ }, oe = class extends e {
775
963
  static formAssociated = !0;
776
964
  static get observedAttributes() {
777
965
  return [
@@ -783,7 +971,8 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
783
971
  "first-day",
784
972
  "size",
785
973
  "aria-label",
786
- "aria-describedby"
974
+ "aria-describedby",
975
+ "aria-invalid"
787
976
  ];
788
977
  }
789
978
  constructor() {
@@ -805,8 +994,16 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
805
994
  this._bindGlobal?.();
806
995
  }
807
996
  attributeChangedCallback(e, t, n) {
997
+ if (e === "aria-invalid") {
998
+ this._syncInvalid();
999
+ return;
1000
+ }
808
1001
  this._rendered && (e === "value" ? (this._value = n || "", this._syncFormValue(), this._syncTrigger()) : e === "first-day" ? this.querySelector(".datepicker-pop")?.hidden || this._renderView() : this.render());
809
1002
  }
1003
+ _syncInvalid() {
1004
+ let e = this.querySelector(".datepicker-trigger");
1005
+ e && (this.hasAttribute("aria-invalid") ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
1006
+ }
810
1007
  formResetCallback() {
811
1008
  this.value = this._defaultValue || "";
812
1009
  }
@@ -822,13 +1019,13 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
822
1019
  }
823
1020
  render() {
824
1021
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
825
- let e = this.getAttribute("placeholder") || "Enter Date", t = j(this._value);
1022
+ let e = this.getAttribute("placeholder") || "Enter Date", t = M(this._value);
826
1023
  t && (this._viewY = t.y, this._viewM = t.m);
827
1024
  let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "", i = this.getAttribute("aria-label"), a = this.getAttribute("aria-describedby");
828
1025
  this.innerHTML = `
829
1026
  <div class="datepicker">
830
- <button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${g(i)}"` : ""}${a ? ` aria-describedby="${g(a)}"` : ""}>
831
- <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? M(this._value) : g(e)}</span>
1027
+ <button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${g(i)}"` : ""}${a ? ` aria-describedby="${g(a)}"` : ""}>
1028
+ <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? N(this._value) : g(e)}</span>
832
1029
  ${p("calendar-dots")}
833
1030
  </button>
834
1031
  <div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
@@ -840,11 +1037,11 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
840
1037
  _syncTrigger() {
841
1038
  let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
842
1039
  if (!t) return;
843
- let n = j(this._value);
844
- t.textContent = n ? M(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
1040
+ let n = M(this._value);
1041
+ t.textContent = n ? N(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
845
1042
  }
846
1043
  _limits() {
847
- let e = j(this.getAttribute("min")), t = j(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
1044
+ let e = M(this.getAttribute("min")), t = M(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
848
1045
  return {
849
1046
  dayDisabled: (e, t, i) => {
850
1047
  let a = new Date(e, t, i).getTime();
@@ -852,7 +1049,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
852
1049
  },
853
1050
  monthDisabled: (e, t) => {
854
1051
  let i = new Date(e, t, 1).getTime();
855
- return new Date(e, t, N(e, t)).getTime() < n || i > r;
1052
+ return new Date(e, t, P(e, t)).getTime() < n || i > r;
856
1053
  },
857
1054
  yearDisabled: (e) => {
858
1055
  let t = new Date(e, 0, 1).getTime();
@@ -865,22 +1062,22 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
865
1062
  e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
866
1063
  }
867
1064
  _daysHtml() {
868
- let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = N(this._viewY, this._viewM), r = j(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
1065
+ let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = P(this._viewY, this._viewM), r = M(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
869
1066
  y: this._viewY,
870
1067
  m: this._viewM,
871
1068
  d: 1
872
1069
  }, s = (e, t, n, s) => {
873
- let c = A(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
1070
+ let c = j(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
874
1071
  return `<button type="button" class="${[
875
1072
  "datepicker-day",
876
1073
  s ? "is-outside" : "",
877
1074
  u ? "is-today" : "",
878
1075
  l ? "is-selected" : ""
879
1076
  ].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
880
- }, c = "", l = P(this._viewY, this._viewM - 1), u = N(l.y, l.m);
1077
+ }, c = "", l = F(this._viewY, this._viewM - 1), u = P(l.y, l.m);
881
1078
  for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
882
1079
  for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
883
- let d = P(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
1080
+ let d = F(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
884
1081
  for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
885
1082
  let m = k.map((t, n) => k[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
886
1083
  return `
@@ -897,7 +1094,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
897
1094
  </div>`;
898
1095
  }
899
1096
  _monthsHtml() {
900
- let e = j(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
1097
+ let e = M(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
901
1098
  for (let i = 0; i < 12; i++) {
902
1099
  let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
903
1100
  "datepicker-cell",
@@ -915,7 +1112,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
915
1112
  <div class="datepicker-cells">${r}</div>`;
916
1113
  }
917
1114
  _yearsHtml() {
918
- let e = j(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
1115
+ let e = M(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
919
1116
  for (let a = 0; a < 12; a++) {
920
1117
  let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
921
1118
  "datepicker-cell",
@@ -940,21 +1137,21 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
940
1137
  s(e, t, { clampHeight: !0 });
941
1138
  }
942
1139
  _setFocus(e, t, n, r) {
943
- let { y: i, m: a } = P(e, t);
1140
+ let { y: i, m: a } = F(e, t);
944
1141
  this._focus = {
945
1142
  y: i,
946
1143
  m: a,
947
1144
  d: n
948
1145
  };
949
1146
  let o = i !== this._viewY || a !== this._viewM;
950
- this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${A(i, a, n)}"]`)?.focus();
1147
+ this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${j(i, a, n)}"]`)?.focus();
951
1148
  }
952
1149
  _onKey(e) {
953
1150
  if (this._mode !== "days") {
954
1151
  e.key === "Escape" && this._close();
955
1152
  return;
956
1153
  }
957
- let t = this._focus || j(this._value) || {
1154
+ let t = this._focus || M(this._value) || {
958
1155
  y: this._viewY,
959
1156
  m: this._viewM,
960
1157
  d: 1
@@ -972,17 +1169,17 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
972
1169
  case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
973
1170
  case "PageUp": {
974
1171
  e.preventDefault();
975
- let n = P(t.y, t.m - (e.shiftKey ? 12 : 1));
976
- return this._setFocus(n.y, n.m, Math.min(t.d, N(n.y, n.m)), "slide-prev");
1172
+ let n = F(t.y, t.m - (e.shiftKey ? 12 : 1));
1173
+ return this._setFocus(n.y, n.m, Math.min(t.d, P(n.y, n.m)), "slide-prev");
977
1174
  }
978
1175
  case "PageDown": {
979
1176
  e.preventDefault();
980
- let n = P(t.y, t.m + (e.shiftKey ? 12 : 1));
981
- return this._setFocus(n.y, n.m, Math.min(t.d, N(n.y, n.m)), "slide-next");
1177
+ let n = F(t.y, t.m + (e.shiftKey ? 12 : 1));
1178
+ return this._setFocus(n.y, n.m, Math.min(t.d, P(n.y, n.m)), "slide-next");
982
1179
  }
983
1180
  case "Enter":
984
1181
  case " ":
985
- e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = A(t.y, t.m, t.d), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
1182
+ e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = j(t.y, t.m, t.d), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
986
1183
  return;
987
1184
  case "Escape": return this._close();
988
1185
  default:
@@ -994,7 +1191,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
994
1191
  if (!e || !t) return;
995
1192
  let r = () => !t.hidden;
996
1193
  this._open = () => {
997
- let r = /* @__PURE__ */ new Date(), i = j(this._value);
1194
+ let r = /* @__PURE__ */ new Date(), i = M(this._value);
998
1195
  (i || !this._viewNavigated) && (this._viewY = r.getFullYear(), this._viewM = r.getMonth()), this._mode = "days";
999
1196
  let a = r.getFullYear() === this._viewY && r.getMonth() === this._viewM, o = i && i.y === this._viewY && i.m === this._viewM;
1000
1197
  this._focus = o ? i : {
@@ -1009,7 +1206,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1009
1206
  let t = e.target.closest("[data-nav]");
1010
1207
  if (t) {
1011
1208
  this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
1012
- let e = P(this._viewY, this._viewM + Number(t.dataset.nav));
1209
+ let e = F(this._viewY, this._viewM + Number(t.dataset.nav));
1013
1210
  this._viewY = e.y, this._viewM = e.m, this._focus = {
1014
1211
  y: e.y,
1015
1212
  m: e.m,
@@ -1048,7 +1245,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1048
1245
  }
1049
1246
  if (e.target.closest("[data-today]")) {
1050
1247
  let e = /* @__PURE__ */ new Date();
1051
- this.value = A(e.getFullYear(), e.getMonth(), e.getDate()), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
1248
+ this.value = j(e.getFullYear(), e.getMonth(), e.getDate()), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
1052
1249
  return;
1053
1250
  }
1054
1251
  if (e.target.closest("[data-clear]")) {
@@ -1076,7 +1273,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1076
1273
  disconnectedCallback() {
1077
1274
  this._teardown();
1078
1275
  }
1079
- }, oe = class extends e {
1276
+ }, se = class extends e {
1080
1277
  static formAssociated = !0;
1081
1278
  static get observedAttributes() {
1082
1279
  return [
@@ -1092,7 +1289,8 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1092
1289
  "aria-describedby",
1093
1290
  "name",
1094
1291
  "start-name",
1095
- "end-name"
1292
+ "end-name",
1293
+ "aria-invalid"
1096
1294
  ];
1097
1295
  }
1098
1296
  constructor() {
@@ -1114,8 +1312,16 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1114
1312
  this._bindGlobal?.();
1115
1313
  }
1116
1314
  attributeChangedCallback(e, t, n) {
1315
+ if (e === "aria-invalid") {
1316
+ this._syncInvalid();
1317
+ return;
1318
+ }
1117
1319
  this._rendered && (e === "start" || e === "end" ? (this._start = this.getAttribute("start") || "", this._end = this.getAttribute("end") || "", this._syncTrigger(), this._syncMirrors()) : this.render());
1118
1320
  }
1321
+ _syncInvalid() {
1322
+ let e = this.querySelector(".daterange-trigger");
1323
+ e && (this.hasAttribute("aria-invalid") ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
1324
+ }
1119
1325
  get value() {
1120
1326
  return {
1121
1327
  start: this._start,
@@ -1135,18 +1341,18 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1135
1341
  text: e,
1136
1342
  empty: !0
1137
1343
  } : {
1138
- text: `${M(this._start) || "Start"} – ${M(this._end) || "End"}`,
1344
+ text: `${N(this._start) || "Start"} – ${N(this._end) || "End"}`,
1139
1345
  empty: !1
1140
1346
  };
1141
1347
  }
1142
1348
  render() {
1143
1349
  this._defaultStart === void 0 && (this._defaultStart = this.getAttribute("start") || "", this._defaultEnd = this.getAttribute("end") || "", this._start = this._defaultStart || this._start, this._end = this._defaultEnd || this._end);
1144
- let e = j(this._start);
1350
+ let e = M(this._start);
1145
1351
  e && (this._viewY = e.y, this._viewM = e.m);
1146
1352
  let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label(), a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
1147
1353
  this.innerHTML = `
1148
1354
  <div class="daterange">
1149
- <button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${g(a)}"` : ""}${o ? ` aria-describedby="${g(o)}"` : ""}>
1355
+ <button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${g(a)}"` : ""}${o ? ` aria-describedby="${g(o)}"` : ""}>
1150
1356
  <span data-range-label class="${i ? "search-select-placeholder" : ""}">${g(r)}</span>
1151
1357
  ${p("calendar")}
1152
1358
  </button>
@@ -1175,20 +1381,20 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1175
1381
  r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "", r.disabled = this.hasAttribute("disabled");
1176
1382
  }
1177
1383
  _limits() {
1178
- let e = j(this.getAttribute("min")), t = j(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
1384
+ let e = M(this.getAttribute("min")), t = M(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
1179
1385
  return (e, t, i) => {
1180
1386
  let a = new Date(e, t, i).getTime();
1181
1387
  return a < n || a > r;
1182
1388
  };
1183
1389
  }
1184
1390
  _monthHtml(e, t) {
1185
- let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = N(e, t), a = this._limits(), o = k.map((e, t) => k[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
1186
- let i = A(e, t, n), o = a(e, t, n);
1391
+ let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = P(e, t), a = this._limits(), o = k.map((e, t) => k[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
1392
+ let i = j(e, t, n), o = a(e, t, n);
1187
1393
  return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
1188
- }, c = "", l = P(e, t - 1), u = N(l.y, l.m);
1394
+ }, c = "", l = F(e, t - 1), u = P(l.y, l.m);
1189
1395
  for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
1190
1396
  for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
1191
- let d = P(e, t + 1), f = (7 - (r + i) % 7) % 7;
1397
+ let d = F(e, t + 1), f = (7 - (r + i) % 7) % 7;
1192
1398
  for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
1193
1399
  return `
1194
1400
  <div class="daterange-cal">
@@ -1200,7 +1406,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1200
1406
  _renderView() {
1201
1407
  let e = this.querySelector(".daterange-pop");
1202
1408
  if (!e) return;
1203
- let t = P(this._viewY, this._viewM + 1);
1409
+ let t = F(this._viewY, this._viewM + 1);
1204
1410
  e.innerHTML = `
1205
1411
  <div class="daterange-head">
1206
1412
  <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${p("chevron-left")}</button>
@@ -1226,7 +1432,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1226
1432
  n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
1227
1433
  }
1228
1434
  let i = e.querySelector("[data-range-hint]");
1229
- i && (i.textContent = this._start ? this._end ? `${M(this._start)} – ${M(this._end)}` : "Pick an end date" : "Pick a start date");
1435
+ i && (i.textContent = this._start ? this._end ? `${N(this._start)} – ${N(this._end)}` : "Pick an end date" : "Pick a start date");
1230
1436
  }
1231
1437
  _position(e, t) {
1232
1438
  s(e, t, { clampHeight: !0 });
@@ -1248,7 +1454,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1248
1454
  if (!e || !t) return;
1249
1455
  let r = () => !t.hidden;
1250
1456
  this._open = () => {
1251
- let r = j(this._start);
1457
+ let r = M(this._start);
1252
1458
  if (r) this._viewY = r.y, this._viewM = r.m;
1253
1459
  else {
1254
1460
  let e = /* @__PURE__ */ new Date();
@@ -1261,7 +1467,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1261
1467
  this._popClick = !0;
1262
1468
  let t = e.target.closest("[data-nav]");
1263
1469
  if (t) {
1264
- let e = P(this._viewY, this._viewM + Number(t.dataset.nav));
1470
+ let e = F(this._viewY, this._viewM + Number(t.dataset.nav));
1265
1471
  this._viewY = e.y, this._viewM = e.m, this._renderView();
1266
1472
  return;
1267
1473
  }
@@ -1291,7 +1497,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1291
1497
  disconnectedCallback() {
1292
1498
  this._teardown();
1293
1499
  }
1294
- }, se = class extends e {
1500
+ }, ce = class extends e {
1295
1501
  static get observedAttributes() {
1296
1502
  return [
1297
1503
  "static",
@@ -1312,10 +1518,10 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1312
1518
  e === "static" && this.isConnected && this._wire();
1313
1519
  }
1314
1520
  _maxScale() {
1315
- return ce(this.getAttribute("max-scale"), 1.6);
1521
+ return le(this.getAttribute("max-scale"), 1.6);
1316
1522
  }
1317
1523
  _radius() {
1318
- return ce(this.getAttribute("radius"), 100);
1524
+ return le(this.getAttribute("radius"), 100);
1319
1525
  }
1320
1526
  _magnifyEnabled() {
1321
1527
  return !(this.hasAttribute("static") || typeof matchMedia == "function" && (matchMedia("(pointer: coarse)").matches || matchMedia("(prefers-reduced-motion: reduce)").matches));
@@ -1340,10 +1546,10 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1340
1546
  _teardown() {
1341
1547
  this._pointerMoveListener &&= (this.removeEventListener("pointermove", this._pointerMoveListener), null), this._pointerLeaveListener &&= (this.removeEventListener("pointerleave", this._pointerLeaveListener), null), this._resetMagnification();
1342
1548
  }
1343
- }, ce = (e, t) => {
1549
+ }, le = (e, t) => {
1344
1550
  let n = Number.parseFloat(e);
1345
1551
  return Number.isFinite(n) ? n : t;
1346
- }, le = "wui-feedback-submit", F = {
1552
+ }, ue = "wui-feedback-submit", I = {
1347
1553
  label: "Feedback",
1348
1554
  heading: "Share feedback",
1349
1555
  placeholder: "What's working, what isn't?",
@@ -1354,7 +1560,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1354
1560
  emptyError: "Please write a message before sending.",
1355
1561
  failedError: "That didn't send. Please try again.",
1356
1562
  thanks: "Thanks — we've got it."
1357
- }, ue = 1e4, de = 1600, fe = class extends e {
1563
+ }, de = 1e4, fe = 1600, pe = class extends e {
1358
1564
  static get observedAttributes() {
1359
1565
  return [
1360
1566
  "position",
@@ -1376,19 +1582,19 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1376
1582
  this.setAttribute("position", String(e ?? "bottom-right"));
1377
1583
  }
1378
1584
  get label() {
1379
- return this.getAttribute("label") || F.label;
1585
+ return this.getAttribute("label") || I.label;
1380
1586
  }
1381
1587
  set label(e) {
1382
1588
  this.setAttribute("label", String(e ?? ""));
1383
1589
  }
1384
1590
  get heading() {
1385
- return this.getAttribute("heading") || F.heading;
1591
+ return this.getAttribute("heading") || I.heading;
1386
1592
  }
1387
1593
  set heading(e) {
1388
1594
  this.setAttribute("heading", String(e ?? ""));
1389
1595
  }
1390
1596
  get placeholder() {
1391
- return this.getAttribute("placeholder") || F.placeholder;
1597
+ return this.getAttribute("placeholder") || I.placeholder;
1392
1598
  }
1393
1599
  set placeholder(e) {
1394
1600
  this.setAttribute("placeholder", String(e ?? ""));
@@ -1403,10 +1609,10 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1403
1609
  return this._open === !0;
1404
1610
  }
1405
1611
  addEventListener(e, t, n) {
1406
- e === le && (this._submitListeners += 1), super.addEventListener(e, t, n);
1612
+ e === ue && (this._submitListeners += 1), super.addEventListener(e, t, n);
1407
1613
  }
1408
1614
  removeEventListener(e, t, n) {
1409
- e === le && this._submitListeners > 0 && --this._submitListeners, super.removeEventListener(e, t, n);
1615
+ e === ue && this._submitListeners > 0 && --this._submitListeners, super.removeEventListener(e, t, n);
1410
1616
  }
1411
1617
  connectedCallback() {
1412
1618
  this._rendered || this.render();
@@ -1422,31 +1628,31 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1422
1628
  this.innerHTML = `
1423
1629
  <button type="button" class="feedback-trigger" aria-expanded="false" aria-haspopup="dialog">
1424
1630
  <span class="feedback-trigger-icon" aria-hidden="true">${p("message-square", { size: 18 })}</span>
1425
- <span class="feedback-trigger-label">${pe(this.label)}</span>
1631
+ <span class="feedback-trigger-label">${me(this.label)}</span>
1426
1632
  </button>
1427
- <div class="feedback-panel" role="dialog" aria-label="${me(this.heading)}" hidden>
1633
+ <div class="feedback-panel" role="dialog" aria-label="${he(this.heading)}" hidden>
1428
1634
  <div class="feedback-head">
1429
- <h2 class="feedback-heading">${pe(this.heading)}</h2>
1635
+ <h2 class="feedback-heading">${me(this.heading)}</h2>
1430
1636
  <button type="button" class="feedback-close" aria-label="Close">${p("x", { size: 16 })}</button>
1431
1637
  </div>
1432
1638
  <div class="feedback-body">
1433
1639
  <label class="feedback-field">
1434
- <span class="feedback-field-label">${F.messageLabel}</span>
1435
- <textarea class="feedback-message" rows="4" required placeholder="${me(this.placeholder)}"></textarea>
1640
+ <span class="feedback-field-label">${I.messageLabel}</span>
1641
+ <textarea class="feedback-message" rows="4" required placeholder="${he(this.placeholder)}"></textarea>
1436
1642
  </label>
1437
1643
  ${this.collectEmail ? `<label class="feedback-field">
1438
- <span class="feedback-field-label">${F.emailLabel}</span>
1644
+ <span class="feedback-field-label">${I.emailLabel}</span>
1439
1645
  <input type="email" class="feedback-email" autocomplete="email" placeholder="you@example.com" />
1440
1646
  </label>` : ""}
1441
1647
  <p class="feedback-error" role="alert" hidden></p>
1442
1648
  </div>
1443
1649
  <div class="feedback-actions">
1444
1650
  <button type="button" class="feedback-cancel">Cancel</button>
1445
- <button type="button" class="feedback-submit">${F.submitLabel}</button>
1651
+ <button type="button" class="feedback-submit">${I.submitLabel}</button>
1446
1652
  </div>
1447
1653
  <div class="feedback-thanks" hidden>
1448
1654
  <span class="feedback-thanks-icon" aria-hidden="true">${p("check-circle", { size: 20 })}</span>
1449
- <span class="feedback-thanks-text">${F.thanks}</span>
1655
+ <span class="feedback-thanks-text">${I.thanks}</span>
1450
1656
  </div>
1451
1657
  </div>`, this._rendered = !0, this._wire();
1452
1658
  let r = this._refs();
@@ -1484,18 +1690,18 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1484
1690
  let { thanks: e, error: t, submit: n, message: r, email: i } = this._refs();
1485
1691
  this._setBusy(!1), t && (t.hidden = !0, t.textContent = ""), e && (e.hidden = !1), this.querySelector(".feedback-body")?.setAttribute("hidden", ""), this.querySelector(".feedback-actions")?.setAttribute("hidden", ""), n && (n.disabled = !0), this._thanksTimer = setTimeout(() => {
1486
1692
  r && (r.value = ""), i && (i.value = ""), this._reset(), this.close();
1487
- }, de);
1693
+ }, fe);
1488
1694
  }
1489
1695
  failed(e) {
1490
1696
  this._clearTimers(), this._state = "error", this._setBusy(!1);
1491
1697
  let { error: t, message: n } = this._refs();
1492
- t && (t.textContent = e || F.failedError, t.hidden = !1), n?.focus();
1698
+ t && (t.textContent = e || I.failedError, t.hidden = !1), n?.focus();
1493
1699
  }
1494
1700
  _submit() {
1495
1701
  if (this._state === "submitting") return;
1496
1702
  let { message: e, email: t, error: n } = this._refs(), r = (e?.value ?? "").trim();
1497
1703
  if (!r) {
1498
- n && (n.textContent = F.emptyError, n.hidden = !1), e?.focus();
1704
+ n && (n.textContent = I.emptyError, n.hidden = !1), e?.focus();
1499
1705
  return;
1500
1706
  }
1501
1707
  n && (n.hidden = !0, n.textContent = ""), this._state = "submitting", this._setBusy(!0);
@@ -1505,7 +1711,7 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1505
1711
  surface: this.getAttribute("surface") || "",
1506
1712
  screen: this.getAttribute("screen") || ""
1507
1713
  };
1508
- if (this.dispatchEvent(new CustomEvent(le, {
1714
+ if (this.dispatchEvent(new CustomEvent(ue, {
1509
1715
  bubbles: !0,
1510
1716
  composed: !0,
1511
1717
  detail: i
@@ -1515,11 +1721,11 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1515
1721
  }
1516
1722
  this._timer = setTimeout(() => {
1517
1723
  this._state === "submitting" && this.failed();
1518
- }, ue);
1724
+ }, de);
1519
1725
  }
1520
1726
  _setBusy(e) {
1521
1727
  let { submit: t } = this._refs();
1522
- t && (t.disabled = e, t.textContent = e ? F.sendingLabel : F.submitLabel, this.toggleAttribute("busy", e));
1728
+ t && (t.disabled = e, t.textContent = e ? I.sendingLabel : I.submitLabel, this.toggleAttribute("busy", e));
1523
1729
  }
1524
1730
  _reset() {
1525
1731
  this._clearTimers(), this._state = "idle", this._setBusy(!1);
@@ -1529,23 +1735,23 @@ var D = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
1529
1735
  _clearTimers() {
1530
1736
  this._timer &&= (clearTimeout(this._timer), 0), this._thanksTimer &&= (clearTimeout(this._thanksTimer), 0);
1531
1737
  }
1532
- }, pe = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), me = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), he = {
1738
+ }, me = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), he = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), ge = {
1533
1739
  enter: "Enter",
1534
1740
  comma: ",",
1535
1741
  space: " ",
1536
1742
  tab: "Tab"
1537
- }, ge = {
1743
+ }, _e = {
1538
1744
  enter: "\n",
1539
1745
  comma: ",",
1540
1746
  space: " ",
1541
1747
  tab: " "
1542
- }, _e = (e) => he[e], ve = (e) => ge[e];
1543
- function ye(e, t) {
1748
+ }, ve = (e) => ge[e], ye = (e) => _e[e];
1749
+ function be(e, t) {
1544
1750
  let n = [String(e ?? "")];
1545
1751
  for (let e of t) n = n.flatMap((t) => t.split(e));
1546
1752
  return n.map((e) => e.trim()).filter(Boolean);
1547
1753
  }
1548
- var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends e {
1754
+ var L = (e, t) => t.some((t) => String(e ?? "").includes(t)), xe = class extends e {
1549
1755
  static formAssociated = !0;
1550
1756
  _accessibleName() {
1551
1757
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
@@ -1645,7 +1851,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1645
1851
  [h]: !0,
1646
1852
  selected: e.hasAttribute("selected")
1647
1853
  };
1648
- for (let [n, r] of xe) {
1854
+ for (let [n, r] of Se) {
1649
1855
  let i = e.getAttribute(n);
1650
1856
  i && (t[r] = i);
1651
1857
  }
@@ -1676,23 +1882,23 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1676
1882
  <div class="search-select${a}">
1677
1883
  <div class="input search-select-control search-select-multi"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : ""}>
1678
1884
  ${r ? p(r, { className: "search-select-icon" }) : ""}
1679
- <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false" aria-controls="${z(o)}" aria-label="${z(this._accessibleName())}" aria-describedby="${z(e)}" autocomplete="off"${s ? " disabled" : ""} /></div>
1885
+ <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false" aria-controls="${B(o)}" aria-label="${B(this._accessibleName())}" aria-describedby="${B(e)}" autocomplete="off"${s ? " disabled" : ""} /></div>
1680
1886
  ${p("chevron-down", { className: "search-select-caret" })}
1681
1887
  </div>
1682
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${z(o)}" aria-multiselectable="true" tabindex="-1" hidden>
1888
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${B(o)}" aria-multiselectable="true" tabindex="-1" hidden>
1683
1889
  <div class="search-select-options"></div>
1684
1890
  </div>
1685
1891
  </div>
1686
- <div class="field-error wui-ms-custom-error" id="${z(e)}" aria-live="polite" hidden></div>`;
1892
+ <div class="field-error wui-ms-custom-error" id="${B(e)}" aria-live="polite" hidden></div>`;
1687
1893
  } else this.innerHTML = `
1688
1894
  <div class="search-select${a}">
1689
- <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${z(o)}" aria-label="${z(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : " tabindex=\"0\""}>
1895
+ <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${B(o)}" aria-label="${B(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : " tabindex=\"0\""}>
1690
1896
  ${r ? p(r, { className: "search-select-icon" }) : ""}
1691
1897
  <div class="ms-chips" data-chips></div>
1692
1898
  ${p("chevron-down", { className: "search-select-caret" })}
1693
1899
  </div>
1694
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${z(o)}" aria-multiselectable="true" tabindex="-1" hidden>
1695
- ${t ? `<div class="search-select-search">${p("search")}<input class="search-select-input" placeholder="${z(n)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${p("x")}</button></div>` : ""}
1900
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${B(o)}" aria-multiselectable="true" tabindex="-1" hidden>
1901
+ ${t ? `<div class="search-select-search">${p("search")}<input class="search-select-input" placeholder="${B(n)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${p("x")}</button></div>` : ""}
1696
1902
  <div class="search-select-options"></div>
1697
1903
  <div class="search-select-empty" hidden>No matches</div>
1698
1904
  </div>
@@ -1702,7 +1908,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1702
1908
  _renderControl() {
1703
1909
  let e = this.querySelector("[data-chips]");
1704
1910
  if (!e) return;
1705
- let t = this.getAttribute("placeholder") || "Select…", n = this._allowCustom ? e.querySelector("[data-input]") : null, r = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${z(e)}" aria-label="Remove ${z(B(this._labelFor(e)))}">${p("x")}</button></span>`).join("");
1911
+ let t = this.getAttribute("placeholder") || "Select…", n = this._allowCustom ? e.querySelector("[data-input]") : null, r = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${B(e)}" aria-label="Remove ${B(V(this._labelFor(e)))}">${p("x")}</button></span>`).join("");
1706
1912
  if (n) {
1707
1913
  for (let t of [...e.querySelectorAll(":scope > .chip")]) t.remove();
1708
1914
  n.insertAdjacentHTML("beforebegin", r), n.placeholder = this._values.length ? "" : t, this._collapseChips();
@@ -1733,11 +1939,11 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1733
1939
  i.textContent = `+${t.length - o}`;
1734
1940
  }
1735
1941
  _matches(e, t) {
1736
- return B(e.label).toLowerCase().includes(t) || String(e.description ?? "").toLowerCase().includes(t);
1942
+ return V(e.label).toLowerCase().includes(t) || String(e.description ?? "").toLowerCase().includes(t);
1737
1943
  }
1738
1944
  _optionNamed(e) {
1739
1945
  let t = e.trim().toLowerCase();
1740
- return this._readOptions().find((e) => String(e.value ?? "").toLowerCase() === t || B(e.label).trim().toLowerCase() === t);
1946
+ return this._readOptions().find((e) => String(e.value ?? "").toLowerCase() === t || V(e.label).trim().toLowerCase() === t);
1741
1947
  }
1742
1948
  _renderOptions(e) {
1743
1949
  let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
@@ -1746,9 +1952,9 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1746
1952
  i && (a = a.filter((e) => this._matches(e, i)));
1747
1953
  let o = this._listboxId || `${this.id || "wui-multiselect"}-listbox`, s = this._allowCustom && r && !this._optionNamed(r), c = a.map((e, t) => {
1748
1954
  let n = this._values.includes(String(e.value)), r = `${o}-opt-${t}`;
1749
- return Se(e) ? Te(e, r, n) : `<button type="button" role="option" id="${z(r)}" class="search-select-option${n ? " selected" : ""}" data-value="${z(e.value)}" aria-selected="${n}"><span class="ms-opt-label">${v(e)}</span><span class="ms-check">${p("check")}</span></button>`;
1955
+ return Ce(e) ? Ee(e, r, n) : `<button type="button" role="option" id="${B(r)}" class="search-select-option${n ? " selected" : ""}" data-value="${B(e.value)}" aria-selected="${n}"><span class="ms-opt-label">${v(e)}</span><span class="ms-check">${p("check")}</span></button>`;
1750
1956
  });
1751
- s && c.push(`<button type="button" role="option" id="${z(`${o}-opt-${a.length}`)}" class="search-select-option search-select-option-custom" data-value="${z(r)}" data-custom="true" aria-selected="false">Add “${g(r)}”</button>`), t.innerHTML = c.join(""), n && (n.hidden = a.length > 0), this._active = -1, this._combobox()?.removeAttribute("aria-activedescendant"), this._allowCustom && this._syncCustomMenu?.(), this._reanchor?.();
1957
+ s && c.push(`<button type="button" role="option" id="${B(`${o}-opt-${a.length}`)}" class="search-select-option search-select-option-custom" data-value="${B(r)}" data-custom="true" aria-selected="false">Add “${g(r)}”</button>`), t.innerHTML = c.join(""), n && (n.hidden = a.length > 0), this._active = -1, this._combobox()?.removeAttribute("aria-activedescendant"), this._allowCustom && this._syncCustomMenu?.(), this._reanchor?.();
1752
1958
  }
1753
1959
  _combobox() {
1754
1960
  return this._allowCustom ? this.querySelector("[data-input]") : this.querySelector(".search-select-control");
@@ -1761,7 +1967,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1761
1967
  _customRefusal(e) {
1762
1968
  let t = this.getAttribute("custom-invalid-message") || "Enter a valid value.", n = this.getAttribute("custom-pattern");
1763
1969
  if (n) {
1764
- let r = Ee(n);
1970
+ let r = De(n);
1765
1971
  if (r && !r.test(e)) return t;
1766
1972
  }
1767
1973
  let r = this._validateCustom;
@@ -1812,35 +2018,35 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1812
2018
  a ? (_ = !1, y()) : (t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open")), g(-1), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "";
1813
2019
  }, S = () => {
1814
2020
  d(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
1815
- }, ee = (e) => {
2021
+ }, C = (e) => {
1816
2022
  let t = String(e);
1817
2023
  if (this._values.includes(t)) this._values = this._values.filter((e) => e !== t);
1818
2024
  else if (a && this._values.some((e) => e.toLowerCase() === t.toLowerCase())) return;
1819
2025
  else this._values = [...this._values, t];
1820
2026
  this._renderControl(), this._renderOptions(this._query()), S();
1821
- }, te = (e) => {
2027
+ }, ee = (e) => {
1822
2028
  this._values = this._values.filter((t) => t !== String(e)), this._renderControl(), this._renderOptions(this._query()), S();
1823
- }, C = (e, { quiet: t = !1 } = {}) => {
1824
- let n = this._values.length, r = I(e, L) ? ye(e, L) : [e], i = [], a = "";
2029
+ }, w = (e, { quiet: t = !1 } = {}) => {
2030
+ let n = this._values.length, r = L(e, R) ? be(e, R) : [e], i = [], a = "";
1825
2031
  for (let e of r) {
1826
2032
  let t = this._commitTyped(e);
1827
2033
  t && (i.push(e.trim()), a ||= t);
1828
2034
  }
1829
2035
  t && i.length || (o.value = i.join(", "), this._setCustomError(a), this._values.length !== n && (this._renderControl(), S()), this._renderOptions(o.value));
1830
- }, w = (e) => {
2036
+ }, te = (e) => {
1831
2037
  if (!(!e || e.getAttribute("aria-disabled") === "true")) {
1832
2038
  if (e.dataset.custom === "true") {
1833
- C(e.dataset.value);
2039
+ w(e.dataset.value);
1834
2040
  return;
1835
2041
  }
1836
- ee(e.dataset.value), o?.value && (o.value = "", this._setCustomError(""), this._renderOptions(""));
2042
+ C(e.dataset.value), o?.value && (o.value = "", this._setCustomError(""), this._renderOptions(""));
1837
2043
  }
1838
2044
  };
1839
2045
  e.addEventListener("click", (e) => {
1840
2046
  if (u()) return;
1841
2047
  let t = e.target.closest("[data-remove]");
1842
2048
  if (t) {
1843
- e.stopPropagation(), te(t.dataset.remove), o?.focus();
2049
+ e.stopPropagation(), ee(t.dataset.remove), o?.focus();
1844
2050
  return;
1845
2051
  }
1846
2052
  if (o) {
@@ -1851,7 +2057,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1851
2057
  v() ? x() : b();
1852
2058
  }), i.addEventListener("click", (e) => {
1853
2059
  let t = e.target.closest(".search-select-option");
1854
- t && (w(t), (o || n)?.focus());
2060
+ t && (te(t), (o || n)?.focus());
1855
2061
  }), i.addEventListener("mousemove", (e) => {
1856
2062
  let t = e.target.closest(".search-select-option");
1857
2063
  t && g(h().indexOf(t));
@@ -1864,7 +2070,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1864
2070
  getActive: () => this._active,
1865
2071
  setActive: (e) => g(e),
1866
2072
  onEnter: (e) => {
1867
- e ? w(e) : o?.value.trim() && C(o.value);
2073
+ e ? te(e) : o?.value.trim() && w(o.value);
1868
2074
  },
1869
2075
  onEscape: () => {
1870
2076
  this._navHandler.clearTypeahead(), x(), o || e.focus();
@@ -1873,7 +2079,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1873
2079
  let T = (e) => {
1874
2080
  let t = o || n;
1875
2081
  if (e.key === "Backspace" && !t?.value && this._values.length) {
1876
- te(this._values[this._values.length - 1]);
2082
+ ee(this._values[this._values.length - 1]);
1877
2083
  return;
1878
2084
  }
1879
2085
  this._navHandler.handler(e);
@@ -1888,7 +2094,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1888
2094
  this._customError && this._setCustomError(""), this._renderOptions(o.value), b();
1889
2095
  }), o.addEventListener("keydown", (e) => {
1890
2096
  if (e.key === "," && o.value.trim()) {
1891
- e.preventDefault(), C(o.value);
2097
+ e.preventDefault(), w(o.value);
1892
2098
  return;
1893
2099
  }
1894
2100
  if (e.key === "Enter") {
@@ -1899,9 +2105,9 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1899
2105
  (e.key === "ArrowDown" || e.key === "ArrowUp") && !v() && b(), T(e);
1900
2106
  }), o.addEventListener("paste", (e) => {
1901
2107
  let t = e.clipboardData?.getData("text/plain") ?? "";
1902
- I(t, L) && (e.preventDefault(), C(`${o.value}${t}`));
2108
+ L(t, R) && (e.preventDefault(), w(`${o.value}${t}`));
1903
2109
  }), o.addEventListener("blur", (e) => {
1904
- e.relatedTarget && this.contains(e.relatedTarget) || (o.value.trim() && C(o.value, { quiet: !0 }), x());
2110
+ e.relatedTarget && this.contains(e.relatedTarget) || (o.value.trim() && w(o.value, { quiet: !0 }), x());
1905
2111
  });
1906
2112
  } else e.addEventListener("keydown", (e) => {
1907
2113
  if (v()) {
@@ -1924,35 +2130,35 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1924
2130
  disconnectedCallback() {
1925
2131
  this._teardown(), this._ro?.disconnect(), this._ro = null;
1926
2132
  }
1927
- }, L = [
2133
+ }, R = [
1928
2134
  ",",
1929
2135
  ";",
1930
2136
  "\n",
1931
2137
  " "
1932
- ], xe = [
2138
+ ], Se = [
1933
2139
  ["description", "description"],
1934
2140
  ["avatar", "avatar"],
1935
2141
  ["initials", "initials"],
1936
2142
  ["disabled-hint", "disabledHint"]
1937
- ], Se = (e) => !!(e.description || e.avatar || e.initials || e.disabled || e.disabledHint), Ce = (e) => {
2143
+ ], Ce = (e) => !!(e.description || e.avatar || e.initials || e.disabled || e.disabledHint), we = (e) => {
1938
2144
  let t = String(e ?? "").trim();
1939
2145
  return /^(https?:)?\/\//i.test(t) || /^\/(?!\/)/.test(t) || /^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t) ? t : "";
1940
- }, we = (e) => {
1941
- let t = Ce(e.avatar);
1942
- return !t && !e.initials ? "" : `<span class="avatar wui-opt-avatar" aria-hidden="true"><span class="avatar-face">${g(e.initials ?? "")}</span>${t ? `<img class="avatar-img" src="${z(t)}" alt="" />` : ""}</span>`;
1943
- }, Te = (e, t, n) => {
2146
+ }, Te = (e) => {
2147
+ let t = we(e.avatar);
2148
+ return !t && !e.initials ? "" : `<span class="avatar wui-opt-avatar" aria-hidden="true"><span class="avatar-face">${g(e.initials ?? "")}</span>${t ? `<img class="avatar-img" src="${B(t)}" alt="" />` : ""}</span>`;
2149
+ }, Ee = (e, t, n) => {
1944
2150
  let r = !!e.disabled, i = e.description ? `<span class="wui-opt-desc">${g(e.description)}</span>` : "", a = e.disabledHint && r ? `<span class="wui-opt-hint">${g(e.disabledHint)}</span>` : "";
1945
- return `<button type="button" role="option" id="${z(t)}" class="search-select-option wui-opt-rich${n ? " selected" : ""}" data-value="${z(e.value)}" aria-selected="${n}"${r ? " aria-disabled=\"true\"" : ""}><span class="ms-opt-label"><span class="wui-opt-name">${v(e)}</span>${i}</span>${a}${we(e)}<span class="ms-check">${p("check")}</span></button>`;
1946
- }, R = /* @__PURE__ */ new Map(), Ee = (e) => {
1947
- if (R.has(e)) return R.get(e);
2151
+ return `<button type="button" role="option" id="${B(t)}" class="search-select-option wui-opt-rich${n ? " selected" : ""}" data-value="${B(e.value)}" aria-selected="${n}"${r ? " aria-disabled=\"true\"" : ""}><span class="ms-opt-label"><span class="wui-opt-name">${v(e)}</span>${i}</span>${a}${Te(e)}<span class="ms-check">${p("check")}</span></button>`;
2152
+ }, z = /* @__PURE__ */ new Map(), De = (e) => {
2153
+ if (z.has(e)) return z.get(e);
1948
2154
  let t = null;
1949
2155
  try {
1950
2156
  t = RegExp(`^(?:${e})$`, "u");
1951
2157
  } catch {
1952
2158
  console.warn(`<wui-multiselect> custom-pattern is not a valid regular expression and is ignored: ${e}`);
1953
2159
  }
1954
- return R.set(e, t), t;
1955
- }, z = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), B = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), De = /[^0-9]/g, Oe = /[^0-9a-zA-Z]/g, ke = class extends e {
2160
+ return z.set(e, t), t;
2161
+ }, B = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), V = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), Oe = /[^0-9]/g, ke = /[^0-9a-zA-Z]/g, Ae = class extends e {
1956
2162
  static formAssociated = !0;
1957
2163
  static get observedAttributes() {
1958
2164
  return [
@@ -1983,7 +2189,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
1983
2189
  this._value = this._clean(e), d(this, this._value), this._paint();
1984
2190
  }
1985
2191
  _clean(e) {
1986
- return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? Oe : De, "").slice(0, this.length);
2192
+ return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? ke : Oe, "").slice(0, this.length);
1987
2193
  }
1988
2194
  constructor() {
1989
2195
  super();
@@ -2074,7 +2280,7 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
2074
2280
  disconnectedCallback() {
2075
2281
  this._onSelectionChange && document.removeEventListener("selectionchange", this._onSelectionChange);
2076
2282
  }
2077
- }, V = [
2283
+ }, H = [
2078
2284
  [
2079
2285
  "AF",
2080
2286
  "Afghanistan",
@@ -3300,11 +3506,11 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
3300
3506
  "Zimbabwe",
3301
3507
  "263"
3302
3508
  ]
3303
- ], H = (e) => (V.find((t) => t[0] === e) || [
3509
+ ], U = (e) => (H.find((t) => t[0] === e) || [
3304
3510
  "",
3305
3511
  "",
3306
3512
  ""
3307
- ])[2], Ae = {
3513
+ ])[2], je = {
3308
3514
  AD: ["Europe/Andorra"],
3309
3515
  AE: ["Asia/Dubai"],
3310
3516
  AF: ["Asia/Kabul"],
@@ -3706,13 +3912,13 @@ var I = (e, t) => t.some((t) => String(e ?? "").includes(t)), be = class extends
3706
3912
  ZA: ["Africa/Johannesburg"],
3707
3913
  ZM: ["Africa/Lusaka"],
3708
3914
  ZW: ["Africa/Harare"]
3709
- }, je = new Set(V.map(([e]) => e)), Me = /* @__PURE__ */ new Map();
3710
- for (let [e, t] of Object.entries(Ae)) for (let n of t) Me.set(n, e);
3711
- function Ne(e) {
3712
- let t = Me.get(e);
3713
- return t && je.has(t) ? t : null;
3714
- }
3915
+ }, Me = new Set(H.map(([e]) => e)), Ne = /* @__PURE__ */ new Map();
3916
+ for (let [e, t] of Object.entries(je)) for (let n of t) Ne.set(n, e);
3715
3917
  function Pe(e) {
3918
+ let t = Ne.get(e);
3919
+ return t && Me.has(t) ? t : null;
3920
+ }
3921
+ function Fe(e) {
3716
3922
  if (!e) return null;
3717
3923
  let t;
3718
3924
  try {
@@ -3720,9 +3926,9 @@ function Pe(e) {
3720
3926
  } catch {
3721
3927
  return null;
3722
3928
  }
3723
- return t && je.has(t) ? t : null;
3929
+ return t && Me.has(t) ? t : null;
3724
3930
  }
3725
- function Fe() {
3931
+ function Ie() {
3726
3932
  let e;
3727
3933
  try {
3728
3934
  e = Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -3730,77 +3936,77 @@ function Fe() {
3730
3936
  e = void 0;
3731
3937
  }
3732
3938
  let t = typeof navigator > "u" ? void 0 : navigator.language;
3733
- return Ne(e) || Pe(t) || "IN";
3939
+ return Pe(e) || Fe(t) || "IN";
3734
3940
  }
3735
3941
  //#endregion
3736
3942
  //#region src/WuiPhone.js
3737
- var Ie = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, U = null, Le = null;
3738
- function Re() {
3739
- return U ? Promise.resolve(U) : (Le ||= Promise.all([import("./max-BDKx469G.js"), import("./examples.mobile.json-BMXTGiGC.js")]).then(([e, t]) => (U = {
3943
+ var Le = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, W = null, Re = null;
3944
+ function ze() {
3945
+ return W ? Promise.resolve(W) : (Re ||= Promise.all([import("./max-BDKx469G.js"), import("./examples.mobile.json-BMXTGiGC.js")]).then(([e, t]) => (W = {
3740
3946
  AsYouType: e.AsYouType,
3741
3947
  getExampleNumber: e.getExampleNumber,
3742
3948
  isValidPhoneNumber: e.isValidPhoneNumber,
3743
3949
  parsePhoneNumber: e.parsePhoneNumber,
3744
3950
  examples: t.default || t
3745
- }, U)).catch(() => null), Le);
3951
+ }, W)).catch(() => null), Re);
3746
3952
  }
3747
- function ze(e, t) {
3748
- let n = `+${H(e)}`;
3953
+ function Be(e, t) {
3954
+ let n = `+${U(e)}`;
3749
3955
  return t?.startsWith(n) ? t.slice(n.length).trimStart() : null;
3750
3956
  }
3751
- function W(e, t) {
3752
- if (!U || !t) return t;
3957
+ function G(e, t) {
3958
+ if (!W || !t) return t;
3753
3959
  try {
3754
- return ze(e, new U.AsYouType(e).input(`+${H(e)}${t}`)) || t;
3960
+ return Be(e, new W.AsYouType(e).input(`+${U(e)}${t}`)) || t;
3755
3961
  } catch {
3756
3962
  return t;
3757
3963
  }
3758
3964
  }
3759
- function Be(e, t) {
3965
+ function Ve(e, t) {
3760
3966
  if (t <= 0) return 0;
3761
3967
  let n = 0;
3762
3968
  for (let r = 0; r < e.length; r++) if (/[0-9]/.test(e[r]) && (n += 1, n === t)) return r + 1;
3763
3969
  return e.length;
3764
3970
  }
3765
- function G(e) {
3766
- if (!U) return null;
3971
+ function K(e) {
3972
+ if (!W) return null;
3767
3973
  try {
3768
- return ze(e, U.getExampleNumber(e, U.examples)?.formatInternational()) || null;
3974
+ return Be(e, W.getExampleNumber(e, W.examples)?.formatInternational()) || null;
3769
3975
  } catch {
3770
3976
  return null;
3771
3977
  }
3772
3978
  }
3773
- function Ve(e) {
3774
- if (!U || !e) return null;
3979
+ function He(e) {
3980
+ if (!W || !e) return null;
3775
3981
  try {
3776
- if (!U.isValidPhoneNumber(e)) return !1;
3777
- let t = U.parsePhoneNumber(e)?.getType?.();
3982
+ if (!W.isValidPhoneNumber(e)) return !1;
3983
+ let t = W.parsePhoneNumber(e)?.getType?.();
3778
3984
  return t === void 0 || t === "MOBILE" || t === "FIXED_LINE_OR_MOBILE";
3779
3985
  } catch {
3780
3986
  return null;
3781
3987
  }
3782
3988
  }
3783
- function He(e) {
3784
- if (!U) return null;
3989
+ function Ue(e) {
3990
+ if (!W) return null;
3785
3991
  try {
3786
- let t = U.getExampleNumber(e, U.examples);
3992
+ let t = W.getExampleNumber(e, W.examples);
3787
3993
  return t?.nationalNumber ? t.nationalNumber.length : null;
3788
3994
  } catch {
3789
3995
  return null;
3790
3996
  }
3791
3997
  }
3792
- function Ue(e, t, n) {
3998
+ function We(e, t, n) {
3793
3999
  try {
3794
- let r = U.parsePhoneNumber(t, e), i = r?.nationalNumber;
4000
+ let r = W.parsePhoneNumber(t, e), i = r?.nationalNumber;
3795
4001
  return !i || r.country !== e || i.length > n || !t.endsWith(i) ? null : i;
3796
4002
  } catch {
3797
4003
  return null;
3798
4004
  }
3799
4005
  }
3800
- function We(e) {
3801
- if (!U || !e?.trim().startsWith("+")) return null;
4006
+ function Ge(e) {
4007
+ if (!W || !e?.trim().startsWith("+")) return null;
3802
4008
  try {
3803
- let t = new U.AsYouType();
4009
+ let t = new W.AsYouType();
3804
4010
  t.input(e.trim());
3805
4011
  let n = t.getCountry();
3806
4012
  return n ? {
@@ -3811,7 +4017,7 @@ function We(e) {
3811
4017
  return null;
3812
4018
  }
3813
4019
  }
3814
- var Ge = class extends e {
4020
+ var Ke = class extends e {
3815
4021
  static formAssociated = !0;
3816
4022
  static get observedAttributes() {
3817
4023
  return [
@@ -3831,7 +4037,7 @@ var Ge = class extends e {
3831
4037
  } catch {
3832
4038
  this._internals = null;
3833
4039
  }
3834
- this._defaultCountry = Fe(), this._country = this._defaultCountry, this._national = "", this._active = -1, this._committedValue = "";
4040
+ this._defaultCountry = Ie(), this._country = this._defaultCountry, this._national = "", this._active = -1, this._committedValue = "";
3835
4041
  }
3836
4042
  connectedCallback() {
3837
4043
  if (!this._rendered) {
@@ -3858,13 +4064,13 @@ var Ge = class extends e {
3858
4064
  this.value = this._defaultValue || "";
3859
4065
  }
3860
4066
  get value() {
3861
- return this._national ? `+${H(this._country)}${this._national}` : "";
4067
+ return this._national ? `+${U(this._country)}${this._national}` : "";
3862
4068
  }
3863
4069
  set value(e) {
3864
- let t = String(e ?? "").trim(), n = We(t);
4070
+ let t = String(e ?? "").trim(), n = Ge(t);
3865
4071
  if (n) this._country = n.country, this._national = n.national.replace(/[^0-9]/g, "");
3866
4072
  else if (t.startsWith("+")) {
3867
- let e = t.replace(/[^0-9]/g, ""), n = String(H(this._country));
4073
+ let e = t.replace(/[^0-9]/g, ""), n = String(U(this._country));
3868
4074
  n && e.startsWith(n) && (e = e.slice(n.length)), this._national = e;
3869
4075
  } else this._national = t.replace(/[^0-9]/g, "");
3870
4076
  n && this.getAttribute("country") !== this._country ? this.setAttribute("country", this._country) : this._rendered && this.render(), this._committedValue = this.value, this._syncMirror();
@@ -3880,25 +4086,25 @@ var Ge = class extends e {
3880
4086
  }
3881
4087
  render() {
3882
4088
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""), this._country = this.getAttribute("country") || this._country;
3883
- let e = this.getAttribute("placeholder") || G(this._country) || "Enter phone number";
4089
+ let e = this.getAttribute("placeholder") || K(this._country) || "Enter phone number";
3884
4090
  this.id ||= `wui-phone-${Math.random().toString(36).slice(2, 9)}`;
3885
4091
  let t = `${this.id}-listbox`;
3886
4092
  this._listboxId = t;
3887
- let n = V.map(([e, n, r], i) => `<button type="button" role="option" id="${K(`${t}-opt-${i}`)}" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}" aria-selected="${e === this._country}"><span class="${Ie(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join("");
4093
+ let n = H.map(([e, n, r], i) => `<button type="button" role="option" id="${q(`${t}-opt-${i}`)}" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}" aria-selected="${e === this._country}"><span class="${Le(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join("");
3888
4094
  this.innerHTML = `
3889
4095
  <div class="phone-input-wrap">
3890
4096
  <div class="phone-country-adornment">
3891
- <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${K(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
3892
- <span class="${Ie(this._country)}" data-flag aria-hidden="true"></span>
4097
+ <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${q(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
4098
+ <span class="${Le(this._country)}" data-flag aria-hidden="true"></span>
3893
4099
  ${p("chevron-down", { className: "phone-chevron" })}
3894
- <span class="phone-dial" data-dial>+${H(this._country)}</span>
4100
+ <span class="phone-dial" data-dial>+${U(this._country)}</span>
3895
4101
  </button>
3896
- <div class="country-dropdown-menu" role="listbox" id="${K(t)}" tabindex="-1" hidden>
3897
- <div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${p("search")}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${K(t)}" aria-autocomplete="list" /></div>
4102
+ <div class="country-dropdown-menu" role="listbox" id="${q(t)}" tabindex="-1" hidden>
4103
+ <div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${p("search")}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${q(t)}" aria-autocomplete="list" /></div>
3898
4104
  <div class="country-list-scroll">${n}<div class="country-empty" hidden>No countries found</div></div>
3899
4105
  </div>
3900
4106
  </div>
3901
- <input type="tel" class="input" placeholder="${K(e)}" value="${K(W(this._country, this._national))}"${this.getAttribute("aria-label") ? ` aria-label="${K(this.getAttribute("aria-label"))}"` : ""}${this.getAttribute("aria-describedby") ? ` aria-describedby="${K(this.getAttribute("aria-describedby"))}"` : ""}${this.hasAttribute("required") ? " required aria-required=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""} />
4107
+ <input type="tel" class="input" placeholder="${q(e)}" value="${q(G(this._country, this._national))}"${this.getAttribute("aria-label") ? ` aria-label="${q(this.getAttribute("aria-label"))}"` : ""}${this.getAttribute("aria-describedby") ? ` aria-describedby="${q(this.getAttribute("aria-describedby"))}"` : ""}${this.hasAttribute("required") ? " required aria-required=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""} />
3902
4108
  </div>
3903
4109
  <div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, d(this, this.value), this._wire();
3904
4110
  }
@@ -3929,12 +4135,12 @@ var Ge = class extends e {
3929
4135
  }
3930
4136
  a && (a.hidden = n > 0);
3931
4137
  }, v = (e) => {
3932
- this._country = e, this.getAttribute("country") !== e && (this._suppressCountryRender = !0, this.setAttribute("country", e), this._suppressCountryRender = !1), u && (u.className = Ie(e)), d && (d.textContent = `+${H(e)}`);
4138
+ this._country = e, this.getAttribute("country") !== e && (this._suppressCountryRender = !0, this.setAttribute("country", e), this._suppressCountryRender = !1), u && (u.className = Le(e)), d && (d.textContent = `+${U(e)}`);
3933
4139
  for (let t of this._itemEls()) {
3934
4140
  let n = t.dataset.iso === e;
3935
4141
  t.classList.toggle("selected", n), t.setAttribute("aria-selected", String(n));
3936
4142
  }
3937
- !this.getAttribute("placeholder") && o && (o.placeholder = G(e) || "Enter phone number"), o && this._national && (o.value = W(e, this._national)), g(), this._syncMirror(), this._emitChange(), o?.focus();
4143
+ !this.getAttribute("placeholder") && o && (o.placeholder = K(e) || "Enter phone number"), o && this._national && (o.value = G(e, this._national)), g(), this._syncMirror(), this._emitChange(), o?.focus();
3938
4144
  }, y = (t) => {
3939
4145
  let n = this._visibleItems();
3940
4146
  if (t.key === "ArrowDown") {
@@ -3968,7 +4174,7 @@ var Ge = class extends e {
3968
4174
  let b = this.querySelector("[data-phone-error]"), x = (e) => {
3969
4175
  if (o.classList.toggle("is-invalid", e), e ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), b) {
3970
4176
  if (e) {
3971
- let e = G(this._country);
4177
+ let e = K(this._country);
3972
4178
  b.textContent = e ? `Enter a valid phone number, e.g. ${e}` : "Enter a valid phone number";
3973
4179
  }
3974
4180
  b.hidden = !e;
@@ -3976,24 +4182,24 @@ var Ge = class extends e {
3976
4182
  };
3977
4183
  o.addEventListener("input", (e) => {
3978
4184
  e.stopPropagation();
3979
- let t = o.selectionStart ?? o.value.length, n = o.value.slice(0, t).replace(/[^0-9]/g, "").length, r = o.value.replace(/[^0-9]/g, ""), i = He(this._country);
4185
+ let t = o.selectionStart ?? o.value.length, n = o.value.slice(0, t).replace(/[^0-9]/g, "").length, r = o.value.replace(/[^0-9]/g, ""), i = Ue(this._country);
3980
4186
  if (i && r.length > i) {
3981
- let e = Ue(this._country, r, i);
4187
+ let e = We(this._country, r, i);
3982
4188
  e ? (n = Math.max(0, n - (r.length - e.length)), r = e) : r = r.slice(0, i);
3983
4189
  }
3984
4190
  this._national = r;
3985
- let a = W(this._country, this._national);
4191
+ let a = G(this._country, this._national);
3986
4192
  if (o.value !== a) {
3987
4193
  o.value = a;
3988
- let e = Be(a, Math.min(n, r.length));
4194
+ let e = Ve(a, Math.min(n, r.length));
3989
4195
  o.setSelectionRange(e, e);
3990
4196
  }
3991
- this._syncMirror(), this._emitInput(), o.classList.contains("is-invalid") && (!this._national || Ve(this.value) === !0) && x(!1);
4197
+ this._syncMirror(), this._emitInput(), o.classList.contains("is-invalid") && (!this._national || He(this.value) === !0) && x(!1);
3992
4198
  }), o.addEventListener("change", (e) => e.stopPropagation()), o.addEventListener("blur", () => {
3993
- x(this._national.length > 0 && Ve(this.value) === !1), this.value !== this._committedValue && this._emitChange();
4199
+ x(this._national.length > 0 && He(this.value) === !1), this.value !== this._committedValue && this._emitChange();
3994
4200
  }), o.addEventListener("paste", (e) => {
3995
- let t = We(e.clipboardData?.getData("text"));
3996
- t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = W(this._country, this._national) : this.setAttribute("country", t.country), this._syncMirror(), this._emitInput(), this._emitChange(), this.querySelector("input[type=tel]")?.focus());
4201
+ let t = Ge(e.clipboardData?.getData("text"));
4202
+ t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = G(this._country, this._national) : this.setAttribute("country", t.country), this._syncMirror(), this._emitInput(), this._emitChange(), this.querySelector("input[type=tel]")?.focus());
3997
4203
  }), this._bindGlobal = () => {
3998
4204
  this._teardownGlobals?.(), this._onDocClick = (e) => {
3999
4205
  f() && !this.contains(e.target) && g();
@@ -4002,9 +4208,9 @@ var Ge = class extends e {
4002
4208
  });
4003
4209
  }, this._teardownGlobals = () => {
4004
4210
  this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), l(this);
4005
- }, this._bindGlobal(), Re().then((e) => {
4006
- if (!(!e || !o.isConnected) && (this._national && (o.value = W(this._country, this._national)), !this.getAttribute("placeholder"))) {
4007
- let e = G(this._country);
4211
+ }, this._bindGlobal(), ze().then((e) => {
4212
+ if (!(!e || !o.isConnected) && (this._national && (o.value = G(this._country, this._national)), !this.getAttribute("placeholder"))) {
4213
+ let e = K(this._country);
4008
4214
  e && (o.placeholder = e);
4009
4215
  }
4010
4216
  }), this._syncMirror();
@@ -4015,7 +4221,7 @@ var Ge = class extends e {
4015
4221
  disconnectedCallback() {
4016
4222
  this._teardown();
4017
4223
  }
4018
- }, K = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Ke = class extends e {
4224
+ }, q = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), qe = class extends e {
4019
4225
  static formAssociated = !0;
4020
4226
  static get observedAttributes() {
4021
4227
  return [
@@ -4104,19 +4310,19 @@ var Ge = class extends e {
4104
4310
  this._listboxId = u;
4105
4311
  let f = e.map((e, t) => {
4106
4312
  let n = String(e.value) === String(this._value);
4107
- return `<button type="button" role="option" id="${q(`${u}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${q(e.value)}" aria-selected="${n}">${v(e)}</button>`;
4313
+ return `<button type="button" role="option" id="${J(`${u}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${n}">${v(e)}</button>`;
4108
4314
  }).join("");
4109
4315
  this.innerHTML = `
4110
4316
  <div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
4111
- <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${q(u)}" aria-label="${q(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}>
4317
+ <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${J(u)}" aria-label="${J(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}>
4112
4318
  ${a ? p(a, { className: "search-select-icon" }) : ""}
4113
4319
  ${o ? `<span class="search-select-prefix">${g(o)}</span>` : ""}
4114
4320
  <span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? v(l) : g(s)}</span>
4115
4321
  ${n ? `<span class="search-select-reset" role="button" aria-label="Clear selection" hidden>${p("x")}</span>` : ""}
4116
4322
  ${p("chevron-down", { className: "search-select-caret" })}
4117
4323
  </button>
4118
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${q(u)}" tabindex="-1" hidden>
4119
- ${t ? `<div class="search-select-search">${p("search")}<input class="search-select-input" placeholder="${q(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${p("x")}</button></div>` : ""}
4324
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${J(u)}" tabindex="-1" hidden>
4325
+ ${t ? `<div class="search-select-search">${p("search")}<input class="search-select-input" placeholder="${J(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${p("x")}</button></div>` : ""}
4120
4326
  <div class="search-select-options">${f}<div class="search-select-empty" hidden>No matches</div></div>
4121
4327
  </div>
4122
4328
  </div>`, this._rendered = !0, d(this, this._value), this._wire(), this._syncReset();
@@ -4221,7 +4427,7 @@ var Ge = class extends e {
4221
4427
  disconnectedCallback() {
4222
4428
  this._teardown();
4223
4429
  }
4224
- }, q = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), qe = class extends e {
4430
+ }, J = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Je = class extends e {
4225
4431
  static formAssociated = !0;
4226
4432
  static get observedAttributes() {
4227
4433
  return [
@@ -4261,19 +4467,19 @@ var Ge = class extends e {
4261
4467
  return this._value;
4262
4468
  }
4263
4469
  set value(e) {
4264
- this._value = this._snapToStep(this._clamp(J(e, this._value))), this._syncValue(), this._syncMirrors();
4470
+ this._value = this._snapToStep(this._clamp(Y(e, this._value))), this._syncValue(), this._syncMirrors();
4265
4471
  }
4266
4472
  get start() {
4267
4473
  return this._start;
4268
4474
  }
4269
4475
  set start(e) {
4270
- this._start = Math.min(this._snapToStep(this._clamp(J(e, this._start))), this._end), this._syncValue(), this._syncMirrors();
4476
+ this._start = Math.min(this._snapToStep(this._clamp(Y(e, this._start))), this._end), this._syncValue(), this._syncMirrors();
4271
4477
  }
4272
4478
  get end() {
4273
4479
  return this._end;
4274
4480
  }
4275
4481
  set end(e) {
4276
- this._end = Math.max(this._snapToStep(this._clamp(J(e, this._end))), this._start), this._syncValue(), this._syncMirrors();
4482
+ this._end = Math.max(this._snapToStep(this._clamp(Y(e, this._end))), this._start), this._syncValue(), this._syncMirrors();
4277
4483
  }
4278
4484
  attributeChangedCallback(e, t, n) {
4279
4485
  if (e === "value" || e === "start" || e === "end" || e === "min" || e === "max" || e === "step") {
@@ -4286,19 +4492,19 @@ var Ge = class extends e {
4286
4492
  this._isRange() ? this._resetRange() : this._resetSingle();
4287
4493
  }
4288
4494
  _updateFromAttribute(e) {
4289
- e === "value" ? this._value = this._snapToStep(this._clamp(J(this.getAttribute("value"), this._value))) : e === "start" ? this._start = this._snapToStep(this._clamp(J(this.getAttribute("start"), this._start))) : e === "end" && (this._end = this._snapToStep(this._clamp(J(this.getAttribute("end"), this._end))));
4495
+ e === "value" ? this._value = this._snapToStep(this._clamp(Y(this.getAttribute("value"), this._value))) : e === "start" ? this._start = this._snapToStep(this._clamp(Y(this.getAttribute("start"), this._start))) : e === "end" && (this._end = this._snapToStep(this._clamp(Y(this.getAttribute("end"), this._end))));
4290
4496
  }
4291
4497
  _isRange() {
4292
4498
  return this.hasAttribute("range");
4293
4499
  }
4294
4500
  _min() {
4295
- return J(this.getAttribute("min"), 0);
4501
+ return Y(this.getAttribute("min"), 0);
4296
4502
  }
4297
4503
  _max() {
4298
- return J(this.getAttribute("max"), 100);
4504
+ return Y(this.getAttribute("max"), 100);
4299
4505
  }
4300
4506
  _step() {
4301
- return J(this.getAttribute("step"), 1);
4507
+ return Y(this.getAttribute("step"), 1);
4302
4508
  }
4303
4509
  _clamp(e) {
4304
4510
  return Math.max(this._min(), Math.min(e, this._max()));
@@ -4363,7 +4569,7 @@ var Ge = class extends e {
4363
4569
  aria-valuenow="${this._value}"
4364
4570
  aria-valuetext="${this._formatValue(this._value)}"
4365
4571
  ${a ? "disabled" : ""}
4366
- aria-label="${Je(this.getAttribute("aria-label") || "Value")}"
4572
+ aria-label="${Ye(this.getAttribute("aria-label") || "Value")}"
4367
4573
  ></button>
4368
4574
  `}
4369
4575
  ${this.hasAttribute("show-value") ? n ? `<span class="slider-value">${this._formatValue(this._start)} – ${this._formatValue(this._end)}</span>` : `<span class="slider-value">${this._formatValue(this._value)}</span>` : ""}
@@ -4463,10 +4669,10 @@ var Ge = class extends e {
4463
4669
  disconnectedCallback() {
4464
4670
  this._teardown();
4465
4671
  }
4466
- }, J = (e, t) => {
4672
+ }, Y = (e, t) => {
4467
4673
  let n = Number.parseFloat(e);
4468
4674
  return Number.isFinite(n) ? n : t;
4469
- }, Je = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Ye = class extends e {
4675
+ }, Ye = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Xe = class extends e {
4470
4676
  static formAssociated = !0;
4471
4677
  _accessibleName() {
4472
4678
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Add tags";
@@ -4539,7 +4745,7 @@ var Ge = class extends e {
4539
4745
  d(this, this._values.join(",")), this.innerHTML = `
4540
4746
  <div class="search-select${t}">
4541
4747
  <div class="input search-select-control search-select-multi"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
4542
- <input type="text" class="ms-input" data-input aria-label="${Y(this._accessibleName())}" placeholder="${Y(this.getAttribute("placeholder") || "Add…")}" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""}/>
4748
+ <input type="text" class="ms-input" data-input aria-label="${X(this._accessibleName())}" placeholder="${X(this.getAttribute("placeholder") || "Add…")}" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""}/>
4543
4749
  <div class="ms-chips" data-chips></div>
4544
4750
  </div>
4545
4751
  </div>`, this._rendered = !0, d(this, this._values.join(",")), this._renderControl(), this._wire();
@@ -4551,14 +4757,14 @@ var Ge = class extends e {
4551
4757
  e.innerHTML = "";
4552
4758
  return;
4553
4759
  }
4554
- e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${Xe(e)}</span><button type="button" class="chip-remove" data-remove="${Y(e)}" aria-label="Remove ${Y(e)}">${p("x")}</button></span>`).join("");
4760
+ e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${Ze(e)}</span><button type="button" class="chip-remove" data-remove="${X(e)}" aria-label="Remove ${X(e)}">${p("x")}</button></span>`).join("");
4555
4761
  }
4556
4762
  }
4557
4763
  _wire() {
4558
4764
  this._teardown();
4559
4765
  let e = this.querySelector(".search-select-control"), t = this.querySelector("[data-input]");
4560
4766
  if (!e || !t) return;
4561
- let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = new Set(r.map(_e).filter(Boolean)), s = () => {
4767
+ let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = new Set(r.map(ve).filter(Boolean)), s = () => {
4562
4768
  d(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
4563
4769
  }, c = (e) => {
4564
4770
  let t = e.trim();
@@ -4590,9 +4796,9 @@ var Ge = class extends e {
4590
4796
  e.preventDefault();
4591
4797
  let n = e.clipboardData.getData("text/plain"), a = [];
4592
4798
  for (let e of r) {
4593
- let t = ve(e) ?? e;
4594
- if (I(n, [t])) {
4595
- a.push(...ye(n, [t]));
4799
+ let t = ye(e) ?? e;
4800
+ if (L(n, [t])) {
4801
+ a.push(...be(n, [t]));
4596
4802
  break;
4597
4803
  }
4598
4804
  }
@@ -4620,18 +4826,18 @@ var Ge = class extends e {
4620
4826
  disconnectedCallback() {
4621
4827
  this._teardown();
4622
4828
  }
4623
- }, Xe = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Y = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Ze = (e) => String(e).padStart(2, "0"), Qe = (e, t) => `${Ze(e)}:${Ze(t)}`, X = (e) => {
4829
+ }, Ze = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), X = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Qe = (e) => String(e).padStart(2, "0"), $e = (e, t) => `${Qe(e)}:${Qe(t)}`, Z = (e) => {
4624
4830
  let t = /^(\d{2}):(\d{2})$/.exec(e || "");
4625
4831
  return t ? {
4626
4832
  h: +t[1],
4627
4833
  m: +t[2]
4628
4834
  } : null;
4629
- }, $e = (e, t = "24") => {
4835
+ }, et = (e, t = "24") => {
4630
4836
  if (!e) return "";
4631
- if (t === "24") return Qe(e.h, e.m);
4837
+ if (t === "24") return $e(e.h, e.m);
4632
4838
  let n = e.h % 12 || 12, r = e.h >= 12 ? "PM" : "AM";
4633
- return `${n}:${Ze(e.m)} ${r}`;
4634
- }, et = class extends e {
4839
+ return `${n}:${Qe(e.m)} ${r}`;
4840
+ }, tt = class extends e {
4635
4841
  static formAssociated = !0;
4636
4842
  static get observedAttributes() {
4637
4843
  return [
@@ -4645,7 +4851,8 @@ var Ge = class extends e {
4645
4851
  "required",
4646
4852
  "size",
4647
4853
  "aria-label",
4648
- "aria-describedby"
4854
+ "aria-describedby",
4855
+ "aria-invalid"
4649
4856
  ];
4650
4857
  }
4651
4858
  constructor() {
@@ -4665,8 +4872,16 @@ var Ge = class extends e {
4665
4872
  this._bindGlobal?.();
4666
4873
  }
4667
4874
  attributeChangedCallback(e, t, n) {
4875
+ if (e === "aria-invalid") {
4876
+ this._syncInvalid();
4877
+ return;
4878
+ }
4668
4879
  this._rendered && (e === "value" ? (this._value = n || "", this._syncFormValue(), this._syncTrigger()) : this.render());
4669
4880
  }
4881
+ _syncInvalid() {
4882
+ let e = this.querySelector(".timepicker-trigger");
4883
+ e && (this.hasAttribute("aria-invalid") ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
4884
+ }
4670
4885
  formResetCallback() {
4671
4886
  this.value = this._defaultValue || "";
4672
4887
  }
@@ -4678,11 +4893,11 @@ var Ge = class extends e {
4678
4893
  }
4679
4894
  render() {
4680
4895
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
4681
- let e = this.getAttribute("placeholder") || "Select time", t = X(this._value), n = this.getAttribute("format") || "24", r = this.getAttribute("size"), i = r === "sm" ? " input-sm" : r === "lg" ? " input-lg" : "", a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
4896
+ let e = this.getAttribute("placeholder") || "Select time", t = Z(this._value), n = this.getAttribute("format") || "24", r = this.getAttribute("size"), i = r === "sm" ? " input-sm" : r === "lg" ? " input-lg" : "", a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
4682
4897
  this.innerHTML = `
4683
4898
  <div class="timepicker">
4684
- <button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${g(a)}"` : ""}${o ? ` aria-describedby="${g(o)}"` : ""}>
4685
- <span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ? $e(t, n) : g(e)}</span>
4899
+ <button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${g(a)}"` : ""}${o ? ` aria-describedby="${g(o)}"` : ""}>
4900
+ <span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ? et(t, n) : g(e)}</span>
4686
4901
  ${p("clock")}
4687
4902
  </button>
4688
4903
  <div class="timepicker-pop" role="listbox" tabindex="-1" hidden></div>
@@ -4694,14 +4909,14 @@ var Ge = class extends e {
4694
4909
  _syncTrigger() {
4695
4910
  let e = this.querySelector(".timepicker-trigger"), t = this.querySelector("[data-trigger-label]");
4696
4911
  if (!t) return;
4697
- let n = X(this._value), r = this.getAttribute("format") || "24";
4698
- t.textContent = n ? $e(n, r) : this.getAttribute("placeholder") || "Select time", t.classList.toggle("timepicker-placeholder", !n), e?.classList.toggle("has-value", !!n);
4912
+ let n = Z(this._value), r = this.getAttribute("format") || "24";
4913
+ t.textContent = n ? et(n, r) : this.getAttribute("placeholder") || "Select time", t.classList.toggle("timepicker-placeholder", !n), e?.classList.toggle("has-value", !!n);
4699
4914
  }
4700
4915
  _buildTimes() {
4701
- let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r = X(t) || {
4916
+ let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r = Z(t) || {
4702
4917
  h: 0,
4703
4918
  m: 0
4704
- }, i = X(n) || {
4919
+ }, i = Z(n) || {
4705
4920
  h: 23,
4706
4921
  m: 59
4707
4922
  }, a = [], o = r.h, s = r.m;
@@ -4714,10 +4929,10 @@ var Ge = class extends e {
4714
4929
  _renderOptions() {
4715
4930
  let e = this.querySelector(".timepicker-pop");
4716
4931
  if (!e) return;
4717
- let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = X(this._value), i = this._focus, a = "";
4932
+ let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = Z(this._value), i = this._focus, a = "";
4718
4933
  for (let e = 0; e < n.length; e++) {
4719
- let o = n[e], s = Qe(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
4720
- a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${$e(o, t)}</button>`;
4934
+ let o = n[e], s = $e(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
4935
+ a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${et(o, t)}</button>`;
4721
4936
  }
4722
4937
  e.innerHTML = a, this._focusActive();
4723
4938
  }
@@ -4815,7 +5030,7 @@ var Ge = class extends e {
4815
5030
  disconnectedCallback() {
4816
5031
  this._teardown();
4817
5032
  }
4818
- }, tt = "wui-wizard-step", nt = class extends e {
5033
+ }, nt = "wui-wizard-step", rt = class extends e {
4819
5034
  static get observedAttributes() {
4820
5035
  return [
4821
5036
  "active",
@@ -4833,7 +5048,7 @@ var Ge = class extends e {
4833
5048
  ];
4834
5049
  }
4835
5050
  constructor() {
4836
- super(), this._active = 0, this._skipped = /* @__PURE__ */ new Set(), this._invalid = /* @__PURE__ */ new Set(), this._finished = !1, this._rendered = !1, this._reflecting = !1, this._beforeNext = null, this._header = null, this._footer = null;
5051
+ super(), this._active = 0, this._skipped = /* @__PURE__ */ new Set(), this._invalid = /* @__PURE__ */ new Set(), this._finished = !1, this._rendered = !1, this._reflecting = !1, this._beforeNext = null, this._header = null, this._footer = null, this._known = [], this._observer = null;
4837
5052
  }
4838
5053
  get active() {
4839
5054
  return this._active;
@@ -4849,13 +5064,13 @@ var Ge = class extends e {
4849
5064
  this._beforeNext = typeof e == "function" ? e : null;
4850
5065
  }
4851
5066
  get _steps() {
4852
- return [...this.querySelectorAll(`:scope > ${tt}`)];
5067
+ return [...this.querySelectorAll(`:scope > ${nt}`)];
4853
5068
  }
4854
5069
  refresh() {
4855
5070
  this._rendered && this._renderChrome();
4856
5071
  }
4857
5072
  connectedCallback() {
4858
- if (this._rendered) this._wire();
5073
+ if (this._rendered) this._wire(), this._onStepsMutated();
4859
5074
  else {
4860
5075
  let e = Number.parseInt(this.getAttribute("active"), 10);
4861
5076
  this._active = Number.isFinite(e) && e >= 0 ? e : 0, this.render();
@@ -4868,7 +5083,7 @@ var Ge = class extends e {
4868
5083
  if (!(!this._rendered || this._reflecting)) {
4869
5084
  if (e === "active") {
4870
5085
  let e = Number.parseInt(n, 10);
4871
- Number.isFinite(e) && e !== this._active && this._go(e, "set");
5086
+ Number.isFinite(e) && this._go(e, "set");
4872
5087
  return;
4873
5088
  }
4874
5089
  this._renderChrome();
@@ -4876,16 +5091,40 @@ var Ge = class extends e {
4876
5091
  }
4877
5092
  render() {
4878
5093
  let e = this._steps;
4879
- this._header || (this._header = document.createElement("nav"), this._header.className = "stepper wizard-stepper", this._footer = document.createElement("div"), this._footer.className = "form-actions wizard-footer form-actions-between", e.length ? (this.insertBefore(this._header, e[0]), e[e.length - 1].after(this._footer)) : (this.prepend(this._header), this.append(this._footer))), this._renderChrome(), this._rendered = !0, this._wire();
5094
+ this._header || (this._header = document.createElement("nav"), this._header.className = "stepper wizard-stepper", this._footer = document.createElement("div"), this._footer.className = "form-actions wizard-footer form-actions-between", e.length ? (this.insertBefore(this._header, e[0]), e[e.length - 1].after(this._footer)) : (this.prepend(this._header), this.append(this._footer))), this._known = e, this._renderChrome(), this._rendered = !0, this._wire();
4880
5095
  }
4881
5096
  _renderChrome() {
4882
- let e = this._steps;
4883
- this._clampActive(e), this._syncPanels(e), this._header.innerHTML = this._headerHtml(e), this._footer.innerHTML = this._footerHtml(e), this._header.hidden = this.hasAttribute("hide-stepper");
5097
+ let e = this._reconcileSteps();
5098
+ this._placeChrome(e), this._clampActive(e), this._syncPanels(e), this._header.innerHTML = this._headerHtml(e), this._footer.innerHTML = this._footerHtml(e), this._header.hidden = this.hasAttribute("hide-stepper");
4884
5099
  }
4885
5100
  _clampActive(e) {
4886
5101
  let t = Math.max(0, e.length - 1);
4887
5102
  this._active > t && (this._active = t), this._active < 0 && (this._active = 0);
4888
5103
  }
5104
+ _reconcileSteps() {
5105
+ let e = this._steps, t = this._known;
5106
+ if (this._known = e, it(e, t)) return e;
5107
+ let n = (n) => new Set([...n].map((n) => e.indexOf(t[n])).filter((e) => e >= 0));
5108
+ this._skipped = n(this._skipped), this._invalid = n(this._invalid);
5109
+ let r = t[this._active];
5110
+ if (!r) return e;
5111
+ let i = e.indexOf(r);
5112
+ if (i < 0) {
5113
+ let n = (t) => e.includes(t), r = t.slice(this._active + 1).find(n) ?? t.slice(0, this._active).reverse().find(n);
5114
+ i = r ? e.indexOf(r) : this._active;
5115
+ }
5116
+ return i = Math.min(i, Math.max(0, e.length - 1)), i !== this._active && (this._active = i, this._reflectActive(i)), e;
5117
+ }
5118
+ _placeChrome(e) {
5119
+ if (!e.length) return;
5120
+ let t = e[e.length - 1];
5121
+ this._header.nextElementSibling !== e[0] && this.insertBefore(this._header, e[0]), this._footer.previousElementSibling !== t && t.after(this._footer);
5122
+ }
5123
+ _onStepsMutated() {
5124
+ if (!this._rendered) return;
5125
+ let e = this._steps;
5126
+ (!e.length || this._header.nextElementSibling === e[0] && this._footer.previousElementSibling === e[e.length - 1]) && it(e, this._known) || (this._renderChrome(), this._observer?.takeRecords());
5127
+ }
4889
5128
  _syncPanels(e) {
4890
5129
  e.forEach((e, t) => {
4891
5130
  let n = t === this._active;
@@ -4908,13 +5147,13 @@ var Ge = class extends e {
4908
5147
  return e.map((e, r) => {
4909
5148
  let a = this._stepStatus(e, r), o = e.getAttribute("label") || "", s = e.getAttribute("description") || "", c = e.getAttribute("icon") || "", l = r + 1, u;
4910
5149
  u = a === "done" ? p("check") : a === "error" ? p("alert-triangle") : a === "skipped" ? p("minus") : c ? p(c) : String(l);
4911
- let d = a === "pending" ? "step" : `step ${a}`, f = a === "active" ? " aria-current=\"step\"" : "", m = i || r < this._active, h = s ? `<span class="step-desc">${Z(s)}</span>` : "", g;
4912
- return g = t ? `<span class="step-circle">${u}</span><span class="step-text"><span class="step-index">Step ${l}</span><span class="step-label">${Z(o)}</span>${h}</span>` : n ? `<span class="step-circle">${u}</span><span class="step-index">Step ${l}</span><span class="step-label">${Z(o)}</span>${h}` : `<span class="step-circle">${u}</span><span class="step-label">${Z(o)}</span>${h}`, m ? `<button type="button" class="${d}" data-step="${r}"${f}>${g}</button>` : `<div class="${d}"${f}>${g}</div>`;
5150
+ let d = a === "pending" ? "step" : `step ${a}`, f = a === "active" ? " aria-current=\"step\"" : "", m = i || r < this._active, h = s ? `<span class="step-desc">${Q(s)}</span>` : "", g;
5151
+ return g = t ? `<span class="step-circle">${u}</span><span class="step-text"><span class="step-index">Step ${l}</span><span class="step-label">${Q(o)}</span>${h}</span>` : n ? `<span class="step-circle">${u}</span><span class="step-index">Step ${l}</span><span class="step-label">${Q(o)}</span>${h}` : `<span class="step-circle">${u}</span><span class="step-label">${Q(o)}</span>${h}`, m ? `<button type="button" class="${d}" data-step="${r}"${f}>${g}</button>` : `<div class="${d}"${f}>${g}</div>`;
4913
5152
  }).join("");
4914
5153
  }
4915
5154
  _footerHtml(e) {
4916
5155
  let t = this._active, n = e.length - 1, r = this.hasAttribute("disabled") ? " disabled" : "", i = e[t]?.hasAttribute("optional") || this.hasAttribute("skippable"), a = this.getAttribute("back-label") || "Back", o = this.getAttribute("next-label") || "Next", s = this.getAttribute("skip-label") || "Skip", c = this.getAttribute("finish-label") || "Finish";
4917
- return `${t > 0 ? `<button type="button" class="btn btn-secondary" data-nav="back"${r}>${p("arrow-left", { className: "me-2" })}${Z(a)}</button>` : "<span></span>"}<span class="wizard-footer-actions">${i && t < n ? `<button type="button" class="btn btn-subtle" data-nav="skip"${r}>${Z(s)}</button>` : ""}${t < n ? `<button type="button" class="btn btn-primary" data-nav="next"${r}>${Z(o)}${p("arrow-right", { className: "ms-2" })}</button>` : `<button type="button" class="btn btn-primary" data-nav="finish"${r}>${Z(c)}</button>`}</span>`;
5156
+ return `${t > 0 ? `<button type="button" class="btn btn-secondary" data-nav="back"${r}>${p("arrow-left", { className: "me-2" })}${Q(a)}</button>` : "<span></span>"}<span class="wizard-footer-actions">${i && t < n ? `<button type="button" class="btn btn-subtle" data-nav="skip"${r}>${Q(s)}</button>` : ""}${t < n ? `<button type="button" class="btn btn-primary" data-nav="next"${r}>${Q(o)}${p("arrow-right", { className: "ms-2" })}</button>` : `<button type="button" class="btn btn-primary" data-nav="finish"${r}>${Q(c)}</button>`}</span>`;
4918
5157
  }
4919
5158
  _wire() {
4920
5159
  this._teardown(), this._onHeaderClick = (e) => {
@@ -4925,10 +5164,10 @@ var Ge = class extends e {
4925
5164
  if (!t || !this.contains(t) || this.hasAttribute("disabled")) return;
4926
5165
  let n = t.dataset.nav;
4927
5166
  n === "back" ? this._back() : n === "skip" ? this._skip() : (n === "next" || n === "finish") && this._next();
4928
- }, this._header.addEventListener("click", this._onHeaderClick), this._footer.addEventListener("click", this._onFooterClick);
5167
+ }, this._header.addEventListener("click", this._onHeaderClick), this._footer.addEventListener("click", this._onFooterClick), this._observer = new MutationObserver(() => this._onStepsMutated()), this._observer.observe(this, { childList: !0 });
4929
5168
  }
4930
5169
  _teardown() {
4931
- this._header && this._onHeaderClick && this._header.removeEventListener("click", this._onHeaderClick), this._footer && this._onFooterClick && this._footer.removeEventListener("click", this._onFooterClick);
5170
+ this._header && this._onHeaderClick && this._header.removeEventListener("click", this._onHeaderClick), this._footer && this._onFooterClick && this._footer.removeEventListener("click", this._onFooterClick), this._observer?.disconnect(), this._observer = null;
4932
5171
  }
4933
5172
  _stepTo(e) {
4934
5173
  this.hasAttribute("disabled") || !this.hasAttribute("non-linear") && e >= this._active || this._go(e, "step");
@@ -4937,9 +5176,10 @@ var Ge = class extends e {
4937
5176
  this._active > 0 && this._go(this._active - 1, "back");
4938
5177
  }
4939
5178
  async _next() {
4940
- let e = this._active, t = e >= this._steps.length - 1;
5179
+ this._reconcileSteps();
5180
+ let e = this._active, t = this._steps, n = e >= t.length - 1, r = t[e];
4941
5181
  if (!this.dispatchEvent(new CustomEvent("wui-wizard:beforechange", {
4942
- detail: t ? {
5182
+ detail: n ? {
4943
5183
  index: e,
4944
5184
  next: e,
4945
5185
  reason: "finish"
@@ -4951,15 +5191,16 @@ var Ge = class extends e {
4951
5191
  cancelable: !0
4952
5192
  }))) return this._flagInvalid(e);
4953
5193
  if (this._beforeNext) {
4954
- let t;
5194
+ let i;
4955
5195
  try {
4956
- t = await this._beforeNext(e);
5196
+ i = await this._beforeNext(e);
4957
5197
  } catch {
4958
- t = !1;
5198
+ i = !1;
4959
5199
  }
4960
- if (t === !1) return this._flagInvalid(e);
5200
+ if (this._reconcileSteps(), t = this._steps, e = t.indexOf(r), e < 0) return;
5201
+ if (n = e >= t.length - 1, i === !1) return this._flagInvalid(e);
4961
5202
  }
4962
- if (this._invalid.delete(e), this._skipped.delete(e), t) return this._finish();
5203
+ if (this._invalid.delete(e), this._skipped.delete(e), n) return this._finish();
4963
5204
  this._go(e + 1, "next");
4964
5205
  }
4965
5206
  _skip() {
@@ -4976,7 +5217,7 @@ var Ge = class extends e {
4976
5217
  this._invalid.delete(this._active), this._finished = !0, this._renderChrome(), this.dispatchEvent(new CustomEvent("wui-wizard:finish", { detail: { index: this._active } }));
4977
5218
  }
4978
5219
  _go(e, t) {
4979
- let n = this._steps, r = Math.max(0, n.length - 1), i = Math.min(Math.max(e, 0), r), a = this._active;
5220
+ let n = this._reconcileSteps(), r = Math.max(0, n.length - 1), i = Math.min(Math.max(e, 0), r), a = this._active;
4980
5221
  this._finished = !1, this._invalid.delete(a), this._active = i, this._reflectActive(i), this._renderChrome(), t !== "silent" && i !== a && this.dispatchEvent(new CustomEvent("wui-wizard:change", { detail: {
4981
5222
  index: i,
4982
5223
  previous: a,
@@ -4986,7 +5227,7 @@ var Ge = class extends e {
4986
5227
  _reflectActive(e) {
4987
5228
  this._reflecting = !0, this.setAttribute("active", String(e)), this._reflecting = !1;
4988
5229
  }
4989
- }, Z = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), rt = class extends e {
5230
+ }, it = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Q = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), at = class extends e {
4990
5231
  static get observedAttributes() {
4991
5232
  return [
4992
5233
  "label",
@@ -5000,8 +5241,8 @@ var Ge = class extends e {
5000
5241
  let e = this.closest("wui-wizard");
5001
5242
  e && typeof e.refresh == "function" && e.refresh();
5002
5243
  }
5003
- }, it = 2e3;
5004
- async function at(e) {
5244
+ }, ot = 2e3;
5245
+ async function st(e) {
5005
5246
  try {
5006
5247
  if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
5007
5248
  } catch {}
@@ -5016,14 +5257,14 @@ async function at(e) {
5016
5257
  }
5017
5258
  //#endregion
5018
5259
  //#region src/fileValidation.js
5019
- var ot = "image/png,image/jpeg,image/webp", st = 5, ct = {
5260
+ var ct = "image/png,image/jpeg,image/webp", lt = 5, ut = {
5020
5261
  "image/png": [".png"],
5021
5262
  "image/jpeg": [".jpg", ".jpeg"],
5022
5263
  "image/webp": [".webp"],
5023
5264
  "image/gif": [".gif"],
5024
5265
  "image/svg+xml": [".svg"],
5025
5266
  "application/pdf": [".pdf"]
5026
- }, lt = {
5267
+ }, dt = {
5027
5268
  "image/png": "PNG",
5028
5269
  "image/jpeg": "JPG",
5029
5270
  "image/webp": "WEBP",
@@ -5037,7 +5278,7 @@ var ot = "image/png,image/jpeg,image/webp", st = 5, ct = {
5037
5278
  ".gif": "GIF",
5038
5279
  ".svg": "SVG",
5039
5280
  ".pdf": "PDF"
5040
- }, ut = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), dt = [
5281
+ }, ft = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), pt = [
5041
5282
  ".png",
5042
5283
  ".jpg",
5043
5284
  ".jpeg",
@@ -5048,54 +5289,54 @@ var ot = "image/png,image/jpeg,image/webp", st = 5, ct = {
5048
5289
  ".avif",
5049
5290
  ".heic"
5050
5291
  ];
5051
- function ft(e) {
5292
+ function mt(e) {
5052
5293
  if (!e) return !1;
5053
5294
  let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
5054
5295
  if (t) return t.startsWith("image/");
5055
5296
  let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
5056
- return dt.some((e) => r.endsWith(e));
5297
+ return pt.some((e) => r.endsWith(e));
5057
5298
  }
5058
- function pt(e) {
5059
- let t = ut(e);
5060
- return t.length ? t.every((e) => e.startsWith(".") ? dt.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
5299
+ function ht(e) {
5300
+ let t = ft(e);
5301
+ return t.length ? t.every((e) => e.startsWith(".") ? pt.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
5061
5302
  }
5062
- function mt(e) {
5303
+ function gt(e) {
5063
5304
  let t = [];
5064
- for (let n of ut(e)) {
5065
- let e = lt[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
5305
+ for (let n of ft(e)) {
5306
+ let e = dt[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
5066
5307
  t.includes(e) || t.push(e);
5067
5308
  }
5068
5309
  return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
5069
5310
  }
5070
- function ht(e, t) {
5071
- let n = ut(t);
5311
+ function _t(e, t) {
5312
+ let n = ft(t);
5072
5313
  if (!n.length) return !0;
5073
5314
  let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
5074
- return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (ct[e] || []).some((e) => i.endsWith(e)));
5315
+ return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (ut[e] || []).some((e) => i.endsWith(e)));
5075
5316
  }
5076
- function gt(e, t = {}) {
5317
+ function vt(e, t = {}) {
5077
5318
  if (!e) return null;
5078
- let n = t.accept === void 0 ? ot : t.accept, r = t.maxSizeMb || 5;
5079
- return ht(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${mt(n)} file.`;
5319
+ let n = t.accept === void 0 ? ct : t.accept, r = t.maxSizeMb || 5;
5320
+ return _t(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${gt(n)} file.`;
5080
5321
  }
5081
5322
  //#endregion
5082
5323
  //#region src/passwordRules.js
5083
- var Q = {
5324
+ var yt = {
5084
5325
  minLength: 8,
5085
5326
  uppercase: !0,
5086
5327
  lowercase: !0,
5087
5328
  digit: !0,
5088
5329
  special: !0,
5089
5330
  uniqueChars: 0
5090
- }, _t = "Password Requirements";
5091
- function vt(e) {
5092
- return e === !0 || e == null ? { ...Q } : {
5093
- ...Q,
5331
+ }, bt = "Password Requirements";
5332
+ function xt(e) {
5333
+ return e === !0 || e == null ? { ...yt } : {
5334
+ ...yt,
5094
5335
  ...e
5095
5336
  };
5096
5337
  }
5097
- function yt(e) {
5098
- let t = vt(e), n = [];
5338
+ function St(e) {
5339
+ let t = xt(e), n = [];
5099
5340
  if (t.minLength > 0 && n.push({
5100
5341
  key: "length",
5101
5342
  label: `At least ${t.minLength} characters long`,
@@ -5126,25 +5367,25 @@ function yt(e) {
5126
5367
  }
5127
5368
  return n;
5128
5369
  }
5129
- function bt(e, t) {
5370
+ function Ct(e, t) {
5130
5371
  let n = e == null ? "" : String(e);
5131
- return yt(t).map((e) => ({
5372
+ return St(t).map((e) => ({
5132
5373
  key: e.key,
5133
5374
  label: e.label,
5134
5375
  met: e.test(n)
5135
5376
  }));
5136
5377
  }
5137
- function xt(e, t) {
5138
- return bt(e, t).every((e) => e.met);
5378
+ function wt(e, t) {
5379
+ return Ct(e, t).every((e) => e.met);
5139
5380
  }
5140
5381
  //#endregion
5141
5382
  //#region src/index.js
5142
5383
  var $ = (e, t) => {
5143
5384
  typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
5144
5385
  };
5145
- function St() {
5146
- $("wui-select", Ke), $("wui-phone", Ge), $("wui-datepicker", ae), $("wui-date-range", oe), $("wui-dock", se), $("wui-feedback", fe), $("wui-consent-banner", ne), $("wui-slider", qe), $("wui-timepicker", et), $("wui-autocomplete", y), $("wui-multiselect", be), $("wui-taginput", Ye), $("wui-otp", ke), $("wui-status-icon", r), $("wui-wizard-step", rt), $("wui-wizard", nt);
5386
+ function Tt() {
5387
+ $("wui-select", qe), $("wui-phone", Ke), $("wui-datepicker", oe), $("wui-date-range", se), $("wui-dock", ce), $("wui-feedback", pe), $("wui-consent-banner", ie), $("wui-slider", Je), $("wui-timepicker", tt), $("wui-autocomplete", y), $("wui-multiselect", xe), $("wui-taginput", Xe), $("wui-otp", Ae), $("wui-status-icon", r), $("wui-wizard-step", at), $("wui-wizard", rt);
5147
5388
  }
5148
- St();
5389
+ Tt();
5149
5390
  //#endregion
5150
- export { it as COPY_FEEDBACK_MS, ot as DEFAULT_IMAGE_ACCEPT, st as DEFAULT_MAX_SIZE_MB, Q as DEFAULT_PASSWORD_RULES, _t as DEFAULT_REQUIREMENTS_TITLE, n as STATUS_TONES, y as WuiAutocomplete, ne as WuiConsentBanner, ae as WuiDatePicker, oe as WuiDateRange, se as WuiDock, fe as WuiFeedback, be as WuiMultiSelect, ke as WuiOtp, Ge as WuiPhone, Ke as WuiSelect, qe as WuiSlider, r as WuiStatusIcon, Ye as WuiTagInput, et as WuiTimePicker, nt as WuiWizard, rt as WuiWizardStep, mt as acceptLabel, yt as buildPasswordRules, at as copyTextToClipboard, St as defineWeborityElements, bt as evaluatePassword, p as glyphSvg, ft as isImageFile, pt as isImageOnlyAccept, ht as matchesAccept, xt as passwordSatisfies, gt as validateFile };
5391
+ export { ot as COPY_FEEDBACK_MS, ct as DEFAULT_IMAGE_ACCEPT, lt as DEFAULT_MAX_SIZE_MB, yt as DEFAULT_PASSWORD_RULES, bt as DEFAULT_REQUIREMENTS_TITLE, n as STATUS_TONES, y as WuiAutocomplete, ie as WuiConsentBanner, oe as WuiDatePicker, se as WuiDateRange, ce as WuiDock, pe as WuiFeedback, xe as WuiMultiSelect, Ae as WuiOtp, Ke as WuiPhone, qe as WuiSelect, Je as WuiSlider, r as WuiStatusIcon, Xe as WuiTagInput, tt as WuiTimePicker, rt as WuiWizard, at as WuiWizardStep, gt as acceptLabel, St as buildPasswordRules, st as copyTextToClipboard, Tt as defineWeborityElements, Ct as evaluatePassword, p as glyphSvg, mt as isImageFile, ht as isImageOnlyAccept, _t as matchesAccept, wt as passwordSatisfies, vt as validateFile };