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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.5.2
2
+ * International Telephone Input v25.8.0
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1364,18 +1364,18 @@ var factoryOutput = (() => {
1364
1364
  ]
1365
1365
  ];
1366
1366
  var allCountries = [];
1367
- for (let i = 0; i < rawCountryData.length; i++) {
1368
- const c = rawCountryData[i];
1369
- allCountries[i] = {
1367
+ for (const c of rawCountryData) {
1368
+ allCountries.push({
1370
1369
  name: "",
1371
- // this is now populated in the plugin
1370
+ // populated in the plugin
1372
1371
  iso2: c[0],
1373
1372
  dialCode: c[1],
1374
1373
  priority: c[2] || 0,
1375
1374
  areaCodes: c[3] || null,
1376
1375
  nodeById: {},
1376
+ // populated by the plugin
1377
1377
  nationalPrefix: c[4] || null
1378
- };
1378
+ });
1379
1379
  }
1380
1380
  var data_default = allCountries;
1381
1381
 
@@ -1632,6 +1632,7 @@ var factoryOutput = (() => {
1632
1632
  noCountrySelected: "No country selected",
1633
1633
  countryListAriaLabel: "List of countries",
1634
1634
  searchPlaceholder: "Search",
1635
+ clearSearchAriaLabel: "Clear search",
1635
1636
  zeroSearchResults: "No results found",
1636
1637
  oneSearchResult: "1 result found",
1637
1638
  multipleSearchResults: "${count} results found",
@@ -1646,10 +1647,23 @@ var factoryOutput = (() => {
1646
1647
  var en_default = allTranslations;
1647
1648
 
1648
1649
  // src/js/intl-tel-input.ts
1649
- for (let i = 0; i < data_default.length; i++) {
1650
- data_default[i].name = en_default[data_default[i].iso2];
1650
+ for (const c of data_default) {
1651
+ c.name = en_default[c.iso2];
1651
1652
  }
1652
1653
  var id = 0;
1654
+ var mq = (q) => {
1655
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
1656
+ };
1657
+ var computeDefaultUseFullscreenPopup = () => {
1658
+ if (typeof navigator !== "undefined" && typeof window !== "undefined") {
1659
+ const isMobileUserAgent = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1660
+ const isNarrowViewport = mq("(max-width: 500px)");
1661
+ const isShortViewport = mq("(max-height: 600px)");
1662
+ const isCoarsePointer = mq("(pointer: coarse)");
1663
+ return isMobileUserAgent || isNarrowViewport || isCoarsePointer && isShortViewport;
1664
+ }
1665
+ return false;
1666
+ };
1653
1667
  var defaults = {
1654
1668
  //* Whether or not to allow the dropdown.
1655
1669
  allowDropdown: true,
@@ -1696,13 +1710,7 @@ var factoryOutput = (() => {
1696
1710
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
1697
1711
  strictMode: false,
1698
1712
  //* Use full screen popup instead of dropdown for country list.
1699
- useFullscreenPopup: typeof navigator !== "undefined" && typeof window !== "undefined" ? (
1700
- //* We cannot just test screen size as some smartphones/website meta tags will report desktop resolutions.
1701
- //* Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
1702
- /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
1703
- navigator.userAgent
1704
- ) || window.innerWidth <= 500
1705
- ) : false,
1713
+ useFullscreenPopup: computeDefaultUseFullscreenPopup(),
1706
1714
  //* The number type to enforce during validation.
1707
1715
  validationNumberTypes: ["MOBILE"]
1708
1716
  };
@@ -1730,7 +1738,7 @@ var factoryOutput = (() => {
1730
1738
  var isRegionlessNanp = (number) => {
1731
1739
  const numeric = getNumeric(number);
1732
1740
  if (numeric.charAt(0) === "1") {
1733
- const areaCode = numeric.substr(1, 3);
1741
+ const areaCode = numeric.substring(1, 4);
1734
1742
  return regionlessNanpNumbers.includes(areaCode);
1735
1743
  }
1736
1744
  return false;
@@ -1753,8 +1761,8 @@ var factoryOutput = (() => {
1753
1761
  }
1754
1762
  return formattedValue.length;
1755
1763
  };
1756
- var createEl = (name, attrs, container) => {
1757
- const el = document.createElement(name);
1764
+ var createEl = (tagName, attrs, container) => {
1765
+ const el = document.createElement(tagName);
1758
1766
  if (attrs) {
1759
1767
  Object.entries(attrs).forEach(([key, value]) => el.setAttribute(key, value));
1760
1768
  }
@@ -1767,7 +1775,14 @@ var factoryOutput = (() => {
1767
1775
  const { instances } = intlTelInput;
1768
1776
  Object.values(instances).forEach((instance) => instance[method](...args));
1769
1777
  };
1770
- var Iti = class {
1778
+ var Iti = class _Iti {
1779
+ /**
1780
+ * Build a space-delimited class string from an object map of className -> truthy/falsey.
1781
+ * Only keys with truthy values are included.
1782
+ */
1783
+ static _buildClassNames(flags) {
1784
+ return Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
1785
+ }
1771
1786
  constructor(input, customOptions = {}) {
1772
1787
  this.id = id++;
1773
1788
  this.telInput = input;
@@ -1830,6 +1845,16 @@ var factoryOutput = (() => {
1830
1845
  this._processDialCodes();
1831
1846
  this._translateCountryNames();
1832
1847
  this._sortCountries();
1848
+ this.countryByIso2 = new Map(this.countries.map((c) => [c.iso2, c]));
1849
+ this._cacheSearchTokens();
1850
+ }
1851
+ //* Precompute and cache country search tokens to speed up filtering
1852
+ _cacheSearchTokens() {
1853
+ for (const c of this.countries) {
1854
+ c.normalisedName = normaliseString(c.name);
1855
+ c.initials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
1856
+ c.dialCodePlus = `+${c.dialCode}`;
1857
+ }
1833
1858
  }
1834
1859
  //* Sort countries by countryOrder option (if present), then name.
1835
1860
  _sortCountries() {
@@ -1861,13 +1886,12 @@ var factoryOutput = (() => {
1861
1886
  if (!this.dialCodeToIso2Map.hasOwnProperty(dialCode)) {
1862
1887
  this.dialCodeToIso2Map[dialCode] = [];
1863
1888
  }
1864
- for (let i = 0; i < this.dialCodeToIso2Map[dialCode].length; i++) {
1865
- if (this.dialCodeToIso2Map[dialCode][i] === iso2) {
1866
- return;
1867
- }
1889
+ const iso2List = this.dialCodeToIso2Map[dialCode];
1890
+ if (iso2List.includes(iso2)) {
1891
+ return;
1868
1892
  }
1869
- const index = priority !== void 0 ? priority : this.dialCodeToIso2Map[dialCode].length;
1870
- this.dialCodeToIso2Map[dialCode][index] = iso2;
1893
+ const index = priority !== void 0 ? priority : iso2List.length;
1894
+ iso2List[index] = iso2;
1871
1895
  }
1872
1896
  //* Process onlyCountries or excludeCountries array if present.
1873
1897
  _processAllCountries() {
@@ -1892,33 +1916,30 @@ var factoryOutput = (() => {
1892
1916
  }
1893
1917
  //* Translate Countries by object literal provided on config.
1894
1918
  _translateCountryNames() {
1895
- for (let i = 0; i < this.countries.length; i++) {
1896
- const iso2 = this.countries[i].iso2.toLowerCase();
1919
+ for (const c of this.countries) {
1920
+ const iso2 = c.iso2.toLowerCase();
1897
1921
  if (this.options.i18n.hasOwnProperty(iso2)) {
1898
- this.countries[i].name = this.options.i18n[iso2];
1922
+ c.name = this.options.i18n[iso2];
1899
1923
  }
1900
1924
  }
1901
1925
  }
1902
1926
  //* Generate this.dialCodes and this.dialCodeToIso2Map.
1903
1927
  _processDialCodes() {
1904
- this.dialCodes = {};
1928
+ this.dialCodes = /* @__PURE__ */ new Set();
1905
1929
  this.dialCodeMaxLen = 0;
1906
1930
  this.dialCodeToIso2Map = {};
1907
- for (let i = 0; i < this.countries.length; i++) {
1908
- const c = this.countries[i];
1909
- if (!this.dialCodes[c.dialCode]) {
1910
- this.dialCodes[c.dialCode] = true;
1931
+ for (const c of this.countries) {
1932
+ if (!this.dialCodes.has(c.dialCode)) {
1933
+ this.dialCodes.add(c.dialCode);
1911
1934
  }
1912
1935
  this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);
1913
1936
  }
1914
- for (let i = 0; i < this.countries.length; i++) {
1915
- const c = this.countries[i];
1937
+ for (const c of this.countries) {
1916
1938
  if (c.areaCodes) {
1917
1939
  const rootIso2Code = this.dialCodeToIso2Map[c.dialCode][0];
1918
- for (let j = 0; j < c.areaCodes.length; j++) {
1919
- const areaCode = c.areaCodes[j];
1940
+ for (const areaCode of c.areaCodes) {
1920
1941
  for (let k = 1; k < areaCode.length; k++) {
1921
- const partialAreaCode = areaCode.substr(0, k);
1942
+ const partialAreaCode = areaCode.substring(0, k);
1922
1943
  const partialDialCode = c.dialCode + partialAreaCode;
1923
1944
  this._addToDialCodeMap(rootIso2Code, partialDialCode);
1924
1945
  this._addToDialCodeMap(c.iso2, partialDialCode);
@@ -1946,20 +1967,14 @@ var factoryOutput = (() => {
1946
1967
  countrySearch,
1947
1968
  i18n
1948
1969
  } = this.options;
1949
- let parentClass = "iti";
1950
- if (allowDropdown) {
1951
- parentClass += " iti--allow-dropdown";
1952
- }
1953
- if (showFlags) {
1954
- parentClass += " iti--show-flags";
1955
- }
1956
- if (containerClass) {
1957
- parentClass += ` ${containerClass}`;
1958
- }
1959
- if (!useFullscreenPopup) {
1960
- parentClass += " iti--inline-dropdown";
1961
- }
1962
- const wrapper = createEl("div", { class: parentClass });
1970
+ const parentClasses = _Iti._buildClassNames({
1971
+ "iti": true,
1972
+ "iti--allow-dropdown": allowDropdown,
1973
+ "iti--show-flags": showFlags,
1974
+ "iti--inline-dropdown": !useFullscreenPopup,
1975
+ [containerClass]: Boolean(containerClass)
1976
+ });
1977
+ const wrapper = createEl("div", { class: parentClasses });
1963
1978
  this.telInput.parentNode?.insertBefore(wrapper, this.telInput);
1964
1979
  if (allowDropdown || showFlags || separateDialCode) {
1965
1980
  this.countryContainer = createEl(
@@ -1980,9 +1995,8 @@ var factoryOutput = (() => {
1980
1995
  class: "iti__selected-country",
1981
1996
  "aria-expanded": "false",
1982
1997
  "aria-label": this.options.i18n.selectedCountryAriaLabel,
1983
- "aria-haspopup": "true",
1984
- "aria-controls": `iti-${this.id}__dropdown-content`,
1985
- "role": "combobox"
1998
+ "aria-haspopup": "dialog",
1999
+ "aria-controls": `iti-${this.id}__dropdown-content`
1986
2000
  },
1987
2001
  this.countryContainer
1988
2002
  );
@@ -2021,15 +2035,38 @@ var factoryOutput = (() => {
2021
2035
  const extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
2022
2036
  this.dropdownContent = createEl("div", {
2023
2037
  id: `iti-${this.id}__dropdown-content`,
2024
- class: `iti__dropdown-content iti__hide ${extraClasses}`
2038
+ class: `iti__dropdown-content iti__hide ${extraClasses}`,
2039
+ role: "dialog",
2040
+ "aria-modal": "true"
2025
2041
  });
2026
2042
  if (countrySearch) {
2043
+ const searchWrapper = createEl(
2044
+ "div",
2045
+ { class: "iti__search-input-wrapper" },
2046
+ this.dropdownContent
2047
+ );
2048
+ this.searchIcon = createEl(
2049
+ "span",
2050
+ {
2051
+ class: "iti__search-icon",
2052
+ "aria-hidden": "true"
2053
+ },
2054
+ searchWrapper
2055
+ );
2056
+ this.searchIcon.innerHTML = `
2057
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
2058
+ <circle cx="11" cy="11" r="7" />
2059
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
2060
+ </svg>`;
2027
2061
  this.searchInput = createEl(
2028
2062
  "input",
2029
2063
  {
2030
- type: "text",
2064
+ id: `iti-${this.id}__search-input`,
2065
+ // Chrome says inputs need either a name or an id
2066
+ type: "search",
2031
2067
  class: "iti__search-input",
2032
2068
  placeholder: i18n.searchPlaceholder,
2069
+ // 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
2033
2070
  role: "combobox",
2034
2071
  "aria-expanded": "true",
2035
2072
  "aria-label": i18n.searchPlaceholder,
@@ -2037,13 +2074,42 @@ var factoryOutput = (() => {
2037
2074
  "aria-autocomplete": "list",
2038
2075
  "autocomplete": "off"
2039
2076
  },
2040
- this.dropdownContent
2077
+ searchWrapper
2041
2078
  );
2079
+ this.searchClearButton = createEl(
2080
+ "button",
2081
+ {
2082
+ type: "button",
2083
+ class: "iti__search-clear iti__hide",
2084
+ "aria-label": i18n.clearSearchAriaLabel,
2085
+ tabindex: "-1"
2086
+ },
2087
+ searchWrapper
2088
+ );
2089
+ const maskId = `iti-${this.id}-clear-mask`;
2090
+ this.searchClearButton.innerHTML = `
2091
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
2092
+ <mask id="${maskId}" maskUnits="userSpaceOnUse">
2093
+ <rect width="16" height="16" fill="white" />
2094
+ <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" />
2095
+ </mask>
2096
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
2097
+ </svg>`;
2042
2098
  this.searchResultsA11yText = createEl(
2043
2099
  "span",
2044
2100
  { class: "iti__a11y-text" },
2045
2101
  this.dropdownContent
2046
2102
  );
2103
+ this.searchNoResults = createEl(
2104
+ "div",
2105
+ {
2106
+ class: "iti__no-results iti__hide",
2107
+ "aria-hidden": "true"
2108
+ // all a11y messaging happens in this.searchResultsA11yText
2109
+ },
2110
+ this.dropdownContent
2111
+ );
2112
+ this.searchNoResults.textContent = i18n.zeroSearchResults;
2047
2113
  }
2048
2114
  this.countryList = createEl(
2049
2115
  "ul",
@@ -2057,18 +2123,16 @@ var factoryOutput = (() => {
2057
2123
  );
2058
2124
  this._appendListItems();
2059
2125
  if (countrySearch) {
2060
- this._updateSearchResultsText();
2126
+ this._updateSearchResultsA11yText();
2061
2127
  }
2062
2128
  if (dropdownContainer) {
2063
- let dropdownClasses = "iti iti--container";
2064
- if (containerClass) {
2065
- dropdownClasses += ` ${containerClass}`;
2066
- }
2067
- if (useFullscreenPopup) {
2068
- dropdownClasses += " iti--fullscreen-popup";
2069
- } else {
2070
- dropdownClasses += " iti--inline-dropdown";
2071
- }
2129
+ const dropdownClasses = _Iti._buildClassNames({
2130
+ "iti": true,
2131
+ "iti--container": true,
2132
+ "iti--fullscreen-popup": useFullscreenPopup,
2133
+ "iti--inline-dropdown": !useFullscreenPopup,
2134
+ [containerClass]: Boolean(containerClass)
2135
+ });
2072
2136
  this.dropdown = createEl("div", { class: dropdownClasses });
2073
2137
  this.dropdown.appendChild(this.dropdownContent);
2074
2138
  } else {
@@ -2353,7 +2417,7 @@ var factoryOutput = (() => {
2353
2417
  //* Adhere to the input's maxlength attr.
2354
2418
  _cap(number) {
2355
2419
  const max = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2356
- return max && number.length > max ? number.substr(0, max) : number;
2420
+ return max && number.length > max ? number.substring(0, max) : number;
2357
2421
  }
2358
2422
  //* Trigger a custom event on the input.
2359
2423
  _trigger(name, detailProps = {}) {
@@ -2466,6 +2530,11 @@ var factoryOutput = (() => {
2466
2530
  } else {
2467
2531
  this._filterCountries("", true);
2468
2532
  }
2533
+ if (this.searchInput.value) {
2534
+ this.searchClearButton.classList.remove("iti__hide");
2535
+ } else {
2536
+ this.searchClearButton.classList.add("iti__hide");
2537
+ }
2469
2538
  };
2470
2539
  let keyupTimer = null;
2471
2540
  this._handleSearchChange = () => {
@@ -2478,14 +2547,20 @@ var factoryOutput = (() => {
2478
2547
  }, 100);
2479
2548
  };
2480
2549
  this.searchInput.addEventListener("input", this._handleSearchChange);
2550
+ this._handleSearchClear = (e) => {
2551
+ e.stopPropagation();
2552
+ this.searchInput.value = "";
2553
+ this.searchInput.focus();
2554
+ doFilter();
2555
+ };
2556
+ this.searchClearButton.addEventListener("click", this._handleSearchClear);
2481
2557
  this.searchInput.addEventListener("click", (e) => e.stopPropagation());
2482
2558
  }
2483
2559
  }
2484
2560
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
2485
2561
  _searchForCountry(query) {
2486
- for (let i = 0; i < this.countries.length; i++) {
2487
- const c = this.countries[i];
2488
- const startsWith = c.name.substr(0, query.length).toLowerCase() === query;
2562
+ for (const c of this.countries) {
2563
+ const startsWith = c.name.substring(0, query.length).toLowerCase() === query;
2489
2564
  if (startsWith) {
2490
2565
  const listItem = c.nodeById[this.id];
2491
2566
  this._highlightListItem(listItem, false);
@@ -2506,23 +2581,20 @@ var factoryOutput = (() => {
2506
2581
  const dialCodeMatches = [];
2507
2582
  const dialCodeContains = [];
2508
2583
  const initialsMatches = [];
2509
- for (let i = 0; i < this.countries.length; i++) {
2510
- const c = this.countries[i];
2511
- const normalisedCountryName = normaliseString(c.name);
2512
- const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
2584
+ for (const c of this.countries) {
2513
2585
  if (isReset || queryLength === 0) {
2514
2586
  nameContains.push(c);
2515
- } else if (c.iso2.toLowerCase() === normalisedQuery) {
2587
+ } else if (c.iso2 === normalisedQuery) {
2516
2588
  iso2Matches.push(c);
2517
- } else if (normalisedCountryName.startsWith(normalisedQuery)) {
2589
+ } else if (c.normalisedName.startsWith(normalisedQuery)) {
2518
2590
  nameStartWith.push(c);
2519
- } else if (normalisedCountryName.includes(normalisedQuery)) {
2591
+ } else if (c.normalisedName.includes(normalisedQuery)) {
2520
2592
  nameContains.push(c);
2521
- } else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
2593
+ } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2522
2594
  dialCodeMatches.push(c);
2523
- } else if (`+${c.dialCode}`.includes(normalisedQuery)) {
2595
+ } else if (c.dialCodePlus.includes(normalisedQuery)) {
2524
2596
  dialCodeContains.push(c);
2525
- } else if (countryInitials.includes(normalisedQuery)) {
2597
+ } else if (c.initials.includes(normalisedQuery)) {
2526
2598
  initialsMatches.push(c);
2527
2599
  }
2528
2600
  }
@@ -2546,12 +2618,17 @@ var factoryOutput = (() => {
2546
2618
  }
2547
2619
  if (noCountriesAddedYet) {
2548
2620
  this._highlightListItem(null, false);
2621
+ if (this.searchNoResults) {
2622
+ this.searchNoResults.classList.remove("iti__hide");
2623
+ }
2624
+ } else if (this.searchNoResults) {
2625
+ this.searchNoResults.classList.add("iti__hide");
2549
2626
  }
2550
2627
  this.countryList.scrollTop = 0;
2551
- this._updateSearchResultsText();
2628
+ this._updateSearchResultsA11yText();
2552
2629
  }
2553
2630
  //* Update search results text (for a11y).
2554
- _updateSearchResultsText() {
2631
+ _updateSearchResultsA11yText() {
2555
2632
  const { i18n } = this.options;
2556
2633
  const count = this.countryList.childElementCount;
2557
2634
  let searchText;
@@ -2642,9 +2719,9 @@ var factoryOutput = (() => {
2642
2719
  const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
2643
2720
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2644
2721
  if (!isRegionlessNanpNumber && !alreadySelected) {
2645
- for (let j = 0; j < iso2Codes.length; j++) {
2646
- if (iso2Codes[j]) {
2647
- return iso2Codes[j];
2722
+ for (const iso2 of iso2Codes) {
2723
+ if (iso2) {
2724
+ return iso2;
2648
2725
  }
2649
2726
  }
2650
2727
  }
@@ -2666,9 +2743,8 @@ var factoryOutput = (() => {
2666
2743
  if (this.highlightedItem) {
2667
2744
  this.highlightedItem.classList.add("iti__highlight");
2668
2745
  this.highlightedItem.setAttribute("aria-selected", "true");
2669
- const activeDescendant = this.highlightedItem.getAttribute("id") || "";
2670
- this.selectedCountry.setAttribute("aria-activedescendant", activeDescendant);
2671
2746
  if (this.options.countrySearch) {
2747
+ const activeDescendant = this.highlightedItem.getAttribute("id") || "";
2672
2748
  this.searchInput.setAttribute("aria-activedescendant", activeDescendant);
2673
2749
  }
2674
2750
  }
@@ -2677,12 +2753,11 @@ var factoryOutput = (() => {
2677
2753
  }
2678
2754
  }
2679
2755
  //* Find the country data for the given iso2 code
2680
- //* the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
2756
+ //* 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
2681
2757
  _getCountryData(iso2, allowFail) {
2682
- for (let i = 0; i < this.countries.length; i++) {
2683
- if (this.countries[i].iso2 === iso2) {
2684
- return this.countries[i];
2685
- }
2758
+ const country = this.countryByIso2.get(iso2);
2759
+ if (country) {
2760
+ return country;
2686
2761
  }
2687
2762
  if (allowFail) {
2688
2763
  return null;
@@ -2833,7 +2908,6 @@ var factoryOutput = (() => {
2833
2908
  _closeDropdown() {
2834
2909
  this.dropdownContent.classList.add("iti__hide");
2835
2910
  this.selectedCountry.setAttribute("aria-expanded", "false");
2836
- this.selectedCountry.removeAttribute("aria-activedescendant");
2837
2911
  if (this.highlightedItem) {
2838
2912
  this.highlightedItem.setAttribute("aria-selected", "false");
2839
2913
  }
@@ -2841,9 +2915,9 @@ var factoryOutput = (() => {
2841
2915
  this.searchInput.removeAttribute("aria-activedescendant");
2842
2916
  }
2843
2917
  this.dropdownArrow.classList.remove("iti__arrow--up");
2844
- document.removeEventListener("keydown", this._handleKeydownOnDropdown);
2845
2918
  if (this.options.countrySearch) {
2846
2919
  this.searchInput.removeEventListener("input", this._handleSearchChange);
2920
+ this.searchClearButton.removeEventListener("click", this._handleSearchClear);
2847
2921
  }
2848
2922
  document.documentElement.removeEventListener(
2849
2923
  "click",
@@ -2913,11 +2987,11 @@ var factoryOutput = (() => {
2913
2987
  numericChars += c;
2914
2988
  if (includeAreaCode) {
2915
2989
  if (this.dialCodeToIso2Map[numericChars]) {
2916
- dialCode = number.substr(0, i + 1);
2990
+ dialCode = number.substring(0, i + 1);
2917
2991
  }
2918
2992
  } else {
2919
- if (this.dialCodes[numericChars]) {
2920
- dialCode = number.substr(0, i + 1);
2993
+ if (this.dialCodes.has(numericChars)) {
2994
+ dialCode = number.substring(0, i + 1);
2921
2995
  break;
2922
2996
  }
2923
2997
  }
@@ -2950,7 +3024,7 @@ var factoryOutput = (() => {
2950
3024
  if (dialCode) {
2951
3025
  dialCode = `+${this.selectedCountryData.dialCode}`;
2952
3026
  const start = number[dialCode.length] === " " || number[dialCode.length] === "-" ? dialCode.length + 1 : dialCode.length;
2953
- number = number.substr(start);
3027
+ number = number.substring(start);
2954
3028
  }
2955
3029
  }
2956
3030
  return this._cap(number);
@@ -3084,38 +3158,32 @@ var factoryOutput = (() => {
3084
3158
  }
3085
3159
  return -99;
3086
3160
  }
3087
- //* Validate the input val
3161
+ //* Validate the input val (with precise=false)
3088
3162
  isValidNumber() {
3089
- if (!this.selectedCountryData.iso2) {
3090
- return false;
3091
- }
3092
- const val = this._getFullNumber();
3093
- const alphaCharPosition = val.search(/\p{L}/u);
3094
- if (alphaCharPosition > -1) {
3095
- const beforeAlphaChar = val.substring(0, alphaCharPosition);
3096
- const beforeAlphaIsValid = this._utilsIsPossibleNumber(beforeAlphaChar);
3097
- const isValid = this._utilsIsPossibleNumber(val);
3098
- return beforeAlphaIsValid && isValid;
3099
- }
3100
- return this._utilsIsPossibleNumber(val);
3163
+ return this._validateNumber(false);
3164
+ }
3165
+ //* Validate the input val (with precise=true)
3166
+ isValidNumberPrecise() {
3167
+ return this._validateNumber(true);
3101
3168
  }
3102
3169
  _utilsIsPossibleNumber(val) {
3103
3170
  return intlTelInput.utils ? intlTelInput.utils.isPossibleNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
3104
3171
  }
3105
- //* Validate the input val (precise)
3106
- isValidNumberPrecise() {
3172
+ //* Shared internal validation logic to handle alpha character extension rules.
3173
+ _validateNumber(precise) {
3107
3174
  if (!this.selectedCountryData.iso2) {
3108
3175
  return false;
3109
3176
  }
3110
3177
  const val = this._getFullNumber();
3111
3178
  const alphaCharPosition = val.search(/\p{L}/u);
3179
+ const testValidity = (s) => precise ? this._utilsIsValidNumber(s) : this._utilsIsPossibleNumber(s);
3112
3180
  if (alphaCharPosition > -1) {
3113
3181
  const beforeAlphaChar = val.substring(0, alphaCharPosition);
3114
- const beforeAlphaIsValid = this._utilsIsValidNumber(beforeAlphaChar);
3115
- const isValid = this._utilsIsValidNumber(val);
3182
+ const beforeAlphaIsValid = testValidity(beforeAlphaChar);
3183
+ const isValid = testValidity(val);
3116
3184
  return beforeAlphaIsValid && isValid;
3117
3185
  }
3118
- return this._utilsIsValidNumber(val);
3186
+ return testValidity(val);
3119
3187
  }
3120
3188
  _utilsIsValidNumber(val) {
3121
3189
  return intlTelInput.utils ? intlTelInput.utils.isValidNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
@@ -3207,7 +3275,7 @@ var factoryOutput = (() => {
3207
3275
  attachUtils,
3208
3276
  startedLoadingUtilsScript: false,
3209
3277
  startedLoadingAutoCountry: false,
3210
- version: "25.5.2"
3278
+ version: "25.8.0"
3211
3279
  }
3212
3280
  );
3213
3281
  var intl_tel_input_default = intlTelInput;
@@ -4551,37 +4619,12 @@ var factoryOutput = (() => {
4551
4619
  ,
4552
4620
  [-1]
4553
4621
  ], [, , "242225\\d{4}", , , , "2422250123"], , , [, , , , , , , , , [-1]]],
4554
- BT: [
4555
- ,
4556
- [, , "[17]\\d{7}|[2-8]\\d{6}", , , , , , , [7, 8], [6]],
4557
- [, , "(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}", , , , "2345678", , , [7], [6]],
4558
- [, , "(?:1[67]|77)\\d{6}", , , , "17123456", , , [8]],
4559
- [, , , , , , , , , [-1]],
4560
- [, , , , , , , , , [-1]],
4561
- [, , , , , , , , , [-1]],
4562
- [, , , , , , , , , [-1]],
4563
- [, , , , , , , , , [-1]],
4564
- "BT",
4565
- 975,
4566
- "00",
4567
- ,
4622
+ 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]"]], [
4568
4623
  ,
4569
- ,
4570
- ,
4571
- ,
4572
- ,
4573
- ,
4574
- [[, "(\\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"]]],
4575
- [[, "(\\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"]]],
4576
- [, , , , , , , , , [-1]],
4577
- ,
4578
- ,
4579
- [, , , , , , , , , [-1]],
4580
- [, , , , , , , , , [-1]],
4581
- ,
4582
- ,
4583
- [, , , , , , , , , [-1]]
4584
- ],
4624
+ "(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
4625
+ "$1 $2 $3 $4",
4626
+ ["1[67]|[78]"]
4627
+ ]], [[, "(\\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]]],
4585
4628
  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]], [
4586
4629
  ,
4587
4630
  ,
@@ -4593,7 +4636,7 @@ var factoryOutput = (() => {
4593
4636
  ,
4594
4637
  ,
4595
4638
  [8]
4596
- ], [, , "(?: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]], , , [
4639
+ ], [, , "(?: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]], [
4597
4640
  ,
4598
4641
  ,
4599
4642
  ,
@@ -4604,7 +4647,7 @@ var factoryOutput = (() => {
4604
4647
  ,
4605
4648
  ,
4606
4649
  [-1]
4607
- ]],
4650
+ ], , , [, , , , , , , , , [-1]]],
4608
4651
  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]], [
4609
4652
  ,
4610
4653
  ,
@@ -4999,7 +5042,7 @@ var factoryOutput = (() => {
4999
5042
  ,
5000
5043
  [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
5001
5044
  [2, 3, 4]
5002
- ], [, , "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", , , , [
5045
+ ], [, , "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", , , , [
5003
5046
  [
5004
5047
  ,
5005
5048
  "(\\d{2})(\\d{3,13})",
@@ -5025,7 +5068,7 @@ var factoryOutput = (() => {
5025
5068
  [, "(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"],
5026
5069
  [, "(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"],
5027
5070
  [, "(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"],
5028
- [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|31)"], "0$1"],
5071
+ [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"],
5029
5072
  [, "(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"],
5030
5073
  [, "(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"],
5031
5074
  [, "(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"],
@@ -5747,7 +5790,7 @@ var factoryOutput = (() => {
5747
5790
  ,
5748
5791
  ,
5749
5792
  "2201234"
5750
- ], [, , "(?: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]]],
5793
+ ], [, , "(?: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]]],
5751
5794
  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]], [
5752
5795
  ,
5753
5796
  ,
@@ -5910,7 +5953,7 @@ var factoryOutput = (() => {
5910
5953
  10,
5911
5954
  11,
5912
5955
  12
5913
- ]], [, , "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]], [
5956
+ ]], [, , "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]], [
5914
5957
  ,
5915
5958
  ,
5916
5959
  "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}",
@@ -7327,7 +7370,7 @@ var factoryOutput = (() => {
7327
7370
  ,
7328
7371
  [, , "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", , , , , , , [7, 8, 9]],
7329
7372
  [, , "2[1-6]\\d{6}", , , , "23123456", , , [8]],
7330
- [, , "1505\\d{4}|(?:7(?:[126-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}", , , , "92123456", , , [8]],
7373
+ [, , "1505\\d{4}|(?:7(?:[125-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}", , , , "92123456", , , [8]],
7331
7374
  [, , "8007\\d{4,5}|(?:500|800[05])\\d{4}", , , , "80071234"],
7332
7375
  [, , "900\\d{5}", , , , "90012345", , , [8]],
7333
7376
  [, , , , , , , , , [-1]],
@@ -7357,7 +7400,7 @@ var factoryOutput = (() => {
7357
7400
  PA: [, [, , "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", , , , , , , [7, 8, 10, 11]], [
7358
7401
  ,
7359
7402
  ,
7360
- "(?: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}",
7403
+ "(?: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}",
7361
7404
  ,
7362
7405
  ,
7363
7406
  ,
@@ -7807,7 +7850,7 @@ var factoryOutput = (() => {
7807
7850
  ,
7808
7851
  ,
7809
7852
  [8]
7810
- ], [, , "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"]], [
7853
+ ], [, , "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"]], [
7811
7854
  ,
7812
7855
  "(\\d{4})(\\d{4})(\\d{3})",
7813
7856
  "$1 $2 $3",
@@ -7980,7 +8023,7 @@ var factoryOutput = (() => {
7980
8023
  "$1 $2",
7981
8024
  ["(?:2|90)4|[67]"]
7982
8025
  ], [, "(\\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]]],
7983
- 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]], [
8026
+ 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]], [
7984
8027
  ,
7985
8028
  ,
7986
8029
  "56\\d{4}",
@@ -7992,37 +8035,13 @@ var factoryOutput = (() => {
7992
8035
  ,
7993
8036
  [6]
7994
8037
  ], "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]]],
7995
- SS: [
8038
+ 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", , , , [[
7996
8039
  ,
7997
- [, , "[19]\\d{8}", , , , , , , [9]],
7998
- [, , "1[89]\\d{7}", , , , "181234567"],
7999
- [, , "(?:12|9[1257-9])\\d{7}", , , , "977123456"],
8000
- [, , , , , , , , , [-1]],
8001
- [, , , , , , , , , [-1]],
8002
- [, , , , , , , , , [-1]],
8003
- [, , , , , , , , , [-1]],
8004
- [, , , , , , , , , [-1]],
8005
- "SS",
8006
- 211,
8007
- "00",
8008
- "0",
8009
- ,
8010
- ,
8011
- "0",
8012
- ,
8013
- ,
8014
- ,
8015
- [[, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]],
8016
- ,
8017
- [, , , , , , , , , [-1]],
8018
- ,
8019
- ,
8020
- [, , , , , , , , , [-1]],
8021
- [, , , , , , , , , [-1]],
8022
- ,
8023
- ,
8024
- [, , , , , , , , , [-1]]
8025
- ],
8040
+ "(\\d{3})(\\d{3})(\\d{3})",
8041
+ "$1 $2 $3",
8042
+ ["[19]"],
8043
+ "0$1"
8044
+ ]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8026
8045
  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]]],
8027
8046
  SV: [, [, , "[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", , , , , , , [7, 8, 11]], [
8028
8047
  ,
@@ -8435,35 +8454,62 @@ var factoryOutput = (() => {
8435
8454
  [, "(\\d{3})(\\d{4})", "$1-$2", ["[24-9]|3(?:[02-9]|1[1-9])"]],
8436
8455
  [, "(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], , , 1]
8437
8456
  ], [[, "(\\d{3})(\\d{4})", "$1-$2", ["310"], , , 1], [, "(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-9]"]]], [, , , , , , , , , [-1]], 1, , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8438
- 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]], [
8457
+ 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]], [
8439
8458
  ,
8440
8459
  ,
8441
- "0004\\d{2,9}|(?:405|80[05])\\d{4}",
8460
+ "9[1-9]\\d{6}",
8442
8461
  ,
8443
8462
  ,
8444
8463
  ,
8445
- "8001234"
8446
- ], [, , "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]], , , [
8464
+ "94231234",
8447
8465
  ,
8448
8466
  ,
8467
+ [8]
8468
+ ], [, , "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"]], [
8449
8469
  ,
8470
+ "(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})",
8471
+ "$1 $2 $3 $4",
8472
+ ["0"]
8473
+ ]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "21\\d{2,3}", , , , "21123", , , [4, 5]], , , [, , , , , , , , , [-1]]],
8474
+ UZ: [
8450
8475
  ,
8476
+ [, , "(?:20|33|[5-9]\\d)\\d{7}", , , , , , , [9]],
8477
+ [, , "(?: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"],
8478
+ [
8479
+ ,
8480
+ ,
8481
+ "(?:(?:[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}",
8482
+ ,
8483
+ ,
8484
+ ,
8485
+ "912345678"
8486
+ ],
8487
+ [, , , , , , , , , [-1]],
8488
+ [, , , , , , , , , [-1]],
8489
+ [, , , , , , , , , [-1]],
8490
+ [, , , , , , , , , [-1]],
8491
+ [, , , , , , , , , [-1]],
8492
+ "UZ",
8493
+ 998,
8494
+ "00",
8451
8495
  ,
8452
8496
  ,
8453
8497
  ,
8454
8498
  ,
8455
8499
  ,
8456
- [-1]
8457
- ]],
8458
- 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"], [
8459
8500
  ,
8460
8501
  ,
8461
- "(?:(?:[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}",
8502
+ [[, "(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]],
8462
8503
  ,
8504
+ [, , , , , , , , , [-1]],
8505
+ ,
8506
+ ,
8507
+ [, , , , , , , , , [-1]],
8508
+ [, , , , , , , , , [-1]],
8463
8509
  ,
8464
8510
  ,
8465
- "912345678"
8466
- ], [, , , , , , , , , [-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]]],
8511
+ [, , , , , , , , , [-1]]
8512
+ ],
8467
8513
  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]], [
8468
8514
  ,
8469
8515
  ,
@@ -9471,7 +9517,9 @@ var factoryOutput = (() => {
9471
9517
  }
9472
9518
  ;
9473
9519
  const yb = (a) => {
9474
- 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");
9520
+ const b = [];
9521
+ 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");
9522
+ return a.concat(b);
9475
9523
  }, 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 };
9476
9524
  m("intlTelInputUtilsTemp", {});
9477
9525
  m("intlTelInputUtilsTemp.formatNumberAsYouType", (a, b) => {
@@ -9544,8 +9592,7 @@ var factoryOutput = (() => {
9544
9592
  try {
9545
9593
  const d = K.g(), e = Y(d, a, b), f = cb(d, e);
9546
9594
  if (c) {
9547
- yb(c);
9548
- const g = c.map((h) => zb[h]);
9595
+ const g = yb(c).map((h) => zb[h]);
9549
9596
  return f && g.includes($a(d, e));
9550
9597
  }
9551
9598
  return f;
@@ -9557,8 +9604,8 @@ var factoryOutput = (() => {
9557
9604
  try {
9558
9605
  const d = K.g(), e = Y(d, a, b);
9559
9606
  if (c) {
9560
- yb(c);
9561
- for (let f of c) if (0 === X(d, e, zb[f])) return true;
9607
+ const f = yb(c);
9608
+ for (let g of f) if (0 === X(d, e, zb[g])) return true;
9562
9609
  return false;
9563
9610
  }
9564
9611
  return 0 === X(d, e, -1);