@intl-tel-input/vue 29.1.0 → 29.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1647,7 +1647,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1647
1647
  isAscii() {
1648
1648
  return !this.#e || this.#e === "ascii";
1649
1649
  }
1650
- }, ye = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --x"), be = class e {
1650
+ }, ye = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --x"), be = class {
1651
1651
  #e;
1652
1652
  #t;
1653
1653
  #n;
@@ -1656,7 +1656,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1656
1656
  #a;
1657
1657
  #o = null;
1658
1658
  #s;
1659
- #c;
1659
+ #c = !1;
1660
1660
  #l;
1661
1661
  #u;
1662
1662
  #d;
@@ -1671,11 +1671,12 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1671
1671
  #b;
1672
1672
  #x;
1673
1673
  #S;
1674
- #C = null;
1674
+ #C;
1675
1675
  #w = null;
1676
- #T = /* @__PURE__ */ new Map();
1677
- #E = null;
1678
- #D;
1676
+ #T = null;
1677
+ #E = /* @__PURE__ */ new Map();
1678
+ #D = null;
1679
+ #O;
1679
1680
  telInputEl;
1680
1681
  hadInitialPlaceholder;
1681
1682
  constructor(e, t, n) {
@@ -1690,10 +1691,10 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1690
1691
  }
1691
1692
  buildMarkup(e, t) {
1692
1693
  this.#i = e, this.#a = t, this.telInputEl.classList.add("iti__tel-input"), this.telInputEl.hasAttribute("type") || this.telInputEl.setAttribute("type", "tel"), this.telInputEl.hasAttribute("autocomplete") || this.telInputEl.setAttribute("autocomplete", "tel"), this.telInputEl.hasAttribute("inputmode") || this.telInputEl.setAttribute("inputmode", "tel");
1693
- let n = this.#O();
1694
- this.#k(n), n.appendChild(this.telInputEl), this.#N(), this.#L(), this.#P(n), this.ensureDropdownWidthSet();
1694
+ let n = this.#k();
1695
+ this.#A(n), n.appendChild(this.telInputEl), this.#P(), this.#R(), this.#F(n), this.ensureDropdownWidthSet();
1695
1696
  }
1696
- #O() {
1697
+ #k() {
1697
1698
  let { countrySelectorMode: e, showFlags: t, containerClass: n } = this.#e, r = q("div", { class: K({
1698
1699
  iti: !0,
1699
1700
  "iti--input-container": !0,
@@ -1704,63 +1705,59 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1704
1705
  }) });
1705
1706
  return this.#n && r.setAttribute("dir", "ltr"), this.telInputEl.before(r), r;
1706
1707
  }
1707
- #k(e) {
1708
+ #A(e) {
1708
1709
  let { countrySelectorMode: t, separateDialCode: n, showFlags: r } = this.#e, i = t !== F.OFF;
1709
1710
  if (!i && !r && !n) return;
1710
- this.#c = q("div", { class: `iti__country-container ${_.V_HIDE}` }, e), i ? (this.#l = q("button", {
1711
+ this.#l = q("div", { class: `iti__country-container ${_.V_HIDE}` }, e), i ? (this.#u = q("button", {
1711
1712
  type: "button",
1712
1713
  class: "iti__selected-country",
1713
1714
  [L.EXPANDED]: "false",
1714
1715
  [L.LABEL]: this.#e.uiTranslations.noCountrySelected,
1715
1716
  [L.HASPOPUP]: "dialog",
1716
1717
  [L.CONTROLS]: `iti-${this.#t}__country-selector`
1717
- }, this.#c), this.telInputEl.disabled && this.#l.setAttribute("disabled", "true")) : this.#l = q("div", { class: "iti__selected-country" }, this.#c);
1718
- let a = q("div", { class: "iti__selected-country-primary" }, this.#l);
1719
- this.#u = q("div", { class: _.FLAG }, a), i && (this.#f = q("div", {
1718
+ }, this.#l), this.telInputEl.disabled && this.#u.setAttribute("disabled", "true")) : this.#u = q("div", { class: "iti__selected-country" }, this.#l);
1719
+ let a = q("div", { class: "iti__selected-country-primary" }, this.#u);
1720
+ this.#d = q("div", { class: _.FLAG }, a), i && (this.#p = q("div", {
1720
1721
  class: "iti__arrow",
1721
1722
  [L.HIDDEN]: "true"
1722
- }, a)), n && (this.#d = q("div", { class: "iti__selected-dial-code" }, this.#l)), i && this.#A();
1723
+ }, a)), n && (this.#f = q("div", { class: "iti__selected-dial-code" }, this.#u)), i && this.#j();
1723
1724
  }
1724
1725
  ensureDropdownWidthSet() {
1725
1726
  let { matchDropdownWidth: e, countrySelectorMode: t } = this.#e;
1726
- if (t === F.OFF || !e || this.#p.style.width) return;
1727
+ if (t === F.OFF || !e || this.#m.style.width) return;
1727
1728
  let n = this.telInputEl.offsetWidth;
1728
- n > 0 && (this.#p.style.width = `${n}px`);
1729
+ n > 0 && (this.#m.style.width = `${n}px`);
1729
1730
  }
1730
- #A() {
1731
- let { matchDropdownWidth: e, countrySelectorMode: t, countrySearch: n, uiTranslations: r, containerClass: i } = this.#e, a = t === F.FULLSCREEN, o = this.#j(), s = e ? "" : "iti--flexible-dropdown-width";
1732
- if (this.#p = q("div", {
1731
+ #j() {
1732
+ let { matchDropdownWidth: e, countrySelectorMode: t, countrySearch: n, uiTranslations: r, containerClass: i } = this.#e, a = t === F.FULLSCREEN, o = this.#M(), s = e ? "" : "iti--flexible-dropdown-width";
1733
+ this.#m = q("div", {
1733
1734
  id: `iti-${this.#t}__country-selector`,
1734
1735
  class: `iti__country-selector ${_.HIDE} ${s}`,
1735
1736
  role: "dialog",
1736
1737
  [L.MODAL]: "true"
1737
- }), this.#n && this.#p.setAttribute("dir", "rtl"), n && this.#M(), this.#_ = q("ul", {
1738
+ }), this.#n && this.#m.setAttribute("dir", "rtl"), n && this.#N(), this.#v = q("ul", {
1738
1739
  class: "iti__country-list",
1739
1740
  id: `iti-${this.#t}__country-listbox`,
1740
1741
  role: "listbox",
1741
1742
  [L.LABEL]: r.countryListAriaLabel
1742
- }, this.#p), this.#F(), n && this.#V(), !a) {
1743
- let { height: t, width: r } = this.#B();
1744
- this.#s = t, n && (this.#p.style.height = `${t}px`, !e && r > 0 && (this.#p.style.width = `${r}px`));
1745
- }
1746
- o ? (this.#S = q("div", { class: K({
1743
+ }, this.#m), this.#I(), n && this.#H(), o ? (this.#C = q("div", { class: K({
1747
1744
  iti: !0,
1748
1745
  "iti--detached-country-selector": !0,
1749
1746
  "iti--fullscreen-popup": a,
1750
1747
  "iti--inline-country-selector": !a,
1751
1748
  [i]: !!i
1752
- }) }), this.#S.appendChild(this.#p), a || this.#oe()) : this.#c.appendChild(this.#p);
1749
+ }) }), this.#C.appendChild(this.#m)) : this.#l.appendChild(this.#m);
1753
1750
  }
1754
- #j() {
1751
+ #M() {
1755
1752
  let { countrySelectorMode: e, dropdownParent: t } = this.#e;
1756
1753
  return e === F.FULLSCREEN ? document.body : e === F.DROPDOWN ? t : null;
1757
1754
  }
1758
- #M() {
1759
- let { uiTranslations: e, searchInputClass: t } = this.#e, n = q("div", { class: "iti__search-input-wrapper" }, this.#p);
1760
- this.#m = q("span", {
1755
+ #N() {
1756
+ let { uiTranslations: e, searchInputClass: t } = this.#e, n = q("div", { class: "iti__search-input-wrapper" }, this.#m);
1757
+ this.#h = q("span", {
1761
1758
  class: "iti__search-icon",
1762
1759
  [L.HIDDEN]: "true"
1763
- }, n), this.#m.appendChild(de()), this.#h = q("input", {
1760
+ }, n), this.#h.appendChild(de()), this.#g = q("input", {
1764
1761
  id: `iti-${this.#t}__search-input`,
1765
1762
  type: "search",
1766
1763
  class: `iti__search-input ${t}`,
@@ -1771,39 +1768,39 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1771
1768
  [L.CONTROLS]: `iti-${this.#t}__country-listbox`,
1772
1769
  [L.AUTOCOMPLETE]: "list",
1773
1770
  autocomplete: "off"
1774
- }, n), this.#g = q("button", {
1771
+ }, n), this.#_ = q("button", {
1775
1772
  type: "button",
1776
1773
  class: `iti__search-clear ${_.HIDE}`,
1777
1774
  [L.LABEL]: e.clearSearchAriaLabel,
1778
1775
  tabindex: "-1"
1779
- }, n), this.#g.appendChild(fe(this.#t)), this.#x = q("span", { class: "iti__a11y-text" }, this.#p), this.#b = q("div", {
1776
+ }, n), this.#_.appendChild(fe(this.#t)), this.#S = q("span", { class: "iti__a11y-text" }, this.#m), this.#x = q("div", {
1780
1777
  class: `iti__no-results ${_.HIDE}`,
1781
1778
  [L.HIDDEN]: "true"
1782
- }, this.#p), this.#b.textContent = e.searchEmptyState ?? null;
1779
+ }, this.#m), this.#x.textContent = e.searchEmptyState ?? null;
1783
1780
  }
1784
- #N() {
1785
- this.#c && (this.#I(), this.#c.classList.remove(_.V_HIDE));
1781
+ #P() {
1782
+ this.#l && (this.#L(), this.#l.classList.remove(_.V_HIDE));
1786
1783
  }
1787
- #P(e) {
1784
+ #F(e) {
1788
1785
  let { hiddenInputs: t } = this.#e;
1789
1786
  if (!t) return;
1790
1787
  let n = t(this.telInputEl.getAttribute("name") || "");
1791
1788
  if (n.phone) {
1792
1789
  let t = this.telInputEl.form?.querySelector(`input[name="${n.phone}"]`);
1793
- t ? this.#v = t : (this.#v = q("input", {
1790
+ t ? this.#y = t : (this.#y = q("input", {
1794
1791
  type: "hidden",
1795
1792
  name: n.phone
1796
- }), e.appendChild(this.#v));
1793
+ }), e.appendChild(this.#y));
1797
1794
  }
1798
1795
  if (n.country) {
1799
1796
  let t = this.telInputEl.form?.querySelector(`input[name="${n.country}"]`);
1800
- t ? this.#y = t : (this.#y = q("input", {
1797
+ t ? this.#b = t : (this.#b = q("input", {
1801
1798
  type: "hidden",
1802
1799
  name: n.country
1803
- }), e.appendChild(this.#y));
1800
+ }), e.appendChild(this.#b));
1804
1801
  }
1805
1802
  }
1806
- #F() {
1803
+ #I() {
1807
1804
  let e = document.createDocumentFragment();
1808
1805
  for (let t = 0; t < this.#i.length; t++) {
1809
1806
  let n = this.#i[t], r = K({ [_.COUNTRY_ITEM]: !0 }), i = q("li", {
@@ -1813,110 +1810,106 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1813
1810
  role: "option",
1814
1811
  [L.SELECTED]: "false"
1815
1812
  });
1816
- i.dataset[I.DIAL_CODE] = n.dialCode, i.dataset[I.ISO2] = n.iso2, this.#T.set(n.iso2, i), this.#e.showFlags && q("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
1813
+ i.dataset[I.DIAL_CODE] = n.dialCode, i.dataset[I.ISO2] = n.iso2, this.#E.set(n.iso2, i), this.#e.showFlags && q("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
1817
1814
  let a = q("span", { class: "iti__country-name" }, i);
1818
1815
  a.textContent = `${n.name} `;
1819
1816
  let o = q("span", { class: "iti__dial-code" }, a);
1820
1817
  this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${n.dialCode})`, e.appendChild(i);
1821
1818
  }
1822
- this.#_.appendChild(e);
1819
+ this.#v.appendChild(e);
1823
1820
  }
1824
- #I() {
1825
- if (this.#l) {
1826
- let e = this.#e.separateDialCode ? S.FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH : S.FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH, t = (this.#l.offsetWidth || this.#z() || e) + S.INPUT_PADDING_EXTRA_LEFT;
1821
+ #L() {
1822
+ if (this.#u) {
1823
+ let e = this.#e.separateDialCode ? S.FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH : S.FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH, t = (this.#u.offsetWidth || this.#z() || e) + S.INPUT_PADDING_EXTRA_LEFT;
1827
1824
  this.telInputEl.style.paddingLeft = `${t}px`;
1828
1825
  }
1829
1826
  }
1830
- #L() {
1831
- !this.#l || typeof ResizeObserver > "u" || (this.#D = new ResizeObserver(() => {
1832
- this.#l?.offsetWidth && this.#I();
1833
- }), this.#D.observe(this.#l));
1834
- }
1835
- static #R() {
1836
- let e;
1837
- try {
1838
- e = window.top.document.body;
1839
- } catch {
1840
- e = document.body;
1841
- }
1842
- return e;
1827
+ #R() {
1828
+ !this.#u || typeof ResizeObserver > "u" || (this.#O = new ResizeObserver(() => {
1829
+ this.#u?.offsetWidth && this.#L();
1830
+ }), this.#O.observe(this.#u));
1843
1831
  }
1844
1832
  #z() {
1845
1833
  if (!this.telInputEl.parentNode) return 0;
1846
- let t = e.#R(), n = this.telInputEl.parentNode.cloneNode(!1);
1847
- n.style.visibility = "hidden", t.appendChild(n);
1848
- let r = this.#c.cloneNode();
1834
+ let e = document.body, t = this.telInputEl.parentNode.cloneNode(!1);
1835
+ t.style.visibility = "hidden", e.appendChild(t);
1836
+ let n = this.#l.cloneNode();
1837
+ t.appendChild(n);
1838
+ let r = this.#u.cloneNode(!0);
1849
1839
  n.appendChild(r);
1850
- let i = this.#l.cloneNode(!0);
1851
- r.appendChild(i);
1852
- let a = i.offsetWidth;
1853
- return t.removeChild(n), a;
1840
+ let i = r.offsetWidth;
1841
+ return e.removeChild(t), i;
1854
1842
  }
1855
1843
  #B() {
1856
- let t = e.#R();
1857
- this.#p.classList.remove(_.HIDE);
1858
- let n = q("div", { class: "iti iti--inline-country-selector" });
1859
- n.appendChild(this.#p), n.style.visibility = "hidden", t.appendChild(n);
1860
- let r = this.#p.offsetHeight, i = this.#p.offsetWidth;
1861
- return t.removeChild(n), n.style.visibility = "", this.#p.classList.add(_.HIDE), {
1862
- height: r > 0 ? r : S.FALLBACK_DROPDOWN_HEIGHT,
1863
- width: i
1864
- };
1844
+ if (this.#s !== void 0) return;
1845
+ let { countrySearch: e, matchDropdownWidth: t } = this.#e, { height: n, width: r } = this.#V();
1846
+ this.#s = n, e && (this.#m.style.height = `${n}px`, !t && r > 0 && (this.#m.style.width = `${r}px`));
1865
1847
  }
1866
1848
  #V() {
1867
- let { uiTranslations: e } = this.#e, t = this.#_.childElementCount;
1868
- this.#x.textContent = e.searchSummaryAria(t);
1849
+ let e = document.body, t = this.#m, n = t.parentNode, r = t.nextSibling;
1850
+ t.classList.remove(_.HIDE);
1851
+ let i = q("div", { class: "iti iti--inline-country-selector" });
1852
+ i.appendChild(t), i.style.visibility = "hidden", e.appendChild(i);
1853
+ let a = t.offsetHeight, o = t.offsetWidth;
1854
+ return e.removeChild(i), t.classList.add(_.HIDE), n && n.insertBefore(t, r), {
1855
+ height: a > 0 ? a : S.FALLBACK_DROPDOWN_HEIGHT,
1856
+ width: o
1857
+ };
1869
1858
  }
1870
- #H(e) {
1859
+ #H() {
1860
+ let { uiTranslations: e } = this.#e, t = this.#v.childElementCount;
1861
+ this.#S.textContent = e.searchSummaryAria(t);
1862
+ }
1863
+ #U(e) {
1871
1864
  let t;
1872
1865
  if (e === "") t = this.#i;
1873
1866
  else {
1874
1867
  let n = ve.toAscii(e);
1875
1868
  t = ge(this.#i, this.#a, n);
1876
1869
  }
1877
- this.#re(t);
1870
+ this.#ie(t);
1878
1871
  }
1879
1872
  prefillSearchWithPlus() {
1880
- this.#h.value = "+", this.#h.focus(), this.#H("");
1881
- }
1882
- #U() {
1883
- let e = this.#h.value.trim();
1884
- this.#H(e), this.#h.value ? this.#g.classList.remove(_.HIDE) : this.#g.classList.add(_.HIDE);
1873
+ this.#g.value = "+", this.#g.focus(), this.#U("");
1885
1874
  }
1886
1875
  #W() {
1876
+ let e = this.#g.value.trim();
1877
+ this.#U(e), this.#g.value ? this.#_.classList.remove(_.HIDE) : this.#_.classList.add(_.HIDE);
1878
+ }
1879
+ #G() {
1887
1880
  this.#o && clearTimeout(this.#o), this.#o = setTimeout(() => {
1888
- this.#U(), this.#o = null;
1881
+ this.#W(), this.#o = null;
1889
1882
  }, x.SEARCH_DEBOUNCE_MS);
1890
1883
  }
1891
- #G() {
1892
- this.#h.value = "", this.#h.focus(), this.#U();
1884
+ #K() {
1885
+ this.#g.value = "", this.#g.focus(), this.#W();
1893
1886
  }
1894
- #K(e) {
1895
- let t = this.#_, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
1887
+ #q(e) {
1888
+ let t = this.#v, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
1896
1889
  r.top < n.top ? t.scrollTop = i : r.bottom > n.bottom && (t.scrollTop = i - n.height + r.height);
1897
1890
  }
1898
- #q(e, t = !0) {
1899
- if (this.#w?.classList.remove(_.HIGHLIGHT), e) {
1891
+ #J(e, t = !0) {
1892
+ if (this.#T?.classList.remove(_.HIGHLIGHT), e) {
1900
1893
  if (e.classList.add(_.HIGHLIGHT), this.#e.countrySearch) {
1901
1894
  let t = e.getAttribute("id") || "";
1902
- this.#h.setAttribute(L.ACTIVE_DESCENDANT, t);
1895
+ this.#g.setAttribute(L.ACTIVE_DESCENDANT, t);
1903
1896
  }
1904
- t && this.#K(e), this.#w = e;
1905
- } else this.#w = null;
1897
+ t && this.#q(e), this.#T = e;
1898
+ } else this.#T = null;
1906
1899
  }
1907
1900
  bindHiddenInputSubmitListener(e, t, n) {
1908
1901
  let r = this.telInputEl.form;
1909
- !r || !this.#v && !this.#y || r.addEventListener("submit", () => {
1910
- this.#v && (this.#v.value = t()), this.#y && (this.#y.value = n());
1902
+ !r || !this.#y && !this.#b || r.addEventListener("submit", () => {
1903
+ this.#y && (this.#y.value = t()), this.#b && (this.#b.value = n());
1911
1904
  }, { signal: e });
1912
1905
  }
1913
1906
  bindAllInitialCountrySelectorListeners(e, t, n) {
1914
1907
  let r = this.telInputEl.closest("label");
1915
1908
  r && r.addEventListener("click", (e) => {
1916
1909
  this.isCountrySelectorOpen() ? e.preventDefault() : this.telInputEl.focus();
1917
- }, { signal: e }), this.#l.addEventListener("click", () => {
1910
+ }, { signal: e }), this.#u.addEventListener("click", () => {
1918
1911
  !this.isCountrySelectorOpen() && !this.telInputEl.disabled && !this.telInputEl.readOnly && t();
1919
- }, { signal: e }), this.#c.addEventListener("keydown", (e) => {
1912
+ }, { signal: e }), this.#l.addEventListener("keydown", (e) => {
1920
1913
  let r = [
1921
1914
  v.ARROW_UP,
1922
1915
  v.ARROW_DOWN,
@@ -1928,126 +1921,129 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1928
1921
  }
1929
1922
  openCountrySelector(e, t) {
1930
1923
  let { countrySearch: n, dropdownAlwaysOpen: r } = this.#e;
1931
- if (this.#E = new AbortController(), this.ensureDropdownWidthSet(), this.#S) this.#ae();
1924
+ if (this.#D = new AbortController(), this.#e.countrySelectorMode !== F.FULLSCREEN && this.#B(), this.ensureDropdownWidthSet(), this.#C) this.#oe();
1932
1925
  else {
1933
- let e = this.#ie(), t = this.telInputEl.offsetHeight + S.DROPDOWN_MARGIN;
1934
- e ? this.#p.style.top = `${t}px` : this.#p.style.bottom = `${t}px`;
1926
+ let e = this.#ae(), t = this.telInputEl.offsetHeight + S.DROPDOWN_MARGIN;
1927
+ e ? this.#m.style.top = `${t}px` : this.#m.style.bottom = `${t}px`;
1935
1928
  }
1936
- this.#p.classList.remove(_.HIDE), this.#l.setAttribute(L.EXPANDED, "true");
1937
- let i = this.#C ?? this.#_.firstElementChild;
1938
- i && this.#q(i), n && !r && this.#h.focus(), this.#e.countrySelectorMode === F.FULLSCREEN && this.#S && window.visualViewport && window.visualViewport.addEventListener("resize", () => {
1939
- this.#se(), this.#w && this.#K(this.#w);
1940
- }, { signal: this.#E.signal }), this.#f.classList.add(_.ARROW_UP), this.#J(e, t);
1941
- }
1942
- #J(e, t) {
1943
- let n = this.#E.signal;
1944
- this.#Y(n), this.#X(n, e), this.#e.dropdownAlwaysOpen || this.#Z(n, t), this.#Q(n, e, t), this.#e.countrySearch && this.#$(n), this.#e.countrySelectorMode === F.DROPDOWN && this.#e.dropdownParent && !ye && document.addEventListener("scroll", t, {
1929
+ this.#m.classList.remove(_.HIDE), this.#u.setAttribute(L.EXPANDED, "true");
1930
+ let i = this.#w ?? this.#v.firstElementChild;
1931
+ i && this.#J(i), n && !r && this.#g.focus(), this.#e.countrySelectorMode === F.FULLSCREEN && this.#C && window.visualViewport && window.visualViewport.addEventListener("resize", () => {
1932
+ this.#ce(), this.#T && this.#q(this.#T);
1933
+ }, { signal: this.#D.signal }), this.#p.classList.add(_.ARROW_UP), this.#Y(e, t);
1934
+ }
1935
+ #Y(e, t) {
1936
+ let n = this.#D.signal;
1937
+ this.#X(n), this.#Z(n, e), this.#e.dropdownAlwaysOpen || this.#Q(n, t), this.#$(n, e, t), this.#e.countrySearch && this.#ee(n), this.#e.countrySelectorMode === F.DROPDOWN && this.#e.dropdownParent && !ye && document.addEventListener("scroll", t, {
1945
1938
  signal: n,
1946
1939
  capture: !0,
1947
1940
  passive: !0
1948
1941
  });
1949
1942
  }
1950
- #Y(e) {
1951
- this.#_.addEventListener("mouseover", (e) => {
1943
+ #X(e) {
1944
+ this.#v.addEventListener("mouseover", (e) => {
1952
1945
  let t = e.target?.closest(`.${_.COUNTRY_ITEM}`);
1953
- t && this.#q(t, !1);
1946
+ t && this.#J(t, !1);
1954
1947
  }, { signal: e });
1955
1948
  }
1956
- #X(e, t) {
1957
- this.#_.addEventListener("click", (e) => {
1949
+ #Z(e, t) {
1950
+ this.#v.addEventListener("click", (e) => {
1958
1951
  let n = e.target?.closest(`.${_.COUNTRY_ITEM}`);
1959
1952
  n && t(n);
1960
1953
  }, { signal: e });
1961
1954
  }
1962
- #Z(e, t) {
1955
+ #Q(e, t) {
1963
1956
  setTimeout(() => {
1964
1957
  document.documentElement.addEventListener("click", (e) => {
1965
- this.#p.contains(e.target) || t();
1958
+ this.#m.contains(e.target) || t();
1966
1959
  }, { signal: e });
1967
1960
  }, 0);
1968
1961
  }
1969
- #Q(e, t, n) {
1962
+ #$(e, t, n) {
1970
1963
  let r = "", i = null, a = (e) => {
1971
1964
  [
1972
1965
  v.ARROW_UP,
1973
1966
  v.ARROW_DOWN,
1974
1967
  v.ENTER,
1975
1968
  v.ESC
1976
- ].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key === v.ARROW_UP || e.key === v.ARROW_DOWN ? this.#te(e.key) : e.key === v.ENTER && !e.isComposing ? t(this.#w) : e.key === v.ESC && (n(), this.#l.focus())), !this.#e.countrySearch && b.HIDDEN_SEARCH_CHAR.test(e.key) && (e.stopPropagation(), i && clearTimeout(i), r += e.key.toLowerCase(), this.#ee(r), i = setTimeout(() => {
1969
+ ].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key === v.ARROW_UP || e.key === v.ARROW_DOWN ? this.#ne(e.key) : e.key === v.ENTER && !e.isComposing ? t(this.#T) : e.key === v.ESC && (n(), this.#u.focus())), !this.#e.countrySearch && b.HIDDEN_SEARCH_CHAR.test(e.key) && (e.stopPropagation(), i && clearTimeout(i), r += e.key.toLowerCase(), this.#te(r), i = setTimeout(() => {
1977
1970
  r = "";
1978
1971
  }, x.HIDDEN_SEARCH_RESET_MS));
1979
1972
  };
1980
- this.#l?.addEventListener("keydown", a, { signal: e }), this.#p?.addEventListener("keydown", a, { signal: e });
1981
- }
1982
- #$(e) {
1983
- this.#h.addEventListener("input", () => this.#W(), { signal: e }), this.#g.addEventListener("click", () => this.#G(), { signal: e });
1973
+ this.#u?.addEventListener("keydown", a, { signal: e }), this.#m?.addEventListener("keydown", a, { signal: e });
1984
1974
  }
1985
1975
  #ee(e) {
1976
+ this.#g.addEventListener("input", () => this.#G(), { signal: e }), this.#_.addEventListener("click", () => this.#K(), { signal: e });
1977
+ }
1978
+ #te(e) {
1986
1979
  let t = _e(this.#i, this.#a, e);
1987
1980
  if (t) {
1988
- let e = this.#T.get(t.iso2);
1989
- this.#q(e);
1981
+ let e = this.#E.get(t.iso2);
1982
+ this.#J(e);
1990
1983
  }
1991
1984
  }
1992
- #te(e) {
1993
- let t = e === v.ARROW_UP ? this.#w?.previousElementSibling : this.#w?.nextElementSibling;
1994
- !t && this.#_.childElementCount > 1 && (t = e === v.ARROW_UP ? this.#_.lastElementChild : this.#_.firstElementChild), t && this.#q(t);
1995
- }
1996
1985
  #ne(e) {
1997
- if (this.#C && this.#C.dataset[I.ISO2] !== e && (this.#C.setAttribute(L.SELECTED, "false"), this.#C.querySelector(".iti__country-check")?.remove(), this.#C = null), e && !this.#C) {
1998
- let t = this.#_.querySelector(`[data-iso2="${e}"]`);
1986
+ let t = e === v.ARROW_UP ? this.#T?.previousElementSibling : this.#T?.nextElementSibling;
1987
+ !t && this.#v.childElementCount > 1 && (t = e === v.ARROW_UP ? this.#v.lastElementChild : this.#v.firstElementChild), t && this.#J(t);
1988
+ }
1989
+ #re(e) {
1990
+ if (this.#w && this.#w.dataset[I.ISO2] !== e && (this.#w.setAttribute(L.SELECTED, "false"), this.#w.querySelector(".iti__country-check")?.remove(), this.#w = null), e && !this.#w) {
1991
+ let t = this.#v.querySelector(`[data-iso2="${e}"]`);
1999
1992
  t && (t.setAttribute(L.SELECTED, "true"), q("span", {
2000
1993
  class: "iti__country-check",
2001
1994
  [L.HIDDEN]: "true"
2002
- }, t).appendChild(pe()), this.#C = t, this.#e.dropdownAlwaysOpen && this.#q(t));
1995
+ }, t).appendChild(pe()), this.#w = t, this.#e.dropdownAlwaysOpen && this.#J(t));
2003
1996
  }
2004
1997
  }
2005
- #re(e) {
2006
- this.#_.replaceChildren();
1998
+ #ie(e) {
1999
+ this.#v.replaceChildren();
2007
2000
  let t = !0;
2008
2001
  for (let n of e) {
2009
- let e = this.#T.get(n.iso2);
2010
- e && (this.#_.appendChild(e), t &&= (this.#q(e, !1), !1));
2002
+ let e = this.#E.get(n.iso2);
2003
+ e && (this.#v.appendChild(e), t &&= (this.#J(e, !1), !1));
2011
2004
  }
2012
- t ? (this.#q(null), this.#b && this.#b.classList.remove(_.HIDE)) : this.#b && this.#b.classList.add(_.HIDE), this.#_.scrollTop = 0, this.#V();
2005
+ t ? (this.#J(null), this.#x && this.#x.classList.remove(_.HIDE)) : this.#x && this.#x.classList.add(_.HIDE), this.#v.scrollTop = 0, this.#H();
2013
2006
  }
2014
2007
  closeCountrySelector() {
2015
2008
  let { countrySearch: e } = this.#e;
2016
- this.#E.abort(), this.#E = null, this.#p.classList.add(_.HIDE), this.#l.setAttribute(L.EXPANDED, "false"), e && (this.#h.removeAttribute(L.ACTIVE_DESCENDANT), this.#h.value = "", this.#U(), this.#w &&= (this.#w.classList.remove(_.HIGHLIGHT), null)), this.#f.classList.remove(_.ARROW_UP), this.#S ? (this.#S.remove(), this.#S.style.top = "", this.#S.style.bottom = "", this.#S.style.paddingLeft = "", this.#S.style.paddingRight = "") : (this.#p.style.top = "", this.#p.style.bottom = "");
2009
+ this.#D.abort(), this.#D = null, this.#m.classList.add(_.HIDE), this.#u.setAttribute(L.EXPANDED, "false"), e && (this.#g.removeAttribute(L.ACTIVE_DESCENDANT), this.#g.value = "", this.#W(), this.#T &&= (this.#T.classList.remove(_.HIGHLIGHT), null)), this.#p.classList.remove(_.ARROW_UP), this.#C ? (this.#C.remove(), this.#C.style.top = "", this.#C.style.bottom = "", this.#C.style.paddingLeft = "", this.#C.style.paddingRight = "") : (this.#m.style.top = "", this.#m.style.bottom = "");
2017
2010
  }
2018
- #ie() {
2011
+ #ae() {
2019
2012
  if (this.#e.dropdownAlwaysOpen) return !0;
2020
2013
  let e = this.telInputEl.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom;
2021
2014
  return n >= this.#s || n >= t;
2022
2015
  }
2023
- #ae() {
2024
- let e = this.#e.countrySelectorMode === F.FULLSCREEN, t = this.#j();
2016
+ #oe() {
2017
+ let e = this.#e.countrySelectorMode === F.FULLSCREEN, t = this.#M();
2025
2018
  if (e) {
2026
2019
  if (window.innerWidth >= S.NARROW_VIEWPORT_WIDTH) {
2027
2020
  let e = this.telInputEl.getBoundingClientRect();
2028
- this.#S.style.paddingLeft = `${e.left}px`, this.#S.style.paddingRight = `${window.innerWidth - e.right}px`;
2021
+ this.#C.style.paddingLeft = `${e.left}px`, this.#C.style.paddingRight = `${window.innerWidth - e.right}px`;
2029
2022
  }
2030
- } else if (!ye) {
2023
+ } else this.#se();
2024
+ if (!e && !ye) {
2031
2025
  let e = this.telInputEl.getBoundingClientRect();
2032
- this.#S.style.left = `${e.left}px`, this.#ie() ? this.#S.style.top = `${e.bottom + S.DROPDOWN_MARGIN}px` : (this.#S.style.top = "unset", this.#S.style.bottom = `${window.innerHeight - e.top + S.DROPDOWN_MARGIN}px`);
2026
+ this.#C.style.left = `${e.left}px`, this.#ae() ? this.#C.style.top = `${e.bottom + S.DROPDOWN_MARGIN}px` : (this.#C.style.top = "unset", this.#C.style.bottom = `${window.innerHeight - e.top + S.DROPDOWN_MARGIN}px`);
2033
2027
  }
2034
- t.appendChild(this.#S);
2028
+ t.appendChild(this.#C);
2035
2029
  }
2036
- #oe() {
2030
+ #se() {
2031
+ if (this.#c) return;
2032
+ this.#c = !0;
2037
2033
  let e = `--iti-anchor-${this.#t}`, t = getComputedStyle(this.telInputEl).anchorName;
2038
- this.telInputEl.style.anchorName = t && t !== "none" ? `${t}, ${e}` : e, this.#S.style.positionAnchor = e;
2034
+ this.telInputEl.style.anchorName = t && t !== "none" ? `${t}, ${e}` : e, this.#C.style.positionAnchor = e;
2039
2035
  }
2040
- #se() {
2036
+ #ce() {
2041
2037
  let e = window.visualViewport;
2042
- if (!e || !this.#S) return;
2038
+ if (!e || !this.#C) return;
2043
2039
  let t = window.innerHeight - e.height;
2044
- this.#S.style.bottom = `${t}px`;
2040
+ this.#C.style.bottom = `${t}px`;
2045
2041
  }
2046
2042
  isCountrySelectorOpen() {
2047
- return !this.#p.classList.contains(_.HIDE);
2043
+ return !this.#m.classList.contains(_.HIDE);
2048
2044
  }
2049
2045
  setLoading(e) {
2050
- this.#u.classList.toggle(_.LOADING, e);
2046
+ this.#d.classList.toggle(_.LOADING, e);
2051
2047
  }
2052
2048
  playStrictRejectAnimation() {
2053
2049
  if (!this.#e.strictRejectAnimation) return;
@@ -2055,29 +2051,29 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2055
2051
  e && (e.classList.remove(_.STRICT_REJECT_ANIMATION), e.offsetWidth, e.classList.add(_.STRICT_REJECT_ANIMATION), e.addEventListener("animationend", () => e.classList.remove(_.STRICT_REJECT_ANIMATION), { once: !0 }));
2056
2052
  }
2057
2053
  isLoading() {
2058
- return this.#u.classList.contains(_.LOADING);
2054
+ return this.#d.classList.contains(_.LOADING);
2059
2055
  }
2060
2056
  setDisabled(e) {
2061
- this.telInputEl.disabled = e, this.#l && (e ? this.#l.setAttribute("disabled", "true") : this.#l.removeAttribute("disabled"));
2057
+ this.telInputEl.disabled = e, this.#u && (e ? this.#u.setAttribute("disabled", "true") : this.#u.removeAttribute("disabled"));
2062
2058
  }
2063
2059
  setReadonly(e) {
2064
- this.telInputEl.readOnly = e, this.#l && (e ? this.#l.setAttribute("disabled", "true") : this.#l.removeAttribute("disabled"));
2060
+ this.telInputEl.readOnly = e, this.#u && (e ? this.#u.setAttribute("disabled", "true") : this.#u.removeAttribute("disabled"));
2065
2061
  }
2066
2062
  setSelectedCountry(e) {
2067
2063
  let { countrySelectorMode: t, showFlags: n, separateDialCode: r, uiTranslations: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
2068
- if (t !== F.OFF && this.#ne(s), this.#l) {
2064
+ if (t !== F.OFF && this.#re(s), this.#u) {
2069
2065
  let e = s && n ? `${_.FLAG} iti__${s}` : `${_.FLAG} ${_.GLOBE}`, t, r, c = null;
2070
- s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), n || (c = me())) : (r = i.noCountrySelected, t = i.noCountrySelected, c = me()), this.#u.className = e, this.#l.setAttribute("title", r), this.#l.setAttribute(L.LABEL, t), c ? this.#u.replaceChildren(c) : this.#u.replaceChildren();
2066
+ s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), n || (c = me())) : (r = i.noCountrySelected, t = i.noCountrySelected, c = me()), this.#d.className = e, this.#u.setAttribute("title", r), this.#u.setAttribute(L.LABEL, t), c ? this.#d.replaceChildren(c) : this.#d.replaceChildren();
2071
2067
  }
2072
2068
  if (r) {
2073
2069
  let e = o ? `+${o}` : "";
2074
- this.#d.textContent = e, this.#I();
2070
+ this.#f.textContent = e, this.#L();
2075
2071
  }
2076
2072
  }
2077
2073
  destroy() {
2078
- this.telInputEl.iti = void 0, delete this.telInputEl.dataset[I.INSTANCE_ID], this.#D?.disconnect(), this.telInputEl.style.paddingLeft = this.#r;
2074
+ this.telInputEl.iti = void 0, delete this.telInputEl.dataset[I.INSTANCE_ID], this.#O?.disconnect(), this.telInputEl.style.paddingLeft = this.#r;
2079
2075
  let e = this.telInputEl.parentNode;
2080
- e && (e.before(this.telInputEl), e.remove()), this.#T.clear();
2076
+ e && (e.before(this.telInputEl), e.remove()), this.#E.clear();
2081
2077
  }
2082
2078
  }, xe = (e) => {
2083
2079
  let { onlyCountries: t, excludeCountries: n } = e;
@@ -2682,7 +2678,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2682
2678
  },
2683
2679
  startedLoadingUtils: !1,
2684
2680
  startedLoadingAutoCountry: !1,
2685
- version: "29.1.0",
2681
+ version: "29.1.2",
2686
2682
  NUMBER_FORMAT: M,
2687
2683
  NUMBER_TYPE: N,
2688
2684
  VALIDATION_ERROR: P,
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./IntlTelInput-Dp7tvaDb.js";
1
+ import { n as e, t } from "./IntlTelInput-DgumlRrA.js";
2
2
  //#region packages/vue/src/index.ts
3
3
  var n = t;
4
4
  //#endregion