intl-tel-input 25.13.1 → 25.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +27 -11
- package/angular/build/IntlTelInputWithUtils.js +27 -11
- package/angular/build/types/modules/core/ui.d.ts +3 -1
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +3 -1
- package/build/js/intlTelInput.js +30 -12
- package/build/js/intlTelInput.min.js +3 -3
- package/build/js/intlTelInputWithUtils.js +30 -12
- package/build/js/intlTelInputWithUtils.min.js +3 -3
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +29 -11
- package/react/build/IntlTelInput.d.ts +3 -1
- package/react/build/IntlTelInput.js +29 -11
- package/react/build/IntlTelInputWithUtils.cjs +29 -11
- package/react/build/IntlTelInputWithUtils.js +29 -11
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +125 -118
- package/vue/build/IntlTelInputWithUtils.mjs +130 -123
|
@@ -1950,7 +1950,7 @@ const $2 = {
|
|
|
1950
1950
|
// additional countries (not supported by country-list library)
|
|
1951
1951
|
ac: "Ascension Island",
|
|
1952
1952
|
xk: "Kosovo"
|
|
1953
|
-
},
|
|
1953
|
+
}, L0 = { ...$2, ...n2 }, _1 = {
|
|
1954
1954
|
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
1955
1955
|
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
1956
1956
|
COUNTRY_CHANGE: "countrychange",
|
|
@@ -1995,7 +1995,7 @@ const $2 = {
|
|
|
1995
1995
|
// px width fallback when no separate dial code
|
|
1996
1996
|
INPUT_PADDING_EXTRA_LEFT: 6
|
|
1997
1997
|
// px gap between selected country container and input text
|
|
1998
|
-
},
|
|
1998
|
+
}, b0 = {
|
|
1999
1999
|
NANP: "1"
|
|
2000
2000
|
// North American Numbering Plan
|
|
2001
2001
|
}, v1 = {
|
|
@@ -2033,7 +2033,7 @@ const $2 = {
|
|
|
2033
2033
|
return h || e || i && $;
|
|
2034
2034
|
}
|
|
2035
2035
|
return !1;
|
|
2036
|
-
},
|
|
2036
|
+
}, T0 = {
|
|
2037
2037
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
2038
2038
|
allowPhonewords: !1,
|
|
2039
2039
|
//* Whether or not to allow the dropdown.
|
|
@@ -2090,7 +2090,7 @@ const $2 = {
|
|
|
2090
2090
|
const $ = A0(e), i = [], s = [], a = [], u = [], f = [], C = [];
|
|
2091
2091
|
for (const _ of h)
|
|
2092
2092
|
_.iso2 === $ ? i.push(_) : _.normalisedName.startsWith($) ? s.push(_) : _.normalisedName.includes($) ? a.push(_) : $ === _.dialCode || $ === _.dialCodePlus ? u.push(_) : _.dialCodePlus.includes($) ? f.push(_) : _.initials.includes($) && C.push(_);
|
|
2093
|
-
const y = (_,
|
|
2093
|
+
const y = (_, E) => _.priority - E.priority;
|
|
2094
2094
|
return [
|
|
2095
2095
|
...i.sort(y),
|
|
2096
2096
|
...s.sort(y),
|
|
@@ -2105,7 +2105,7 @@ const $2 = {
|
|
|
2105
2105
|
if (i.name.toLowerCase().startsWith($))
|
|
2106
2106
|
return i;
|
|
2107
2107
|
return null;
|
|
2108
|
-
}, R1 = (h) => Object.keys(h).filter((e) => !!h[e]).join(" "),
|
|
2108
|
+
}, R1 = (h) => Object.keys(h).filter((e) => !!h[e]).join(" "), T = (h, e, $) => {
|
|
2109
2109
|
const i = document.createElement(h);
|
|
2110
2110
|
return e && Object.entries(e).forEach(
|
|
2111
2111
|
([s, a]) => i.setAttribute(s, a)
|
|
@@ -2127,7 +2127,7 @@ const $2 = {
|
|
|
2127
2127
|
};
|
|
2128
2128
|
class h2 {
|
|
2129
2129
|
constructor(e, $, i) {
|
|
2130
|
-
this.highlightedItem = null, e.dataset.intlTelInputId = i.toString(), this.telInput = e, this.options = $, this.id = i, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
|
|
2130
|
+
this.highlightedItem = null, this.selectedItem = null, e.dataset.intlTelInputId = i.toString(), this.telInput = e, this.options = $, this.id = i, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
|
|
2131
2131
|
}
|
|
2132
2132
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
2133
2133
|
generateMarkup(e) {
|
|
@@ -2146,18 +2146,18 @@ class h2 {
|
|
|
2146
2146
|
"iti--show-flags": $,
|
|
2147
2147
|
"iti--inline-dropdown": !s,
|
|
2148
2148
|
[i]: !!i
|
|
2149
|
-
}), u =
|
|
2149
|
+
}), u = T("div", { class: a });
|
|
2150
2150
|
return this.isRTL && u.setAttribute("dir", "ltr"), this.telInput.before(u), u;
|
|
2151
2151
|
}
|
|
2152
2152
|
_maybeBuildCountryContainer(e) {
|
|
2153
2153
|
const { allowDropdown: $, separateDialCode: i, showFlags: s } = this.options;
|
|
2154
2154
|
if ($ || s || i) {
|
|
2155
|
-
this.countryContainer =
|
|
2155
|
+
this.countryContainer = T(
|
|
2156
2156
|
"div",
|
|
2157
2157
|
// visibly hidden until we measure it's width to set the input padding correctly
|
|
2158
2158
|
{ class: `iti__country-container ${N.V_HIDE}` },
|
|
2159
2159
|
e
|
|
2160
|
-
), $ ? (this.selectedCountry =
|
|
2160
|
+
), $ ? (this.selectedCountry = T(
|
|
2161
2161
|
"button",
|
|
2162
2162
|
{
|
|
2163
2163
|
type: "button",
|
|
@@ -2168,25 +2168,25 @@ class h2 {
|
|
|
2168
2168
|
[b.CONTROLS]: `iti-${this.id}__dropdown-content`
|
|
2169
2169
|
},
|
|
2170
2170
|
this.countryContainer
|
|
2171
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
2171
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = T(
|
|
2172
2172
|
"div",
|
|
2173
2173
|
{ class: "iti__selected-country" },
|
|
2174
2174
|
this.countryContainer
|
|
2175
2175
|
);
|
|
2176
|
-
const a =
|
|
2176
|
+
const a = T(
|
|
2177
2177
|
"div",
|
|
2178
2178
|
{ class: "iti__selected-country-primary" },
|
|
2179
2179
|
this.selectedCountry
|
|
2180
2180
|
);
|
|
2181
|
-
this.selectedCountryInner =
|
|
2181
|
+
this.selectedCountryInner = T(
|
|
2182
2182
|
"div",
|
|
2183
2183
|
{ class: N.FLAG },
|
|
2184
2184
|
a
|
|
2185
|
-
), $ && (this.dropdownArrow =
|
|
2185
|
+
), $ && (this.dropdownArrow = T(
|
|
2186
2186
|
"div",
|
|
2187
2187
|
{ class: "iti__arrow", [b.HIDDEN]: "true" },
|
|
2188
2188
|
a
|
|
2189
|
-
)), i && (this.selectedDialCode =
|
|
2189
|
+
)), i && (this.selectedDialCode = T(
|
|
2190
2190
|
"div",
|
|
2191
2191
|
{ class: "iti__selected-dial-code" },
|
|
2192
2192
|
this.selectedCountry
|
|
@@ -2202,12 +2202,12 @@ class h2 {
|
|
|
2202
2202
|
dropdownContainer: a,
|
|
2203
2203
|
containerClass: u
|
|
2204
2204
|
} = this.options, f = e ? "" : "iti--flexible-dropdown-width";
|
|
2205
|
-
if (this.dropdownContent =
|
|
2205
|
+
if (this.dropdownContent = T("div", {
|
|
2206
2206
|
id: `iti-${this.id}__dropdown-content`,
|
|
2207
2207
|
class: `iti__dropdown-content ${N.HIDE} ${f}`,
|
|
2208
2208
|
role: "dialog",
|
|
2209
2209
|
[b.MODAL]: "true"
|
|
2210
|
-
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList =
|
|
2210
|
+
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList = T(
|
|
2211
2211
|
"ul",
|
|
2212
2212
|
{
|
|
2213
2213
|
class: "iti__country-list",
|
|
@@ -2224,24 +2224,24 @@ class h2 {
|
|
|
2224
2224
|
"iti--inline-dropdown": !$,
|
|
2225
2225
|
[u]: !!u
|
|
2226
2226
|
});
|
|
2227
|
-
this.dropdown =
|
|
2227
|
+
this.dropdown = T("div", { class: C }), this.dropdown.appendChild(this.dropdownContent);
|
|
2228
2228
|
} else
|
|
2229
2229
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
2230
2230
|
}
|
|
2231
2231
|
_buildSearchUI() {
|
|
2232
|
-
const { i18n: e } = this.options, $ =
|
|
2232
|
+
const { i18n: e } = this.options, $ = T(
|
|
2233
2233
|
"div",
|
|
2234
2234
|
{ class: "iti__search-input-wrapper" },
|
|
2235
2235
|
this.dropdownContent
|
|
2236
2236
|
);
|
|
2237
|
-
this.searchIcon =
|
|
2237
|
+
this.searchIcon = T(
|
|
2238
2238
|
"span",
|
|
2239
2239
|
{
|
|
2240
2240
|
class: "iti__search-icon",
|
|
2241
2241
|
[b.HIDDEN]: "true"
|
|
2242
2242
|
},
|
|
2243
2243
|
$
|
|
2244
|
-
), this.searchIcon.innerHTML = a2(), this.searchInput =
|
|
2244
|
+
), this.searchIcon.innerHTML = a2(), this.searchInput = T(
|
|
2245
2245
|
"input",
|
|
2246
2246
|
{
|
|
2247
2247
|
id: `iti-${this.id}__search-input`,
|
|
@@ -2258,7 +2258,7 @@ class h2 {
|
|
|
2258
2258
|
autocomplete: "off"
|
|
2259
2259
|
},
|
|
2260
2260
|
$
|
|
2261
|
-
), this.searchClearButton =
|
|
2261
|
+
), this.searchClearButton = T(
|
|
2262
2262
|
"button",
|
|
2263
2263
|
{
|
|
2264
2264
|
type: "button",
|
|
@@ -2267,11 +2267,11 @@ class h2 {
|
|
|
2267
2267
|
tabindex: "-1"
|
|
2268
2268
|
},
|
|
2269
2269
|
$
|
|
2270
|
-
), this.searchClearButton.innerHTML = c2(this.id), this.searchResultsA11yText =
|
|
2270
|
+
), this.searchClearButton.innerHTML = c2(this.id), this.searchResultsA11yText = T(
|
|
2271
2271
|
"span",
|
|
2272
2272
|
{ class: "iti__a11y-text" },
|
|
2273
2273
|
this.dropdownContent
|
|
2274
|
-
), this.searchNoResults =
|
|
2274
|
+
), this.searchNoResults = T(
|
|
2275
2275
|
"div",
|
|
2276
2276
|
{
|
|
2277
2277
|
class: `iti__no-results ${N.HIDE}`,
|
|
@@ -2293,7 +2293,7 @@ class h2 {
|
|
|
2293
2293
|
const f = (i = this.telInput.form) == null ? void 0 : i.querySelector(
|
|
2294
2294
|
`input[name="${u.phone}"]`
|
|
2295
2295
|
);
|
|
2296
|
-
f ? this.hiddenInput = f : (this.hiddenInput =
|
|
2296
|
+
f ? this.hiddenInput = f : (this.hiddenInput = T("input", {
|
|
2297
2297
|
type: "hidden",
|
|
2298
2298
|
name: u.phone
|
|
2299
2299
|
}), e.appendChild(this.hiddenInput));
|
|
@@ -2302,7 +2302,7 @@ class h2 {
|
|
|
2302
2302
|
const f = (s = this.telInput.form) == null ? void 0 : s.querySelector(
|
|
2303
2303
|
`input[name="${u.country}"]`
|
|
2304
2304
|
);
|
|
2305
|
-
f ? this.hiddenInputCountry = f : (this.hiddenInputCountry =
|
|
2305
|
+
f ? this.hiddenInputCountry = f : (this.hiddenInputCountry = T("input", {
|
|
2306
2306
|
type: "hidden",
|
|
2307
2307
|
name: u.country
|
|
2308
2308
|
}), e.appendChild(this.hiddenInputCountry));
|
|
@@ -2314,19 +2314,18 @@ class h2 {
|
|
|
2314
2314
|
const e = document.createDocumentFragment();
|
|
2315
2315
|
for (let $ = 0; $ < this.countries.length; $++) {
|
|
2316
2316
|
const i = this.countries[$], s = R1({
|
|
2317
|
-
[N.COUNTRY_ITEM]: !0
|
|
2318
|
-
|
|
2319
|
-
}), a = L("li", {
|
|
2317
|
+
[N.COUNTRY_ITEM]: !0
|
|
2318
|
+
}), a = T("li", {
|
|
2320
2319
|
id: `iti-${this.id}__item-${i.iso2}`,
|
|
2321
2320
|
class: s,
|
|
2322
2321
|
tabindex: "-1",
|
|
2323
2322
|
role: "option",
|
|
2324
2323
|
[b.SELECTED]: "false"
|
|
2325
2324
|
});
|
|
2326
|
-
a.dataset.dialCode = i.dialCode, a.dataset.countryCode = i.iso2, i.nodeById[this.id] = a, this.options.showFlags &&
|
|
2327
|
-
const u =
|
|
2325
|
+
a.dataset.dialCode = i.dialCode, a.dataset.countryCode = i.iso2, i.nodeById[this.id] = a, this.options.showFlags && T("div", { class: `${N.FLAG} iti__${i.iso2}` }, a);
|
|
2326
|
+
const u = T("span", { class: "iti__country-name" }, a);
|
|
2328
2327
|
u.textContent = i.name;
|
|
2329
|
-
const f =
|
|
2328
|
+
const f = T("span", { class: "iti__dial-code" }, a);
|
|
2330
2329
|
this.isRTL && f.setAttribute("dir", "ltr"), f.textContent = `+${i.dialCode}`, e.appendChild(a);
|
|
2331
2330
|
}
|
|
2332
2331
|
this.countryList.appendChild(e);
|
|
@@ -2380,19 +2379,27 @@ class h2 {
|
|
|
2380
2379
|
if (C < a)
|
|
2381
2380
|
$.scrollTop = _;
|
|
2382
2381
|
else if (y > u) {
|
|
2383
|
-
const
|
|
2384
|
-
$.scrollTop = _ -
|
|
2382
|
+
const E = s - f;
|
|
2383
|
+
$.scrollTop = _ - E;
|
|
2385
2384
|
}
|
|
2386
2385
|
}
|
|
2387
|
-
//* Remove highlighting from
|
|
2386
|
+
//* Remove highlighting from the previous list item and highlight the new one.
|
|
2388
2387
|
highlightListItem(e, $) {
|
|
2389
2388
|
const i = this.highlightedItem;
|
|
2390
|
-
if (i &&
|
|
2389
|
+
if (i && i.classList.remove(N.HIGHLIGHT), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add(N.HIGHLIGHT), this.options.countrySearch)) {
|
|
2391
2390
|
const s = this.highlightedItem.getAttribute("id") || "";
|
|
2392
2391
|
this.searchInput.setAttribute(b.ACTIVE_DESCENDANT, s);
|
|
2393
2392
|
}
|
|
2394
2393
|
$ && this.highlightedItem.focus();
|
|
2395
2394
|
}
|
|
2395
|
+
updateSelectedItem(e) {
|
|
2396
|
+
if (this.selectedItem && this.selectedItem.dataset.countryCode !== e && (this.selectedItem.setAttribute(b.SELECTED, "false"), this.selectedItem = null), e && !this.selectedItem) {
|
|
2397
|
+
const $ = this.countryList.querySelector(
|
|
2398
|
+
`[data-country-code="${e}"]`
|
|
2399
|
+
);
|
|
2400
|
+
$ && ($.setAttribute(b.SELECTED, "true"), this.selectedItem = $);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2396
2403
|
//* Country search: Filter the country list to the given array of countries.
|
|
2397
2404
|
filterCountries(e) {
|
|
2398
2405
|
this.countryList.innerHTML = "";
|
|
@@ -2406,7 +2413,7 @@ class h2 {
|
|
|
2406
2413
|
destroy() {
|
|
2407
2414
|
this.telInput.iti = void 0, delete this.telInput.dataset.intlTelInputId, this.options.separateDialCode && (this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
2408
2415
|
const e = this.telInput.parentNode;
|
|
2409
|
-
e.before(this.telInput), e.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null;
|
|
2416
|
+
e.before(this.telInput), e.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null, this.selectedItem = null;
|
|
2410
2417
|
for (const $ of this.countries)
|
|
2411
2418
|
delete $.nodeById[this.id];
|
|
2412
2419
|
this.countries = null;
|
|
@@ -2455,8 +2462,8 @@ const f2 = (h) => {
|
|
|
2455
2462
|
const f = i[u.dialCode][0];
|
|
2456
2463
|
for (const C of u.areaCodes) {
|
|
2457
2464
|
for (let y = 1; y < C.length; y++) {
|
|
2458
|
-
const _ = C.substring(0, y),
|
|
2459
|
-
s(f,
|
|
2465
|
+
const _ = C.substring(0, y), E = u.dialCode + _;
|
|
2466
|
+
s(f, E), s(u.iso2, E);
|
|
2460
2467
|
}
|
|
2461
2468
|
s(u.iso2, u.dialCode + C);
|
|
2462
2469
|
}
|
|
@@ -2520,19 +2527,19 @@ const f2 = (h) => {
|
|
|
2520
2527
|
"889"
|
|
2521
2528
|
], S0 = (h) => {
|
|
2522
2529
|
const e = N1(h);
|
|
2523
|
-
if (e.startsWith(
|
|
2530
|
+
if (e.startsWith(b0.NANP) && e.length >= 4) {
|
|
2524
2531
|
const $ = e.substring(1, 4);
|
|
2525
2532
|
return N2.includes($);
|
|
2526
2533
|
}
|
|
2527
2534
|
return !1;
|
|
2528
2535
|
};
|
|
2529
2536
|
for (const h of t1)
|
|
2530
|
-
h.name =
|
|
2537
|
+
h.name = L0[h.iso2];
|
|
2531
2538
|
let E2 = 0;
|
|
2532
2539
|
const S2 = new Set(t1.map((h) => h.iso2)), O1 = (h) => S2.has(h);
|
|
2533
2540
|
class B1 {
|
|
2534
2541
|
constructor(e, $ = {}) {
|
|
2535
|
-
this.id = E2++, this.options = { ...
|
|
2542
|
+
this.id = E2++, this.options = { ...T0, ...$ }, o2(this.options, L0), this.ui = new h2(e, this.options, this.id), this.isAndroid = B1._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = f2(this.options);
|
|
2536
2543
|
const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: a } = C2(
|
|
2537
2544
|
this.countries
|
|
2538
2545
|
);
|
|
@@ -2589,10 +2596,10 @@ class B1 {
|
|
|
2589
2596
|
//* 1. Extracting a dial code from the given number
|
|
2590
2597
|
//* 2. Using explicit initialCountry
|
|
2591
2598
|
_setInitialState(e = !1) {
|
|
2592
|
-
const $ = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals($), s = this._getTelInputValue(), u = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, f = this._getDialCode(u), C = S0(u), { initialCountry: y, geoIpLookup: _ } = this.options,
|
|
2599
|
+
const $ = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals($), s = this._getTelInputValue(), u = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, f = this._getDialCode(u), C = S0(u), { initialCountry: y, geoIpLookup: _ } = this.options, E = y === P1.AUTO && _;
|
|
2593
2600
|
if (f && !C)
|
|
2594
2601
|
this._updateCountryFromNumber(u);
|
|
2595
|
-
else if (!
|
|
2602
|
+
else if (!E || e) {
|
|
2596
2603
|
const B = y ? y.toLowerCase() : "";
|
|
2597
2604
|
O1(B) ? this._setCountry(B) : f && C ? this._setCountry(s2.ISO2) : this._setCountry("");
|
|
2598
2605
|
}
|
|
@@ -2701,10 +2708,10 @@ class B1 {
|
|
|
2701
2708
|
return;
|
|
2702
2709
|
}
|
|
2703
2710
|
this._updateCountryFromNumber(y) && this._triggerCountryChange();
|
|
2704
|
-
const _ = (C == null ? void 0 : C.data) && d1.NON_PLUS_NUMERIC.test(C.data),
|
|
2705
|
-
_ ||
|
|
2706
|
-
const B = (C == null ? void 0 : C.detail) && C.detail.isSetNumber,
|
|
2707
|
-
if ($ && !u && !B &&
|
|
2711
|
+
const _ = (C == null ? void 0 : C.data) && d1.NON_PLUS_NUMERIC.test(C.data), E = (C == null ? void 0 : C.inputType) === _0.PASTE && y;
|
|
2712
|
+
_ || E && !e ? u = !0 : d1.NON_PLUS_NUMERIC.test(y) || (u = !1);
|
|
2713
|
+
const B = (C == null ? void 0 : C.detail) && C.detail.isSetNumber, S = this.userNumeralSet === "ascii";
|
|
2714
|
+
if ($ && !u && !B && S) {
|
|
2708
2715
|
const w = this.ui.telInput.selectionStart || 0, k = y.substring(
|
|
2709
2716
|
0,
|
|
2710
2717
|
w
|
|
@@ -2744,7 +2751,7 @@ class B1 {
|
|
|
2744
2751
|
return;
|
|
2745
2752
|
}
|
|
2746
2753
|
if (e) {
|
|
2747
|
-
const f = this._getTelInputValue(), y = !f.startsWith("+") && this.ui.telInput.selectionStart === 0 && u.key === "+", _ = this._normaliseNumerals(u.key),
|
|
2754
|
+
const f = this._getTelInputValue(), y = !f.startsWith("+") && this.ui.telInput.selectionStart === 0 && u.key === "+", _ = this._normaliseNumerals(u.key), E = /^[0-9]$/.test(_), B = $ ? E : y || E, S = this.ui.telInput, w = S.selectionStart, H = S.selectionEnd, k = f.slice(0, w), W = f.slice(H), D = k + u.key + W, K = this._getFullNumber(D), V = m.utils.getCoreNumber(
|
|
2748
2755
|
K,
|
|
2749
2756
|
this.selectedCountryData.iso2
|
|
2750
2757
|
), $1 = this.maxCoreNumberLength && V.length > this.maxCoreNumberLength, a1 = this._getNewCountryFromNumber(K) !== null;
|
|
@@ -2761,7 +2768,7 @@ class B1 {
|
|
|
2761
2768
|
if (this.options.strictMode) {
|
|
2762
2769
|
const e = ($) => {
|
|
2763
2770
|
$.preventDefault();
|
|
2764
|
-
const i = this.ui.telInput, s = i.selectionStart, a = i.selectionEnd, u = this._getTelInputValue(), f = u.slice(0, s), C = u.slice(a), y = this.selectedCountryData.iso2, _ = $.clipboardData.getData("text"),
|
|
2771
|
+
const i = this.ui.telInput, s = i.selectionStart, a = i.selectionEnd, u = this._getTelInputValue(), f = u.slice(0, s), C = u.slice(a), y = this.selectedCountryData.iso2, _ = $.clipboardData.getData("text"), E = this._normaliseNumerals(_), B = s === 0 && a > 0, S = !u.startsWith("+") || B, w = E.replace(d1.NON_PLUS_NUMERIC_GLOBAL, ""), H = w.startsWith("+"), k = w.replace(/\+/g, ""), W = H && S ? `+${k}` : k;
|
|
2765
2772
|
let D = f + W + C;
|
|
2766
2773
|
if (D.length > 5) {
|
|
2767
2774
|
let V = m.utils.getCoreNumber(D, y);
|
|
@@ -2979,18 +2986,18 @@ class B1 {
|
|
|
2979
2986
|
return y[0] === s ? null : y[0];
|
|
2980
2987
|
if (!s && this.defaultCountry && y.includes(this.defaultCountry))
|
|
2981
2988
|
return this.defaultCountry;
|
|
2982
|
-
if (a ===
|
|
2989
|
+
if (a === b0.NANP && S0(f))
|
|
2983
2990
|
return null;
|
|
2984
|
-
const { areaCodes:
|
|
2985
|
-
if (
|
|
2986
|
-
const W =
|
|
2991
|
+
const { areaCodes: E, priority: B } = this.selectedCountryData;
|
|
2992
|
+
if (E) {
|
|
2993
|
+
const W = E.map(
|
|
2987
2994
|
(D) => `${a}${D}`
|
|
2988
2995
|
);
|
|
2989
2996
|
for (const D of W)
|
|
2990
2997
|
if (f.startsWith(D))
|
|
2991
2998
|
return null;
|
|
2992
2999
|
}
|
|
2993
|
-
const w =
|
|
3000
|
+
const w = E && !(B === 0) && f.length > C.length, H = s && y.includes(s) && !w, k = s === y[0];
|
|
2994
3001
|
if (!H && !k)
|
|
2995
3002
|
return y[0];
|
|
2996
3003
|
} else if (i.startsWith("+") && f.length) {
|
|
@@ -3000,25 +3007,25 @@ class B1 {
|
|
|
3000
3007
|
return this.defaultCountry;
|
|
3001
3008
|
return null;
|
|
3002
3009
|
}
|
|
3003
|
-
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and
|
|
3010
|
+
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and selected list item.
|
|
3004
3011
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
3005
3012
|
_setCountry(e) {
|
|
3006
|
-
const { separateDialCode: $, showFlags: i, i18n: s } = this.options,
|
|
3007
|
-
if (this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
|
|
3008
|
-
const
|
|
3009
|
-
let
|
|
3013
|
+
const { separateDialCode: $, showFlags: i, i18n: s, allowDropdown: a } = this.options, u = this.selectedCountryData.iso2 || "";
|
|
3014
|
+
if (a && this.ui.updateSelectedItem(e), this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
|
|
3015
|
+
const f = e && i ? `${N.FLAG} iti__${e}` : `${N.FLAG} ${N.GLOBE}`;
|
|
3016
|
+
let C, y;
|
|
3010
3017
|
if (e) {
|
|
3011
|
-
const { name:
|
|
3012
|
-
|
|
3018
|
+
const { name: _, dialCode: E } = this.selectedCountryData;
|
|
3019
|
+
y = _, C = s.selectedCountryAriaLabel.replace("${countryName}", _).replace("${dialCode}", `+${E}`);
|
|
3013
3020
|
} else
|
|
3014
|
-
|
|
3015
|
-
this.ui.selectedCountryInner.className =
|
|
3021
|
+
y = s.noCountrySelected, C = s.noCountrySelected;
|
|
3022
|
+
this.ui.selectedCountryInner.className = f, this.ui.selectedCountry.setAttribute("title", y), this.ui.selectedCountry.setAttribute(b.LABEL, C);
|
|
3016
3023
|
}
|
|
3017
3024
|
if ($) {
|
|
3018
|
-
const
|
|
3019
|
-
this.ui.selectedDialCode.textContent =
|
|
3025
|
+
const f = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
3026
|
+
this.ui.selectedDialCode.textContent = f, this.ui.updateInputPadding();
|
|
3020
3027
|
}
|
|
3021
|
-
return this._updatePlaceholder(), this._updateMaxLength(),
|
|
3028
|
+
return this._updatePlaceholder(), this._updateMaxLength(), u !== e;
|
|
3022
3029
|
}
|
|
3023
3030
|
//* Update the maximum valid number length for the currently selected country.
|
|
3024
3031
|
_updateMaxLength() {
|
|
@@ -3074,7 +3081,7 @@ class B1 {
|
|
|
3074
3081
|
}
|
|
3075
3082
|
//* Close the dropdown and unbind any listeners.
|
|
3076
3083
|
_closeDropdown() {
|
|
3077
|
-
this.ui.dropdownContent.classList.contains(N.HIDE) || (this.ui.dropdownContent.classList.add(N.HIDE), this.ui.selectedCountry.setAttribute(b.EXPANDED, "false"), this.
|
|
3084
|
+
this.ui.dropdownContent.classList.contains(N.HIDE) || (this.ui.dropdownContent.classList.add(N.HIDE), this.ui.selectedCountry.setAttribute(b.EXPANDED, "false"), this.options.countrySearch && (this.ui.searchInput.removeAttribute(b.ACTIVE_DESCENDANT), this.ui.highlightedItem && (this.ui.highlightedItem.classList.remove(N.HIGHLIGHT), this.ui.highlightedItem = null)), this.ui.dropdownArrow.classList.remove(N.ARROW_UP), this.dropdownAbortController.abort(), this.dropdownAbortController = null, this.options.dropdownContainer && this.ui.dropdown.remove(), this._trigger(_1.CLOSE_COUNTRY_DROPDOWN));
|
|
3078
3085
|
}
|
|
3079
3086
|
//* Replace any existing dial code with the new one
|
|
3080
3087
|
//* Note: called from _selectListItem and setCountry
|
|
@@ -3257,7 +3264,7 @@ class B1 {
|
|
|
3257
3264
|
this.ui.telInput.disabled = e, e ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
|
|
3258
3265
|
}
|
|
3259
3266
|
}
|
|
3260
|
-
const
|
|
3267
|
+
const L2 = (h) => {
|
|
3261
3268
|
if (!m.utils && !m.startedLoadingUtilsScript) {
|
|
3262
3269
|
let e;
|
|
3263
3270
|
if (typeof h == "function")
|
|
@@ -3295,7 +3302,7 @@ const b2 = (h) => {
|
|
|
3295
3302
|
return m.instances[$.id] = $, h.iti = $, $;
|
|
3296
3303
|
},
|
|
3297
3304
|
{
|
|
3298
|
-
defaults:
|
|
3305
|
+
defaults: T0,
|
|
3299
3306
|
//* Using a static var like this allows us to mock it in the tests.
|
|
3300
3307
|
documentReady: () => document.readyState === "complete",
|
|
3301
3308
|
//* Get the country data object.
|
|
@@ -3307,10 +3314,10 @@ const b2 = (h) => {
|
|
|
3307
3314
|
},
|
|
3308
3315
|
//* A map from instance ID to instance object.
|
|
3309
3316
|
instances: {},
|
|
3310
|
-
attachUtils:
|
|
3317
|
+
attachUtils: L2,
|
|
3311
3318
|
startedLoadingUtilsScript: !1,
|
|
3312
3319
|
startedLoadingAutoCountry: !1,
|
|
3313
|
-
version: "25.13.
|
|
3320
|
+
version: "25.13.2"
|
|
3314
3321
|
}
|
|
3315
3322
|
);
|
|
3316
3323
|
(function() {
|
|
@@ -3366,7 +3373,7 @@ const b2 = (h) => {
|
|
|
3366
3373
|
}
|
|
3367
3374
|
new y();
|
|
3368
3375
|
const _ = {};
|
|
3369
|
-
class
|
|
3376
|
+
class E {
|
|
3370
3377
|
constructor() {
|
|
3371
3378
|
var t = h.trustedTypes && h.trustedTypes.emptyHTML || "";
|
|
3372
3379
|
if (_ !== _) throw Error("SafeHtml is not meant to be built directly");
|
|
@@ -3376,7 +3383,7 @@ const b2 = (h) => {
|
|
|
3376
3383
|
return this.g.toString();
|
|
3377
3384
|
}
|
|
3378
3385
|
}
|
|
3379
|
-
new
|
|
3386
|
+
new E();
|
|
3380
3387
|
function B(d, t) {
|
|
3381
3388
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
3382
3389
|
case H:
|
|
@@ -3385,12 +3392,12 @@ const b2 = (h) => {
|
|
|
3385
3392
|
case D:
|
|
3386
3393
|
case K:
|
|
3387
3394
|
case w:
|
|
3388
|
-
case
|
|
3395
|
+
case S:
|
|
3389
3396
|
this.o = !0;
|
|
3390
3397
|
}
|
|
3391
3398
|
this.j = t.defaultValue;
|
|
3392
3399
|
}
|
|
3393
|
-
var
|
|
3400
|
+
var S = 1, w = 2, H = 3, k = 4, W = 6, D = 16, K = 18;
|
|
3394
3401
|
function V(d, t) {
|
|
3395
3402
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
3396
3403
|
var n = t[d];
|
|
@@ -3454,7 +3461,7 @@ const b2 = (h) => {
|
|
|
3454
3461
|
var r = c1(d, t);
|
|
3455
3462
|
return d.j[t].l ? r[n || 0] : r;
|
|
3456
3463
|
}
|
|
3457
|
-
function
|
|
3464
|
+
function L(d, t) {
|
|
3458
3465
|
if (U(d, t)) d = g(d, t);
|
|
3459
3466
|
else d: {
|
|
3460
3467
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
@@ -9002,15 +9009,15 @@ const b2 = (h) => {
|
|
|
9002
9009
|
}
|
|
9003
9010
|
M.prototype.format = function(d, t) {
|
|
9004
9011
|
if (g(d, 2) == 0 && U(d, 5)) {
|
|
9005
|
-
var n =
|
|
9012
|
+
var n = L(d, 5);
|
|
9006
9013
|
if (0 < n.length) return n;
|
|
9007
9014
|
}
|
|
9008
|
-
n =
|
|
9015
|
+
n = L(d, 1);
|
|
9009
9016
|
var r = o1(d);
|
|
9010
9017
|
if (t == 0) return Q1(n, 0, r, "");
|
|
9011
9018
|
if (!(n in i1)) return r;
|
|
9012
9019
|
var o = r1(this, n, u1(n));
|
|
9013
|
-
d = U(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : U(o, 13) ? g(o, 13) +
|
|
9020
|
+
d = U(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : U(o, 13) ? g(o, 13) + L(d, 3) : " ext. " + L(d, 3) : "";
|
|
9014
9021
|
d: {
|
|
9015
9022
|
o = O(o, 20).length == 0 || t == 2 ? O(o, 19) : O(o, 20);
|
|
9016
9023
|
for (var l, c = o.length, p = 0; p < c; ++p) {
|
|
@@ -9023,10 +9030,10 @@ const b2 = (h) => {
|
|
|
9023
9030
|
}
|
|
9024
9031
|
o = null;
|
|
9025
9032
|
}
|
|
9026
|
-
return o != null && (c = o, o =
|
|
9033
|
+
return o != null && (c = o, o = L(c, 2), l = new RegExp(g(c, 1)), L(
|
|
9027
9034
|
c,
|
|
9028
9035
|
5
|
|
9029
|
-
), c =
|
|
9036
|
+
), c = L(c, 4), r = t == 2 && c != null && 0 < c.length ? r.replace(l, o.replace(k0, c)) : r.replace(l, o), t == 3 && (r = r.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), r = r.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), Q1(n, t, r, d);
|
|
9030
9037
|
};
|
|
9031
9038
|
function r1(d, t, n) {
|
|
9032
9039
|
return n == "001" ? J(d, "" + t) : J(d, n);
|
|
@@ -9034,7 +9041,7 @@ const b2 = (h) => {
|
|
|
9034
9041
|
function o1(d) {
|
|
9035
9042
|
if (!U(d, 2)) return "";
|
|
9036
9043
|
var t = "" + g(d, 2);
|
|
9037
|
-
return U(d, 4) && g(d, 4) && 0 <
|
|
9044
|
+
return U(d, 4) && g(d, 4) && 0 < L(d, 8) ? Array(L(d, 8) + 1).join("0") + t : t;
|
|
9038
9045
|
}
|
|
9039
9046
|
function Q1(d, t, n, r) {
|
|
9040
9047
|
switch (t) {
|
|
@@ -9077,9 +9084,9 @@ const b2 = (h) => {
|
|
|
9077
9084
|
}
|
|
9078
9085
|
function d0(d, t) {
|
|
9079
9086
|
var n = t0(d, t);
|
|
9080
|
-
return d = r1(d,
|
|
9087
|
+
return d = r1(d, L(t, 1), n), d == null ? -1 : (t = o1(t), L1(t, d));
|
|
9081
9088
|
}
|
|
9082
|
-
function
|
|
9089
|
+
function L1(d, t) {
|
|
9083
9090
|
return F(d, g(t, 1)) ? F(d, g(t, 5)) ? 4 : F(d, g(t, 4)) ? 3 : F(d, g(t, 6)) ? 5 : F(d, g(t, 8)) ? 6 : F(d, g(t, 7)) ? 7 : F(d, g(t, 21)) ? 8 : F(d, g(t, 25)) ? 9 : F(d, g(t, 28)) ? 10 : F(d, g(t, 2)) ? g(t, 18) || F(d, g(t, 3)) ? 2 : 0 : !g(t, 18) && F(d, g(t, 3)) ? 1 : -1 : -1;
|
|
9084
9091
|
}
|
|
9085
9092
|
function J(d, t) {
|
|
@@ -9094,15 +9101,15 @@ const b2 = (h) => {
|
|
|
9094
9101
|
}
|
|
9095
9102
|
function F(d, t) {
|
|
9096
9103
|
var n = d.length;
|
|
9097
|
-
return 0 < z(t, 9) && O(t, 9).indexOf(n) == -1 ? !1 : j(
|
|
9104
|
+
return 0 < z(t, 9) && O(t, 9).indexOf(n) == -1 ? !1 : j(L(t, 2), d);
|
|
9098
9105
|
}
|
|
9099
9106
|
function F0(d, t) {
|
|
9100
|
-
var n = t0(d, t), r =
|
|
9101
|
-
return o == null || n != "001" && r != e0(d, n) ? o = !1 : (d = o1(t), o =
|
|
9107
|
+
var n = t0(d, t), r = L(t, 1), o = r1(d, r, n);
|
|
9108
|
+
return o == null || n != "001" && r != e0(d, n) ? o = !1 : (d = o1(t), o = L1(d, o) != -1), o;
|
|
9102
9109
|
}
|
|
9103
9110
|
function t0(d, t) {
|
|
9104
9111
|
if (t == null) return null;
|
|
9105
|
-
var n =
|
|
9112
|
+
var n = L(t, 1);
|
|
9106
9113
|
if (n = i1[n], n == null) d = null;
|
|
9107
9114
|
else if (n.length == 1) d = n[0];
|
|
9108
9115
|
else d: {
|
|
@@ -9115,7 +9122,7 @@ const b2 = (h) => {
|
|
|
9115
9122
|
d = r;
|
|
9116
9123
|
break d;
|
|
9117
9124
|
}
|
|
9118
|
-
} else if (
|
|
9125
|
+
} else if (L1(t, c) != -1) {
|
|
9119
9126
|
d = r;
|
|
9120
9127
|
break d;
|
|
9121
9128
|
}
|
|
@@ -9129,7 +9136,7 @@ const b2 = (h) => {
|
|
|
9129
9136
|
}
|
|
9130
9137
|
function e0(d, t) {
|
|
9131
9138
|
if (d = J(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
9132
|
-
return
|
|
9139
|
+
return L(d, 10);
|
|
9133
9140
|
}
|
|
9134
9141
|
function m1(d, t, n, r) {
|
|
9135
9142
|
var o = g1(n, r), l = z(o, 9) == 0 ? O(g(n, 1), 9) : O(o, 9);
|
|
@@ -9139,7 +9146,7 @@ const b2 = (h) => {
|
|
|
9139
9146
|
}
|
|
9140
9147
|
function y1(d, t, n) {
|
|
9141
9148
|
var r = o1(t);
|
|
9142
|
-
return t =
|
|
9149
|
+
return t = L(t, 1), t in i1 ? (t = r1(d, t, u1(t)), m1(d, r, t, n)) : 1;
|
|
9143
9150
|
}
|
|
9144
9151
|
function $0(d, t) {
|
|
9145
9152
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
@@ -9167,14 +9174,14 @@ const b2 = (h) => {
|
|
|
9167
9174
|
if (d = $0(t, r), d != 0) return P(l, 1, d), d;
|
|
9168
9175
|
throw Error("Invalid country calling code");
|
|
9169
9176
|
}
|
|
9170
|
-
return n != null && (c =
|
|
9177
|
+
return n != null && (c = L(n, 10), p = "" + c, I = t.toString(), I.lastIndexOf(p, 0) == 0 && (p = new v(I.substring(p.length)), I = g(n, 1), I = new RegExp(L(I, 2)), i0(p, n, null), p = p.toString(), !j(I, t.toString()) && j(I, p) || m1(d, t.toString(), n, -1) == 3)) ? (r.g(p), o && P(l, 6, 10), P(l, 1, c), c) : (P(l, 1, 0), 0);
|
|
9171
9178
|
}
|
|
9172
9179
|
function i0(d, t, n) {
|
|
9173
9180
|
var r = d.toString(), o = r.length, l = g(t, 15);
|
|
9174
9181
|
if (o != 0 && l != null && l.length != 0) {
|
|
9175
9182
|
var c = new RegExp("^(?:" + l + ")");
|
|
9176
9183
|
if (o = c.exec(r)) {
|
|
9177
|
-
l = new RegExp(
|
|
9184
|
+
l = new RegExp(L(g(t, 1), 2));
|
|
9178
9185
|
var p = j(l, r), I = o.length - 1;
|
|
9179
9186
|
t = g(t, 16), t == null || t.length == 0 || o[I] == null || o[I].length == 0 ? (!p || j(l, r.substring(o[0].length))) && (n != null && 0 < I && o[I] != null && n.g(o[1]), d.set(r.substring(o[0].length))) : (r = r.replace(c, t), (!p || j(l, r)) && (n != null && 0 < I && n.g(o[1]), d.set(r)));
|
|
9180
9187
|
}
|
|
@@ -9216,7 +9223,7 @@ const b2 = (h) => {
|
|
|
9216
9223
|
if (I = I.replace(s1, ""), p = n0(d, I, c, t, r, l), p == 0) throw A1;
|
|
9217
9224
|
} else throw A1;
|
|
9218
9225
|
}
|
|
9219
|
-
if (p != 0 ? (o = u1(p), o != n && (c = r1(d, p, o))) : (J1(o), t.g(o.toString()), n != null ? (p =
|
|
9226
|
+
if (p != 0 ? (o = u1(p), o != n && (c = r1(d, p, o))) : (J1(o), t.g(o.toString()), n != null ? (p = L(c, 10), P(
|
|
9220
9227
|
l,
|
|
9221
9228
|
1,
|
|
9222
9229
|
p
|
|
@@ -9243,12 +9250,12 @@ const b2 = (h) => {
|
|
|
9243
9250
|
}
|
|
9244
9251
|
function l0(d) {
|
|
9245
9252
|
for (var t = d.j.length, n = 0; n < t; ++n) {
|
|
9246
|
-
var r = d.j[n], o =
|
|
9253
|
+
var r = d.j[n], o = L(r, 1);
|
|
9247
9254
|
if (d.da == o) return !1;
|
|
9248
|
-
var l = d, c = r, p =
|
|
9255
|
+
var l = d, c = r, p = L(c, 1);
|
|
9249
9256
|
G(l.v);
|
|
9250
9257
|
var I = l;
|
|
9251
|
-
c =
|
|
9258
|
+
c = L(c, 2);
|
|
9252
9259
|
var Y = "999999999999999".match(p)[0];
|
|
9253
9260
|
if (Y.length < I.g.h.length ? I = "" : (I = Y.replace(new RegExp(p, "g"), c), I = I.replace(RegExp("9", "g"), " ")), 0 < I.length ? (l.v.g(I), l = !0) : l = !1, l) return d.da = o, d.ha = o0.test(g(r, 4)), d.$ = 0, !0;
|
|
9254
9261
|
}
|
|
@@ -9279,17 +9286,17 @@ const b2 = (h) => {
|
|
|
9279
9286
|
return d.s.toString();
|
|
9280
9287
|
case 3:
|
|
9281
9288
|
if (C0(d)) d.ea = !0;
|
|
9282
|
-
else return d.o = p0(d),
|
|
9289
|
+
else return d.o = p0(d), b1(d);
|
|
9283
9290
|
default:
|
|
9284
|
-
return d.ea ? (g0(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = m0(d, t), n = h0(d), 0 < n.length ? n : (a0(d, d.g.toString()), l0(d) ? f0(d) : d.u ? I1(d, t) : d.s.toString())) :
|
|
9291
|
+
return d.ea ? (g0(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = m0(d, t), n = h0(d), 0 < n.length ? n : (a0(d, d.g.toString()), l0(d) ? f0(d) : d.u ? I1(d, t) : d.s.toString())) : b1(d);
|
|
9285
9292
|
}
|
|
9286
9293
|
}
|
|
9287
9294
|
function c0(d) {
|
|
9288
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, G(d.v), d.da = "",
|
|
9295
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, G(d.v), d.da = "", b1(d);
|
|
9289
9296
|
}
|
|
9290
9297
|
function h0(d) {
|
|
9291
9298
|
for (var t = d.g.toString(), n = d.j.length, r = 0; r < n; ++r) {
|
|
9292
|
-
var o = d.j[r], l =
|
|
9299
|
+
var o = d.j[r], l = L(o, 1);
|
|
9293
9300
|
if (new RegExp("^(?:" + l + ")$").test(t) && (d.ha = o0.test(g(o, 4)), o = t.replace(new RegExp(l, "g"), g(o, 2)), o = I1(d, o), p1(o, v0) == d.ba)) return o;
|
|
9294
9301
|
}
|
|
9295
9302
|
return "";
|
|
@@ -9298,12 +9305,12 @@ const b2 = (h) => {
|
|
|
9298
9305
|
var n = d.h.h.length;
|
|
9299
9306
|
return d.ha && 0 < n && d.h.toString().charAt(n - 1) != " " ? d.h + " " + t : d.h + t;
|
|
9300
9307
|
}
|
|
9301
|
-
function
|
|
9308
|
+
function b1(d) {
|
|
9302
9309
|
var t = d.g.toString();
|
|
9303
9310
|
if (3 <= t.length) {
|
|
9304
9311
|
for (var n = d.ca && d.o.length == 0 && 0 < z(d.l, 20) ? O(d.l, 20) : O(d.l, 19), r = n.length, o = 0; o < r; ++o) {
|
|
9305
9312
|
var l = n[o];
|
|
9306
|
-
0 < d.o.length && q1(
|
|
9313
|
+
0 < d.o.length && q1(L(l, 4)) && !g(l, 6) && !U(l, 5) || (d.o.length != 0 || d.ca || q1(L(l, 4)) || g(l, 6)) && K0.test(L(l, 2)) && d.j.push(l);
|
|
9307
9314
|
}
|
|
9308
9315
|
return a0(d, t), t = h0(d), 0 < t.length ? t : l0(d) ? f0(d) : d.s.toString();
|
|
9309
9316
|
}
|
|
@@ -9343,7 +9350,7 @@ const b2 = (h) => {
|
|
|
9343
9350
|
const y0 = (d) => {
|
|
9344
9351
|
const t = [];
|
|
9345
9352
|
return d.includes("FIXED_LINE_OR_MOBILE") ? (d.includes("MOBILE") || t.push("MOBILE"), d.includes("FIXED_LINE") || t.push("FIXED_LINE")) : (d.includes("MOBILE") || d.includes("FIXED_LINE")) && t.push("FIXED_LINE_OR_MOBILE"), d.concat(t);
|
|
9346
|
-
},
|
|
9353
|
+
}, T1 = { 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 };
|
|
9347
9354
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
9348
9355
|
try {
|
|
9349
9356
|
const n = d.replace(/[^+0-9]/g, ""), r = new W0(t);
|
|
@@ -9407,7 +9414,7 @@ const b2 = (h) => {
|
|
|
9407
9414
|
try {
|
|
9408
9415
|
const r = M.g(), o = Q(r, d, t), l = F0(r, o);
|
|
9409
9416
|
if (n) {
|
|
9410
|
-
const c = y0(n).map((p) =>
|
|
9417
|
+
const c = y0(n).map((p) => T1[p]);
|
|
9411
9418
|
return l && c.includes(d0(r, o));
|
|
9412
9419
|
}
|
|
9413
9420
|
return l;
|
|
@@ -9419,7 +9426,7 @@ const b2 = (h) => {
|
|
|
9419
9426
|
const r = M.g(), o = Q(r, d, t);
|
|
9420
9427
|
if (n) {
|
|
9421
9428
|
const l = y0(n);
|
|
9422
|
-
for (let c of l) if (y1(r, o,
|
|
9429
|
+
for (let c of l) if (y1(r, o, T1[c]) === 0) return !0;
|
|
9423
9430
|
return !1;
|
|
9424
9431
|
}
|
|
9425
9432
|
return y1(r, o, -1) === 0;
|
|
@@ -9432,11 +9439,11 @@ const b2 = (h) => {
|
|
|
9432
9439
|
} catch {
|
|
9433
9440
|
return "";
|
|
9434
9441
|
}
|
|
9435
|
-
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType",
|
|
9442
|
+
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", T1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
9436
9443
|
})();
|
|
9437
|
-
const w0 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0,
|
|
9444
|
+
const w0 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, b2 = w0.intlTelInputUtilsTemp;
|
|
9438
9445
|
delete w0.intlTelInputUtilsTemp;
|
|
9439
|
-
m.utils =
|
|
9446
|
+
m.utils = b2;
|
|
9440
9447
|
const A2 = {
|
|
9441
9448
|
__name: "IntlTelInputWithUtils",
|
|
9442
9449
|
props: /* @__PURE__ */ I0({
|
|
@@ -9471,36 +9478,36 @@ const A2 = {
|
|
|
9471
9478
|
], ["update:modelValue"]),
|
|
9472
9479
|
setup(h, { expose: e, emit: $ }) {
|
|
9473
9480
|
const i = Y0(h, "modelValue"), s = h, a = $, u = w1(), f = w1(), C = w1(!1), y = () => f.value ? s.options.strictMode ? f.value.isValidNumberPrecise() : f.value.isValidNumber() : null, _ = () => {
|
|
9474
|
-
let
|
|
9475
|
-
C.value !==
|
|
9481
|
+
let S = y();
|
|
9482
|
+
C.value !== S && (C.value = S, a("changeValidity", !!S), a(
|
|
9476
9483
|
"changeErrorCode",
|
|
9477
|
-
|
|
9484
|
+
S ? null : f.value.getValidationError()
|
|
9478
9485
|
));
|
|
9479
|
-
},
|
|
9480
|
-
var
|
|
9481
|
-
a("changeNumber", ((
|
|
9486
|
+
}, E = () => {
|
|
9487
|
+
var S;
|
|
9488
|
+
a("changeNumber", ((S = f.value) == null ? void 0 : S.getNumber()) ?? ""), _();
|
|
9482
9489
|
}, B = () => {
|
|
9483
|
-
var
|
|
9484
|
-
a("changeCountry", ((
|
|
9490
|
+
var S;
|
|
9491
|
+
a("changeCountry", ((S = f.value) == null ? void 0 : S.getSelectedCountryData().iso2) ?? ""), E(), _();
|
|
9485
9492
|
};
|
|
9486
9493
|
return z0(() => {
|
|
9487
9494
|
u.value && (f.value = m(u.value, s.options), s.value && f.value.setNumber(s.value), s.disabled && f.value.setDisabled(s.disabled), C.value = y());
|
|
9488
9495
|
}), Z0(
|
|
9489
9496
|
() => s.disabled,
|
|
9490
|
-
(
|
|
9497
|
+
(S) => {
|
|
9491
9498
|
var w;
|
|
9492
|
-
return (w = f.value) == null ? void 0 : w.setDisabled(
|
|
9499
|
+
return (w = f.value) == null ? void 0 : w.setDisabled(S);
|
|
9493
9500
|
}
|
|
9494
9501
|
), J0(() => {
|
|
9495
|
-
var
|
|
9496
|
-
return (
|
|
9497
|
-
}), e({ instance: f, input: u }), (
|
|
9502
|
+
var S;
|
|
9503
|
+
return (S = f.value) == null ? void 0 : S.destroy();
|
|
9504
|
+
}), e({ instance: f, input: u }), (S, w) => X0((Q0(), q0("input", d2({
|
|
9498
9505
|
ref_key: "input",
|
|
9499
9506
|
ref: u,
|
|
9500
9507
|
"onUpdate:modelValue": w[0] || (w[0] = (H) => i.value = H),
|
|
9501
9508
|
type: "tel",
|
|
9502
9509
|
onCountrychange: B,
|
|
9503
|
-
onInput:
|
|
9510
|
+
onInput: E
|
|
9504
9511
|
}, h.inputProps), null, 16)), [
|
|
9505
9512
|
[
|
|
9506
9513
|
t2,
|