intl-tel-input 26.9.2 → 27.0.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.
- package/angular/README.md +1 -1
- package/angular/dist/IntlTelInput.d.ts +97 -0
- package/angular/dist/IntlTelInput.js +4812 -0
- package/angular/dist/IntlTelInputWithUtils.d.ts +3 -0
- package/angular/{build → dist}/IntlTelInputWithUtils.js +2342 -2096
- package/{build → dist}/css/demo.css +1 -1
- package/dist/css/intlTelInput-no-assets.css +1 -0
- package/dist/css/intlTelInput-no-assets.min.css +1 -0
- package/dist/css/intlTelInput.css +1 -0
- package/dist/css/intlTelInput.min.css +1 -0
- package/dist/img/flags.png +0 -0
- package/dist/img/flags.webp +0 -0
- package/dist/img/flags@2x.png +0 -0
- package/dist/img/flags@2x.webp +0 -0
- package/dist/js/data.d.ts +1616 -0
- package/{build → dist}/js/data.js +5 -17
- package/dist/js/data.min.js +7 -0
- package/dist/js/data.mjs +1708 -0
- package/{build/js/i18n/ar/index.js → dist/js/i18n/ar.js} +1 -0
- package/{build/js/i18n/bg/index.js → dist/js/i18n/bg.js} +1 -0
- package/{build/js/i18n/bn/index.js → dist/js/i18n/bn.js} +1 -0
- package/{build/js/i18n/bs/index.js → dist/js/i18n/bs.js} +1 -0
- package/{build/js/i18n/ca/index.js → dist/js/i18n/ca.js} +1 -0
- package/{build/js/i18n/cs/index.js → dist/js/i18n/cs.js} +1 -0
- package/{build/js/i18n/da/index.js → dist/js/i18n/da.js} +1 -0
- package/{build/js/i18n/de/index.js → dist/js/i18n/de.js} +1 -0
- package/{build/js/i18n/el/index.js → dist/js/i18n/el.js} +1 -0
- package/{build/js/i18n/en/index.js → dist/js/i18n/en.js} +3 -2
- package/{build/js/i18n/es/index.js → dist/js/i18n/es.js} +1 -0
- package/{build/js/i18n/et/index.js → dist/js/i18n/et.js} +1 -0
- package/{build/js/i18n/fa/index.js → dist/js/i18n/fa.js} +1 -0
- package/{build/js/i18n/fi/index.js → dist/js/i18n/fi.js} +1 -0
- package/{build/js/i18n/fr/index.js → dist/js/i18n/fr.js} +1 -0
- package/{build/js/i18n/hi/index.js → dist/js/i18n/hi.js} +1 -0
- package/{build/js/i18n/hr/index.js → dist/js/i18n/hr.js} +1 -0
- package/{build/js/i18n/hu/index.js → dist/js/i18n/hu.js} +1 -0
- package/{build/js/i18n/id/index.js → dist/js/i18n/id.js} +1 -0
- package/{build → dist}/js/i18n/index.js +1 -0
- package/{build/js/i18n/it/index.js → dist/js/i18n/it.js} +1 -0
- package/{build/js/i18n/ja/index.js → dist/js/i18n/ja.js} +1 -0
- package/{build/js/i18n/kn/index.js → dist/js/i18n/kn.js} +1 -0
- package/{build/js/i18n/ko/index.js → dist/js/i18n/ko.js} +1 -0
- package/{build/js/i18n/lt/index.js → dist/js/i18n/lt.js} +1 -0
- package/{build/js/i18n/mr/index.js → dist/js/i18n/mr.js} +1 -0
- package/{build/js/i18n/nl/index.js → dist/js/i18n/nl.js} +1 -0
- package/{build/js/i18n/no/index.js → dist/js/i18n/no.js} +1 -0
- package/{build/js/i18n/pl/index.js → dist/js/i18n/pl.js} +1 -0
- package/{build/js/i18n/pt/index.js → dist/js/i18n/pt.js} +1 -0
- package/{build/js/i18n/ro/index.js → dist/js/i18n/ro.js} +1 -0
- package/{build/js/i18n/ru/index.js → dist/js/i18n/ru.js} +1 -0
- package/{build/js/i18n/sk/index.js → dist/js/i18n/sk.js} +1 -0
- package/{build/js/i18n/sl/index.js → dist/js/i18n/sl.js} +1 -0
- package/{build/js/i18n/sq/index.js → dist/js/i18n/sq.js} +1 -0
- package/{build/js/i18n/sr/index.js → dist/js/i18n/sr.js} +1 -0
- package/{build/js/i18n/sv/index.js → dist/js/i18n/sv.js} +1 -0
- package/{build/js/i18n/te/index.js → dist/js/i18n/te.js} +1 -0
- package/{build/js/i18n/th/index.js → dist/js/i18n/th.js} +1 -0
- package/{build/js/i18n/tr/index.js → dist/js/i18n/tr.js} +1 -0
- package/dist/js/i18n/types.js +1 -0
- package/{build/js/i18n/uk/index.js → dist/js/i18n/uk.js} +1 -0
- package/{build/js/i18n/ur/index.js → dist/js/i18n/ur.js} +1 -0
- package/{build/js/i18n/uz/index.js → dist/js/i18n/uz.js} +1 -0
- package/{build/js/i18n/vi/index.js → dist/js/i18n/vi.js} +1 -0
- package/{build/js/i18n/zh-hk/index.js → dist/js/i18n/zh-hk.js} +1 -0
- package/{build/js/i18n/zh/index.js → dist/js/i18n/zh.js} +1 -0
- package/dist/js/i18n.d.ts +1697 -0
- package/dist/js/intlTelInput.d.ts +1773 -0
- package/{build → dist}/js/intlTelInput.js +228 -215
- package/dist/js/intlTelInput.min.js +25 -0
- package/{react/build/IntlTelInput.cjs → dist/js/intlTelInput.mjs} +230 -340
- package/{build → dist}/js/intlTelInputWithUtils.js +531 -498
- package/dist/js/intlTelInputWithUtils.min.js +25 -0
- package/{react/build/IntlTelInputWithUtils.cjs → dist/js/intlTelInputWithUtils.mjs} +530 -621
- package/{build → dist}/js/utils.js +46 -47
- package/package.json +122 -122
- package/react/README.md +1 -1
- package/react/dist/IntlTelInput.d.ts +20 -0
- package/react/{build → dist}/IntlTelInput.js +274 -255
- package/react/dist/IntlTelInputWithUtils.d.ts +4 -0
- package/react/{build → dist}/IntlTelInputWithUtils.js +580 -542
- package/svelte/README.md +1 -1
- package/svelte/src/IntlTelInput.svelte +199 -0
- package/svelte/src/IntlTelInputWithUtils.svelte +15 -0
- package/svelte/src/shims.d.ts +4 -0
- package/vue/README.md +1 -1
- package/vue/dist/IntlTelInput-D7r449B2.js +2577 -0
- package/vue/dist/IntlTelInput.js +5 -0
- package/vue/dist/IntlTelInputWithUtils.js +49385 -0
- package/vue/dist/src/IntlTelInput.vue.d.ts +35 -0
- package/vue/dist/src/index.d.ts +4 -0
- package/vue/dist/src/indexWithUtils.d.ts +3 -0
- package/angular/build/IntlTelInput.js +0 -4501
- package/angular/build/types/intl-tel-input/angular.d.ts +0 -65
- package/angular/build/types/intl-tel-input/angularWithUtils.d.ts +0 -65
- package/angular/build/types/intl-tel-input/data.d.ts +0 -20
- package/angular/build/types/intl-tel-input/i18n/ar/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/bg/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/bn/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/bs/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/ca/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/cs/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/da/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/de/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/el/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/en/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/es/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/et/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/fa/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/fi/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/fr/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/hi/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/hr/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/hu/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/id/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/index.d.ts +0 -45
- package/angular/build/types/intl-tel-input/i18n/it/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/ja/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/kn/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/ko/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/lt/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/mr/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/nl/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/no/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/pl/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/pt/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/ro/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/ru/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/sk/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/sl/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/sq/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/sr/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/sv/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/te/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/th/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/tr/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/types.d.ts +0 -10
- package/angular/build/types/intl-tel-input/i18n/uk/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/ur/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/uz/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/vi/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/zh/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/i18n/zh-hk/index.d.ts +0 -3
- package/angular/build/types/intl-tel-input/intlTelInputWithUtils.d.ts +0 -2
- package/angular/build/types/intl-tel-input/utils.d.ts +0 -2
- package/angular/build/types/intl-tel-input.d.ts +0 -46
- package/angular/build/types/modules/constants.d.ts +0 -94
- package/angular/build/types/modules/core/countrySearch.d.ts +0 -17
- package/angular/build/types/modules/core/icons.d.ts +0 -11
- package/angular/build/types/modules/core/numerals.d.ts +0 -7
- package/angular/build/types/modules/core/options.d.ts +0 -8
- package/angular/build/types/modules/core/ui.d.ts +0 -30
- package/angular/build/types/modules/data/country-data.d.ts +0 -12
- package/angular/build/types/modules/data/intl-regionless.d.ts +0 -2
- package/angular/build/types/modules/data/nanp-regionless.d.ts +0 -2
- package/angular/build/types/modules/format/caret.d.ts +0 -1
- package/angular/build/types/modules/format/formatting.d.ts +0 -3
- package/angular/build/types/modules/types/events.d.ts +0 -10
- package/angular/build/types/modules/types/forEachInstanceArgsMap.d.ts +0 -6
- package/angular/build/types/modules/types/public-api.d.ts +0 -65
- package/angular/build/types/modules/utils/dom.d.ts +0 -6
- package/angular/build/types/modules/utils/isAndroid.d.ts +0 -1
- package/angular/build/types/modules/utils/string.d.ts +0 -2
- package/build/css/intlTelInput-no-assets.css +0 -1323
- package/build/css/intlTelInput-no-assets.min.css +0 -1
- package/build/css/intlTelInput.css +0 -1327
- package/build/css/intlTelInput.min.css +0 -1
- package/build/img/flags.png +0 -0
- package/build/img/flags.webp +0 -0
- package/build/img/flags@2x.png +0 -0
- package/build/img/flags@2x.webp +0 -0
- package/build/js/data.min.js +0 -20
- package/build/js/i18n/types.js +0 -0
- package/build/js/intlTelInput.d.ts +0 -671
- package/build/js/intlTelInput.min.js +0 -38
- package/build/js/intlTelInputWithUtils.min.js +0 -38
- package/index.js +0 -1
- package/react/build/IntlTelInput.d.ts +0 -721
- package/svelte/build/IntlTelInput.mjs +0 -5294
- package/svelte/build/IntlTelInputWithUtils.mjs +0 -11381
- package/vue/build/IntlTelInput.vue.d.ts +0 -34
- package/vue/build/IntlTelInputWithUtils.vue.d.ts +0 -34
- package/vue/build/exports/IntlTelInput.d.ts +0 -3
- package/vue/build/exports/IntlTelInput.mjs +0 -86
- package/vue/build/exports/IntlTelInputWithUtils.d.ts +0 -3
- package/vue/build/exports/IntlTelInputWithUtils.mjs +0 -6173
- package/vue/build/intl-tel-input/data.d.ts +0 -20
- package/vue/build/intl-tel-input/i18n/ar/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/bg/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/bn/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/bs/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/ca/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/cs/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/da/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/de/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/el/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/en/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/es/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/et/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/fa/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/fi/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/fr/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/hi/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/hr/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/hu/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/id/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/index.d.ts +0 -45
- package/vue/build/intl-tel-input/i18n/it/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/ja/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/kn/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/ko/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/lt/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/mr/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/nl/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/no/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/pl/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/pt/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/ro/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/ru/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/sk/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/sl/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/sq/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/sr/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/sv/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/te/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/th/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/tr/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/types.d.ts +0 -10
- package/vue/build/intl-tel-input/i18n/uk/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/ur/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/uz/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/vi/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/zh/index.d.ts +0 -3
- package/vue/build/intl-tel-input/i18n/zh-hk/index.d.ts +0 -3
- package/vue/build/intl-tel-input/intlTelInputWithUtils.d.ts +0 -2
- package/vue/build/intl-tel-input-MeSkUgHd.mjs +0 -3438
- package/vue/build/intl-tel-input.d.ts +0 -46
- package/vue/build/modules/constants.d.ts +0 -94
- package/vue/build/modules/core/countrySearch.d.ts +0 -17
- package/vue/build/modules/core/icons.d.ts +0 -11
- package/vue/build/modules/core/numerals.d.ts +0 -7
- package/vue/build/modules/core/options.d.ts +0 -8
- package/vue/build/modules/core/ui.d.ts +0 -30
- package/vue/build/modules/data/country-data.d.ts +0 -12
- package/vue/build/modules/data/intl-regionless.d.ts +0 -2
- package/vue/build/modules/data/nanp-regionless.d.ts +0 -2
- package/vue/build/modules/format/caret.d.ts +0 -1
- package/vue/build/modules/format/formatting.d.ts +0 -3
- package/vue/build/modules/types/events.d.ts +0 -10
- package/vue/build/modules/types/forEachInstanceArgsMap.d.ts +0 -6
- package/vue/build/modules/types/public-api.d.ts +0 -65
- package/vue/build/modules/utils/dom.d.ts +0 -6
- package/vue/build/modules/utils/isAndroid.d.ts +0 -1
- package/vue/build/modules/utils/string.d.ts +0 -2
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// react/src/intl-tel-input/reactWithUtils.tsx
|
|
30
|
-
var reactWithUtils_exports = {};
|
|
31
|
-
__export(reactWithUtils_exports, {
|
|
32
|
-
default: () => reactWithUtils_default,
|
|
33
|
-
intlTelInput: () => intlTelInputWithUtils_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(reactWithUtils_exports);
|
|
36
|
-
|
|
37
|
-
// src/js/intl-tel-input/data.ts
|
|
1
|
+
// src/js/data.ts
|
|
38
2
|
var rawCountryData = [
|
|
39
3
|
[
|
|
40
4
|
"af",
|
|
@@ -1737,7 +1701,7 @@ var iso2Set = new Set(allCountries.map((c) => c.iso2));
|
|
|
1737
1701
|
var isIso2 = (val) => iso2Set.has(val);
|
|
1738
1702
|
var data_default = allCountries;
|
|
1739
1703
|
|
|
1740
|
-
// src/js/
|
|
1704
|
+
// src/js/constants.ts
|
|
1741
1705
|
var EVENTS = {
|
|
1742
1706
|
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
1743
1707
|
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
@@ -1858,10 +1822,10 @@ var ARIA = {
|
|
|
1858
1822
|
MODAL: "aria-modal"
|
|
1859
1823
|
};
|
|
1860
1824
|
|
|
1861
|
-
// src/js/
|
|
1825
|
+
// src/js/i18n/en.ts
|
|
1862
1826
|
var interfaceTranslations = {
|
|
1863
|
-
selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
|
|
1864
|
-
noCountrySelected: "Select country",
|
|
1827
|
+
selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
|
|
1828
|
+
noCountrySelected: "Select country for phone number",
|
|
1865
1829
|
countryListAriaLabel: "List of countries",
|
|
1866
1830
|
searchPlaceholder: "Search",
|
|
1867
1831
|
clearSearchAriaLabel: "Clear search",
|
|
@@ -1878,7 +1842,7 @@ var interfaceTranslations = {
|
|
|
1878
1842
|
};
|
|
1879
1843
|
var en_default = interfaceTranslations;
|
|
1880
1844
|
|
|
1881
|
-
// src/js/
|
|
1845
|
+
// src/js/core/options.ts
|
|
1882
1846
|
var mq = (q) => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
|
|
1883
1847
|
var isNarrowViewport = () => mq(`(max-width: ${LAYOUT.NARROW_VIEWPORT_WIDTH}px)`);
|
|
1884
1848
|
var computeDefaultUseFullscreenPopup = () => {
|
|
@@ -1915,7 +1879,7 @@ var defaults = {
|
|
|
1915
1879
|
//* Append menu to specified element.
|
|
1916
1880
|
dropdownContainer: null,
|
|
1917
1881
|
//* Don't display these countries.
|
|
1918
|
-
excludeCountries:
|
|
1882
|
+
excludeCountries: null,
|
|
1919
1883
|
//* Fix the dropdown width to the input width (rather than being as wide as the longest country name).
|
|
1920
1884
|
fixDropdownWidth: true,
|
|
1921
1885
|
//* Format the number as the user types
|
|
@@ -1935,7 +1899,7 @@ var defaults = {
|
|
|
1935
1899
|
//* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
|
|
1936
1900
|
nationalMode: true,
|
|
1937
1901
|
//* Display only these countries.
|
|
1938
|
-
onlyCountries:
|
|
1902
|
+
onlyCountries: null,
|
|
1939
1903
|
//* Number type to use for placeholders.
|
|
1940
1904
|
placeholderNumberType: "MOBILE",
|
|
1941
1905
|
//* Add custom classes to the search input element.
|
|
@@ -1953,7 +1917,9 @@ var toString = (val) => JSON.stringify(val);
|
|
|
1953
1917
|
var isPlainObject = (val) => Boolean(val) && typeof val === "object" && !Array.isArray(val);
|
|
1954
1918
|
var isFn = (val) => typeof val === "function";
|
|
1955
1919
|
var isElLike = (val) => {
|
|
1956
|
-
if (!val || typeof val !== "object")
|
|
1920
|
+
if (!val || typeof val !== "object") {
|
|
1921
|
+
return false;
|
|
1922
|
+
}
|
|
1957
1923
|
const v = val;
|
|
1958
1924
|
return v.nodeType === 1 && typeof v.tagName === "string" && typeof v.appendChild === "function";
|
|
1959
1925
|
};
|
|
@@ -2068,9 +2034,13 @@ var validateOptions = (customOptions) => {
|
|
|
2068
2034
|
break;
|
|
2069
2035
|
case "excludeCountries":
|
|
2070
2036
|
case "onlyCountries": {
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2037
|
+
if (value === null) {
|
|
2038
|
+
validatedOptions[key] = value;
|
|
2039
|
+
} else {
|
|
2040
|
+
const filtered = validateIso2Array(key, value);
|
|
2041
|
+
if (filtered !== false) {
|
|
2042
|
+
validatedOptions[key] = filtered;
|
|
2043
|
+
}
|
|
2074
2044
|
}
|
|
2075
2045
|
break;
|
|
2076
2046
|
}
|
|
@@ -2154,7 +2124,7 @@ var applyOptionSideEffects = (o) => {
|
|
|
2154
2124
|
o.fixDropdownWidth = true;
|
|
2155
2125
|
}
|
|
2156
2126
|
}
|
|
2157
|
-
if (o.onlyCountries
|
|
2127
|
+
if (o.onlyCountries?.length === 1) {
|
|
2158
2128
|
o.initialCountry = o.onlyCountries[0];
|
|
2159
2129
|
}
|
|
2160
2130
|
if (o.separateDialCode) {
|
|
@@ -2169,14 +2139,14 @@ var applyOptionSideEffects = (o) => {
|
|
|
2169
2139
|
o.i18n = { ...en_default, ...o.i18n };
|
|
2170
2140
|
};
|
|
2171
2141
|
|
|
2172
|
-
// src/js/
|
|
2142
|
+
// src/js/helpers/string.ts
|
|
2173
2143
|
var getNumeric = (s) => s.replace(/\D/g, "");
|
|
2174
2144
|
var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
2175
2145
|
|
|
2176
|
-
// src/js/
|
|
2146
|
+
// src/js/helpers/isAndroid.ts
|
|
2177
2147
|
var getIsAndroid = () => typeof navigator !== "undefined" ? /Android/i.test(navigator.userAgent) : false;
|
|
2178
2148
|
|
|
2179
|
-
// src/js/
|
|
2149
|
+
// src/js/core/countrySearch.ts
|
|
2180
2150
|
var getMatchedCountries = (countries, query) => {
|
|
2181
2151
|
const normalisedQuery = normaliseString(query);
|
|
2182
2152
|
const iso2Matches = [];
|
|
@@ -2221,7 +2191,7 @@ var findFirstCountryStartingWith = (countries, query) => {
|
|
|
2221
2191
|
return null;
|
|
2222
2192
|
};
|
|
2223
2193
|
|
|
2224
|
-
// src/js/
|
|
2194
|
+
// src/js/helpers/dom.ts
|
|
2225
2195
|
var buildClassNames = (flags) => Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
|
|
2226
2196
|
var createEl = (tagName, attrs, container) => {
|
|
2227
2197
|
const el = document.createElement(tagName);
|
|
@@ -2236,7 +2206,7 @@ var createEl = (tagName, attrs, container) => {
|
|
|
2236
2206
|
return el;
|
|
2237
2207
|
};
|
|
2238
2208
|
|
|
2239
|
-
// src/js/
|
|
2209
|
+
// src/js/core/icons.ts
|
|
2240
2210
|
var buildSearchIcon = () => `
|
|
2241
2211
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
|
|
2242
2212
|
<circle cx="11" cy="11" r="7" />
|
|
@@ -2263,31 +2233,15 @@ var buildGlobeIcon = () => `
|
|
|
2263
2233
|
<path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
|
|
2264
2234
|
</svg>`;
|
|
2265
2235
|
|
|
2266
|
-
// src/js/
|
|
2236
|
+
// src/js/core/ui.ts
|
|
2267
2237
|
var UI = class _UI {
|
|
2268
|
-
constructor(input, options, id2) {
|
|
2269
|
-
this.#searchKeyupTimer = null;
|
|
2270
|
-
this.#inlineDropdownHeight = null;
|
|
2271
|
-
this.#dropdownForContainer = null;
|
|
2272
|
-
this.#selectedItem = null;
|
|
2273
|
-
this.highlightedItem = null;
|
|
2274
|
-
input.dataset.intlTelInputId = id2.toString();
|
|
2275
|
-
this.telInput = input;
|
|
2276
|
-
this.#options = options;
|
|
2277
|
-
this.#id = id2;
|
|
2278
|
-
this.hadInitialPlaceholder = Boolean(input.getAttribute("placeholder"));
|
|
2279
|
-
this.#isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
2280
|
-
if (this.#options.separateDialCode) {
|
|
2281
|
-
this.#originalPaddingLeft = this.telInput.style.paddingLeft;
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
2238
|
// private
|
|
2285
2239
|
#options;
|
|
2286
2240
|
#id;
|
|
2287
2241
|
#isRTL;
|
|
2288
|
-
#originalPaddingLeft;
|
|
2242
|
+
#originalPaddingLeft = "";
|
|
2289
2243
|
#countries;
|
|
2290
|
-
#searchKeyupTimer;
|
|
2244
|
+
#searchKeyupTimer = null;
|
|
2291
2245
|
#inlineDropdownHeight;
|
|
2292
2246
|
#selectedDialCode;
|
|
2293
2247
|
#dropdownArrow;
|
|
@@ -2296,7 +2250,30 @@ var UI = class _UI {
|
|
|
2296
2250
|
#searchNoResults;
|
|
2297
2251
|
#searchResultsA11yText;
|
|
2298
2252
|
#dropdownForContainer;
|
|
2299
|
-
#selectedItem;
|
|
2253
|
+
#selectedItem = null;
|
|
2254
|
+
// public
|
|
2255
|
+
telInput;
|
|
2256
|
+
countryContainer;
|
|
2257
|
+
selectedCountry;
|
|
2258
|
+
selectedCountryInner;
|
|
2259
|
+
searchInput;
|
|
2260
|
+
searchClearButton;
|
|
2261
|
+
countryList;
|
|
2262
|
+
hiddenInputPhone;
|
|
2263
|
+
hiddenInputCountry;
|
|
2264
|
+
highlightedItem = null;
|
|
2265
|
+
hadInitialPlaceholder;
|
|
2266
|
+
constructor(input, options, id2) {
|
|
2267
|
+
input.dataset.intlTelInputId = id2.toString();
|
|
2268
|
+
this.telInput = input;
|
|
2269
|
+
this.#options = options;
|
|
2270
|
+
this.#id = id2;
|
|
2271
|
+
this.hadInitialPlaceholder = Boolean(input.getAttribute("placeholder"));
|
|
2272
|
+
this.#isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
2273
|
+
if (this.#options.separateDialCode) {
|
|
2274
|
+
this.#originalPaddingLeft = this.telInput.style.paddingLeft;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2300
2277
|
// Validate that the provided element is an HTMLInputElement.
|
|
2301
2278
|
static validateInput(input) {
|
|
2302
2279
|
const tagName = input?.tagName;
|
|
@@ -2312,6 +2289,9 @@ var UI = class _UI {
|
|
|
2312
2289
|
generateMarkup(countries) {
|
|
2313
2290
|
this.#countries = countries;
|
|
2314
2291
|
this.telInput.classList.add("iti__tel-input");
|
|
2292
|
+
if (!this.telInput.hasAttribute("type")) {
|
|
2293
|
+
this.telInput.setAttribute("type", "tel");
|
|
2294
|
+
}
|
|
2315
2295
|
if (!this.telInput.hasAttribute("autocomplete")) {
|
|
2316
2296
|
this.telInput.setAttribute("autocomplete", "tel");
|
|
2317
2297
|
}
|
|
@@ -2531,7 +2511,7 @@ var UI = class _UI {
|
|
|
2531
2511
|
},
|
|
2532
2512
|
this.#dropdownContent
|
|
2533
2513
|
);
|
|
2534
|
-
this.#searchNoResults.textContent = i18n.searchEmptyState;
|
|
2514
|
+
this.#searchNoResults.textContent = i18n.searchEmptyState ?? null;
|
|
2535
2515
|
}
|
|
2536
2516
|
#maybeUpdateInputPaddingAndReveal() {
|
|
2537
2517
|
if (this.countryContainer) {
|
|
@@ -2549,13 +2529,13 @@ var UI = class _UI {
|
|
|
2549
2529
|
`input[name="${names.phone}"]`
|
|
2550
2530
|
);
|
|
2551
2531
|
if (existingInput) {
|
|
2552
|
-
this.
|
|
2532
|
+
this.hiddenInputPhone = existingInput;
|
|
2553
2533
|
} else {
|
|
2554
|
-
this.
|
|
2534
|
+
this.hiddenInputPhone = createEl("input", {
|
|
2555
2535
|
type: "hidden",
|
|
2556
2536
|
name: names.phone
|
|
2557
2537
|
});
|
|
2558
|
-
wrapper.appendChild(this.
|
|
2538
|
+
wrapper.appendChild(this.hiddenInputPhone);
|
|
2559
2539
|
}
|
|
2560
2540
|
}
|
|
2561
2541
|
if (names.country) {
|
|
@@ -2800,28 +2780,9 @@ var UI = class _UI {
|
|
|
2800
2780
|
const wrapper = this.telInput.parentNode;
|
|
2801
2781
|
wrapper.before(this.telInput);
|
|
2802
2782
|
wrapper.remove();
|
|
2803
|
-
this.telInput = null;
|
|
2804
|
-
this.countryContainer = null;
|
|
2805
|
-
this.selectedCountry = null;
|
|
2806
|
-
this.selectedCountryInner = null;
|
|
2807
|
-
this.searchInput = null;
|
|
2808
|
-
this.searchClearButton = null;
|
|
2809
|
-
this.countryList = null;
|
|
2810
|
-
this.hiddenInput = null;
|
|
2811
|
-
this.hiddenInputCountry = null;
|
|
2812
|
-
this.highlightedItem = null;
|
|
2813
|
-
this.#selectedDialCode = null;
|
|
2814
|
-
this.#dropdownArrow = null;
|
|
2815
|
-
this.#dropdownContent = null;
|
|
2816
|
-
this.#searchIcon = null;
|
|
2817
|
-
this.#searchNoResults = null;
|
|
2818
|
-
this.#searchResultsA11yText = null;
|
|
2819
|
-
this.#dropdownForContainer = null;
|
|
2820
|
-
this.#selectedItem = null;
|
|
2821
2783
|
for (const c of this.#countries) {
|
|
2822
2784
|
delete c.nodeById[this.#id];
|
|
2823
2785
|
}
|
|
2824
|
-
this.#countries = null;
|
|
2825
2786
|
}
|
|
2826
2787
|
// UI: Open the dropdown (DOM only).
|
|
2827
2788
|
openDropdown() {
|
|
@@ -2845,10 +2806,10 @@ var UI = class _UI {
|
|
|
2845
2806
|
this.#dropdownContent.classList.remove(CLASSES.HIDE);
|
|
2846
2807
|
this.selectedCountry.setAttribute(ARIA.EXPANDED, "true");
|
|
2847
2808
|
if (countrySearch) {
|
|
2848
|
-
const
|
|
2849
|
-
if (
|
|
2850
|
-
this.highlightListItem(
|
|
2851
|
-
this.
|
|
2809
|
+
const itemToHighlight = this.#selectedItem ?? this.countryList.firstElementChild;
|
|
2810
|
+
if (itemToHighlight) {
|
|
2811
|
+
this.highlightListItem(itemToHighlight, false);
|
|
2812
|
+
this.scrollCountryListToItem(itemToHighlight);
|
|
2852
2813
|
}
|
|
2853
2814
|
if (!dropdownAlwaysOpen) {
|
|
2854
2815
|
this.searchInput.focus();
|
|
@@ -2863,6 +2824,8 @@ var UI = class _UI {
|
|
|
2863
2824
|
this.selectedCountry.setAttribute(ARIA.EXPANDED, "false");
|
|
2864
2825
|
if (countrySearch) {
|
|
2865
2826
|
this.searchInput.removeAttribute(ARIA.ACTIVE_DESCENDANT);
|
|
2827
|
+
this.searchInput.value = "";
|
|
2828
|
+
this.#doFilter();
|
|
2866
2829
|
if (this.highlightedItem) {
|
|
2867
2830
|
this.highlightedItem.classList.remove(CLASSES.HIGHLIGHT);
|
|
2868
2831
|
this.highlightedItem = null;
|
|
@@ -2917,7 +2880,9 @@ var UI = class _UI {
|
|
|
2917
2880
|
}
|
|
2918
2881
|
setCountry(selectedCountryData) {
|
|
2919
2882
|
const { allowDropdown, showFlags, separateDialCode, i18n } = this.#options;
|
|
2920
|
-
const
|
|
2883
|
+
const name = selectedCountryData?.name;
|
|
2884
|
+
const dialCode = selectedCountryData?.dialCode;
|
|
2885
|
+
const iso2 = selectedCountryData?.iso2 ?? "";
|
|
2921
2886
|
if (allowDropdown) {
|
|
2922
2887
|
this.#updateSelectedItem(iso2);
|
|
2923
2888
|
}
|
|
@@ -2946,7 +2911,7 @@ var UI = class _UI {
|
|
|
2946
2911
|
}
|
|
2947
2912
|
};
|
|
2948
2913
|
|
|
2949
|
-
// src/js/
|
|
2914
|
+
// src/js/data/country-data.ts
|
|
2950
2915
|
var processAllCountries = (options) => {
|
|
2951
2916
|
const { onlyCountries, excludeCountries } = options;
|
|
2952
2917
|
if (onlyCountries?.length) {
|
|
@@ -3051,7 +3016,7 @@ var cacheSearchTokens = (countries) => {
|
|
|
3051
3016
|
}
|
|
3052
3017
|
};
|
|
3053
3018
|
|
|
3054
|
-
// src/js/
|
|
3019
|
+
// src/js/data/intl-regionless.ts
|
|
3055
3020
|
var REGIONLESS_DIAL_CODES = /* @__PURE__ */ new Set([
|
|
3056
3021
|
"800",
|
|
3057
3022
|
"808",
|
|
@@ -3067,7 +3032,7 @@ var hasRegionlessDialCode = (number) => {
|
|
|
3067
3032
|
return number.startsWith("+") && REGIONLESS_DIAL_CODES.has(dialCode);
|
|
3068
3033
|
};
|
|
3069
3034
|
|
|
3070
|
-
// src/js/
|
|
3035
|
+
// src/js/format/formatting.ts
|
|
3071
3036
|
var beforeSetNumber = (fullNumber, hasValidDialCode, separateDialCode, selectedCountryData) => {
|
|
3072
3037
|
let number = fullNumber;
|
|
3073
3038
|
if (separateDialCode) {
|
|
@@ -3079,9 +3044,9 @@ var beforeSetNumber = (fullNumber, hasValidDialCode, separateDialCode, selectedC
|
|
|
3079
3044
|
}
|
|
3080
3045
|
return number;
|
|
3081
3046
|
};
|
|
3082
|
-
var formatNumberAsYouType = (fullNumber, telInputValue,
|
|
3083
|
-
const result =
|
|
3084
|
-
const
|
|
3047
|
+
var formatNumberAsYouType = (fullNumber, telInputValue, utils, selectedCountryData, separateDialCode) => {
|
|
3048
|
+
const result = utils ? utils.formatNumberAsYouType(fullNumber, selectedCountryData?.iso2) : fullNumber;
|
|
3049
|
+
const dialCode = selectedCountryData?.dialCode;
|
|
3085
3050
|
if (separateDialCode && telInputValue.charAt(0) !== "+" && result.includes(`+${dialCode}`)) {
|
|
3086
3051
|
const afterDialCode = result.split(`+${dialCode}`)[1] || "";
|
|
3087
3052
|
return afterDialCode.trim();
|
|
@@ -3089,7 +3054,7 @@ var formatNumberAsYouType = (fullNumber, telInputValue, utils2, selectedCountryD
|
|
|
3089
3054
|
return result;
|
|
3090
3055
|
};
|
|
3091
3056
|
|
|
3092
|
-
// src/js/
|
|
3057
|
+
// src/js/format/caret.ts
|
|
3093
3058
|
var translateCursorPosition = (relevantChars, formattedValue, prevCaretPos, isDeleteForwards) => {
|
|
3094
3059
|
if (prevCaretPos === 0 && !isDeleteForwards) {
|
|
3095
3060
|
return 0;
|
|
@@ -3109,7 +3074,7 @@ var translateCursorPosition = (relevantChars, formattedValue, prevCaretPos, isDe
|
|
|
3109
3074
|
return formattedValue.length;
|
|
3110
3075
|
};
|
|
3111
3076
|
|
|
3112
|
-
// src/js/
|
|
3077
|
+
// src/js/data/nanp-regionless.ts
|
|
3113
3078
|
var regionlessNanpNumbers = /* @__PURE__ */ new Set([
|
|
3114
3079
|
"800",
|
|
3115
3080
|
"822",
|
|
@@ -3138,7 +3103,7 @@ var isRegionlessNanp = (number) => {
|
|
|
3138
3103
|
return false;
|
|
3139
3104
|
};
|
|
3140
3105
|
|
|
3141
|
-
// src/js/
|
|
3106
|
+
// src/js/core/numerals.ts
|
|
3142
3107
|
var Numerals = class {
|
|
3143
3108
|
#userNumeralSet;
|
|
3144
3109
|
constructor(initialValue) {
|
|
@@ -3185,7 +3150,26 @@ var Numerals = class {
|
|
|
3185
3150
|
|
|
3186
3151
|
// src/js/intl-tel-input.ts
|
|
3187
3152
|
var id = 0;
|
|
3153
|
+
var ensureUtils = (methodName) => {
|
|
3154
|
+
if (!intlTelInput.utils) {
|
|
3155
|
+
throw new Error(`intlTelInput.utils is required for ${methodName}(). See: https://intl-tel-input.com/docs/utils`);
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
var createDeferred = () => {
|
|
3159
|
+
let resolve;
|
|
3160
|
+
let reject;
|
|
3161
|
+
const promise = new Promise((res, rej) => {
|
|
3162
|
+
resolve = res;
|
|
3163
|
+
reject = rej;
|
|
3164
|
+
});
|
|
3165
|
+
return { promise, resolve, reject };
|
|
3166
|
+
};
|
|
3188
3167
|
var Iti = class _Iti {
|
|
3168
|
+
//* PUBLIC FIELDS - READONLY
|
|
3169
|
+
//* Can't be private as it's called from intlTelInput convenience wrapper.
|
|
3170
|
+
id;
|
|
3171
|
+
// accessed externally via iti.promise.then(...)
|
|
3172
|
+
promise;
|
|
3189
3173
|
//* PRIVATE FIELDS
|
|
3190
3174
|
#ui;
|
|
3191
3175
|
#options;
|
|
@@ -3196,16 +3180,15 @@ var Iti = class _Iti {
|
|
|
3196
3180
|
#dialCodeToIso2Map;
|
|
3197
3181
|
#dialCodes;
|
|
3198
3182
|
#countryByIso2;
|
|
3199
|
-
#selectedCountryData;
|
|
3200
|
-
#maxCoreNumberLength;
|
|
3183
|
+
#selectedCountryData = null;
|
|
3184
|
+
#maxCoreNumberLength = null;
|
|
3201
3185
|
#defaultCountry;
|
|
3186
|
+
#destroyed = false;
|
|
3202
3187
|
#abortController;
|
|
3203
|
-
#dropdownAbortController;
|
|
3188
|
+
#dropdownAbortController = null;
|
|
3204
3189
|
#numerals;
|
|
3205
|
-
#
|
|
3206
|
-
#
|
|
3207
|
-
#resolveUtilsScriptPromise;
|
|
3208
|
-
#rejectUtilsScriptPromise;
|
|
3190
|
+
#autoCountryDeferred;
|
|
3191
|
+
#utilsScriptDeferred;
|
|
3209
3192
|
constructor(input, customOptions = {}) {
|
|
3210
3193
|
this.id = id++;
|
|
3211
3194
|
UI.validateInput(input);
|
|
@@ -3238,37 +3221,19 @@ var Iti = class _Iti {
|
|
|
3238
3221
|
const { initialCountry, geoIpLookup, loadUtils } = options;
|
|
3239
3222
|
const needsAutoCountryPromise = initialCountry === INITIAL_COUNTRY.AUTO && Boolean(geoIpLookup);
|
|
3240
3223
|
const needsUtilsScriptPromise = Boolean(loadUtils) && !intlTelInput.utils;
|
|
3241
|
-
let autoCountryPromise;
|
|
3242
3224
|
if (needsAutoCountryPromise) {
|
|
3243
|
-
|
|
3244
|
-
this.#resolveAutoCountryPromise = resolve;
|
|
3245
|
-
this.#rejectAutoCountryPromise = reject;
|
|
3246
|
-
});
|
|
3247
|
-
} else {
|
|
3248
|
-
autoCountryPromise = Promise.resolve(void 0);
|
|
3249
|
-
this.#resolveAutoCountryPromise = () => {
|
|
3250
|
-
};
|
|
3251
|
-
this.#rejectAutoCountryPromise = () => {
|
|
3252
|
-
};
|
|
3225
|
+
this.#autoCountryDeferred = createDeferred();
|
|
3253
3226
|
}
|
|
3254
|
-
let utilsScriptPromise;
|
|
3255
3227
|
if (needsUtilsScriptPromise) {
|
|
3256
|
-
|
|
3257
|
-
this.#resolveUtilsScriptPromise = resolve;
|
|
3258
|
-
this.#rejectUtilsScriptPromise = reject;
|
|
3259
|
-
});
|
|
3260
|
-
} else {
|
|
3261
|
-
utilsScriptPromise = Promise.resolve(void 0);
|
|
3262
|
-
this.#resolveUtilsScriptPromise = () => {
|
|
3263
|
-
};
|
|
3264
|
-
this.#rejectUtilsScriptPromise = () => {
|
|
3265
|
-
};
|
|
3228
|
+
this.#utilsScriptDeferred = createDeferred();
|
|
3266
3229
|
}
|
|
3267
|
-
return Promise.all([
|
|
3230
|
+
return Promise.all([
|
|
3231
|
+
this.#autoCountryDeferred?.promise,
|
|
3232
|
+
this.#utilsScriptDeferred?.promise
|
|
3233
|
+
]).then(() => {
|
|
3268
3234
|
});
|
|
3269
3235
|
}
|
|
3270
3236
|
#init() {
|
|
3271
|
-
this.#selectedCountryData = null;
|
|
3272
3237
|
this.#abortController = new AbortController();
|
|
3273
3238
|
this.#processCountryData();
|
|
3274
3239
|
this.#ui.generateMarkup(this.#countries);
|
|
@@ -3293,7 +3258,7 @@ var Iti = class _Iti {
|
|
|
3293
3258
|
//* 2. Using explicit initialCountry
|
|
3294
3259
|
#setInitialState(overrideAutoCountry = false) {
|
|
3295
3260
|
const attributeValueRaw = this.#ui.telInput.getAttribute("value");
|
|
3296
|
-
const attributeValue = this.#numerals.normalise(attributeValueRaw);
|
|
3261
|
+
const attributeValue = this.#numerals.normalise(attributeValueRaw ?? "");
|
|
3297
3262
|
const inputValue = this.#getTelInputValue();
|
|
3298
3263
|
const useAttribute = attributeValue && attributeValue.startsWith("+") && (!inputValue || !inputValue.startsWith("+"));
|
|
3299
3264
|
const val = useAttribute ? attributeValue : inputValue;
|
|
@@ -3328,15 +3293,15 @@ var Iti = class _Iti {
|
|
|
3328
3293
|
if (this.#options.allowDropdown) {
|
|
3329
3294
|
this.#initDropdownListeners();
|
|
3330
3295
|
}
|
|
3331
|
-
if ((this.#ui.
|
|
3296
|
+
if ((this.#ui.hiddenInputPhone || this.#ui.hiddenInputCountry) && this.#ui.telInput.form) {
|
|
3332
3297
|
this.#initHiddenInputListener();
|
|
3333
3298
|
}
|
|
3334
3299
|
}
|
|
3335
3300
|
//* Update hidden input on form submit.
|
|
3336
3301
|
#initHiddenInputListener() {
|
|
3337
3302
|
const handleHiddenInputSubmit = () => {
|
|
3338
|
-
if (this.#ui.
|
|
3339
|
-
this.#ui.
|
|
3303
|
+
if (this.#ui.hiddenInputPhone) {
|
|
3304
|
+
this.#ui.hiddenInputPhone.value = this.getNumber();
|
|
3340
3305
|
}
|
|
3341
3306
|
if (this.#ui.hiddenInputCountry) {
|
|
3342
3307
|
this.#ui.hiddenInputCountry.value = this.#selectedCountryData?.iso2 || "";
|
|
@@ -3405,12 +3370,12 @@ var Iti = class _Iti {
|
|
|
3405
3370
|
});
|
|
3406
3371
|
}
|
|
3407
3372
|
} else {
|
|
3408
|
-
this.#
|
|
3373
|
+
this.#utilsScriptDeferred?.resolve();
|
|
3409
3374
|
}
|
|
3410
3375
|
const isAutoCountry = initialCountry === INITIAL_COUNTRY.AUTO && geoIpLookup;
|
|
3411
3376
|
if (isAutoCountry) {
|
|
3412
|
-
if (this.#selectedCountryData
|
|
3413
|
-
this.#
|
|
3377
|
+
if (this.#selectedCountryData) {
|
|
3378
|
+
this.#autoCountryDeferred?.resolve();
|
|
3414
3379
|
} else {
|
|
3415
3380
|
this.#loadAutoCountry();
|
|
3416
3381
|
}
|
|
@@ -3505,7 +3470,7 @@ var Iti = class _Iti {
|
|
|
3505
3470
|
fullNumber,
|
|
3506
3471
|
inputValue,
|
|
3507
3472
|
intlTelInput.utils,
|
|
3508
|
-
this.#selectedCountryData
|
|
3473
|
+
this.#selectedCountryData,
|
|
3509
3474
|
separateDialCode
|
|
3510
3475
|
);
|
|
3511
3476
|
const newCaretPos = translateCursorPosition(
|
|
@@ -3522,7 +3487,7 @@ var Iti = class _Iti {
|
|
|
3522
3487
|
inputValue,
|
|
3523
3488
|
true,
|
|
3524
3489
|
separateDialCode,
|
|
3525
|
-
this.#selectedCountryData
|
|
3490
|
+
this.#selectedCountryData
|
|
3526
3491
|
);
|
|
3527
3492
|
this.#setTelInputValue(cleanNumber);
|
|
3528
3493
|
}
|
|
@@ -3555,8 +3520,8 @@ var Iti = class _Iti {
|
|
|
3555
3520
|
const input = this.#ui.telInput;
|
|
3556
3521
|
const selStart = input.selectionStart;
|
|
3557
3522
|
const selEnd = input.selectionEnd;
|
|
3558
|
-
const before = inputValue.slice(0, selStart);
|
|
3559
|
-
const after = inputValue.slice(selEnd);
|
|
3523
|
+
const before = inputValue.slice(0, selStart ?? void 0);
|
|
3524
|
+
const after = inputValue.slice(selEnd ?? void 0);
|
|
3560
3525
|
const newValue = before + e.key + after;
|
|
3561
3526
|
const newFullNumber = this.#getFullNumber(newValue);
|
|
3562
3527
|
let hasExceededMaxLength = false;
|
|
@@ -3588,8 +3553,8 @@ var Iti = class _Iti {
|
|
|
3588
3553
|
const selStart = input.selectionStart;
|
|
3589
3554
|
const selEnd = input.selectionEnd;
|
|
3590
3555
|
const inputValue = this.#getTelInputValue();
|
|
3591
|
-
const before = inputValue.slice(0, selStart);
|
|
3592
|
-
const after = inputValue.slice(selEnd);
|
|
3556
|
+
const before = inputValue.slice(0, selStart ?? void 0);
|
|
3557
|
+
const after = inputValue.slice(selEnd ?? void 0);
|
|
3593
3558
|
const iso2 = this.#selectedCountryData?.iso2;
|
|
3594
3559
|
const pastedRaw = e.clipboardData.getData("text");
|
|
3595
3560
|
const pasted = this.#numerals.normalise(pastedRaw);
|
|
@@ -3600,7 +3565,7 @@ var Iti = class _Iti {
|
|
|
3600
3565
|
const numerics = allowedChars.replace(/\+/g, "");
|
|
3601
3566
|
const sanitised = hasLeadingPlus && allowLeadingPlus ? `+${numerics}` : numerics;
|
|
3602
3567
|
let newVal = before + sanitised + after;
|
|
3603
|
-
if (newVal.length > 5) {
|
|
3568
|
+
if (newVal.length > 5 && intlTelInput.utils) {
|
|
3604
3569
|
let coreNumber = intlTelInput.utils.getCoreNumber(newVal, iso2);
|
|
3605
3570
|
while (coreNumber.length === 0 && newVal.length > 0) {
|
|
3606
3571
|
newVal = newVal.slice(0, -1);
|
|
@@ -3890,10 +3855,10 @@ var Iti = class _Iti {
|
|
|
3890
3855
|
#setCountry(iso2) {
|
|
3891
3856
|
const prevIso2 = this.#selectedCountryData?.iso2 || "";
|
|
3892
3857
|
this.#selectedCountryData = iso2 ? this.#countryByIso2.get(iso2) : null;
|
|
3893
|
-
if (this.#selectedCountryData
|
|
3858
|
+
if (this.#selectedCountryData) {
|
|
3894
3859
|
this.#defaultCountry = this.#selectedCountryData.iso2;
|
|
3895
3860
|
}
|
|
3896
|
-
this.#ui.setCountry(this.#selectedCountryData
|
|
3861
|
+
this.#ui.setCountry(this.#selectedCountryData);
|
|
3897
3862
|
this.#updatePlaceholder();
|
|
3898
3863
|
this.#updateMaxLength();
|
|
3899
3864
|
return prevIso2 !== iso2;
|
|
@@ -3941,14 +3906,14 @@ var Iti = class _Iti {
|
|
|
3941
3906
|
const shouldSetPlaceholder = autoPlaceholder === PLACEHOLDER_MODES.AGGRESSIVE || !this.#ui.hadInitialPlaceholder && autoPlaceholder === PLACEHOLDER_MODES.POLITE;
|
|
3942
3907
|
if (intlTelInput.utils && shouldSetPlaceholder) {
|
|
3943
3908
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
3944
|
-
let placeholder = this.#selectedCountryData
|
|
3909
|
+
let placeholder = this.#selectedCountryData ? intlTelInput.utils.getExampleNumber(
|
|
3945
3910
|
this.#selectedCountryData.iso2,
|
|
3946
3911
|
nationalMode,
|
|
3947
3912
|
numberType
|
|
3948
3913
|
) : "";
|
|
3949
3914
|
placeholder = this.#beforeSetNumber(placeholder);
|
|
3950
3915
|
if (typeof customPlaceholder === "function") {
|
|
3951
|
-
placeholder = customPlaceholder(placeholder, this.#selectedCountryData
|
|
3916
|
+
placeholder = customPlaceholder(placeholder, this.#selectedCountryData);
|
|
3952
3917
|
}
|
|
3953
3918
|
this.#ui.telInput.setAttribute("placeholder", placeholder);
|
|
3954
3919
|
}
|
|
@@ -4047,14 +4012,16 @@ var Iti = class _Iti {
|
|
|
4047
4012
|
fullNumber,
|
|
4048
4013
|
hasValidDialCode,
|
|
4049
4014
|
this.#options.separateDialCode,
|
|
4050
|
-
this.#selectedCountryData
|
|
4015
|
+
this.#selectedCountryData
|
|
4051
4016
|
);
|
|
4052
4017
|
return this.#cap(number);
|
|
4053
4018
|
}
|
|
4054
4019
|
//* Return only the public-facing subset of the selected country data.
|
|
4055
4020
|
#getPublicCountryData() {
|
|
4056
4021
|
const d = this.#selectedCountryData;
|
|
4057
|
-
if (!d)
|
|
4022
|
+
if (!d) {
|
|
4023
|
+
return null;
|
|
4024
|
+
}
|
|
4058
4025
|
const { iso2, dialCode, name } = d;
|
|
4059
4026
|
return { iso2, dialCode, name };
|
|
4060
4027
|
}
|
|
@@ -4068,32 +4035,32 @@ var Iti = class _Iti {
|
|
|
4068
4035
|
//**************************
|
|
4069
4036
|
//* Called when the geoip call returns.
|
|
4070
4037
|
#handleAutoCountry() {
|
|
4071
|
-
if (
|
|
4072
|
-
this.#
|
|
4038
|
+
if (this.#destroyed) {
|
|
4039
|
+
this.#autoCountryDeferred?.resolve();
|
|
4073
4040
|
return;
|
|
4074
4041
|
}
|
|
4075
4042
|
if (this.#options.initialCountry === INITIAL_COUNTRY.AUTO && intlTelInput.autoCountry) {
|
|
4076
4043
|
this.#defaultCountry = intlTelInput.autoCountry;
|
|
4077
|
-
const hasSelectedCountryOrGlobe = this.#selectedCountryData
|
|
4044
|
+
const hasSelectedCountryOrGlobe = this.#selectedCountryData || this.#ui.selectedCountryInner.classList.contains(CLASSES.GLOBE);
|
|
4078
4045
|
if (!hasSelectedCountryOrGlobe) {
|
|
4079
4046
|
this.setCountry(this.#defaultCountry);
|
|
4080
4047
|
}
|
|
4081
|
-
this.#
|
|
4048
|
+
this.#autoCountryDeferred?.resolve();
|
|
4082
4049
|
}
|
|
4083
4050
|
}
|
|
4084
4051
|
//* Called when the geoip call fails or times out.
|
|
4085
4052
|
#handleAutoCountryFailure() {
|
|
4086
|
-
if (
|
|
4087
|
-
this.#
|
|
4053
|
+
if (this.#destroyed) {
|
|
4054
|
+
this.#autoCountryDeferred?.reject();
|
|
4088
4055
|
return;
|
|
4089
4056
|
}
|
|
4090
4057
|
this.#setInitialState(true);
|
|
4091
|
-
this.#
|
|
4058
|
+
this.#autoCountryDeferred?.reject();
|
|
4092
4059
|
}
|
|
4093
4060
|
//* Called when the utils request completes.
|
|
4094
4061
|
#handleUtils() {
|
|
4095
|
-
if (
|
|
4096
|
-
this.#
|
|
4062
|
+
if (this.#destroyed) {
|
|
4063
|
+
this.#utilsScriptDeferred?.resolve();
|
|
4097
4064
|
return;
|
|
4098
4065
|
}
|
|
4099
4066
|
if (intlTelInput.utils) {
|
|
@@ -4101,74 +4068,77 @@ var Iti = class _Iti {
|
|
|
4101
4068
|
if (inputValue) {
|
|
4102
4069
|
this.#updateValFromNumber(inputValue);
|
|
4103
4070
|
}
|
|
4104
|
-
if (this.#selectedCountryData
|
|
4071
|
+
if (this.#selectedCountryData) {
|
|
4105
4072
|
this.#updatePlaceholder();
|
|
4106
4073
|
this.#updateMaxLength();
|
|
4107
4074
|
}
|
|
4108
4075
|
}
|
|
4109
|
-
this.#
|
|
4076
|
+
this.#utilsScriptDeferred?.resolve();
|
|
4110
4077
|
}
|
|
4111
4078
|
//* Called when the utils request fails or times out.
|
|
4112
4079
|
#handleUtilsFailure(error) {
|
|
4113
|
-
if (
|
|
4114
|
-
this.#
|
|
4080
|
+
if (this.#destroyed) {
|
|
4081
|
+
this.#utilsScriptDeferred?.reject(error);
|
|
4115
4082
|
return;
|
|
4116
4083
|
}
|
|
4117
|
-
this.#
|
|
4084
|
+
this.#utilsScriptDeferred?.reject(error);
|
|
4118
4085
|
}
|
|
4119
4086
|
//********************
|
|
4120
4087
|
//* PUBLIC METHODS
|
|
4121
4088
|
//********************
|
|
4122
4089
|
//* Remove plugin.
|
|
4123
4090
|
destroy() {
|
|
4124
|
-
if (
|
|
4091
|
+
if (this.#destroyed) {
|
|
4125
4092
|
return;
|
|
4126
4093
|
}
|
|
4094
|
+
this.#destroyed = true;
|
|
4127
4095
|
if (this.#options.allowDropdown) {
|
|
4128
4096
|
this.#closeDropdown(true);
|
|
4129
4097
|
}
|
|
4130
4098
|
this.#abortController.abort();
|
|
4131
|
-
this.#abortController = null;
|
|
4132
4099
|
this.#ui.destroy();
|
|
4133
|
-
|
|
4100
|
+
intlTelInput.instances.delete(String(this.id));
|
|
4134
4101
|
}
|
|
4135
|
-
// check if the instance is still valid (not destroyed
|
|
4102
|
+
// check if the instance is still valid (not destroyed)
|
|
4136
4103
|
isActive() {
|
|
4137
|
-
return
|
|
4104
|
+
return !this.#destroyed;
|
|
4138
4105
|
}
|
|
4139
4106
|
//* Get the extension from the current number.
|
|
4140
4107
|
getExtension() {
|
|
4141
|
-
if (
|
|
4142
|
-
return
|
|
4143
|
-
this.#getFullNumber(),
|
|
4144
|
-
this.#selectedCountryData?.iso2
|
|
4145
|
-
);
|
|
4108
|
+
if (this.#destroyed) {
|
|
4109
|
+
return "";
|
|
4146
4110
|
}
|
|
4147
|
-
|
|
4111
|
+
ensureUtils("getExtension");
|
|
4112
|
+
return intlTelInput.utils.getExtension(
|
|
4113
|
+
this.#getFullNumber(),
|
|
4114
|
+
this.#selectedCountryData?.iso2
|
|
4115
|
+
);
|
|
4148
4116
|
}
|
|
4149
4117
|
//* Format the number to the given format.
|
|
4150
4118
|
getNumber(format) {
|
|
4151
|
-
if (
|
|
4152
|
-
|
|
4153
|
-
const fullNumber = this.#getFullNumber();
|
|
4154
|
-
const formattedNumber = intlTelInput.utils.formatNumber(
|
|
4155
|
-
fullNumber,
|
|
4156
|
-
iso2,
|
|
4157
|
-
format
|
|
4158
|
-
);
|
|
4159
|
-
return this.#numerals.denormalise(formattedNumber);
|
|
4119
|
+
if (this.#destroyed) {
|
|
4120
|
+
return "";
|
|
4160
4121
|
}
|
|
4161
|
-
|
|
4122
|
+
ensureUtils("getNumber");
|
|
4123
|
+
const iso2 = this.#selectedCountryData?.iso2;
|
|
4124
|
+
const fullNumber = this.#getFullNumber();
|
|
4125
|
+
const formattedNumber = intlTelInput.utils.formatNumber(
|
|
4126
|
+
fullNumber,
|
|
4127
|
+
iso2,
|
|
4128
|
+
format
|
|
4129
|
+
);
|
|
4130
|
+
return this.#numerals.denormalise(formattedNumber);
|
|
4162
4131
|
}
|
|
4163
4132
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
4164
4133
|
getNumberType() {
|
|
4165
|
-
if (
|
|
4166
|
-
return
|
|
4167
|
-
this.#getFullNumber(),
|
|
4168
|
-
this.#selectedCountryData?.iso2
|
|
4169
|
-
);
|
|
4134
|
+
if (this.#destroyed) {
|
|
4135
|
+
return SENTINELS.UNKNOWN_NUMBER_TYPE;
|
|
4170
4136
|
}
|
|
4171
|
-
|
|
4137
|
+
ensureUtils("getNumberType");
|
|
4138
|
+
return intlTelInput.utils.getNumberType(
|
|
4139
|
+
this.#getFullNumber(),
|
|
4140
|
+
this.#selectedCountryData?.iso2
|
|
4141
|
+
);
|
|
4172
4142
|
}
|
|
4173
4143
|
//* Get the country data for the currently selected country.
|
|
4174
4144
|
getSelectedCountryData() {
|
|
@@ -4176,32 +4146,35 @@ var Iti = class _Iti {
|
|
|
4176
4146
|
}
|
|
4177
4147
|
//* Get the validation error.
|
|
4178
4148
|
getValidationError() {
|
|
4179
|
-
if (
|
|
4180
|
-
|
|
4181
|
-
return intlTelInput.utils.getValidationError(this.#getFullNumber(), iso2);
|
|
4149
|
+
if (this.#destroyed) {
|
|
4150
|
+
return SENTINELS.UNKNOWN_VALIDATION_ERROR;
|
|
4182
4151
|
}
|
|
4183
|
-
|
|
4152
|
+
ensureUtils("getValidationError");
|
|
4153
|
+
const iso2 = this.#selectedCountryData?.iso2;
|
|
4154
|
+
return intlTelInput.utils.getValidationError(this.#getFullNumber(), iso2);
|
|
4184
4155
|
}
|
|
4185
4156
|
//* Validate the input val using number length only
|
|
4186
4157
|
isValidNumber() {
|
|
4158
|
+
if (this.#destroyed) {
|
|
4159
|
+
return null;
|
|
4160
|
+
}
|
|
4161
|
+
ensureUtils("isValidNumber");
|
|
4187
4162
|
const dialCode = this.#selectedCountryData?.dialCode;
|
|
4188
4163
|
const iso2 = this.#selectedCountryData?.iso2;
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
if (
|
|
4193
|
-
if (
|
|
4194
|
-
|
|
4195
|
-
return false;
|
|
4196
|
-
}
|
|
4164
|
+
const number = this.#getFullNumber();
|
|
4165
|
+
const coreNumber = intlTelInput.utils.getCoreNumber(number, iso2);
|
|
4166
|
+
if (coreNumber) {
|
|
4167
|
+
if (dialCode === UK.DIAL_CODE) {
|
|
4168
|
+
if (coreNumber[0] === UK.MOBILE_PREFIX && coreNumber.length !== UK.MOBILE_CORE_LENGTH) {
|
|
4169
|
+
return false;
|
|
4197
4170
|
}
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4171
|
+
}
|
|
4172
|
+
const hasAlphaChar = REGEX.ALPHA_UNICODE.test(number);
|
|
4173
|
+
if (!hasAlphaChar && dialCode) {
|
|
4174
|
+
const nationalPortion = number.startsWith("+") ? number.slice(1 + dialCode.length) : number;
|
|
4175
|
+
const nationalDigitCount = getNumeric(nationalPortion).length;
|
|
4176
|
+
if (coreNumber.length > nationalDigitCount) {
|
|
4177
|
+
return false;
|
|
4205
4178
|
}
|
|
4206
4179
|
}
|
|
4207
4180
|
}
|
|
@@ -4209,6 +4182,10 @@ var Iti = class _Iti {
|
|
|
4209
4182
|
}
|
|
4210
4183
|
//* Validate the input val with precise validation
|
|
4211
4184
|
isValidNumberPrecise() {
|
|
4185
|
+
if (this.#destroyed) {
|
|
4186
|
+
return null;
|
|
4187
|
+
}
|
|
4188
|
+
ensureUtils("isValidNumberPrecise");
|
|
4212
4189
|
return this.#validateNumber(true);
|
|
4213
4190
|
}
|
|
4214
4191
|
#utilsIsPossibleNumber(val) {
|
|
@@ -4220,13 +4197,10 @@ var Iti = class _Iti {
|
|
|
4220
4197
|
}
|
|
4221
4198
|
//* Shared internal validation logic to handle alpha character extension rules.
|
|
4222
4199
|
#validateNumber(precise) {
|
|
4223
|
-
if (!intlTelInput.utils || !this.#ui.telInput) {
|
|
4224
|
-
return null;
|
|
4225
|
-
}
|
|
4226
4200
|
const { allowNumberExtensions, allowPhonewords } = this.#options;
|
|
4227
4201
|
const testValidity = (s) => precise ? this.#utilsIsValidNumber(s) : this.#utilsIsPossibleNumber(s);
|
|
4228
4202
|
const val = this.#getFullNumber();
|
|
4229
|
-
if (!this.#selectedCountryData
|
|
4203
|
+
if (!this.#selectedCountryData) {
|
|
4230
4204
|
const isRegionlessDialCode = hasRegionlessDialCode(val);
|
|
4231
4205
|
if (!isRegionlessDialCode) {
|
|
4232
4206
|
return false;
|
|
@@ -4256,7 +4230,7 @@ var Iti = class _Iti {
|
|
|
4256
4230
|
}
|
|
4257
4231
|
//* Update the selected country, and update the input val accordingly.
|
|
4258
4232
|
setCountry(iso2) {
|
|
4259
|
-
if (
|
|
4233
|
+
if (this.#destroyed) {
|
|
4260
4234
|
return;
|
|
4261
4235
|
}
|
|
4262
4236
|
const iso2Lower = iso2?.toLowerCase();
|
|
@@ -4277,7 +4251,7 @@ var Iti = class _Iti {
|
|
|
4277
4251
|
}
|
|
4278
4252
|
//* Set the input value and update the country.
|
|
4279
4253
|
setNumber(number) {
|
|
4280
|
-
if (
|
|
4254
|
+
if (this.#destroyed) {
|
|
4281
4255
|
return;
|
|
4282
4256
|
}
|
|
4283
4257
|
const normalisedNumber = this.#numerals.normalise(number);
|
|
@@ -4288,16 +4262,17 @@ var Iti = class _Iti {
|
|
|
4288
4262
|
}
|
|
4289
4263
|
this.#trigger(EVENTS.INPUT, { isSetNumber: true });
|
|
4290
4264
|
}
|
|
4291
|
-
//* Set the placeholder number
|
|
4265
|
+
//* Set the placeholder number type
|
|
4292
4266
|
setPlaceholderNumberType(type) {
|
|
4293
|
-
if (
|
|
4267
|
+
if (this.#destroyed) {
|
|
4294
4268
|
return;
|
|
4295
4269
|
}
|
|
4296
4270
|
this.#options.placeholderNumberType = type;
|
|
4297
4271
|
this.#updatePlaceholder();
|
|
4298
4272
|
}
|
|
4273
|
+
// Set the disabled state of the input and dropdown.
|
|
4299
4274
|
setDisabled(disabled) {
|
|
4300
|
-
if (
|
|
4275
|
+
if (this.#destroyed) {
|
|
4301
4276
|
return;
|
|
4302
4277
|
}
|
|
4303
4278
|
this.#ui.telInput.disabled = disabled;
|
|
@@ -4309,6 +4284,20 @@ var Iti = class _Iti {
|
|
|
4309
4284
|
}
|
|
4310
4285
|
}
|
|
4311
4286
|
}
|
|
4287
|
+
// Set the readonly state of the input and dropdown.
|
|
4288
|
+
setReadonly(readonly) {
|
|
4289
|
+
if (!this.#ui.telInput) {
|
|
4290
|
+
return;
|
|
4291
|
+
}
|
|
4292
|
+
this.#ui.telInput.readOnly = readonly;
|
|
4293
|
+
if (this.#ui.selectedCountry) {
|
|
4294
|
+
if (readonly) {
|
|
4295
|
+
this.#ui.selectedCountry.setAttribute("disabled", "true");
|
|
4296
|
+
} else {
|
|
4297
|
+
this.#ui.selectedCountry.removeAttribute("disabled");
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4312
4301
|
//********************
|
|
4313
4302
|
//* STATIC METHODS
|
|
4314
4303
|
//********************
|
|
@@ -4316,7 +4305,7 @@ var Iti = class _Iti {
|
|
|
4316
4305
|
// Kept public so module-level helpers (e.g. attachUtils) can call it, while still allowing
|
|
4317
4306
|
// access to private instance methods.
|
|
4318
4307
|
static forEachInstance(method, ...args) {
|
|
4319
|
-
const values =
|
|
4308
|
+
const values = [...intlTelInput.instances.values()];
|
|
4320
4309
|
const arg = args[0];
|
|
4321
4310
|
values.forEach((instance) => {
|
|
4322
4311
|
if (!(instance instanceof _Iti)) {
|
|
@@ -4356,14 +4345,14 @@ var attachUtils = (source) => {
|
|
|
4356
4345
|
);
|
|
4357
4346
|
}
|
|
4358
4347
|
intlTelInput.startedLoadingUtilsScript = true;
|
|
4359
|
-
return loadCall.then((
|
|
4360
|
-
const
|
|
4361
|
-
if (!
|
|
4348
|
+
return loadCall.then((module) => {
|
|
4349
|
+
const utils = module?.default;
|
|
4350
|
+
if (!utils || typeof utils !== "object") {
|
|
4362
4351
|
throw new TypeError(
|
|
4363
4352
|
"The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
|
|
4364
4353
|
);
|
|
4365
4354
|
}
|
|
4366
|
-
intlTelInput.utils =
|
|
4355
|
+
intlTelInput.utils = utils;
|
|
4367
4356
|
Iti.forEachInstance("handleUtils");
|
|
4368
4357
|
return true;
|
|
4369
4358
|
}).catch((error) => {
|
|
@@ -4376,7 +4365,7 @@ var attachUtils = (source) => {
|
|
|
4376
4365
|
var intlTelInput = Object.assign(
|
|
4377
4366
|
(input, options) => {
|
|
4378
4367
|
const iti = new Iti(input, options);
|
|
4379
|
-
intlTelInput.instances
|
|
4368
|
+
intlTelInput.instances.set(String(iti.id), iti);
|
|
4380
4369
|
input.iti = iti;
|
|
4381
4370
|
return iti;
|
|
4382
4371
|
},
|
|
@@ -4389,35 +4378,36 @@ var intlTelInput = Object.assign(
|
|
|
4389
4378
|
//* A getter for the plugin instance.
|
|
4390
4379
|
getInstance: (input) => {
|
|
4391
4380
|
const id2 = input.dataset.intlTelInputId;
|
|
4392
|
-
return id2 ? intlTelInput.instances
|
|
4381
|
+
return id2 ? intlTelInput.instances.get(id2) ?? null : null;
|
|
4393
4382
|
},
|
|
4394
4383
|
//* A map from instance ID to instance object.
|
|
4395
|
-
instances:
|
|
4384
|
+
instances: /* @__PURE__ */ new Map(),
|
|
4396
4385
|
attachUtils,
|
|
4397
4386
|
startedLoadingUtilsScript: false,
|
|
4398
4387
|
startedLoadingAutoCountry: false,
|
|
4399
|
-
version: "
|
|
4388
|
+
version: "27.0.0"
|
|
4400
4389
|
}
|
|
4401
4390
|
);
|
|
4402
4391
|
var intl_tel_input_default = intlTelInput;
|
|
4403
4392
|
|
|
4404
|
-
//
|
|
4393
|
+
// dist/js/utils.js
|
|
4394
|
+
var _scope = {};
|
|
4405
4395
|
(function() {
|
|
4406
4396
|
var k = this || self;
|
|
4407
4397
|
function m(a, b) {
|
|
4408
4398
|
a = a.split(".");
|
|
4409
4399
|
var c = k;
|
|
4410
|
-
a[0] in c ||
|
|
4411
|
-
for (var d; a.length && (d = a.shift()); ) a.length || void 0
|
|
4400
|
+
a[0] in c || typeof c.execScript == "undefined" || c.execScript("var " + a[0]);
|
|
4401
|
+
for (var d; a.length && (d = a.shift()); ) a.length || b === void 0 ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
|
|
4412
4402
|
}
|
|
4413
4403
|
function n(a, b) {
|
|
4414
4404
|
function c() {
|
|
4415
4405
|
}
|
|
4416
4406
|
c.prototype = b.prototype;
|
|
4417
|
-
a.
|
|
4407
|
+
a.na = b.prototype;
|
|
4418
4408
|
a.prototype = new c();
|
|
4419
4409
|
a.prototype.constructor = a;
|
|
4420
|
-
a.
|
|
4410
|
+
a.ta = function(d, e, f) {
|
|
4421
4411
|
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++) g[h - 2] = arguments[h];
|
|
4422
4412
|
return b.prototype[e].apply(d, g);
|
|
4423
4413
|
};
|
|
@@ -4475,9 +4465,9 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4475
4465
|
new ka();
|
|
4476
4466
|
function la(a, b) {
|
|
4477
4467
|
this.g = a;
|
|
4478
|
-
this.l = !!b.
|
|
4468
|
+
this.l = !!b.ca;
|
|
4479
4469
|
this.h = b.i;
|
|
4480
|
-
this.
|
|
4470
|
+
this.u = b.type;
|
|
4481
4471
|
this.o = false;
|
|
4482
4472
|
switch (this.h) {
|
|
4483
4473
|
case ma:
|
|
@@ -4525,16 +4515,35 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4525
4515
|
p.prototype.add = function(a, b) {
|
|
4526
4516
|
va(this, a.g, b);
|
|
4527
4517
|
};
|
|
4518
|
+
p.prototype.equals = function(a) {
|
|
4519
|
+
if (!a || this.constructor != a.constructor) return false;
|
|
4520
|
+
for (var b = ua(this.m()), c = 0; c < b.length; c++) {
|
|
4521
|
+
var d = b[c], e = d.g;
|
|
4522
|
+
if (q(this, e) != q(a, e)) return false;
|
|
4523
|
+
if (q(this, e)) {
|
|
4524
|
+
var f = d.h == 11 || d.h == 10, g = u(this, e);
|
|
4525
|
+
e = u(a, e);
|
|
4526
|
+
if (d.l) {
|
|
4527
|
+
if (g.length != e.length) return false;
|
|
4528
|
+
for (d = 0; d < g.length; d++) {
|
|
4529
|
+
var h = g[d], l = e[d];
|
|
4530
|
+
if (f ? !h.equals(l) : h != l) return false;
|
|
4531
|
+
}
|
|
4532
|
+
} else if (f ? !g.equals(e) : g != e) return false;
|
|
4533
|
+
}
|
|
4534
|
+
}
|
|
4535
|
+
return true;
|
|
4536
|
+
};
|
|
4528
4537
|
function wa(a, b) {
|
|
4529
4538
|
for (var c = ua(a.m()), d = 0; d < c.length; d++) {
|
|
4530
4539
|
var e = c[d], f = e.g;
|
|
4531
4540
|
if (q(b, f)) {
|
|
4532
4541
|
a.g && delete a.g[e.g];
|
|
4533
|
-
var g =
|
|
4542
|
+
var g = e.h == 11 || e.h == 10;
|
|
4534
4543
|
if (e.l) {
|
|
4535
|
-
e = u(b, f);
|
|
4544
|
+
e = u(b, f) || [];
|
|
4536
4545
|
for (var h = 0; h < e.length; h++) va(a, f, g ? e[h].clone() : e[h]);
|
|
4537
|
-
} else e =
|
|
4546
|
+
} else e = u(b, f), g ? (g = u(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
|
|
4538
4547
|
}
|
|
4539
4548
|
}
|
|
4540
4549
|
}
|
|
@@ -4544,15 +4553,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4544
4553
|
return a;
|
|
4545
4554
|
};
|
|
4546
4555
|
function q(a, b) {
|
|
4547
|
-
return
|
|
4556
|
+
return a.h[b] != null;
|
|
4548
4557
|
}
|
|
4549
|
-
function
|
|
4558
|
+
function u(a, b) {
|
|
4550
4559
|
var c = a.h[b];
|
|
4551
|
-
if (
|
|
4560
|
+
if (c == null) return null;
|
|
4552
4561
|
if (a.l) {
|
|
4553
4562
|
if (!(b in a.g)) {
|
|
4554
4563
|
var d = a.l, e = a.j[b];
|
|
4555
|
-
if (
|
|
4564
|
+
if (c != null) if (e.l) {
|
|
4556
4565
|
for (var f = [], g = 0; g < c.length; g++) f[g] = d.h(e, c[g]);
|
|
4557
4566
|
c = f;
|
|
4558
4567
|
} else c = d.h(e, c);
|
|
@@ -4563,14 +4572,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4563
4572
|
return c;
|
|
4564
4573
|
}
|
|
4565
4574
|
function r(a, b, c) {
|
|
4566
|
-
var d =
|
|
4575
|
+
var d = u(a, b);
|
|
4567
4576
|
return a.j[b].l ? d[c || 0] : d;
|
|
4568
4577
|
}
|
|
4569
|
-
function
|
|
4578
|
+
function v(a, b) {
|
|
4570
4579
|
if (q(a, b)) a = r(a, b);
|
|
4571
4580
|
else a: {
|
|
4572
4581
|
a = a.j[b];
|
|
4573
|
-
if (void 0
|
|
4582
|
+
if (a.j === void 0) if (b = a.u, b === Boolean) a.j = false;
|
|
4574
4583
|
else if (b === Number) a.j = 0;
|
|
4575
4584
|
else if (b === String) a.j = a.o ? "0" : "";
|
|
4576
4585
|
else {
|
|
@@ -4581,10 +4590,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4581
4590
|
}
|
|
4582
4591
|
return a;
|
|
4583
4592
|
}
|
|
4584
|
-
function
|
|
4585
|
-
return v(a, b) || [];
|
|
4586
|
-
}
|
|
4587
|
-
function x(a, b) {
|
|
4593
|
+
function w(a, b) {
|
|
4588
4594
|
return a.j[b].l ? q(a, b) ? a.h[b].length : 0 : q(a, b) ? 1 : 0;
|
|
4589
4595
|
}
|
|
4590
4596
|
function t(a, b, c) {
|
|
@@ -4596,114 +4602,117 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4596
4602
|
a.h[b].push(c);
|
|
4597
4603
|
a.g && delete a.g[b];
|
|
4598
4604
|
}
|
|
4599
|
-
function
|
|
4605
|
+
function x(a, b) {
|
|
4600
4606
|
var c = [], d;
|
|
4601
|
-
for (d in b)
|
|
4607
|
+
for (d in b) d != 0 && c.push(new la(d, b[d]));
|
|
4602
4608
|
return new ta(a, c);
|
|
4603
4609
|
}
|
|
4604
4610
|
;
|
|
4605
|
-
function
|
|
4611
|
+
function y() {
|
|
4606
4612
|
}
|
|
4607
|
-
|
|
4613
|
+
y.prototype.g = function(a) {
|
|
4608
4614
|
new a.h();
|
|
4609
4615
|
throw Error("Unimplemented");
|
|
4610
4616
|
};
|
|
4611
|
-
|
|
4612
|
-
if (
|
|
4613
|
-
if (
|
|
4617
|
+
y.prototype.h = function(a, b) {
|
|
4618
|
+
if (a.h == 11 || a.h == 10) return b instanceof p ? b : this.g(a.u.prototype.m(), b);
|
|
4619
|
+
if (a.h == 14) return typeof b === "string" && xa.test(b) && (a = Number(b), a > 0) ? a : b;
|
|
4614
4620
|
if (!a.o) return b;
|
|
4615
|
-
a = a.
|
|
4621
|
+
a = a.u;
|
|
4616
4622
|
if (a === String) {
|
|
4617
|
-
if ("number"
|
|
4618
|
-
} else if (a === Number && "string"
|
|
4623
|
+
if (typeof b === "number") return String(b);
|
|
4624
|
+
} else if (a === Number && typeof b === "string" && (b === "Infinity" || b === "-Infinity" || b === "NaN" || xa.test(b))) return Number(b);
|
|
4619
4625
|
return b;
|
|
4620
4626
|
};
|
|
4621
4627
|
var xa = /^-?[0-9]+$/;
|
|
4622
|
-
function
|
|
4628
|
+
function z() {
|
|
4623
4629
|
}
|
|
4624
|
-
n(
|
|
4625
|
-
|
|
4630
|
+
n(z, y);
|
|
4631
|
+
z.prototype.g = function(a, b) {
|
|
4626
4632
|
a = new a.h();
|
|
4627
4633
|
a.l = this;
|
|
4628
4634
|
a.h = b;
|
|
4629
4635
|
a.g = {};
|
|
4630
4636
|
return a;
|
|
4631
4637
|
};
|
|
4632
|
-
function
|
|
4638
|
+
function B() {
|
|
4633
4639
|
}
|
|
4634
|
-
n(
|
|
4635
|
-
|
|
4636
|
-
return
|
|
4640
|
+
n(B, z);
|
|
4641
|
+
B.prototype.h = function(a, b) {
|
|
4642
|
+
return a.h == 8 ? !!b : y.prototype.h.apply(this, arguments);
|
|
4637
4643
|
};
|
|
4638
|
-
|
|
4639
|
-
return
|
|
4644
|
+
B.prototype.g = function(a, b) {
|
|
4645
|
+
return B.na.g.call(this, a, b);
|
|
4640
4646
|
};
|
|
4641
|
-
function
|
|
4642
|
-
|
|
4647
|
+
function C(a, b) {
|
|
4648
|
+
a != null && this.g.apply(this, arguments);
|
|
4643
4649
|
}
|
|
4644
|
-
|
|
4645
|
-
|
|
4650
|
+
C.prototype.h = "";
|
|
4651
|
+
C.prototype.set = function(a) {
|
|
4646
4652
|
this.h = "" + a;
|
|
4647
4653
|
};
|
|
4648
|
-
|
|
4654
|
+
C.prototype.g = function(a, b, c) {
|
|
4649
4655
|
this.h += String(a);
|
|
4650
|
-
if (
|
|
4656
|
+
if (b != null) for (let d = 1; d < arguments.length; d++) this.h += arguments[d];
|
|
4651
4657
|
return this;
|
|
4652
4658
|
};
|
|
4653
|
-
function
|
|
4659
|
+
function D(a) {
|
|
4654
4660
|
a.h = "";
|
|
4655
4661
|
}
|
|
4656
|
-
|
|
4662
|
+
C.prototype.toString = function() {
|
|
4657
4663
|
return this.h;
|
|
4658
4664
|
};
|
|
4659
|
-
function
|
|
4665
|
+
function E() {
|
|
4660
4666
|
p.call(this);
|
|
4661
4667
|
}
|
|
4662
|
-
n(
|
|
4668
|
+
n(E, p);
|
|
4663
4669
|
var ya = null;
|
|
4664
|
-
function
|
|
4670
|
+
function F() {
|
|
4665
4671
|
p.call(this);
|
|
4666
4672
|
}
|
|
4667
|
-
n(
|
|
4673
|
+
n(F, p);
|
|
4668
4674
|
var za = null;
|
|
4675
|
+
function G(a) {
|
|
4676
|
+
return u(a, 9) || [];
|
|
4677
|
+
}
|
|
4669
4678
|
function H() {
|
|
4670
4679
|
p.call(this);
|
|
4671
4680
|
}
|
|
4672
4681
|
n(H, p);
|
|
4673
4682
|
var Aa = null;
|
|
4674
|
-
|
|
4683
|
+
E.prototype.m = function() {
|
|
4675
4684
|
var a = ya;
|
|
4676
|
-
a || (ya = a =
|
|
4685
|
+
a || (ya = a = x(E, { 0: { name: "NumberFormat", ja: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: true, i: 9, type: String }, 2: { name: "format", required: true, i: 9, type: String }, 3: { name: "leading_digits_pattern", ca: true, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: false, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } }));
|
|
4677
4686
|
return a;
|
|
4678
4687
|
};
|
|
4679
|
-
|
|
4680
|
-
|
|
4688
|
+
E.m = E.prototype.m;
|
|
4689
|
+
F.prototype.m = function() {
|
|
4681
4690
|
var a = za;
|
|
4682
|
-
a || (za = a =
|
|
4691
|
+
a || (za = a = x(F, { 0: { name: "PhoneNumberDesc", ja: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", ca: true, i: 5, type: Number }, 10: { name: "possible_length_local_only", ca: true, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } }));
|
|
4683
4692
|
return a;
|
|
4684
4693
|
};
|
|
4685
|
-
|
|
4694
|
+
F.m = F.prototype.m;
|
|
4686
4695
|
H.prototype.m = function() {
|
|
4687
4696
|
var a = Aa;
|
|
4688
|
-
a || (Aa = a =
|
|
4689
|
-
0: { name: "PhoneMetadata",
|
|
4690
|
-
1: { name: "general_desc", i: 11, type:
|
|
4691
|
-
2: { name: "fixed_line", i: 11, type:
|
|
4692
|
-
3: { name: "mobile", i: 11, type:
|
|
4693
|
-
4: { name: "toll_free", i: 11, type:
|
|
4694
|
-
5: { name: "premium_rate", i: 11, type:
|
|
4695
|
-
6: { name: "shared_cost", i: 11, type:
|
|
4696
|
-
7: { name: "personal_number", i: 11, type:
|
|
4697
|
-
8: { name: "voip", i: 11, type:
|
|
4698
|
-
21: { name: "pager", i: 11, type:
|
|
4699
|
-
25: { name: "uan", i: 11, type:
|
|
4700
|
-
27: { name: "emergency", i: 11, type:
|
|
4701
|
-
28: { name: "voicemail", i: 11, type:
|
|
4702
|
-
29: { name: "short_code", i: 11, type:
|
|
4703
|
-
30: { name: "standard_rate", i: 11, type:
|
|
4704
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
4705
|
-
33: { name: "sms_services", i: 11, type:
|
|
4706
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
4697
|
+
a || (Aa = a = x(H, {
|
|
4698
|
+
0: { name: "PhoneMetadata", ja: "i18n.phonenumbers.PhoneMetadata" },
|
|
4699
|
+
1: { name: "general_desc", i: 11, type: F },
|
|
4700
|
+
2: { name: "fixed_line", i: 11, type: F },
|
|
4701
|
+
3: { name: "mobile", i: 11, type: F },
|
|
4702
|
+
4: { name: "toll_free", i: 11, type: F },
|
|
4703
|
+
5: { name: "premium_rate", i: 11, type: F },
|
|
4704
|
+
6: { name: "shared_cost", i: 11, type: F },
|
|
4705
|
+
7: { name: "personal_number", i: 11, type: F },
|
|
4706
|
+
8: { name: "voip", i: 11, type: F },
|
|
4707
|
+
21: { name: "pager", i: 11, type: F },
|
|
4708
|
+
25: { name: "uan", i: 11, type: F },
|
|
4709
|
+
27: { name: "emergency", i: 11, type: F },
|
|
4710
|
+
28: { name: "voicemail", i: 11, type: F },
|
|
4711
|
+
29: { name: "short_code", i: 11, type: F },
|
|
4712
|
+
30: { name: "standard_rate", i: 11, type: F },
|
|
4713
|
+
31: { name: "carrier_specific", i: 11, type: F },
|
|
4714
|
+
33: { name: "sms_services", i: 11, type: F },
|
|
4715
|
+
24: { name: "no_international_dialling", i: 11, type: F },
|
|
4707
4716
|
9: { name: "id", required: true, i: 9, type: String },
|
|
4708
4717
|
10: { name: "country_code", i: 5, type: Number },
|
|
4709
4718
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -4717,8 +4726,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4717
4726
|
},
|
|
4718
4727
|
16: { name: "national_prefix_transform_rule", i: 9, type: String },
|
|
4719
4728
|
18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: false, type: Boolean },
|
|
4720
|
-
19: { name: "number_format",
|
|
4721
|
-
20: { name: "intl_number_format",
|
|
4729
|
+
19: { name: "number_format", ca: true, i: 11, type: E },
|
|
4730
|
+
20: { name: "intl_number_format", ca: true, i: 11, type: E },
|
|
4722
4731
|
22: { name: "main_country_for_code", i: 8, defaultValue: false, type: Boolean },
|
|
4723
4732
|
23: { name: "leading_digits", i: 9, type: String }
|
|
4724
4733
|
}));
|
|
@@ -4729,10 +4738,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
4729
4738
|
p.call(this);
|
|
4730
4739
|
}
|
|
4731
4740
|
n(I, p);
|
|
4732
|
-
var Ba = null, Ca = {
|
|
4741
|
+
var Ba = null, Ca = { sa: 0, ra: 1, qa: 5, pa: 10, oa: 20 };
|
|
4733
4742
|
I.prototype.m = function() {
|
|
4734
4743
|
var a = Ba;
|
|
4735
|
-
a || (Ba = a =
|
|
4744
|
+
a || (Ba = a = x(I, { 0: { name: "PhoneNumber", ja: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: true, i: 5, type: Number }, 2: { name: "national_number", required: true, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: Ca }, 7: {
|
|
4736
4745
|
name: "preferred_domestic_carrier_code",
|
|
4737
4746
|
i: 9,
|
|
4738
4747
|
type: String
|
|
@@ -10083,46 +10092,46 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10083
10092
|
}
|
|
10084
10093
|
var Qa = new RegExp("(?:" + Pa() + ")$", "i"), Ra = new RegExp("^[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{2}$|^[+\uFF0B]*(?:[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*]*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]){3,}[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]*(?:" + Pa() + ")?$", "i"), Sa = /(\$\d)/, Ta = /^\(?\$1\)?$/;
|
|
10085
10094
|
function Ua(a) {
|
|
10086
|
-
return
|
|
10095
|
+
return a.length < 2 ? false : N(Ra, a);
|
|
10087
10096
|
}
|
|
10088
10097
|
function Va(a) {
|
|
10089
10098
|
return N(Ma, a) ? O(a, Ga) : O(a, Ea);
|
|
10090
10099
|
}
|
|
10091
10100
|
function Wa(a) {
|
|
10092
10101
|
var b = Va(a.toString());
|
|
10093
|
-
|
|
10102
|
+
D(a);
|
|
10094
10103
|
a.g(b);
|
|
10095
10104
|
}
|
|
10096
10105
|
function Xa(a) {
|
|
10097
|
-
return
|
|
10106
|
+
return a != null && (w(a, 9) != 1 || G(a)[0] != -1);
|
|
10098
10107
|
}
|
|
10099
10108
|
function O(a, b) {
|
|
10100
|
-
for (var c = new
|
|
10109
|
+
for (var c = new C(), d, e = a.length, f = 0; f < e; ++f) d = a.charAt(f), d = b[d.toUpperCase()], d != null && c.g(d);
|
|
10101
10110
|
return c.toString();
|
|
10102
10111
|
}
|
|
10103
10112
|
function Ya(a) {
|
|
10104
|
-
return
|
|
10113
|
+
return a.length == 0 || Ta.test(a);
|
|
10105
10114
|
}
|
|
10106
10115
|
function P(a) {
|
|
10107
|
-
return
|
|
10116
|
+
return a != null && isNaN(a) && a.toUpperCase() in Da;
|
|
10108
10117
|
}
|
|
10109
10118
|
K.prototype.format = function(a, b) {
|
|
10110
|
-
if (
|
|
10111
|
-
var c =
|
|
10112
|
-
if (
|
|
10119
|
+
if (r(a, 2) == 0 && q(a, 5)) {
|
|
10120
|
+
var c = v(a, 5);
|
|
10121
|
+
if (c.length > 0) return c;
|
|
10113
10122
|
}
|
|
10114
|
-
c =
|
|
10123
|
+
c = v(a, 1);
|
|
10115
10124
|
var d = Q(a);
|
|
10116
|
-
if (
|
|
10125
|
+
if (b == 0) return Za(c, 0, d, "");
|
|
10117
10126
|
if (!(c in J)) return d;
|
|
10118
10127
|
var e = R(this, c, S(c));
|
|
10119
|
-
a = q(a, 3) &&
|
|
10128
|
+
a = q(a, 3) && r(a, 3).length != 0 ? b == 3 ? ";ext=" + r(a, 3) : q(e, 13) ? r(e, 13) + v(a, 3) : " ext. " + v(a, 3) : "";
|
|
10120
10129
|
a: {
|
|
10121
|
-
e =
|
|
10130
|
+
e = (u(e, 20) || []).length == 0 || b == 2 ? u(e, 19) || [] : u(e, 20) || [];
|
|
10122
10131
|
for (var f, g = e.length, h = 0; h < g; ++h) {
|
|
10123
10132
|
f = e[h];
|
|
10124
|
-
var l =
|
|
10125
|
-
if (
|
|
10133
|
+
var l = w(f, 3);
|
|
10134
|
+
if (l == 0 || d.search(r(f, 3, l - 1)) == 0) {
|
|
10126
10135
|
if (l = new RegExp(r(f, 1)), N(l, d)) {
|
|
10127
10136
|
e = f;
|
|
10128
10137
|
break a;
|
|
@@ -10131,10 +10140,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10131
10140
|
}
|
|
10132
10141
|
e = null;
|
|
10133
10142
|
}
|
|
10134
|
-
|
|
10143
|
+
e != null && (g = e, e = v(g, 2), f = new RegExp(r(
|
|
10135
10144
|
g,
|
|
10136
|
-
|
|
10137
|
-
), g =
|
|
10145
|
+
1
|
|
10146
|
+
)), v(g, 5), g = v(g, 4), d = b == 2 && g != null && g.length > 0 ? d.replace(f, e.replace(Sa, g)) : d.replace(f, e), b == 3 && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
|
|
10138
10147
|
return Za(c, b, d, a);
|
|
10139
10148
|
};
|
|
10140
10149
|
function R(a, b, c) {
|
|
@@ -10143,7 +10152,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10143
10152
|
function Q(a) {
|
|
10144
10153
|
if (!q(a, 2)) return "";
|
|
10145
10154
|
var b = "" + r(a, 2);
|
|
10146
|
-
return q(a, 4) && r(a, 4) &&
|
|
10155
|
+
return q(a, 4) && r(a, 4) && v(a, 8) > 0 ? Array(v(a, 8) + 1).join("0") + b : b;
|
|
10147
10156
|
}
|
|
10148
10157
|
function Za(a, b, c, d) {
|
|
10149
10158
|
switch (b) {
|
|
@@ -10186,8 +10195,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10186
10195
|
}
|
|
10187
10196
|
function $a(a, b) {
|
|
10188
10197
|
var c = ab(a, b);
|
|
10189
|
-
a = R(a,
|
|
10190
|
-
if (
|
|
10198
|
+
a = R(a, v(b, 1), c);
|
|
10199
|
+
if (a == null) return -1;
|
|
10191
10200
|
b = Q(b);
|
|
10192
10201
|
return bb(b, a);
|
|
10193
10202
|
}
|
|
@@ -10195,45 +10204,45 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10195
10204
|
return V(a, r(b, 1)) ? V(a, r(b, 5)) ? 4 : V(a, r(b, 4)) ? 3 : V(a, r(b, 6)) ? 5 : V(a, r(b, 8)) ? 6 : V(a, r(b, 7)) ? 7 : V(a, r(b, 21)) ? 8 : V(a, r(b, 25)) ? 9 : V(a, r(b, 28)) ? 10 : V(a, r(b, 2)) ? r(b, 18) || V(a, r(b, 3)) ? 2 : 0 : !r(b, 18) && V(a, r(b, 3)) ? 1 : -1 : -1;
|
|
10196
10205
|
}
|
|
10197
10206
|
function T(a, b) {
|
|
10198
|
-
if (
|
|
10207
|
+
if (b == null) return null;
|
|
10199
10208
|
b = b.toUpperCase();
|
|
10200
10209
|
var c = a.g[b];
|
|
10201
|
-
if (
|
|
10210
|
+
if (c == null) {
|
|
10202
10211
|
c = Da[b];
|
|
10203
|
-
if (
|
|
10204
|
-
c = new
|
|
10212
|
+
if (c == null) return null;
|
|
10213
|
+
c = new B().g(H.m(), c);
|
|
10205
10214
|
a.g[b] = c;
|
|
10206
10215
|
}
|
|
10207
10216
|
return c;
|
|
10208
10217
|
}
|
|
10209
10218
|
function V(a, b) {
|
|
10210
10219
|
var c = a.length;
|
|
10211
|
-
return
|
|
10220
|
+
return w(b, 9) > 0 && G(b).indexOf(c) == -1 ? false : N(v(b, 2), a);
|
|
10212
10221
|
}
|
|
10213
10222
|
function cb(a, b) {
|
|
10214
10223
|
var c = ab(a, b);
|
|
10215
|
-
var d =
|
|
10224
|
+
var d = v(b, 1);
|
|
10216
10225
|
var e = R(a, d, c);
|
|
10217
|
-
|
|
10226
|
+
e == null || "001" != c && d != db(a, c) ? e = false : (a = Q(b), e = bb(a, e) != -1);
|
|
10218
10227
|
return e;
|
|
10219
10228
|
}
|
|
10220
10229
|
function ab(a, b) {
|
|
10221
|
-
if (
|
|
10222
|
-
var c =
|
|
10230
|
+
if (b == null) return null;
|
|
10231
|
+
var c = v(b, 1);
|
|
10223
10232
|
c = J[c];
|
|
10224
|
-
if (
|
|
10225
|
-
else if (
|
|
10233
|
+
if (c == null) a = null;
|
|
10234
|
+
else if (c.length == 1) a = c[0];
|
|
10226
10235
|
else a: {
|
|
10227
10236
|
b = Q(b);
|
|
10228
10237
|
for (var d, e = c.length, f = 0; f < e; f++) {
|
|
10229
10238
|
d = c[f];
|
|
10230
10239
|
var g = T(a, d);
|
|
10231
10240
|
if (q(g, 23)) {
|
|
10232
|
-
if (
|
|
10241
|
+
if (b.search(r(g, 23)) == 0) {
|
|
10233
10242
|
a = d;
|
|
10234
10243
|
break a;
|
|
10235
10244
|
}
|
|
10236
|
-
} else if (
|
|
10245
|
+
} else if (bb(b, g) != -1) {
|
|
10237
10246
|
a = d;
|
|
10238
10247
|
break a;
|
|
10239
10248
|
}
|
|
@@ -10244,116 +10253,117 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10244
10253
|
}
|
|
10245
10254
|
function S(a) {
|
|
10246
10255
|
a = J[a];
|
|
10247
|
-
return
|
|
10256
|
+
return a == null ? "ZZ" : a[0];
|
|
10248
10257
|
}
|
|
10249
10258
|
function db(a, b) {
|
|
10250
10259
|
a = T(a, b);
|
|
10251
|
-
if (
|
|
10252
|
-
return
|
|
10260
|
+
if (a == null) throw Error("Invalid region code: " + b);
|
|
10261
|
+
return v(a, 10);
|
|
10253
10262
|
}
|
|
10254
10263
|
function W(a, b, c, d) {
|
|
10255
|
-
var e = U(c, d), f =
|
|
10256
|
-
e = u(e, 10);
|
|
10257
|
-
if (
|
|
10264
|
+
var e = U(c, d), f = w(e, 9) == 0 ? G(r(c, 1)) : G(e);
|
|
10265
|
+
e = u(e, 10) || [];
|
|
10266
|
+
if (d == 2) if (Xa(U(c, 0))) a = U(c, 1), Xa(a) && (f = f.concat(w(a, 9) == 0 ? G(r(c, 1)) : G(a)), f.sort(), e.length == 0 ? e = u(a, 10) || [] : (e = e.concat(u(a, 10) || []), e.sort()));
|
|
10258
10267
|
else return W(a, b, c, 1);
|
|
10259
|
-
if (
|
|
10268
|
+
if (f[0] == -1) return 5;
|
|
10260
10269
|
b = b.length;
|
|
10261
|
-
if (
|
|
10270
|
+
if (e.indexOf(b) > -1) return 4;
|
|
10262
10271
|
c = f[0];
|
|
10263
|
-
return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 :
|
|
10272
|
+
return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : f.indexOf(b, 1) > -1 ? 0 : 5;
|
|
10264
10273
|
}
|
|
10265
10274
|
function X(a, b, c) {
|
|
10266
10275
|
var d = Q(b);
|
|
10267
|
-
b =
|
|
10276
|
+
b = v(b, 1);
|
|
10268
10277
|
if (!(b in J)) return 1;
|
|
10269
10278
|
b = R(a, b, S(b));
|
|
10270
10279
|
return W(a, d, b, c);
|
|
10271
10280
|
}
|
|
10272
10281
|
function eb(a, b) {
|
|
10273
10282
|
a = a.toString();
|
|
10274
|
-
if (
|
|
10275
|
-
for (var c, d = a.length, e = 1;
|
|
10283
|
+
if (a.length == 0 || a.charAt(0) == "0") return 0;
|
|
10284
|
+
for (var c, d = a.length, e = 1; e <= 3 && e <= d; ++e) if (c = parseInt(a.substring(0, e), 10), c in J) return b.g(a.substring(e)), c;
|
|
10276
10285
|
return 0;
|
|
10277
10286
|
}
|
|
10278
10287
|
function fb(a, b, c, d, e, f) {
|
|
10279
|
-
if (
|
|
10280
|
-
b = new
|
|
10288
|
+
if (b.length == 0) return 0;
|
|
10289
|
+
b = new C(b);
|
|
10281
10290
|
var g;
|
|
10282
|
-
|
|
10283
|
-
|
|
10291
|
+
c != null && (g = r(c, 11));
|
|
10292
|
+
g == null && (g = "NonMatch");
|
|
10284
10293
|
var h = b.toString();
|
|
10285
|
-
if (
|
|
10286
|
-
else if (L.test(h)) h = h.replace(L, ""),
|
|
10294
|
+
if (h.length == 0) g = 20;
|
|
10295
|
+
else if (L.test(h)) h = h.replace(L, ""), D(b), b.g(Va(h)), g = 1;
|
|
10287
10296
|
else {
|
|
10288
10297
|
h = new RegExp(g);
|
|
10289
10298
|
Wa(b);
|
|
10290
10299
|
g = b.toString();
|
|
10291
|
-
if (
|
|
10300
|
+
if (g.search(h) == 0) {
|
|
10292
10301
|
h = g.match(h)[0].length;
|
|
10293
10302
|
var l = g.substring(h).match(Ia);
|
|
10294
|
-
l &&
|
|
10303
|
+
l && l[1] != null && l[1].length > 0 && O(l[1], Ea) == "0" ? g = false : (D(b), b.g(g.substring(h)), g = true);
|
|
10295
10304
|
} else g = false;
|
|
10296
10305
|
g = g ? 5 : 20;
|
|
10297
10306
|
}
|
|
10298
10307
|
e && t(f, 6, g);
|
|
10299
|
-
if (
|
|
10300
|
-
if (
|
|
10308
|
+
if (g != 20) {
|
|
10309
|
+
if (b.h.length <= 2) throw Error("Phone number too short after IDD");
|
|
10301
10310
|
a = eb(b, d);
|
|
10302
|
-
if (
|
|
10311
|
+
if (a != 0) return t(f, 1, a), a;
|
|
10303
10312
|
throw Error("Invalid country calling code");
|
|
10304
10313
|
}
|
|
10305
|
-
if (
|
|
10314
|
+
if (c != null && (g = v(c, 10), h = "" + g, l = b.toString(), l.lastIndexOf(h, 0) == 0 && (h = new C(l.substring(h.length)), l = r(c, 1), l = new RegExp(v(l, 2)), gb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || W(a, b.toString(), c, -1) == 3))) return d.g(h), e && t(f, 6, 10), t(f, 1, g), g;
|
|
10306
10315
|
t(f, 1, 0);
|
|
10307
10316
|
return 0;
|
|
10308
10317
|
}
|
|
10309
10318
|
function gb(a, b, c) {
|
|
10310
10319
|
var d = a.toString(), e = d.length, f = r(b, 15);
|
|
10311
|
-
if (
|
|
10312
|
-
var g =
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10320
|
+
if (e != 0 && f != null && f.length != 0 && (f = new RegExp("^(?:" + f + ")"), e = f.exec(d))) {
|
|
10321
|
+
var g = RegExp;
|
|
10322
|
+
var h = r(b, 1);
|
|
10323
|
+
h = v(h, 2);
|
|
10324
|
+
g = new g(h);
|
|
10325
|
+
h = N(g, d);
|
|
10326
|
+
var l = e.length - 1;
|
|
10327
|
+
b = r(b, 16);
|
|
10328
|
+
if (b == null || b.length == 0 || e[l] == null || e[l].length == 0) {
|
|
10329
|
+
if (!h || N(g, d.substring(e[0].length))) c != null && l > 0 && e[l] != null && c.g(e[1]), a.set(d.substring(e[0].length));
|
|
10330
|
+
} else if (d = d.replace(f, b), !h || N(g, d)) c != null && l > 0 && c.g(e[1]), a.set(d);
|
|
10321
10331
|
}
|
|
10322
10332
|
}
|
|
10323
10333
|
function Y(a, b, c) {
|
|
10324
|
-
if (!P(c) &&
|
|
10334
|
+
if (!P(c) && b.length > 0 && b.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
10325
10335
|
return hb(a, b, c, true);
|
|
10326
10336
|
}
|
|
10327
10337
|
function hb(a, b, c, d) {
|
|
10328
|
-
if (
|
|
10329
|
-
if (
|
|
10330
|
-
var e = new
|
|
10338
|
+
if (b == null) throw Error("The string supplied did not seem to be a phone number");
|
|
10339
|
+
if (b.length > 250) throw Error("The string supplied is too long to be a phone number");
|
|
10340
|
+
var e = new C();
|
|
10331
10341
|
var f = b.indexOf(";phone-context=");
|
|
10332
|
-
if (
|
|
10342
|
+
if (f === -1) f = null;
|
|
10333
10343
|
else if (f += 15, f >= b.length) f = "";
|
|
10334
10344
|
else {
|
|
10335
10345
|
var g = b.indexOf(";", f);
|
|
10336
|
-
f =
|
|
10346
|
+
f = g !== -1 ? b.substring(f, g) : b.substring(f);
|
|
10337
10347
|
}
|
|
10338
10348
|
var h = f;
|
|
10339
|
-
|
|
10349
|
+
h == null ? g = true : h.length === 0 ? g = false : (g = Na.exec(h), h = Oa.exec(h), g = g !== null || h !== null);
|
|
10340
10350
|
if (!g) throw Error("The string supplied did not seem to be a phone number");
|
|
10341
|
-
|
|
10351
|
+
f != null ? (f.charAt(0) === "+" && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(f >= 0 ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b ?? "", h = g.search(Ja), h >= 0 ? (g = g.substring(h), g = g.replace(La, ""), h = g.search(Ka), h >= 0 && (g = g.substring(0, h))) : g = "", f.call(e, g));
|
|
10342
10352
|
f = e.toString();
|
|
10343
10353
|
g = f.indexOf(";isub=");
|
|
10344
|
-
|
|
10354
|
+
g > 0 && (D(e), e.g(f.substring(0, g)));
|
|
10345
10355
|
if (!Ua(e.toString())) throw Error("The string supplied did not seem to be a phone number");
|
|
10346
10356
|
f = e.toString();
|
|
10347
|
-
if (!(P(c) ||
|
|
10357
|
+
if (!(P(c) || f != null && f.length > 0 && L.test(f))) throw Error("Invalid country calling code");
|
|
10348
10358
|
f = new I();
|
|
10349
10359
|
d && t(f, 5, b);
|
|
10350
10360
|
a: {
|
|
10351
10361
|
b = e.toString();
|
|
10352
10362
|
g = b.search(Qa);
|
|
10353
|
-
if (
|
|
10363
|
+
if (g >= 0 && Ua(b.substring(0, g))) {
|
|
10354
10364
|
h = b.match(Qa);
|
|
10355
|
-
for (var l = h.length, A = 1; A < l; ++A) if (
|
|
10356
|
-
|
|
10365
|
+
for (var l = h.length, A = 1; A < l; ++A) if (h[A] != null && h[A].length > 0) {
|
|
10366
|
+
D(e);
|
|
10357
10367
|
e.g(b.substring(0, g));
|
|
10358
10368
|
b = h[A];
|
|
10359
10369
|
break a;
|
|
@@ -10361,204 +10371,204 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10361
10371
|
}
|
|
10362
10372
|
b = "";
|
|
10363
10373
|
}
|
|
10364
|
-
|
|
10374
|
+
b.length > 0 && t(f, 3, b);
|
|
10365
10375
|
g = T(a, c);
|
|
10366
|
-
b = new
|
|
10376
|
+
b = new C();
|
|
10367
10377
|
h = 0;
|
|
10368
10378
|
l = e.toString();
|
|
10369
10379
|
try {
|
|
10370
10380
|
h = fb(a, l, g, b, d, f);
|
|
10371
10381
|
} catch (ca) {
|
|
10372
|
-
if ("Invalid country calling code"
|
|
10373
|
-
if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f),
|
|
10382
|
+
if (ca.message == "Invalid country calling code" && L.test(l)) {
|
|
10383
|
+
if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), h == 0) throw ca;
|
|
10374
10384
|
} else throw ca;
|
|
10375
10385
|
}
|
|
10376
|
-
|
|
10386
|
+
h != 0 ? (e = S(h), e != c && (g = R(a, h, e))) : (Wa(e), b.g(e.toString()), c != null ? (h = v(g, 10), t(
|
|
10377
10387
|
f,
|
|
10378
10388
|
1,
|
|
10379
10389
|
h
|
|
10380
10390
|
)) : d && (delete f.h[6], f.g && delete f.g[6]));
|
|
10381
|
-
if (
|
|
10382
|
-
|
|
10391
|
+
if (b.h.length < 2) throw Error("The string supplied is too short to be a phone number");
|
|
10392
|
+
g != null && (c = new C(), e = new C(b.toString()), gb(e, g, c), a = W(a, e.toString(), g, -1), a != 2 && a != 4 && a != 5 && (b = e, d && c.toString().length > 0 && t(f, 7, c.toString())));
|
|
10383
10393
|
d = b.toString();
|
|
10384
10394
|
a = d.length;
|
|
10385
|
-
if (
|
|
10386
|
-
if (
|
|
10387
|
-
if (
|
|
10395
|
+
if (a < 2) throw Error("The string supplied is too short to be a phone number");
|
|
10396
|
+
if (a > 17) throw Error("The string supplied is too long to be a phone number");
|
|
10397
|
+
if (d.length > 1 && d.charAt(0) == "0") {
|
|
10388
10398
|
t(f, 4, true);
|
|
10389
|
-
for (a = 1; a < d.length - 1 &&
|
|
10390
|
-
|
|
10399
|
+
for (a = 1; a < d.length - 1 && d.charAt(a) == "0"; ) a++;
|
|
10400
|
+
a != 1 && t(f, 8, a);
|
|
10391
10401
|
}
|
|
10392
10402
|
t(f, 2, parseInt(d, 10));
|
|
10393
10403
|
return f;
|
|
10394
10404
|
}
|
|
10395
10405
|
function N(a, b) {
|
|
10396
|
-
return (a = b.match(new RegExp("^(?:" + ("string"
|
|
10406
|
+
return (a = b.match(new RegExp("^(?:" + (typeof a == "string" ? a : a.source) + ")$", "i"))) && a[0].length == b.length ? true : false;
|
|
10397
10407
|
}
|
|
10398
10408
|
;
|
|
10399
10409
|
function ib(a) {
|
|
10400
|
-
this.
|
|
10401
|
-
this.
|
|
10402
|
-
this
|
|
10403
|
-
this.
|
|
10404
|
-
this.
|
|
10405
|
-
this.
|
|
10406
|
-
this.
|
|
10407
|
-
this.
|
|
10408
|
-
this.
|
|
10409
|
-
this
|
|
10410
|
-
this.h = new
|
|
10411
|
-
this.
|
|
10410
|
+
this.ga = RegExp("\u2008");
|
|
10411
|
+
this.ka = "";
|
|
10412
|
+
this.$ = new C();
|
|
10413
|
+
this.ea = "";
|
|
10414
|
+
this.u = new C();
|
|
10415
|
+
this.da = new C();
|
|
10416
|
+
this.v = true;
|
|
10417
|
+
this.fa = this.aa = this.ma = false;
|
|
10418
|
+
this.ha = K.g();
|
|
10419
|
+
this.ba = 0;
|
|
10420
|
+
this.h = new C();
|
|
10421
|
+
this.ia = false;
|
|
10412
10422
|
this.o = "";
|
|
10413
|
-
this.g = new
|
|
10423
|
+
this.g = new C();
|
|
10414
10424
|
this.j = [];
|
|
10415
|
-
this.
|
|
10416
|
-
this.l = jb(this, this.
|
|
10425
|
+
this.la = a;
|
|
10426
|
+
this.l = jb(this, this.la);
|
|
10417
10427
|
}
|
|
10418
10428
|
var kb = new H();
|
|
10419
10429
|
t(kb, 11, "NA");
|
|
10420
10430
|
var lb = RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*\\$1[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*(\\$\\d[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*)*$"), mb = /[- ]/;
|
|
10421
10431
|
function jb(a, b) {
|
|
10422
|
-
var c = a.
|
|
10432
|
+
var c = a.ha;
|
|
10423
10433
|
b = P(b) ? db(c, b) : 0;
|
|
10424
|
-
a = T(a.
|
|
10425
|
-
return
|
|
10434
|
+
a = T(a.ha, S(b));
|
|
10435
|
+
return a != null ? a : kb;
|
|
10426
10436
|
}
|
|
10427
10437
|
function nb(a) {
|
|
10428
10438
|
for (var b = a.j.length, c = 0; c < b; ++c) {
|
|
10429
|
-
var d = a.j[c], e =
|
|
10430
|
-
if (a.
|
|
10439
|
+
var d = a.j[c], e = v(d, 1);
|
|
10440
|
+
if (a.ea == e) return false;
|
|
10431
10441
|
var f = a;
|
|
10432
|
-
var g = d, h =
|
|
10433
|
-
|
|
10442
|
+
var g = d, h = v(g, 1);
|
|
10443
|
+
D(f.$);
|
|
10434
10444
|
var l = f;
|
|
10435
|
-
g =
|
|
10445
|
+
g = v(g, 2);
|
|
10436
10446
|
var A = "999999999999999".match(h)[0];
|
|
10437
10447
|
A.length < l.g.h.length ? l = "" : (l = A.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
|
|
10438
|
-
|
|
10439
|
-
if (f) return a.
|
|
10448
|
+
l.length > 0 ? (f.$.g(l), f = true) : f = false;
|
|
10449
|
+
if (f) return a.ea = e, a.ia = mb.test(r(d, 4)), a.ba = 0, true;
|
|
10440
10450
|
}
|
|
10441
|
-
return a.
|
|
10451
|
+
return a.v = false;
|
|
10442
10452
|
}
|
|
10443
10453
|
function ob(a, b) {
|
|
10444
10454
|
for (var c = [], d = b.length - 3, e = a.j.length, f = 0; f < e; ++f) {
|
|
10445
10455
|
var g = a.j[f];
|
|
10446
|
-
|
|
10456
|
+
w(g, 3) == 0 ? c.push(a.j[f]) : (g = r(g, 3, Math.min(d, w(g, 3) - 1)), b.search(g) == 0 && c.push(a.j[f]));
|
|
10447
10457
|
}
|
|
10448
10458
|
a.j = c;
|
|
10449
10459
|
}
|
|
10450
10460
|
function pb(a, b) {
|
|
10451
|
-
a.
|
|
10461
|
+
a.u.g(b);
|
|
10452
10462
|
var c = b;
|
|
10453
|
-
Ia.test(c) ||
|
|
10454
|
-
if (!a.
|
|
10455
|
-
if (!a.
|
|
10463
|
+
Ia.test(c) || a.u.h.length == 1 && Ha.test(c) ? (b == "+" ? (c = b, a.da.g(b)) : (c = Ea[b], a.da.g(c), a.g.g(c)), b = c) : (a.v = false, a.ma = true);
|
|
10464
|
+
if (!a.v) {
|
|
10465
|
+
if (!a.ma) {
|
|
10456
10466
|
if (qb(a)) {
|
|
10457
10467
|
if (rb(a)) return sb(a);
|
|
10458
|
-
} else if (
|
|
10468
|
+
} else if (a.o.length > 0 && (b = a.g.toString(), D(a.g), a.g.g(a.o), a.g.g(b), b = a.h.toString(), c = b.lastIndexOf(a.o), D(a.h), a.h.g(b.substring(0, c))), a.o != tb(a)) return a.h.g(" "), sb(a);
|
|
10459
10469
|
}
|
|
10460
|
-
return a.
|
|
10470
|
+
return a.u.toString();
|
|
10461
10471
|
}
|
|
10462
|
-
switch (a.
|
|
10472
|
+
switch (a.da.h.length) {
|
|
10463
10473
|
case 0:
|
|
10464
10474
|
case 1:
|
|
10465
10475
|
case 2:
|
|
10466
|
-
return a.
|
|
10476
|
+
return a.u.toString();
|
|
10467
10477
|
case 3:
|
|
10468
|
-
if (qb(a)) a.
|
|
10478
|
+
if (qb(a)) a.fa = true;
|
|
10469
10479
|
else return a.o = tb(a), ub(a);
|
|
10470
10480
|
default:
|
|
10471
|
-
if (a.
|
|
10472
|
-
if (
|
|
10481
|
+
if (a.fa) return rb(a) && (a.fa = false), a.h.toString() + a.g.toString();
|
|
10482
|
+
if (a.j.length > 0) {
|
|
10473
10483
|
b = vb(a, b);
|
|
10474
10484
|
c = wb(a);
|
|
10475
|
-
if (
|
|
10485
|
+
if (c.length > 0) return c;
|
|
10476
10486
|
ob(a, a.g.toString());
|
|
10477
|
-
return nb(a) ? xb(a) : a.
|
|
10487
|
+
return nb(a) ? xb(a) : a.v ? Z(a, b) : a.u.toString();
|
|
10478
10488
|
}
|
|
10479
10489
|
return ub(a);
|
|
10480
10490
|
}
|
|
10481
10491
|
}
|
|
10482
10492
|
function sb(a) {
|
|
10483
|
-
a.
|
|
10484
|
-
a.
|
|
10493
|
+
a.v = true;
|
|
10494
|
+
a.fa = false;
|
|
10485
10495
|
a.j = [];
|
|
10486
|
-
a
|
|
10487
|
-
|
|
10488
|
-
a.
|
|
10496
|
+
a.ba = 0;
|
|
10497
|
+
D(a.$);
|
|
10498
|
+
a.ea = "";
|
|
10489
10499
|
return ub(a);
|
|
10490
10500
|
}
|
|
10491
10501
|
function wb(a) {
|
|
10492
10502
|
for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
|
|
10493
|
-
var e = a.j[d], f =
|
|
10494
|
-
if (new RegExp("^(?:" + f + ")$").test(b) && (a.
|
|
10503
|
+
var e = a.j[d], f = v(e, 1);
|
|
10504
|
+
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ia = mb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.da)) return e;
|
|
10495
10505
|
}
|
|
10496
10506
|
return "";
|
|
10497
10507
|
}
|
|
10498
10508
|
function Z(a, b) {
|
|
10499
10509
|
var c = a.h.h.length;
|
|
10500
|
-
return a.
|
|
10510
|
+
return a.ia && c > 0 && a.h.toString().charAt(c - 1) != " " ? a.h + " " + b : a.h + b;
|
|
10501
10511
|
}
|
|
10502
10512
|
function ub(a) {
|
|
10503
10513
|
var b = a.g.toString();
|
|
10504
|
-
if (
|
|
10505
|
-
for (var c = a.
|
|
10514
|
+
if (b.length >= 3) {
|
|
10515
|
+
for (var c = a.aa && a.o.length == 0 && w(a.l, 20) > 0 ? u(a.l, 20) || [] : u(a.l, 19) || [], d = c.length, e = 0; e < d; ++e) {
|
|
10506
10516
|
var f = c[e];
|
|
10507
|
-
|
|
10517
|
+
a.o.length > 0 && Ya(v(f, 4)) && !r(f, 6) && !q(f, 5) || (a.o.length != 0 || a.aa || Ya(v(f, 4)) || r(f, 6)) && lb.test(v(f, 2)) && a.j.push(f);
|
|
10508
10518
|
}
|
|
10509
10519
|
ob(a, b);
|
|
10510
10520
|
b = wb(a);
|
|
10511
|
-
return
|
|
10521
|
+
return b.length > 0 ? b : nb(a) ? xb(a) : a.u.toString();
|
|
10512
10522
|
}
|
|
10513
10523
|
return Z(a, b);
|
|
10514
10524
|
}
|
|
10515
10525
|
function xb(a) {
|
|
10516
10526
|
var b = a.g.toString(), c = b.length;
|
|
10517
|
-
if (
|
|
10527
|
+
if (c > 0) {
|
|
10518
10528
|
for (var d = "", e = 0; e < c; e++) d = vb(a, b.charAt(e));
|
|
10519
|
-
return a.
|
|
10529
|
+
return a.v ? Z(a, d) : a.u.toString();
|
|
10520
10530
|
}
|
|
10521
10531
|
return a.h.toString();
|
|
10522
10532
|
}
|
|
10523
10533
|
function tb(a) {
|
|
10524
10534
|
var b = a.g.toString(), c = 0;
|
|
10525
|
-
if (
|
|
10526
|
-
else d = a.g.toString(), d =
|
|
10527
|
-
d ? (c = 1, a.h.g("1").g(" "), a.
|
|
10528
|
-
|
|
10535
|
+
if (r(a.l, 10) != 1) var d = false;
|
|
10536
|
+
else d = a.g.toString(), d = d.charAt(0) == "1" && d.charAt(1) != "0" && d.charAt(1) != "1";
|
|
10537
|
+
d ? (c = 1, a.h.g("1").g(" "), a.aa = true) : q(a.l, 15) && (d = new RegExp("^(?:" + r(a.l, 15) + ")"), d = b.match(d), d != null && d[0] != null && d[0].length > 0 && (a.aa = true, c = d[0].length, a.h.g(b.substring(0, c))));
|
|
10538
|
+
D(a.g);
|
|
10529
10539
|
a.g.g(b.substring(c));
|
|
10530
10540
|
return b.substring(0, c);
|
|
10531
10541
|
}
|
|
10532
10542
|
function qb(a) {
|
|
10533
|
-
var b = a.
|
|
10543
|
+
var b = a.da.toString(), c = new RegExp("^(?:\\+|" + r(a.l, 11) + ")");
|
|
10534
10544
|
c = b.match(c);
|
|
10535
|
-
return
|
|
10545
|
+
return c != null && c[0] != null && c[0].length > 0 ? (a.aa = true, c = c[0].length, D(a.g), a.g.g(b.substring(c)), D(a.h), a.h.g(b.substring(0, c)), b.charAt(0) != "+" && a.h.g(" "), true) : false;
|
|
10536
10546
|
}
|
|
10537
10547
|
function rb(a) {
|
|
10538
|
-
if (
|
|
10539
|
-
var b = new
|
|
10540
|
-
if (
|
|
10541
|
-
|
|
10548
|
+
if (a.g.h.length == 0) return false;
|
|
10549
|
+
var b = new C(), c = eb(a.g, b);
|
|
10550
|
+
if (c == 0) return false;
|
|
10551
|
+
D(a.g);
|
|
10542
10552
|
a.g.g(b.toString());
|
|
10543
10553
|
b = S(c);
|
|
10544
|
-
"001" == b ? a.l = T(a.
|
|
10554
|
+
"001" == b ? a.l = T(a.ha, "" + c) : b != a.la && (a.l = jb(a, b));
|
|
10545
10555
|
a.h.g("" + c).g(" ");
|
|
10546
10556
|
a.o = "";
|
|
10547
10557
|
return true;
|
|
10548
10558
|
}
|
|
10549
10559
|
function vb(a, b) {
|
|
10550
|
-
var c = a
|
|
10551
|
-
if (
|
|
10552
|
-
var d = c.search(a.
|
|
10553
|
-
b = c.replace(a.
|
|
10554
|
-
|
|
10555
|
-
a
|
|
10556
|
-
a
|
|
10557
|
-
return b.substring(0, a
|
|
10558
|
-
}
|
|
10559
|
-
|
|
10560
|
-
a.
|
|
10561
|
-
return a.
|
|
10560
|
+
var c = a.$.toString();
|
|
10561
|
+
if (c.substring(a.ba).search(a.ga) >= 0) {
|
|
10562
|
+
var d = c.search(a.ga);
|
|
10563
|
+
b = c.replace(a.ga, b);
|
|
10564
|
+
D(a.$);
|
|
10565
|
+
a.$.g(b);
|
|
10566
|
+
a.ba = d;
|
|
10567
|
+
return b.substring(0, a.ba + 1);
|
|
10568
|
+
}
|
|
10569
|
+
a.j.length == 1 && (a.v = false);
|
|
10570
|
+
a.ea = "";
|
|
10571
|
+
return a.u.toString();
|
|
10562
10572
|
}
|
|
10563
10573
|
;
|
|
10564
10574
|
const yb = (a) => {
|
|
@@ -10566,27 +10576,27 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10566
10576
|
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");
|
|
10567
10577
|
return a.concat(b);
|
|
10568
10578
|
}, 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 };
|
|
10569
|
-
m("
|
|
10570
|
-
m("
|
|
10579
|
+
m("utils", {});
|
|
10580
|
+
m("utils.formatNumberAsYouType", (a, b) => {
|
|
10571
10581
|
try {
|
|
10572
10582
|
const c = a.replace(/[^+0-9]/g, ""), d = new ib(b);
|
|
10573
10583
|
b = "";
|
|
10574
|
-
for (let e = 0; e < c.length; e++) d.
|
|
10584
|
+
for (let e = 0; e < c.length; e++) d.ka = pb(d, c.charAt(e)), b = d.ka;
|
|
10575
10585
|
return b;
|
|
10576
10586
|
} catch {
|
|
10577
10587
|
return a;
|
|
10578
10588
|
}
|
|
10579
10589
|
});
|
|
10580
|
-
m("
|
|
10590
|
+
m("utils.formatNumber", (a, b, c) => {
|
|
10581
10591
|
try {
|
|
10582
10592
|
const e = K.g(), f = Y(e, a, b);
|
|
10583
10593
|
var d = X(e, f, -1);
|
|
10584
|
-
return
|
|
10594
|
+
return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : c) : a;
|
|
10585
10595
|
} catch {
|
|
10586
10596
|
return a;
|
|
10587
10597
|
}
|
|
10588
10598
|
});
|
|
10589
|
-
m("
|
|
10599
|
+
m("utils.getExampleNumber", (a, b, c, d) => {
|
|
10590
10600
|
try {
|
|
10591
10601
|
const l = K.g();
|
|
10592
10602
|
a: {
|
|
@@ -10609,14 +10619,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10609
10619
|
return "";
|
|
10610
10620
|
}
|
|
10611
10621
|
});
|
|
10612
|
-
m("
|
|
10622
|
+
m("utils.getExtension", (a, b) => {
|
|
10613
10623
|
try {
|
|
10614
|
-
|
|
10624
|
+
var c = Y(K.g(), a, b);
|
|
10625
|
+
return r(c, 3);
|
|
10615
10626
|
} catch {
|
|
10616
10627
|
return "";
|
|
10617
10628
|
}
|
|
10618
10629
|
});
|
|
10619
|
-
m("
|
|
10630
|
+
m("utils.getNumberType", (a, b) => {
|
|
10620
10631
|
try {
|
|
10621
10632
|
const c = K.g(), d = Y(c, a, b);
|
|
10622
10633
|
return $a(c, d);
|
|
@@ -10624,16 +10635,16 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10624
10635
|
return -99;
|
|
10625
10636
|
}
|
|
10626
10637
|
});
|
|
10627
|
-
m("
|
|
10638
|
+
m("utils.getValidationError", (a, b) => {
|
|
10628
10639
|
if (!b) return 1;
|
|
10629
10640
|
try {
|
|
10630
10641
|
const c = K.g(), d = Y(c, a, b);
|
|
10631
10642
|
return X(c, d, -1);
|
|
10632
10643
|
} catch (c) {
|
|
10633
|
-
return "Invalid country calling code"
|
|
10644
|
+
return c.message === "Invalid country calling code" ? 1 : a.length <= 3 || c.message === "Phone number too short after IDD" || c.message === "The string supplied is too short to be a phone number" ? 2 : c.message === "The string supplied is too long to be a phone number" ? 3 : -99;
|
|
10634
10645
|
}
|
|
10635
10646
|
});
|
|
10636
|
-
m("
|
|
10647
|
+
m("utils.isValidNumber", (a, b, c) => {
|
|
10637
10648
|
try {
|
|
10638
10649
|
const d = K.g(), e = Y(d, a, b), f = cb(d, e);
|
|
10639
10650
|
if (c) {
|
|
@@ -10645,138 +10656,36 @@ var intl_tel_input_default = intlTelInput;
|
|
|
10645
10656
|
return false;
|
|
10646
10657
|
}
|
|
10647
10658
|
});
|
|
10648
|
-
m("
|
|
10659
|
+
m("utils.isPossibleNumber", (a, b, c) => {
|
|
10649
10660
|
try {
|
|
10650
10661
|
const d = K.g(), e = Y(d, a, b);
|
|
10651
10662
|
if (c) {
|
|
10652
10663
|
const f = yb(c);
|
|
10653
|
-
for (let g of f) if (
|
|
10664
|
+
for (let g of f) if (X(d, e, zb[g]) === 0) return true;
|
|
10654
10665
|
return false;
|
|
10655
10666
|
}
|
|
10656
|
-
return
|
|
10667
|
+
return X(d, e, -1) === 0;
|
|
10657
10668
|
} catch {
|
|
10658
10669
|
return false;
|
|
10659
10670
|
}
|
|
10660
10671
|
});
|
|
10661
|
-
m("
|
|
10672
|
+
m("utils.getCoreNumber", (a, b) => {
|
|
10662
10673
|
try {
|
|
10663
|
-
|
|
10674
|
+
var c = Y(K.g(), a, b);
|
|
10675
|
+
return r(c, 2).toString();
|
|
10664
10676
|
} catch {
|
|
10665
10677
|
return "";
|
|
10666
10678
|
}
|
|
10667
10679
|
});
|
|
10668
|
-
m("
|
|
10669
|
-
m("
|
|
10670
|
-
m("
|
|
10671
|
-
})();
|
|
10672
|
-
var
|
|
10673
|
-
var utils = globalContext.intlTelInputUtilsTemp;
|
|
10674
|
-
delete globalContext.intlTelInputUtilsTemp;
|
|
10675
|
-
var utils_default = utils;
|
|
10680
|
+
m("utils.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 });
|
|
10681
|
+
m("utils.numberType", zb);
|
|
10682
|
+
m("utils.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
10683
|
+
}).call(_scope);
|
|
10684
|
+
var utils_default = _scope.utils;
|
|
10676
10685
|
|
|
10677
|
-
// src/js/
|
|
10686
|
+
// src/js/intlTelInputWithUtils.ts
|
|
10678
10687
|
intl_tel_input_default.utils = utils_default;
|
|
10679
10688
|
var intlTelInputWithUtils_default = intl_tel_input_default;
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
var IntlTelInput = (0, import_react.forwardRef)(function IntlTelInput2({
|
|
10684
|
-
initialValue = "",
|
|
10685
|
-
onChangeNumber = () => {
|
|
10686
|
-
},
|
|
10687
|
-
onChangeCountry = () => {
|
|
10688
|
-
},
|
|
10689
|
-
onChangeValidity = () => {
|
|
10690
|
-
},
|
|
10691
|
-
onChangeErrorCode = () => {
|
|
10692
|
-
},
|
|
10693
|
-
usePreciseValidation = false,
|
|
10694
|
-
initOptions = {},
|
|
10695
|
-
inputProps = {},
|
|
10696
|
-
disabled = void 0
|
|
10697
|
-
}, ref) {
|
|
10698
|
-
const inputRef = (0, import_react.useRef)(null);
|
|
10699
|
-
const itiRef = (0, import_react.useRef)(null);
|
|
10700
|
-
const lastEmittedNumberRef = (0, import_react.useRef)();
|
|
10701
|
-
const lastEmittedCountryRef = (0, import_react.useRef)();
|
|
10702
|
-
const lastEmittedValidityRef = (0, import_react.useRef)();
|
|
10703
|
-
const lastEmittedErrorCodeRef = (0, import_react.useRef)();
|
|
10704
|
-
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
10705
|
-
getInstance: () => itiRef.current,
|
|
10706
|
-
getInput: () => inputRef.current
|
|
10707
|
-
}));
|
|
10708
|
-
const update = (0, import_react.useCallback)(() => {
|
|
10709
|
-
if (!itiRef.current?.isActive()) {
|
|
10710
|
-
return;
|
|
10711
|
-
}
|
|
10712
|
-
const num = itiRef.current?.getNumber() || "";
|
|
10713
|
-
const countryIso = itiRef.current?.getSelectedCountryData().iso2 || "";
|
|
10714
|
-
if (num !== lastEmittedNumberRef.current) {
|
|
10715
|
-
lastEmittedNumberRef.current = num;
|
|
10716
|
-
onChangeNumber(num);
|
|
10717
|
-
}
|
|
10718
|
-
if (countryIso !== lastEmittedCountryRef.current) {
|
|
10719
|
-
lastEmittedCountryRef.current = countryIso;
|
|
10720
|
-
onChangeCountry(countryIso);
|
|
10721
|
-
}
|
|
10722
|
-
if (itiRef.current) {
|
|
10723
|
-
const isValid = usePreciseValidation ? itiRef.current.isValidNumberPrecise() : itiRef.current.isValidNumber();
|
|
10724
|
-
const errorCode = isValid ? null : itiRef.current.getValidationError();
|
|
10725
|
-
if (isValid !== lastEmittedValidityRef.current) {
|
|
10726
|
-
lastEmittedValidityRef.current = isValid;
|
|
10727
|
-
onChangeValidity(isValid);
|
|
10728
|
-
}
|
|
10729
|
-
if (errorCode !== lastEmittedErrorCodeRef.current) {
|
|
10730
|
-
lastEmittedErrorCodeRef.current = errorCode;
|
|
10731
|
-
onChangeErrorCode(errorCode);
|
|
10732
|
-
}
|
|
10733
|
-
}
|
|
10734
|
-
}, [
|
|
10735
|
-
onChangeCountry,
|
|
10736
|
-
onChangeErrorCode,
|
|
10737
|
-
onChangeNumber,
|
|
10738
|
-
onChangeValidity,
|
|
10739
|
-
usePreciseValidation
|
|
10740
|
-
]);
|
|
10741
|
-
(0, import_react.useEffect)(() => {
|
|
10742
|
-
if (inputRef.current) {
|
|
10743
|
-
itiRef.current = intlTelInputWithUtils_default(inputRef.current, initOptions);
|
|
10744
|
-
}
|
|
10745
|
-
return () => {
|
|
10746
|
-
itiRef.current?.destroy();
|
|
10747
|
-
};
|
|
10748
|
-
}, []);
|
|
10749
|
-
(0, import_react.useEffect)(() => {
|
|
10750
|
-
const inputRefCurrent = inputRef.current;
|
|
10751
|
-
if (inputRefCurrent) {
|
|
10752
|
-
inputRefCurrent.addEventListener("countrychange", update);
|
|
10753
|
-
itiRef.current.promise.then(update);
|
|
10754
|
-
}
|
|
10755
|
-
return () => {
|
|
10756
|
-
if (inputRefCurrent) {
|
|
10757
|
-
inputRefCurrent.removeEventListener("countrychange", update);
|
|
10758
|
-
}
|
|
10759
|
-
};
|
|
10760
|
-
}, [update]);
|
|
10761
|
-
(0, import_react.useEffect)(() => {
|
|
10762
|
-
if (itiRef.current && disabled !== void 0) {
|
|
10763
|
-
itiRef.current.setDisabled(disabled);
|
|
10764
|
-
}
|
|
10765
|
-
}, [disabled]);
|
|
10766
|
-
const {
|
|
10767
|
-
value: _value,
|
|
10768
|
-
// disabled: _disabled,
|
|
10769
|
-
...sanitizedInputProps
|
|
10770
|
-
} = inputProps;
|
|
10771
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
10772
|
-
"input",
|
|
10773
|
-
{
|
|
10774
|
-
...sanitizedInputProps,
|
|
10775
|
-
type: "tel",
|
|
10776
|
-
ref: inputRef,
|
|
10777
|
-
onInput: update,
|
|
10778
|
-
defaultValue: initialValue
|
|
10779
|
-
}
|
|
10780
|
-
);
|
|
10781
|
-
});
|
|
10782
|
-
var reactWithUtils_default = IntlTelInput;
|
|
10689
|
+
export {
|
|
10690
|
+
intlTelInputWithUtils_default as default
|
|
10691
|
+
};
|