intl-tel-input 25.5.2 → 25.8.0

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.
@@ -1324,18 +1324,18 @@ var rawCountryData = [
1324
1324
  ]
1325
1325
  ];
1326
1326
  var allCountries = [];
1327
- for (let i = 0; i < rawCountryData.length; i++) {
1328
- const c = rawCountryData[i];
1329
- allCountries[i] = {
1327
+ for (const c of rawCountryData) {
1328
+ allCountries.push({
1330
1329
  name: "",
1331
- // this is now populated in the plugin
1330
+ // populated in the plugin
1332
1331
  iso2: c[0],
1333
1332
  dialCode: c[1],
1334
1333
  priority: c[2] || 0,
1335
1334
  areaCodes: c[3] || null,
1336
1335
  nodeById: {},
1336
+ // populated by the plugin
1337
1337
  nationalPrefix: c[4] || null
1338
- };
1338
+ });
1339
1339
  }
1340
1340
  var data_default = allCountries;
1341
1341
 
@@ -1592,6 +1592,7 @@ var interfaceTranslations = {
1592
1592
  noCountrySelected: "No country selected",
1593
1593
  countryListAriaLabel: "List of countries",
1594
1594
  searchPlaceholder: "Search",
1595
+ clearSearchAriaLabel: "Clear search",
1595
1596
  zeroSearchResults: "No results found",
1596
1597
  oneSearchResult: "1 result found",
1597
1598
  multipleSearchResults: "${count} results found",
@@ -1606,10 +1607,23 @@ var allTranslations = { ...countries_default, ...interface_default };
1606
1607
  var en_default = allTranslations;
1607
1608
 
1608
1609
  // src/js/intl-tel-input.ts
1609
- for (let i = 0; i < data_default.length; i++) {
1610
- data_default[i].name = en_default[data_default[i].iso2];
1610
+ for (const c of data_default) {
1611
+ c.name = en_default[c.iso2];
1611
1612
  }
1612
1613
  var id = 0;
1614
+ var mq = (q) => {
1615
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
1616
+ };
1617
+ var computeDefaultUseFullscreenPopup = () => {
1618
+ if (typeof navigator !== "undefined" && typeof window !== "undefined") {
1619
+ const isMobileUserAgent = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1620
+ const isNarrowViewport = mq("(max-width: 500px)");
1621
+ const isShortViewport = mq("(max-height: 600px)");
1622
+ const isCoarsePointer = mq("(pointer: coarse)");
1623
+ return isMobileUserAgent || isNarrowViewport || isCoarsePointer && isShortViewport;
1624
+ }
1625
+ return false;
1626
+ };
1613
1627
  var defaults = {
1614
1628
  //* Whether or not to allow the dropdown.
1615
1629
  allowDropdown: true,
@@ -1656,13 +1670,7 @@ var defaults = {
1656
1670
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
1657
1671
  strictMode: false,
1658
1672
  //* Use full screen popup instead of dropdown for country list.
1659
- useFullscreenPopup: typeof navigator !== "undefined" && typeof window !== "undefined" ? (
1660
- //* We cannot just test screen size as some smartphones/website meta tags will report desktop resolutions.
1661
- //* Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
1662
- /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
1663
- navigator.userAgent
1664
- ) || window.innerWidth <= 500
1665
- ) : false,
1673
+ useFullscreenPopup: computeDefaultUseFullscreenPopup(),
1666
1674
  //* The number type to enforce during validation.
1667
1675
  validationNumberTypes: ["MOBILE"]
1668
1676
  };
@@ -1690,7 +1698,7 @@ var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g,
1690
1698
  var isRegionlessNanp = (number) => {
1691
1699
  const numeric = getNumeric(number);
1692
1700
  if (numeric.charAt(0) === "1") {
1693
- const areaCode = numeric.substr(1, 3);
1701
+ const areaCode = numeric.substring(1, 4);
1694
1702
  return regionlessNanpNumbers.includes(areaCode);
1695
1703
  }
1696
1704
  return false;
@@ -1713,8 +1721,8 @@ var translateCursorPosition = (relevantChars, formattedValue, prevCaretPos, isDe
1713
1721
  }
1714
1722
  return formattedValue.length;
1715
1723
  };
1716
- var createEl = (name, attrs, container) => {
1717
- const el = document.createElement(name);
1724
+ var createEl = (tagName, attrs, container) => {
1725
+ const el = document.createElement(tagName);
1718
1726
  if (attrs) {
1719
1727
  Object.entries(attrs).forEach(([key, value]) => el.setAttribute(key, value));
1720
1728
  }
@@ -1727,7 +1735,14 @@ var forEachInstance = (method, ...args) => {
1727
1735
  const { instances } = intlTelInput;
1728
1736
  Object.values(instances).forEach((instance) => instance[method](...args));
1729
1737
  };
1730
- var Iti = class {
1738
+ var Iti = class _Iti {
1739
+ /**
1740
+ * Build a space-delimited class string from an object map of className -> truthy/falsey.
1741
+ * Only keys with truthy values are included.
1742
+ */
1743
+ static _buildClassNames(flags) {
1744
+ return Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
1745
+ }
1731
1746
  constructor(input, customOptions = {}) {
1732
1747
  this.id = id++;
1733
1748
  this.telInput = input;
@@ -1790,6 +1805,16 @@ var Iti = class {
1790
1805
  this._processDialCodes();
1791
1806
  this._translateCountryNames();
1792
1807
  this._sortCountries();
1808
+ this.countryByIso2 = new Map(this.countries.map((c) => [c.iso2, c]));
1809
+ this._cacheSearchTokens();
1810
+ }
1811
+ //* Precompute and cache country search tokens to speed up filtering
1812
+ _cacheSearchTokens() {
1813
+ for (const c of this.countries) {
1814
+ c.normalisedName = normaliseString(c.name);
1815
+ c.initials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
1816
+ c.dialCodePlus = `+${c.dialCode}`;
1817
+ }
1793
1818
  }
1794
1819
  //* Sort countries by countryOrder option (if present), then name.
1795
1820
  _sortCountries() {
@@ -1821,13 +1846,12 @@ var Iti = class {
1821
1846
  if (!this.dialCodeToIso2Map.hasOwnProperty(dialCode)) {
1822
1847
  this.dialCodeToIso2Map[dialCode] = [];
1823
1848
  }
1824
- for (let i = 0; i < this.dialCodeToIso2Map[dialCode].length; i++) {
1825
- if (this.dialCodeToIso2Map[dialCode][i] === iso2) {
1826
- return;
1827
- }
1849
+ const iso2List = this.dialCodeToIso2Map[dialCode];
1850
+ if (iso2List.includes(iso2)) {
1851
+ return;
1828
1852
  }
1829
- const index = priority !== void 0 ? priority : this.dialCodeToIso2Map[dialCode].length;
1830
- this.dialCodeToIso2Map[dialCode][index] = iso2;
1853
+ const index = priority !== void 0 ? priority : iso2List.length;
1854
+ iso2List[index] = iso2;
1831
1855
  }
1832
1856
  //* Process onlyCountries or excludeCountries array if present.
1833
1857
  _processAllCountries() {
@@ -1852,33 +1876,30 @@ var Iti = class {
1852
1876
  }
1853
1877
  //* Translate Countries by object literal provided on config.
1854
1878
  _translateCountryNames() {
1855
- for (let i = 0; i < this.countries.length; i++) {
1856
- const iso2 = this.countries[i].iso2.toLowerCase();
1879
+ for (const c of this.countries) {
1880
+ const iso2 = c.iso2.toLowerCase();
1857
1881
  if (this.options.i18n.hasOwnProperty(iso2)) {
1858
- this.countries[i].name = this.options.i18n[iso2];
1882
+ c.name = this.options.i18n[iso2];
1859
1883
  }
1860
1884
  }
1861
1885
  }
1862
1886
  //* Generate this.dialCodes and this.dialCodeToIso2Map.
1863
1887
  _processDialCodes() {
1864
- this.dialCodes = {};
1888
+ this.dialCodes = /* @__PURE__ */ new Set();
1865
1889
  this.dialCodeMaxLen = 0;
1866
1890
  this.dialCodeToIso2Map = {};
1867
- for (let i = 0; i < this.countries.length; i++) {
1868
- const c = this.countries[i];
1869
- if (!this.dialCodes[c.dialCode]) {
1870
- this.dialCodes[c.dialCode] = true;
1891
+ for (const c of this.countries) {
1892
+ if (!this.dialCodes.has(c.dialCode)) {
1893
+ this.dialCodes.add(c.dialCode);
1871
1894
  }
1872
1895
  this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);
1873
1896
  }
1874
- for (let i = 0; i < this.countries.length; i++) {
1875
- const c = this.countries[i];
1897
+ for (const c of this.countries) {
1876
1898
  if (c.areaCodes) {
1877
1899
  const rootIso2Code = this.dialCodeToIso2Map[c.dialCode][0];
1878
- for (let j = 0; j < c.areaCodes.length; j++) {
1879
- const areaCode = c.areaCodes[j];
1900
+ for (const areaCode of c.areaCodes) {
1880
1901
  for (let k = 1; k < areaCode.length; k++) {
1881
- const partialAreaCode = areaCode.substr(0, k);
1902
+ const partialAreaCode = areaCode.substring(0, k);
1882
1903
  const partialDialCode = c.dialCode + partialAreaCode;
1883
1904
  this._addToDialCodeMap(rootIso2Code, partialDialCode);
1884
1905
  this._addToDialCodeMap(c.iso2, partialDialCode);
@@ -1906,20 +1927,14 @@ var Iti = class {
1906
1927
  countrySearch,
1907
1928
  i18n
1908
1929
  } = this.options;
1909
- let parentClass = "iti";
1910
- if (allowDropdown) {
1911
- parentClass += " iti--allow-dropdown";
1912
- }
1913
- if (showFlags) {
1914
- parentClass += " iti--show-flags";
1915
- }
1916
- if (containerClass) {
1917
- parentClass += ` ${containerClass}`;
1918
- }
1919
- if (!useFullscreenPopup) {
1920
- parentClass += " iti--inline-dropdown";
1921
- }
1922
- const wrapper = createEl("div", { class: parentClass });
1930
+ const parentClasses = _Iti._buildClassNames({
1931
+ "iti": true,
1932
+ "iti--allow-dropdown": allowDropdown,
1933
+ "iti--show-flags": showFlags,
1934
+ "iti--inline-dropdown": !useFullscreenPopup,
1935
+ [containerClass]: Boolean(containerClass)
1936
+ });
1937
+ const wrapper = createEl("div", { class: parentClasses });
1923
1938
  this.telInput.parentNode?.insertBefore(wrapper, this.telInput);
1924
1939
  if (allowDropdown || showFlags || separateDialCode) {
1925
1940
  this.countryContainer = createEl(
@@ -1940,9 +1955,8 @@ var Iti = class {
1940
1955
  class: "iti__selected-country",
1941
1956
  "aria-expanded": "false",
1942
1957
  "aria-label": this.options.i18n.selectedCountryAriaLabel,
1943
- "aria-haspopup": "true",
1944
- "aria-controls": `iti-${this.id}__dropdown-content`,
1945
- "role": "combobox"
1958
+ "aria-haspopup": "dialog",
1959
+ "aria-controls": `iti-${this.id}__dropdown-content`
1946
1960
  },
1947
1961
  this.countryContainer
1948
1962
  );
@@ -1981,15 +1995,38 @@ var Iti = class {
1981
1995
  const extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
1982
1996
  this.dropdownContent = createEl("div", {
1983
1997
  id: `iti-${this.id}__dropdown-content`,
1984
- class: `iti__dropdown-content iti__hide ${extraClasses}`
1998
+ class: `iti__dropdown-content iti__hide ${extraClasses}`,
1999
+ role: "dialog",
2000
+ "aria-modal": "true"
1985
2001
  });
1986
2002
  if (countrySearch) {
2003
+ const searchWrapper = createEl(
2004
+ "div",
2005
+ { class: "iti__search-input-wrapper" },
2006
+ this.dropdownContent
2007
+ );
2008
+ this.searchIcon = createEl(
2009
+ "span",
2010
+ {
2011
+ class: "iti__search-icon",
2012
+ "aria-hidden": "true"
2013
+ },
2014
+ searchWrapper
2015
+ );
2016
+ this.searchIcon.innerHTML = `
2017
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
2018
+ <circle cx="11" cy="11" r="7" />
2019
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
2020
+ </svg>`;
1987
2021
  this.searchInput = createEl(
1988
2022
  "input",
1989
2023
  {
1990
- type: "text",
2024
+ id: `iti-${this.id}__search-input`,
2025
+ // Chrome says inputs need either a name or an id
2026
+ type: "search",
1991
2027
  class: "iti__search-input",
1992
2028
  placeholder: i18n.searchPlaceholder,
2029
+ // role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
1993
2030
  role: "combobox",
1994
2031
  "aria-expanded": "true",
1995
2032
  "aria-label": i18n.searchPlaceholder,
@@ -1997,13 +2034,42 @@ var Iti = class {
1997
2034
  "aria-autocomplete": "list",
1998
2035
  "autocomplete": "off"
1999
2036
  },
2000
- this.dropdownContent
2037
+ searchWrapper
2001
2038
  );
2039
+ this.searchClearButton = createEl(
2040
+ "button",
2041
+ {
2042
+ type: "button",
2043
+ class: "iti__search-clear iti__hide",
2044
+ "aria-label": i18n.clearSearchAriaLabel,
2045
+ tabindex: "-1"
2046
+ },
2047
+ searchWrapper
2048
+ );
2049
+ const maskId = `iti-${this.id}-clear-mask`;
2050
+ this.searchClearButton.innerHTML = `
2051
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
2052
+ <mask id="${maskId}" maskUnits="userSpaceOnUse">
2053
+ <rect width="16" height="16" fill="white" />
2054
+ <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
2055
+ </mask>
2056
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
2057
+ </svg>`;
2002
2058
  this.searchResultsA11yText = createEl(
2003
2059
  "span",
2004
2060
  { class: "iti__a11y-text" },
2005
2061
  this.dropdownContent
2006
2062
  );
2063
+ this.searchNoResults = createEl(
2064
+ "div",
2065
+ {
2066
+ class: "iti__no-results iti__hide",
2067
+ "aria-hidden": "true"
2068
+ // all a11y messaging happens in this.searchResultsA11yText
2069
+ },
2070
+ this.dropdownContent
2071
+ );
2072
+ this.searchNoResults.textContent = i18n.zeroSearchResults;
2007
2073
  }
2008
2074
  this.countryList = createEl(
2009
2075
  "ul",
@@ -2017,18 +2083,16 @@ var Iti = class {
2017
2083
  );
2018
2084
  this._appendListItems();
2019
2085
  if (countrySearch) {
2020
- this._updateSearchResultsText();
2086
+ this._updateSearchResultsA11yText();
2021
2087
  }
2022
2088
  if (dropdownContainer) {
2023
- let dropdownClasses = "iti iti--container";
2024
- if (containerClass) {
2025
- dropdownClasses += ` ${containerClass}`;
2026
- }
2027
- if (useFullscreenPopup) {
2028
- dropdownClasses += " iti--fullscreen-popup";
2029
- } else {
2030
- dropdownClasses += " iti--inline-dropdown";
2031
- }
2089
+ const dropdownClasses = _Iti._buildClassNames({
2090
+ "iti": true,
2091
+ "iti--container": true,
2092
+ "iti--fullscreen-popup": useFullscreenPopup,
2093
+ "iti--inline-dropdown": !useFullscreenPopup,
2094
+ [containerClass]: Boolean(containerClass)
2095
+ });
2032
2096
  this.dropdown = createEl("div", { class: dropdownClasses });
2033
2097
  this.dropdown.appendChild(this.dropdownContent);
2034
2098
  } else {
@@ -2313,7 +2377,7 @@ var Iti = class {
2313
2377
  //* Adhere to the input's maxlength attr.
2314
2378
  _cap(number) {
2315
2379
  const max = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2316
- return max && number.length > max ? number.substr(0, max) : number;
2380
+ return max && number.length > max ? number.substring(0, max) : number;
2317
2381
  }
2318
2382
  //* Trigger a custom event on the input.
2319
2383
  _trigger(name, detailProps = {}) {
@@ -2426,6 +2490,11 @@ var Iti = class {
2426
2490
  } else {
2427
2491
  this._filterCountries("", true);
2428
2492
  }
2493
+ if (this.searchInput.value) {
2494
+ this.searchClearButton.classList.remove("iti__hide");
2495
+ } else {
2496
+ this.searchClearButton.classList.add("iti__hide");
2497
+ }
2429
2498
  };
2430
2499
  let keyupTimer = null;
2431
2500
  this._handleSearchChange = () => {
@@ -2438,14 +2507,20 @@ var Iti = class {
2438
2507
  }, 100);
2439
2508
  };
2440
2509
  this.searchInput.addEventListener("input", this._handleSearchChange);
2510
+ this._handleSearchClear = (e) => {
2511
+ e.stopPropagation();
2512
+ this.searchInput.value = "";
2513
+ this.searchInput.focus();
2514
+ doFilter();
2515
+ };
2516
+ this.searchClearButton.addEventListener("click", this._handleSearchClear);
2441
2517
  this.searchInput.addEventListener("click", (e) => e.stopPropagation());
2442
2518
  }
2443
2519
  }
2444
2520
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
2445
2521
  _searchForCountry(query) {
2446
- for (let i = 0; i < this.countries.length; i++) {
2447
- const c = this.countries[i];
2448
- const startsWith = c.name.substr(0, query.length).toLowerCase() === query;
2522
+ for (const c of this.countries) {
2523
+ const startsWith = c.name.substring(0, query.length).toLowerCase() === query;
2449
2524
  if (startsWith) {
2450
2525
  const listItem = c.nodeById[this.id];
2451
2526
  this._highlightListItem(listItem, false);
@@ -2466,23 +2541,20 @@ var Iti = class {
2466
2541
  const dialCodeMatches = [];
2467
2542
  const dialCodeContains = [];
2468
2543
  const initialsMatches = [];
2469
- for (let i = 0; i < this.countries.length; i++) {
2470
- const c = this.countries[i];
2471
- const normalisedCountryName = normaliseString(c.name);
2472
- const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
2544
+ for (const c of this.countries) {
2473
2545
  if (isReset || queryLength === 0) {
2474
2546
  nameContains.push(c);
2475
- } else if (c.iso2.toLowerCase() === normalisedQuery) {
2547
+ } else if (c.iso2 === normalisedQuery) {
2476
2548
  iso2Matches.push(c);
2477
- } else if (normalisedCountryName.startsWith(normalisedQuery)) {
2549
+ } else if (c.normalisedName.startsWith(normalisedQuery)) {
2478
2550
  nameStartWith.push(c);
2479
- } else if (normalisedCountryName.includes(normalisedQuery)) {
2551
+ } else if (c.normalisedName.includes(normalisedQuery)) {
2480
2552
  nameContains.push(c);
2481
- } else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
2553
+ } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2482
2554
  dialCodeMatches.push(c);
2483
- } else if (`+${c.dialCode}`.includes(normalisedQuery)) {
2555
+ } else if (c.dialCodePlus.includes(normalisedQuery)) {
2484
2556
  dialCodeContains.push(c);
2485
- } else if (countryInitials.includes(normalisedQuery)) {
2557
+ } else if (c.initials.includes(normalisedQuery)) {
2486
2558
  initialsMatches.push(c);
2487
2559
  }
2488
2560
  }
@@ -2506,12 +2578,17 @@ var Iti = class {
2506
2578
  }
2507
2579
  if (noCountriesAddedYet) {
2508
2580
  this._highlightListItem(null, false);
2581
+ if (this.searchNoResults) {
2582
+ this.searchNoResults.classList.remove("iti__hide");
2583
+ }
2584
+ } else if (this.searchNoResults) {
2585
+ this.searchNoResults.classList.add("iti__hide");
2509
2586
  }
2510
2587
  this.countryList.scrollTop = 0;
2511
- this._updateSearchResultsText();
2588
+ this._updateSearchResultsA11yText();
2512
2589
  }
2513
2590
  //* Update search results text (for a11y).
2514
- _updateSearchResultsText() {
2591
+ _updateSearchResultsA11yText() {
2515
2592
  const { i18n } = this.options;
2516
2593
  const count = this.countryList.childElementCount;
2517
2594
  let searchText;
@@ -2602,9 +2679,9 @@ var Iti = class {
2602
2679
  const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
2603
2680
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2604
2681
  if (!isRegionlessNanpNumber && !alreadySelected) {
2605
- for (let j = 0; j < iso2Codes.length; j++) {
2606
- if (iso2Codes[j]) {
2607
- return iso2Codes[j];
2682
+ for (const iso2 of iso2Codes) {
2683
+ if (iso2) {
2684
+ return iso2;
2608
2685
  }
2609
2686
  }
2610
2687
  }
@@ -2626,9 +2703,8 @@ var Iti = class {
2626
2703
  if (this.highlightedItem) {
2627
2704
  this.highlightedItem.classList.add("iti__highlight");
2628
2705
  this.highlightedItem.setAttribute("aria-selected", "true");
2629
- const activeDescendant = this.highlightedItem.getAttribute("id") || "";
2630
- this.selectedCountry.setAttribute("aria-activedescendant", activeDescendant);
2631
2706
  if (this.options.countrySearch) {
2707
+ const activeDescendant = this.highlightedItem.getAttribute("id") || "";
2632
2708
  this.searchInput.setAttribute("aria-activedescendant", activeDescendant);
2633
2709
  }
2634
2710
  }
@@ -2637,12 +2713,11 @@ var Iti = class {
2637
2713
  }
2638
2714
  }
2639
2715
  //* Find the country data for the given iso2 code
2640
- //* the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
2716
+ //* the allowFail option is only used during init() for the initialCountry option, and for the iso2 returned from geoIpLookup - in these 2 cases we don't want to error out
2641
2717
  _getCountryData(iso2, allowFail) {
2642
- for (let i = 0; i < this.countries.length; i++) {
2643
- if (this.countries[i].iso2 === iso2) {
2644
- return this.countries[i];
2645
- }
2718
+ const country = this.countryByIso2.get(iso2);
2719
+ if (country) {
2720
+ return country;
2646
2721
  }
2647
2722
  if (allowFail) {
2648
2723
  return null;
@@ -2793,7 +2868,6 @@ var Iti = class {
2793
2868
  _closeDropdown() {
2794
2869
  this.dropdownContent.classList.add("iti__hide");
2795
2870
  this.selectedCountry.setAttribute("aria-expanded", "false");
2796
- this.selectedCountry.removeAttribute("aria-activedescendant");
2797
2871
  if (this.highlightedItem) {
2798
2872
  this.highlightedItem.setAttribute("aria-selected", "false");
2799
2873
  }
@@ -2801,9 +2875,9 @@ var Iti = class {
2801
2875
  this.searchInput.removeAttribute("aria-activedescendant");
2802
2876
  }
2803
2877
  this.dropdownArrow.classList.remove("iti__arrow--up");
2804
- document.removeEventListener("keydown", this._handleKeydownOnDropdown);
2805
2878
  if (this.options.countrySearch) {
2806
2879
  this.searchInput.removeEventListener("input", this._handleSearchChange);
2880
+ this.searchClearButton.removeEventListener("click", this._handleSearchClear);
2807
2881
  }
2808
2882
  document.documentElement.removeEventListener(
2809
2883
  "click",
@@ -2873,11 +2947,11 @@ var Iti = class {
2873
2947
  numericChars += c;
2874
2948
  if (includeAreaCode) {
2875
2949
  if (this.dialCodeToIso2Map[numericChars]) {
2876
- dialCode = number.substr(0, i + 1);
2950
+ dialCode = number.substring(0, i + 1);
2877
2951
  }
2878
2952
  } else {
2879
- if (this.dialCodes[numericChars]) {
2880
- dialCode = number.substr(0, i + 1);
2953
+ if (this.dialCodes.has(numericChars)) {
2954
+ dialCode = number.substring(0, i + 1);
2881
2955
  break;
2882
2956
  }
2883
2957
  }
@@ -2910,7 +2984,7 @@ var Iti = class {
2910
2984
  if (dialCode) {
2911
2985
  dialCode = `+${this.selectedCountryData.dialCode}`;
2912
2986
  const start = number[dialCode.length] === " " || number[dialCode.length] === "-" ? dialCode.length + 1 : dialCode.length;
2913
- number = number.substr(start);
2987
+ number = number.substring(start);
2914
2988
  }
2915
2989
  }
2916
2990
  return this._cap(number);
@@ -3044,38 +3118,32 @@ var Iti = class {
3044
3118
  }
3045
3119
  return -99;
3046
3120
  }
3047
- //* Validate the input val
3121
+ //* Validate the input val (with precise=false)
3048
3122
  isValidNumber() {
3049
- if (!this.selectedCountryData.iso2) {
3050
- return false;
3051
- }
3052
- const val = this._getFullNumber();
3053
- const alphaCharPosition = val.search(/\p{L}/u);
3054
- if (alphaCharPosition > -1) {
3055
- const beforeAlphaChar = val.substring(0, alphaCharPosition);
3056
- const beforeAlphaIsValid = this._utilsIsPossibleNumber(beforeAlphaChar);
3057
- const isValid = this._utilsIsPossibleNumber(val);
3058
- return beforeAlphaIsValid && isValid;
3059
- }
3060
- return this._utilsIsPossibleNumber(val);
3123
+ return this._validateNumber(false);
3124
+ }
3125
+ //* Validate the input val (with precise=true)
3126
+ isValidNumberPrecise() {
3127
+ return this._validateNumber(true);
3061
3128
  }
3062
3129
  _utilsIsPossibleNumber(val) {
3063
3130
  return intlTelInput.utils ? intlTelInput.utils.isPossibleNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
3064
3131
  }
3065
- //* Validate the input val (precise)
3066
- isValidNumberPrecise() {
3132
+ //* Shared internal validation logic to handle alpha character extension rules.
3133
+ _validateNumber(precise) {
3067
3134
  if (!this.selectedCountryData.iso2) {
3068
3135
  return false;
3069
3136
  }
3070
3137
  const val = this._getFullNumber();
3071
3138
  const alphaCharPosition = val.search(/\p{L}/u);
3139
+ const testValidity = (s) => precise ? this._utilsIsValidNumber(s) : this._utilsIsPossibleNumber(s);
3072
3140
  if (alphaCharPosition > -1) {
3073
3141
  const beforeAlphaChar = val.substring(0, alphaCharPosition);
3074
- const beforeAlphaIsValid = this._utilsIsValidNumber(beforeAlphaChar);
3075
- const isValid = this._utilsIsValidNumber(val);
3142
+ const beforeAlphaIsValid = testValidity(beforeAlphaChar);
3143
+ const isValid = testValidity(val);
3076
3144
  return beforeAlphaIsValid && isValid;
3077
3145
  }
3078
- return this._utilsIsValidNumber(val);
3146
+ return testValidity(val);
3079
3147
  }
3080
3148
  _utilsIsValidNumber(val) {
3081
3149
  return intlTelInput.utils ? intlTelInput.utils.isValidNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
@@ -3167,7 +3235,7 @@ var intlTelInput = Object.assign(
3167
3235
  attachUtils,
3168
3236
  startedLoadingUtilsScript: false,
3169
3237
  startedLoadingAutoCountry: false,
3170
- version: "25.5.2"
3238
+ version: "25.8.0"
3171
3239
  }
3172
3240
  );
3173
3241
  var intl_tel_input_default = intlTelInput;
@@ -4511,37 +4579,12 @@ var intl_tel_input_default = intlTelInput;
4511
4579
  ,
4512
4580
  [-1]
4513
4581
  ], [, , "242225\\d{4}", , , , "2422250123"], , , [, , , , , , , , , [-1]]],
4514
- BT: [
4515
- ,
4516
- [, , "[17]\\d{7}|[2-8]\\d{6}", , , , , , , [7, 8], [6]],
4517
- [, , "(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}", , , , "2345678", , , [7], [6]],
4518
- [, , "(?:1[67]|77)\\d{6}", , , , "17123456", , , [8]],
4519
- [, , , , , , , , , [-1]],
4520
- [, , , , , , , , , [-1]],
4521
- [, , , , , , , , , [-1]],
4522
- [, , , , , , , , , [-1]],
4523
- [, , , , , , , , , [-1]],
4524
- "BT",
4525
- 975,
4526
- "00",
4527
- ,
4582
+ BT: [, [, , "[178]\\d{7}|[2-8]\\d{6}", , , , , , , [7, 8], [6]], [, , "(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}", , , , "2345678", , , [7], [6]], [, , "(?:1[67]|[78]7)\\d{6}", , , , "17123456", , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "BT", 975, "00", , , , , , , , [[, "(\\d{3})(\\d{3})", "$1 $2", ["[2-7]"]], [, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], [
4528
4583
  ,
4529
- ,
4530
- ,
4531
- ,
4532
- ,
4533
- ,
4534
- [[, "(\\d{3})(\\d{3})", "$1 $2", ["[2-7]"]], [, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]],
4535
- [[, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]],
4536
- [, , , , , , , , , [-1]],
4537
- ,
4538
- ,
4539
- [, , , , , , , , , [-1]],
4540
- [, , , , , , , , , [-1]],
4541
- ,
4542
- ,
4543
- [, , , , , , , , , [-1]]
4544
- ],
4584
+ "(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
4585
+ "$1 $2 $3 $4",
4586
+ ["1[67]|[78]"]
4587
+ ]], [[, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
4545
4588
  BW: [, [, , "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", , , , , , , [7, 8, 10]], [, , "(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[013467]))\\d{4}", , , , "2401234", , , [7]], [
4546
4589
  ,
4547
4590
  ,
@@ -4553,7 +4596,7 @@ var intl_tel_input_default = intlTelInput;
4553
4596
  ,
4554
4597
  ,
4555
4598
  [8]
4556
- ], [, , "(?:0800|800\\d)\\d{6}", , , , "0800012345", , , [10]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}", , , , "79101234", , , [8]], "BW", 267, "00", , , , , , , , [[, "(\\d{2})(\\d{5})", "$1 $2", ["90"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], [, "(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [
4599
+ ], [, , "(?:0800|800\\d)\\d{6}", , , , "0800012345", , , [10]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}", , , , "79101234", , , [8]], "BW", 267, "00", , , , , , , , [[, "(\\d{2})(\\d{5})", "$1 $2", ["90"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], [, "(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [
4557
4600
  ,
4558
4601
  ,
4559
4602
  ,
@@ -4564,7 +4607,7 @@ var intl_tel_input_default = intlTelInput;
4564
4607
  ,
4565
4608
  ,
4566
4609
  [-1]
4567
- ]],
4610
+ ], , , [, , , , , , , , , [-1]]],
4568
4611
  BY: [, [, , "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", , , , , , , [6, 7, 8, 9, 10, 11], [5]], [, , "(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}", , , , "152450911", , , [9], [5, 6, 7]], [, , "(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}", , , , "294911911", , , [9]], [
4569
4612
  ,
4570
4613
  ,
@@ -4959,7 +5002,7 @@ var intl_tel_input_default = intlTelInput;
4959
5002
  ,
4960
5003
  [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
4961
5004
  [2, 3, 4]
4962
- ], [, , "15310\\d{6}|1(?:5[0-25-9]\\d|7[013-5])\\d{7}|1(?:6[023]|7[26-9])\\d{7,8}", , , , "15123456789", , , [10, 11]], [, , "800\\d{7,12}", , , , "8001234567890", , , [10, 11, 12, 13, 14, 15]], [, , "(?:137[7-9]|900(?:[135]|9\\d))\\d{6}", , , , "9001234567", , , [10, 11]], [, , "180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}", , , , "18012345", , , [7, 8, 9, 10, 11, 12, 13, 14]], [, , "700\\d{8}", , , , "70012345678", , , [11]], [, , , , , , , , , [-1]], "DE", 49, "00", "0", , , "0", , , , [
5005
+ ], [, , "1(?:(?:5(?:[0-25-9]\\d\\d|3(?:10|33))|7[26-9]\\d\\d)\\d{6}|6[023]\\d{7,8})|17\\d{8}", , , , "15123456789", , , [10, 11]], [, , "800\\d{7,12}", , , , "8001234567890", , , [10, 11, 12, 13, 14, 15]], [, , "(?:137[7-9]|900(?:[135]|9\\d))\\d{6}", , , , "9001234567", , , [10, 11]], [, , "180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}", , , , "18012345", , , [7, 8, 9, 10, 11, 12, 13, 14]], [, , "700\\d{8}", , , , "70012345678", , , [11]], [, , , , , , , , , [-1]], "DE", 49, "00", "0", , , "0", , , , [
4963
5006
  [
4964
5007
  ,
4965
5008
  "(\\d{2})(\\d{3,13})",
@@ -4985,7 +5028,7 @@ var intl_tel_input_default = intlTelInput;
4985
5028
  [, "(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"],
4986
5029
  [, "(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"],
4987
5030
  [, "(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"],
4988
- [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|31)"], "0$1"],
5031
+ [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"],
4989
5032
  [, "(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"],
4990
5033
  [, "(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"],
4991
5034
  [, "(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"],
@@ -5707,7 +5750,7 @@ var intl_tel_input_default = intlTelInput;
5707
5750
  ,
5708
5751
  ,
5709
5752
  "2201234"
5710
- ], [, , "(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[019]|70))\\d{4}", , , , "6091234"], [, , "(?:289|8(?:00|6[28]|88|99))\\d{4}", , , , "2891234"], [, , "9008\\d{3}", , , , "9008123"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "515\\d{4}", , , , "5151234"], "GY", 592, "001", , , , , , , , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5753
+ ], [, , "(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-39]|70))\\d{4}", , , , "6091234"], [, , "(?:289|8(?:00|6[28]|88|99))\\d{4}", , , , "2891234"], [, , "9008\\d{3}", , , , "9008123"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "515\\d{4}", , , , "5151234"], "GY", 592, "001", , , , , , , , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5711
5754
  HK: [, [, , "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", , , , , , , [5, 6, 7, 8, 9, 11]], [
5712
5755
  ,
5713
5756
  ,
@@ -5870,7 +5913,7 @@ var intl_tel_input_default = intlTelInput;
5870
5913
  10,
5871
5914
  11,
5872
5915
  12
5873
- ]], [, , "153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}", , , , "21234567", , , [8, 11, 12], [7]], [, , "55(?:4(?:[01]0|5[0-5])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}", , , , "502345678", , , [9]], [, , "1(?:255|80[019]\\d{3})\\d{3}", , , , "1800123456", , , [7, 10]], [, , "1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}", , , , "1919123456", , , [8, 10]], [, , "1700\\d{6}", , , , "1700123456", , , [10]], [, , , , , , , , , [-1]], [
5916
+ ]], [, , "153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}", , , , "21234567", , , [8, 11, 12], [7]], [, , "55(?:4(?:0[01]|10|5[0-7])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}", , , , "502345678", , , [9]], [, , "1(?:255|80[019]\\d{3})\\d{3}", , , , "1800123456", , , [7, 10]], [, , "1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}", , , , "1919123456", , , [8, 10]], [, , "1700\\d{6}", , , , "1700123456", , , [10]], [, , , , , , , , , [-1]], [
5874
5917
  ,
5875
5918
  ,
5876
5919
  "7(?:38(?:[05]\\d|8[018])|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",
@@ -7287,7 +7330,7 @@ var intl_tel_input_default = intlTelInput;
7287
7330
  ,
7288
7331
  [, , "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", , , , , , , [7, 8, 9]],
7289
7332
  [, , "2[1-6]\\d{6}", , , , "23123456", , , [8]],
7290
- [, , "1505\\d{4}|(?:7(?:[126-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}", , , , "92123456", , , [8]],
7333
+ [, , "1505\\d{4}|(?:7(?:[125-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}", , , , "92123456", , , [8]],
7291
7334
  [, , "8007\\d{4,5}|(?:500|800[05])\\d{4}", , , , "80071234"],
7292
7335
  [, , "900\\d{5}", , , , "90012345", , , [8]],
7293
7336
  [, , , , , , , , , [-1]],
@@ -7317,7 +7360,7 @@ var intl_tel_input_default = intlTelInput;
7317
7360
  PA: [, [, , "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", , , , , , , [7, 8, 10, 11]], [
7318
7361
  ,
7319
7362
  ,
7320
- "(?:1(?:0\\d|1[479]|2[37]|3[0137]|4[17]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[047-9]\\d|1[0-8]|2[0-5]|33|5[0-35]|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",
7363
+ "(?:1(?:0\\d|1[0479]|2[37]|3[0137]|4[17]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[047-9]\\d|1[0-8]|2[0-5]|33|5[0-35]|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",
7321
7364
  ,
7322
7365
  ,
7323
7366
  ,
@@ -7767,7 +7810,7 @@ var intl_tel_input_default = intlTelInput;
7767
7810
  ,
7768
7811
  ,
7769
7812
  [8]
7770
- ], [, , "89(?:7[0-689]|80)\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-6])|9[0-8]\\d)\\d{5}", , , , "81234567", , , [8]], [, , "(?:18|8)00\\d{7}", , , , "18001234567", , , [10, 11]], [, , "1900\\d{7}", , , , "19001234567", , , [11]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "(?:3[12]\\d|666)\\d{5}", , , , "31234567", , , [8]], "SG", 65, "0[0-3]\\d", , , , , , , , [[, "(\\d{4,5})", "$1", ["1[013-9]|77", "1(?:[013-8]|9(?:0[1-9]|[1-9]))|77"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], [, "(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], [
7813
+ ], [, , "8980\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}", , , , "81234567", , , [8]], [, , "(?:18|8)00\\d{7}", , , , "18001234567", , , [10, 11]], [, , "1900\\d{7}", , , , "19001234567", , , [11]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "(?:3[12]\\d|666)\\d{5}", , , , "31234567", , , [8]], "SG", 65, "0[0-3]\\d", , , , , , , , [[, "(\\d{4,5})", "$1", ["1[013-9]|77", "1(?:[013-8]|9(?:0[1-9]|[1-9]))|77"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], [, "(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], [
7771
7814
  ,
7772
7815
  "(\\d{4})(\\d{4})(\\d{3})",
7773
7816
  "$1 $2 $3",
@@ -7940,7 +7983,7 @@ var intl_tel_input_default = intlTelInput;
7940
7983
  "$1 $2",
7941
7984
  ["(?:2|90)4|[67]"]
7942
7985
  ], [, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], [, "(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|7[67]|9[2-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
7943
- SR: [, [, , "(?:[2-5]|68|[78]\\d|90)\\d{5}", , , , , , , [6, 7]], [, , "(?:2[1-3]|3[0-7]|(?:4|68)\\d|5[2-58])\\d{4}", , , , "211234"], [, , "(?:7[124-7]|8[1-9])\\d{5}", , , , "7412345", , , [7]], [, , "80\\d{5}", , , , "8012345", , , [7]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [
7986
+ SR: [, [, , "(?:[2-5]|[6-8]\\d|90)\\d{5}", , , , , , , [6, 7]], [, , "(?:2[1-3]|3[0-7]|4\\d|5[2-58])\\d{4}", , , , "211234", , , [6]], [, , "(?:6[08]|7[124-7]|8[1-9])\\d{5}", , , , "7412345", , , [7]], [, , "80\\d{5}", , , , "8012345", , , [7]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [
7944
7987
  ,
7945
7988
  ,
7946
7989
  "56\\d{4}",
@@ -7952,37 +7995,13 @@ var intl_tel_input_default = intlTelInput;
7952
7995
  ,
7953
7996
  [6]
7954
7997
  ], "SR", 597, "00", , , , , , , , [[, "(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], [, "(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], [, "(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
7955
- SS: [
7998
+ SS: [, [, , "[19]\\d{8}", , , , , , , [9]], [, , "1[89]\\d{7}", , , , "181234567"], [, , "(?:12|9[1257-9])\\d{7}", , , , "977123456"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "SS", 211, "00", "0", , , "0", , , , [[
7956
7999
  ,
7957
- [, , "[19]\\d{8}", , , , , , , [9]],
7958
- [, , "1[89]\\d{7}", , , , "181234567"],
7959
- [, , "(?:12|9[1257-9])\\d{7}", , , , "977123456"],
7960
- [, , , , , , , , , [-1]],
7961
- [, , , , , , , , , [-1]],
7962
- [, , , , , , , , , [-1]],
7963
- [, , , , , , , , , [-1]],
7964
- [, , , , , , , , , [-1]],
7965
- "SS",
7966
- 211,
7967
- "00",
7968
- "0",
7969
- ,
7970
- ,
7971
- "0",
7972
- ,
7973
- ,
7974
- ,
7975
- [[, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]],
7976
- ,
7977
- [, , , , , , , , , [-1]],
7978
- ,
7979
- ,
7980
- [, , , , , , , , , [-1]],
7981
- [, , , , , , , , , [-1]],
7982
- ,
7983
- ,
7984
- [, , , , , , , , , [-1]]
7985
- ],
8000
+ "(\\d{3})(\\d{3})(\\d{3})",
8001
+ "$1 $2 $3",
8002
+ ["[19]"],
8003
+ "0$1"
8004
+ ]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
7986
8005
  ST: [, [, , "(?:22|9\\d)\\d{5}", , , , , , , [7]], [, , "22\\d{5}", , , , "2221234"], [, , "900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}", , , , "9812345"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "ST", 239, "00", , , , , , , , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
7987
8006
  SV: [, [, , "[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", , , , , , , [7, 8, 11]], [
7988
8007
  ,
@@ -8395,35 +8414,62 @@ var intl_tel_input_default = intlTelInput;
8395
8414
  [, "(\\d{3})(\\d{4})", "$1-$2", ["[24-9]|3(?:[02-9]|1[1-9])"]],
8396
8415
  [, "(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], , , 1]
8397
8416
  ], [[, "(\\d{3})(\\d{4})", "$1-$2", ["310"], , , 1], [, "(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-9]"]]], [, , , , , , , , , [-1]], 1, , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8398
- UY: [, [, , "0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}", , , , , , , [6, 7, 8, 9, 10, 11, 12, 13]], [, , "(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}", , , , "21231234", , , [8], [7]], [, , "9[1-9]\\d{6}", , , , "94231234", , , [8]], [
8417
+ UY: [, [, , "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", , , , , , , [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]], [, , "(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}", , , , "21231234", , , [8], [7]], [
8399
8418
  ,
8400
8419
  ,
8401
- "0004\\d{2,9}|(?:405|80[05])\\d{4}",
8420
+ "9[1-9]\\d{6}",
8402
8421
  ,
8403
8422
  ,
8404
8423
  ,
8405
- "8001234"
8406
- ], [, , "90[0-8]\\d{4}", , , , "9001234", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "UY", 598, "0(?:0|1[3-9]\\d)", "0", " int. ", , "0", , "00", , [[, "(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], [, "(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], [, "(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [
8424
+ "94231234",
8407
8425
  ,
8408
8426
  ,
8427
+ [8]
8428
+ ], [, , "0004\\d{2,9}|(?:405|80[05])\\d{4}", , , , "8001234", , , [6, 7, 8, 9, 10, 11, 12, 13]], [, , "90[0-8]\\d{4}", , , , "9001234", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "UY", 598, "0(?:0|1[3-9]\\d)", "0", " int. ", , "0", , "00", , [[, "(\\d{4,5})", "$1", ["21"]], [, "(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], [, "(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], [, "(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], [
8409
8429
  ,
8430
+ "(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})",
8431
+ "$1 $2 $3 $4",
8432
+ ["0"]
8433
+ ]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "21\\d{2,3}", , , , "21123", , , [4, 5]], , , [, , , , , , , , , [-1]]],
8434
+ UZ: [
8410
8435
  ,
8436
+ [, , "(?:20|33|[5-9]\\d)\\d{7}", , , , , , , [9]],
8437
+ [, , "(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}", , , , "669050123"],
8438
+ [
8439
+ ,
8440
+ ,
8441
+ "(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}",
8442
+ ,
8443
+ ,
8444
+ ,
8445
+ "912345678"
8446
+ ],
8447
+ [, , , , , , , , , [-1]],
8448
+ [, , , , , , , , , [-1]],
8449
+ [, , , , , , , , , [-1]],
8450
+ [, , , , , , , , , [-1]],
8451
+ [, , , , , , , , , [-1]],
8452
+ "UZ",
8453
+ 998,
8454
+ "00",
8411
8455
  ,
8412
8456
  ,
8413
8457
  ,
8414
8458
  ,
8415
8459
  ,
8416
- [-1]
8417
- ]],
8418
- UZ: [, [, , "(?:20|33|[5-9]\\d)\\d{7}", , , , , , , [9]], [, , "(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}", , , , "669050123"], [
8419
8460
  ,
8420
8461
  ,
8421
- "(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}",
8462
+ [[, "(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]],
8422
8463
  ,
8464
+ [, , , , , , , , , [-1]],
8465
+ ,
8466
+ ,
8467
+ [, , , , , , , , , [-1]],
8468
+ [, , , , , , , , , [-1]],
8423
8469
  ,
8424
8470
  ,
8425
- "912345678"
8426
- ], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "UZ", 998, "00", , , , , , , , [[, "(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8471
+ [, , , , , , , , , [-1]]
8472
+ ],
8427
8473
  VA: [, [, , "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", , , , , , , [6, 7, 8, 9, 10, 11, 12]], [, , "06698\\d{1,6}", , , , "0669812345", , , [6, 7, 8, 9, 10, 11]], [, , "3[1-9]\\d{8}|3[2-9]\\d{7}", , , , "3123456789", , , [9, 10]], [
8428
8474
  ,
8429
8475
  ,
@@ -9431,7 +9477,9 @@ var intl_tel_input_default = intlTelInput;
9431
9477
  }
9432
9478
  ;
9433
9479
  const yb = (a) => {
9434
- a.includes("FIXED_LINE_OR_MOBILE") ? (a.includes("MOBILE") || a.push("MOBILE"), a.includes("FIXED_LINE") || a.push("FIXED_LINE")) : (a.includes("MOBILE") || a.includes("FIXED_LINE")) && a.push("FIXED_LINE_OR_MOBILE");
9480
+ const b = [];
9481
+ a.includes("FIXED_LINE_OR_MOBILE") ? (a.includes("MOBILE") || b.push("MOBILE"), a.includes("FIXED_LINE") || b.push("FIXED_LINE")) : (a.includes("MOBILE") || a.includes("FIXED_LINE")) && b.push("FIXED_LINE_OR_MOBILE");
9482
+ return a.concat(b);
9435
9483
  }, zb = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
9436
9484
  m("intlTelInputUtilsTemp", {});
9437
9485
  m("intlTelInputUtilsTemp.formatNumberAsYouType", (a, b) => {
@@ -9504,8 +9552,7 @@ var intl_tel_input_default = intlTelInput;
9504
9552
  try {
9505
9553
  const d = K.g(), e = Y(d, a, b), f = cb(d, e);
9506
9554
  if (c) {
9507
- yb(c);
9508
- const g = c.map((h) => zb[h]);
9555
+ const g = yb(c).map((h) => zb[h]);
9509
9556
  return f && g.includes($a(d, e));
9510
9557
  }
9511
9558
  return f;
@@ -9517,8 +9564,8 @@ var intl_tel_input_default = intlTelInput;
9517
9564
  try {
9518
9565
  const d = K.g(), e = Y(d, a, b);
9519
9566
  if (c) {
9520
- yb(c);
9521
- for (let f of c) if (0 === X(d, e, zb[f])) return true;
9567
+ const f = yb(c);
9568
+ for (let g of f) if (0 === X(d, e, zb[g])) return true;
9522
9569
  return false;
9523
9570
  }
9524
9571
  return 0 === X(d, e, -1);