import { computed as e, createElementBlock as t, defineComponent as n, getCurrentInstance as r, mergeProps as i, onMounted as a, onUnmounted as o, openBlock as s, ref as c, shallowRef as l, watch as u } from "vue";
//#region dist/js/intlTelInput.mjs
var d = [
	[
		"af",
		"93",
		0,
		null,
		"0"
	],
	[
		"ax",
		"358",
		1,
		["18", "4"],
		"0"
	],
	[
		"al",
		"355",
		0,
		null,
		"0"
	],
	[
		"dz",
		"213",
		0,
		null,
		"0"
	],
	[
		"as",
		"1",
		5,
		["684"],
		"1"
	],
	["ad", "376"],
	["ao", "244"],
	[
		"ai",
		"1",
		6,
		["264"],
		"1"
	],
	[
		"ag",
		"1",
		7,
		["268"],
		"1"
	],
	[
		"ar",
		"54",
		0,
		null,
		"0"
	],
	[
		"am",
		"374",
		0,
		null,
		"0"
	],
	["aw", "297"],
	["ac", "247"],
	[
		"au",
		"61",
		0,
		["4"],
		"0"
	],
	[
		"at",
		"43",
		0,
		null,
		"0"
	],
	[
		"az",
		"994",
		0,
		null,
		"0"
	],
	[
		"bs",
		"1",
		8,
		["242"],
		"1"
	],
	["bh", "973"],
	[
		"bd",
		"880",
		0,
		null,
		"0"
	],
	[
		"bb",
		"1",
		9,
		["246"],
		"1"
	],
	[
		"by",
		"375",
		0,
		null,
		"8"
	],
	[
		"be",
		"32",
		0,
		null,
		"0"
	],
	["bz", "501"],
	["bj", "229"],
	[
		"bm",
		"1",
		10,
		["441"],
		"1"
	],
	["bt", "975"],
	[
		"bo",
		"591",
		0,
		null,
		"0"
	],
	[
		"ba",
		"387",
		0,
		null,
		"0"
	],
	["bw", "267"],
	[
		"br",
		"55",
		0,
		null,
		"0"
	],
	["io", "246"],
	[
		"vg",
		"1",
		11,
		["284"],
		"1"
	],
	["bn", "673"],
	[
		"bg",
		"359",
		0,
		null,
		"0"
	],
	["bf", "226"],
	["bi", "257"],
	[
		"kh",
		"855",
		0,
		null,
		"0"
	],
	["cm", "237"],
	[
		"ca",
		"1",
		1,
		/* @__PURE__ */ "204.226.236.249.250.257.263.289.306.343.354.365.367.368.382.403.416.418.428.431.437.438.450.468.474.506.514.519.548.579.581.584.587.604.613.639.647.672.683.705.709.742.753.778.780.782.807.819.825.867.873.879.902.905.942".split("."),
		"1"
	],
	["cv", "238"],
	[
		"bq",
		"599",
		1,
		[
			"3",
			"4",
			"7"
		]
	],
	[
		"ky",
		"1",
		12,
		["345"],
		"1"
	],
	["cf", "236"],
	["td", "235"],
	["cl", "56"],
	[
		"cn",
		"86",
		0,
		null,
		"0"
	],
	[
		"cx",
		"61",
		2,
		["4", "89164"],
		"0"
	],
	[
		"cc",
		"61",
		1,
		["4", "89162"],
		"0"
	],
	[
		"co",
		"57",
		0,
		null,
		"0"
	],
	["km", "269"],
	["cg", "242"],
	[
		"cd",
		"243",
		0,
		null,
		"0"
	],
	["ck", "682"],
	["cr", "506"],
	["ci", "225"],
	[
		"hr",
		"385",
		0,
		null,
		"0"
	],
	[
		"cu",
		"53",
		0,
		null,
		"0"
	],
	[
		"cw",
		"599",
		0
	],
	["cy", "357"],
	["cz", "420"],
	["dk", "45"],
	["dj", "253"],
	[
		"dm",
		"1",
		13,
		["767"],
		"1"
	],
	[
		"do",
		"1",
		2,
		[
			"809",
			"829",
			"849"
		],
		"1"
	],
	[
		"ec",
		"593",
		0,
		null,
		"0"
	],
	[
		"eg",
		"20",
		0,
		null,
		"0"
	],
	["sv", "503"],
	["gq", "240"],
	[
		"er",
		"291",
		0,
		null,
		"0"
	],
	["ee", "372"],
	["sz", "268"],
	[
		"et",
		"251",
		0,
		null,
		"0"
	],
	["fk", "500"],
	["fo", "298"],
	["fj", "679"],
	[
		"fi",
		"358",
		0,
		["4"],
		"0"
	],
	[
		"fr",
		"33",
		0,
		null,
		"0"
	],
	[
		"gf",
		"594",
		0,
		null,
		"0"
	],
	["pf", "689"],
	["ga", "241"],
	["gm", "220"],
	[
		"ge",
		"995",
		0,
		null,
		"0"
	],
	[
		"de",
		"49",
		0,
		null,
		"0"
	],
	[
		"gh",
		"233",
		0,
		null,
		"0"
	],
	["gi", "350"],
	["gr", "30"],
	["gl", "299"],
	[
		"gd",
		"1",
		14,
		["473"],
		"1"
	],
	[
		"gp",
		"590",
		0,
		null,
		"0"
	],
	[
		"gu",
		"1",
		15,
		["671"],
		"1"
	],
	["gt", "502"],
	[
		"gg",
		"44",
		1,
		[
			"1481",
			"7781",
			"7839",
			"7911"
		],
		"0"
	],
	["gn", "224"],
	["gw", "245"],
	["gy", "592"],
	["ht", "509"],
	["hn", "504"],
	["hk", "852"],
	[
		"hu",
		"36",
		0,
		null,
		"06"
	],
	["is", "354"],
	[
		"in",
		"91",
		0,
		null,
		"0"
	],
	[
		"id",
		"62",
		0,
		null,
		"0"
	],
	[
		"ir",
		"98",
		0,
		null,
		"0"
	],
	[
		"iq",
		"964",
		0,
		null,
		"0"
	],
	[
		"ie",
		"353",
		0,
		null,
		"0"
	],
	[
		"im",
		"44",
		2,
		[
			"1624",
			"74576",
			"7524",
			"7624",
			"7924"
		],
		"0"
	],
	[
		"il",
		"972",
		0,
		null,
		"0"
	],
	[
		"it",
		"39",
		0,
		["3"]
	],
	[
		"jm",
		"1",
		4,
		["658", "876"],
		"1"
	],
	[
		"jp",
		"81",
		0,
		null,
		"0"
	],
	[
		"je",
		"44",
		3,
		[
			"1534",
			"7509",
			"7700",
			"7797",
			"7829",
			"7937"
		],
		"0"
	],
	[
		"jo",
		"962",
		0,
		null,
		"0"
	],
	[
		"kz",
		"7",
		1,
		["33", "7"],
		"8"
	],
	[
		"ke",
		"254",
		0,
		null,
		"0"
	],
	[
		"ki",
		"686",
		0,
		null,
		"0"
	],
	[
		"xk",
		"383",
		0,
		null,
		"0"
	],
	["kw", "965"],
	[
		"kg",
		"996",
		0,
		null,
		"0"
	],
	[
		"la",
		"856",
		0,
		null,
		"0"
	],
	["lv", "371"],
	[
		"lb",
		"961",
		0,
		null,
		"0"
	],
	["ls", "266"],
	[
		"lr",
		"231",
		0,
		null,
		"0"
	],
	[
		"ly",
		"218",
		0,
		null,
		"0"
	],
	[
		"li",
		"423",
		0,
		null,
		"0"
	],
	[
		"lt",
		"370",
		0,
		null,
		"0"
	],
	["lu", "352"],
	["mo", "853"],
	[
		"mg",
		"261",
		0,
		null,
		"0"
	],
	[
		"mw",
		"265",
		0,
		null,
		"0"
	],
	[
		"my",
		"60",
		0,
		null,
		"0"
	],
	["mv", "960"],
	["ml", "223"],
	["mt", "356"],
	[
		"mh",
		"692",
		0,
		null,
		"1"
	],
	[
		"mq",
		"596",
		0,
		null,
		"0"
	],
	["mr", "222"],
	["mu", "230"],
	[
		"yt",
		"262",
		1,
		["269", "639"],
		"0"
	],
	["mx", "52"],
	["fm", "691"],
	[
		"md",
		"373",
		0,
		null,
		"0"
	],
	[
		"mc",
		"377",
		0,
		null,
		"0"
	],
	[
		"mn",
		"976",
		0,
		null,
		"0"
	],
	[
		"me",
		"382",
		0,
		null,
		"0"
	],
	[
		"ms",
		"1",
		16,
		["664"],
		"1"
	],
	[
		"ma",
		"212",
		0,
		["6", "7"],
		"0"
	],
	["mz", "258"],
	[
		"mm",
		"95",
		0,
		null,
		"0"
	],
	[
		"na",
		"264",
		0,
		null,
		"0"
	],
	["nr", "674"],
	[
		"np",
		"977",
		0,
		null,
		"0"
	],
	[
		"nl",
		"31",
		0,
		null,
		"0"
	],
	["nc", "687"],
	[
		"nz",
		"64",
		0,
		null,
		"0"
	],
	["ni", "505"],
	["ne", "227"],
	[
		"ng",
		"234",
		0,
		null,
		"0"
	],
	["nu", "683"],
	["nf", "672"],
	[
		"kp",
		"850",
		0,
		null,
		"0"
	],
	[
		"mk",
		"389",
		0,
		null,
		"0"
	],
	[
		"mp",
		"1",
		17,
		["670"],
		"1"
	],
	[
		"no",
		"47",
		0,
		["4", "9"]
	],
	["om", "968"],
	[
		"pk",
		"92",
		0,
		null,
		"0"
	],
	["pw", "680"],
	[
		"ps",
		"970",
		0,
		null,
		"0"
	],
	["pa", "507"],
	["pg", "675"],
	[
		"py",
		"595",
		0,
		null,
		"0"
	],
	[
		"pe",
		"51",
		0,
		null,
		"0"
	],
	[
		"ph",
		"63",
		0,
		null,
		"0"
	],
	["pl", "48"],
	["pt", "351"],
	[
		"pr",
		"1",
		3,
		["787", "939"],
		"1"
	],
	["qa", "974"],
	[
		"re",
		"262",
		0,
		null,
		"0"
	],
	[
		"ro",
		"40",
		0,
		null,
		"0"
	],
	[
		"ru",
		"7",
		0,
		["33"],
		"8"
	],
	[
		"rw",
		"250",
		0,
		null,
		"0"
	],
	["ws", "685"],
	["sm", "378"],
	["st", "239"],
	[
		"sa",
		"966",
		0,
		null,
		"0"
	],
	["sn", "221"],
	[
		"rs",
		"381",
		0,
		null,
		"0"
	],
	["sc", "248"],
	[
		"sl",
		"232",
		0,
		null,
		"0"
	],
	["sg", "65"],
	[
		"sx",
		"1",
		21,
		["721"],
		"1"
	],
	[
		"sk",
		"421",
		0,
		null,
		"0"
	],
	[
		"si",
		"386",
		0,
		null,
		"0"
	],
	["sb", "677"],
	[
		"so",
		"252",
		0,
		null,
		"0"
	],
	[
		"za",
		"27",
		0,
		null,
		"0"
	],
	[
		"kr",
		"82",
		0,
		null,
		"0"
	],
	[
		"ss",
		"211",
		0,
		null,
		"0"
	],
	["es", "34"],
	[
		"lk",
		"94",
		0,
		null,
		"0"
	],
	[
		"bl",
		"590",
		1,
		null,
		"0"
	],
	["sh", "290"],
	[
		"kn",
		"1",
		18,
		["869"],
		"1"
	],
	[
		"lc",
		"1",
		19,
		["758"],
		"1"
	],
	[
		"mf",
		"590",
		2,
		null,
		"0"
	],
	[
		"pm",
		"508",
		0,
		null,
		"0"
	],
	[
		"vc",
		"1",
		20,
		["784"],
		"1"
	],
	[
		"sd",
		"249",
		0,
		null,
		"0"
	],
	["sr", "597"],
	[
		"sj",
		"47",
		1,
		[
			"4",
			"79",
			"9"
		]
	],
	[
		"se",
		"46",
		0,
		null,
		"0"
	],
	[
		"ch",
		"41",
		0,
		null,
		"0"
	],
	[
		"sy",
		"963",
		0,
		null,
		"0"
	],
	[
		"tw",
		"886",
		0,
		null,
		"0"
	],
	["tj", "992"],
	[
		"tz",
		"255",
		0,
		null,
		"0"
	],
	[
		"th",
		"66",
		0,
		null,
		"0"
	],
	["tl", "670"],
	["tg", "228"],
	["tk", "690"],
	["to", "676"],
	[
		"tt",
		"1",
		22,
		["868"],
		"1"
	],
	["tn", "216"],
	[
		"tr",
		"90",
		0,
		null,
		"0"
	],
	[
		"tm",
		"993",
		0,
		null,
		"8"
	],
	[
		"tc",
		"1",
		23,
		["649"],
		"1"
	],
	["tv", "688"],
	[
		"vi",
		"1",
		24,
		["340"],
		"1"
	],
	[
		"ug",
		"256",
		0,
		null,
		"0"
	],
	[
		"ua",
		"380",
		0,
		null,
		"0"
	],
	[
		"ae",
		"971",
		0,
		null,
		"0"
	],
	[
		"gb",
		"44",
		0,
		null,
		"0"
	],
	[
		"us",
		"1",
		0,
		null,
		"1"
	],
	[
		"uy",
		"598",
		0,
		null,
		"0"
	],
	["uz", "998"],
	["vu", "678"],
	[
		"va",
		"39",
		1,
		["06698", "3"]
	],
	[
		"ve",
		"58",
		0,
		null,
		"0"
	],
	[
		"vn",
		"84",
		0,
		null,
		"0"
	],
	["wf", "681"],
	[
		"eh",
		"212",
		1,
		[
			"5288",
			"5289",
			"6",
			"7"
		],
		"0"
	],
	[
		"ye",
		"967",
		0,
		null,
		"0"
	],
	[
		"zm",
		"260",
		0,
		null,
		"0"
	],
	[
		"zw",
		"263",
		0,
		null,
		"0"
	]
], f = [];
for (let e of d) f.push({
	name: "",
	iso2: e[0],
	dialCode: e[1],
	priority: e[2] || 0,
	areaCodes: e[3] || null,
	nationalPrefix: e[4] || null,
	normalisedName: "",
	initials: "",
	dialCodePlus: ""
});
var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
	OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
	CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
	COUNTRY_CHANGE: "countrychange",
	INPUT: "input",
	STRICT_REJECT: "strict:reject"
}, _ = {
	HIDE: "iti__hide",
	V_HIDE: "iti__v-hide",
	ARROW_UP: "iti__arrow--up",
	GLOBE: "iti__globe",
	FLAG: "iti__flag",
	LOADING: "iti__loading",
	COUNTRY_ITEM: "iti__country",
	HIGHLIGHT: "iti__highlight"
}, v = {
	ARROW_UP: "ArrowUp",
	ARROW_DOWN: "ArrowDown",
	SPACE: " ",
	ENTER: "Enter",
	ESC: "Escape",
	TAB: "Tab"
}, y = {
	PASTE: "insertFromPaste",
	DELETE_FORWARD: "deleteContentForward"
}, b = {
	ALPHA_UNICODE: /\p{L}/u,
	NON_PLUS_NUMERIC: /[^+0-9]/,
	NON_PLUS_NUMERIC_GLOBAL: /[^+0-9]/g,
	HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
}, x = {
	SEARCH_DEBOUNCE_MS: 100,
	HIDDEN_SEARCH_RESET_MS: 1e3,
	NEXT_TICK: 0
}, S = {
	UNKNOWN_NUMBER_TYPE: -99,
	UNKNOWN_VALIDATION_ERROR: -99
}, C = {
	NARROW_VIEWPORT_WIDTH: 500,
	FALLBACK_SELECTED_WITH_DIAL_WIDTH: 78,
	FALLBACK_SELECTED_NO_DIAL_WIDTH: 42,
	INPUT_PADDING_EXTRA_LEFT: 6,
	DROPDOWN_MARGIN: 3,
	FALLBACK_DROPDOWN_HEIGHT: 200
}, w = {
	PLUS: "+",
	NANP: "1"
}, T = {
	ISO2: "gb",
	DIAL_CODE: "44",
	MOBILE_PREFIX: "7",
	MOBILE_CORE_LENGTH: 10
}, E = {
	ISO2: "us",
	DIAL_CODE: "1"
}, D = {
	AGGRESSIVE: "aggressive",
	POLITE: "polite",
	OFF: "off"
}, O = { AUTO: "auto" }, k = new Set([
	"FIXED_LINE",
	"MOBILE",
	"FIXED_LINE_OR_MOBILE",
	"TOLL_FREE",
	"PREMIUM_RATE",
	"SHARED_COST",
	"VOIP",
	"PERSONAL_NUMBER",
	"PAGER",
	"UAN",
	"VOICEMAIL",
	"UNKNOWN"
]), A = {
	ISO2: "countryCode",
	DIAL_CODE: "dialCode",
	INSTANCE_ID: "intlTelInputId"
}, j = {
	EXPANDED: "aria-expanded",
	LABEL: "aria-label",
	SELECTED: "aria-selected",
	ACTIVE_DESCENDANT: "aria-activedescendant",
	HASPOPUP: "aria-haspopup",
	CONTROLS: "aria-controls",
	HIDDEN: "aria-hidden",
	AUTOCOMPLETE: "aria-autocomplete",
	MODAL: "aria-modal"
}, M = {
	selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
	noCountrySelected: "Select country for phone number",
	countryListAriaLabel: "List of countries",
	searchPlaceholder: "Search",
	clearSearchAriaLabel: "Clear search",
	searchEmptyState: "No results found",
	searchSummaryAria(e) {
		return e === 0 ? "No results found" : e === 1 ? "1 result found" : `${e} results found`;
	}
}, N = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, P = () => N(`(max-width: ${C.NARROW_VIEWPORT_WIDTH}px)`), F = {
	allowDropdown: !0,
	allowedNumberTypes: ["MOBILE", "FIXED_LINE"],
	allowNumberExtensions: !1,
	allowPhonewords: !1,
	autoPlaceholder: D.POLITE,
	containerClass: "",
	countryNameLocale: "en",
	countryOrder: null,
	countrySearch: !0,
	customPlaceholder: null,
	dropdownAlwaysOpen: !1,
	dropdownContainer: null,
	excludeCountries: null,
	fixDropdownWidth: !0,
	formatAsYouType: !0,
	formatOnDisplay: !0,
	geoIpLookup: null,
	hiddenInput: null,
	i18n: {},
	initialCountry: "",
	loadUtils: null,
	nationalMode: !0,
	onlyCountries: null,
	placeholderNumberType: "MOBILE",
	searchInputClass: "",
	separateDialCode: !1,
	strictRejectAnimation: !1,
	showFlags: !0,
	strictMode: !1,
	useFullscreenPopup: (() => {
		if (typeof navigator < "u" && typeof window < "u") {
			let e = N("(max-height: 600px)"), t = N("(pointer: coarse)");
			return P() || t && e;
		}
		return !1;
	})()
}, I = (e) => JSON.stringify(e), L = (e) => !!e && typeof e == "object" && !Array.isArray(e), ee = (e) => typeof e == "function", te = (e) => {
	if (!e || typeof e != "object") return !1;
	let t = e;
	return t.nodeType === 1 && typeof t.tagName == "string" && typeof t.appendChild == "function";
}, R = new Set(Object.values(D)), z = (e) => {
	console.warn(`[intl-tel-input] ${e}`);
}, B = (e, t, n) => {
	z(`Option '${e}' must be ${t}; got ${I(n)}. Ignoring.`);
}, V = (e, t) => {
	let n = "an array of iso2 country code strings";
	if (!Array.isArray(t)) return B(e, n, t), !1;
	let r = [];
	for (let i of t) {
		if (typeof i != "string") return B(e, n, t), !1;
		m(i.toLowerCase()) ? r.push(i) : z(`Invalid iso2 code in '${e}': '${i}'. Skipping.`);
	}
	return r;
}, ne = (e) => {
	if (e === void 0) return {};
	if (!L(e)) return z(`The second argument must be an options object; got ${I(e)}. Using defaults.`), {};
	let t = {};
	for (let [n, r] of Object.entries(e)) {
		if (!Object.hasOwn(F, n)) {
			z(`Unknown option '${n}'. Ignoring.`);
			continue;
		}
		switch (n) {
			case "allowDropdown":
			case "allowNumberExtensions":
			case "allowPhonewords":
			case "countrySearch":
			case "dropdownAlwaysOpen":
			case "fixDropdownWidth":
			case "formatAsYouType":
			case "formatOnDisplay":
			case "nationalMode":
			case "showFlags":
			case "separateDialCode":
			case "strictMode":
			case "strictRejectAnimation":
			case "useFullscreenPopup":
				if (typeof r != "boolean") {
					B(n, "a boolean", r);
					break;
				}
				t[n] = r;
				break;
			case "autoPlaceholder":
				if (typeof r != "string" || !R.has(r)) {
					B("autoPlaceholder", `one of ${Array.from(R).join(", ")}`, r);
					break;
				}
				t[n] = r;
				break;
			case "containerClass":
			case "searchInputClass":
			case "countryNameLocale":
				if (typeof r != "string") {
					B(n, "a string", r);
					break;
				}
				t[n] = r;
				break;
			case "countryOrder":
				if (r === null) t[n] = r;
				else {
					let e = V(n, r);
					e !== !1 && (t[n] = e);
				}
				break;
			case "customPlaceholder":
			case "geoIpLookup":
			case "hiddenInput":
			case "loadUtils":
				if (r !== null && !ee(r)) {
					B(n, "a function or null", r);
					break;
				}
				t[n] = r;
				break;
			case "dropdownContainer":
				if (r !== null && !te(r)) {
					B("dropdownContainer", "an HTMLElement or null", r);
					break;
				}
				t[n] = r;
				break;
			case "excludeCountries":
			case "onlyCountries":
				if (r === null) t[n] = r;
				else {
					let e = V(n, r);
					e !== !1 && (t[n] = e);
				}
				break;
			case "i18n":
				if (r && !L(r)) {
					B("i18n", "an object", r);
					break;
				}
				t[n] = r;
				break;
			case "initialCountry": {
				if (typeof r != "string") {
					B("initialCountry", "a string", r);
					break;
				}
				let e = r.toLowerCase();
				if (e && e !== O.AUTO && !m(e)) {
					B("initialCountry", "a valid iso2 country code or 'auto'", r);
					break;
				}
				t[n] = r;
				break;
			}
			case "placeholderNumberType":
				if (typeof r != "string" || !k.has(r)) {
					B("placeholderNumberType", `one of ${Array.from(k).join(", ")}`, r);
					break;
				}
				t[n] = r;
				break;
			case "allowedNumberTypes":
				if (r !== null) {
					if (!Array.isArray(r)) {
						B("allowedNumberTypes", "an array of number types or null", r);
						break;
					}
					let e = !0;
					for (let t of r) if (typeof t != "string" || !k.has(t)) {
						B("allowedNumberTypes", `an array of valid number types (${Array.from(k).join(", ")})`, t), e = !1;
						break;
					}
					e && (t[n] = r);
				} else t[n] = null;
				break;
		}
	}
	return t;
}, re = (e) => {
	e.initialCountry &&= e.initialCountry.toLowerCase(), e.onlyCountries?.length && (e.onlyCountries = e.onlyCountries.map((e) => e.toLowerCase())), e.excludeCountries?.length && (e.excludeCountries = e.excludeCountries.map((e) => e.toLowerCase())), e.countryOrder &&= e.countryOrder.map((e) => e.toLowerCase());
}, ie = (e) => {
	e.dropdownAlwaysOpen && (e.useFullscreenPopup = !1, e.allowDropdown = !0), e.useFullscreenPopup ? e.fixDropdownWidth = !1 : P() && (e.fixDropdownWidth = !0), e.onlyCountries?.length === 1 && (e.initialCountry = e.onlyCountries[0]), e.separateDialCode && (e.nationalMode = !1), e.allowDropdown && !e.showFlags && !e.separateDialCode && (e.nationalMode = !1), e.useFullscreenPopup && !e.dropdownContainer && (e.dropdownContainer = document.body), e.i18n = {
		...M,
		...e.i18n
	};
}, H = (e) => e.replace(/\D/g, ""), U = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), W = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), G = (e, t, n) => {
	let r = document.createElement(e);
	return t && Object.entries(t).forEach(([e, t]) => r.setAttribute(e, t)), n && n.appendChild(r), r;
}, ae = () => `
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${j.HIDDEN}="true">
    <circle cx="11" cy="11" r="7" />
    <line x1="21" y1="21" x2="16.65" y2="16.65" />
  </svg>`, oe = (e) => {
	let t = `iti-${e}-clear-mask`;
	return `
    <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${j.HIDDEN}="true" focusable="false">
      <mask id="${t}" maskUnits="userSpaceOnUse">
        <rect width="16" height="16" fill="white" />
        <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
      </mask>
      <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
    </svg>`;
}, se = () => `
  <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${j.HIDDEN}="true">
    <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
  </svg>`, K = () => "\n  <svg width=\"256\" height=\"256\" viewBox=\"0 0 512 512\" class=\"iti__globe-svg\">\n    <path d=\"M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39\"/>\n    <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\"/>\n  </svg>", ce = (e, t) => {
	let n = U(t), r = [], i = [], a = [], o = [], s = [], c = [];
	for (let t of e) t.iso2 === n ? r.push(t) : t.normalisedName.startsWith(n) ? i.push(t) : t.normalisedName.includes(n) ? a.push(t) : n === t.dialCode || n === t.dialCodePlus ? o.push(t) : t.dialCodePlus.includes(n) ? s.push(t) : t.initials.includes(n) && c.push(t);
	let l = (e, t) => e.priority - t.priority;
	return [
		...r,
		...i,
		...a,
		...o.sort(l),
		...s.sort(l),
		...c
	];
}, le = (e, t) => {
	let n = U(t);
	for (let t of e) if (t.normalisedName.startsWith(n)) return t;
	return null;
}, q = class e {
	#e;
	#t;
	#n;
	#r = "";
	#i;
	#a = null;
	#o;
	#s;
	#c;
	#l;
	#u;
	#d;
	#f;
	#p;
	#m;
	#h;
	#g;
	#_;
	#v;
	#y;
	#b;
	#x;
	#S = null;
	#C = null;
	#w = /* @__PURE__ */ new Map();
	#T = null;
	telInputEl;
	hadInitialPlaceholder;
	constructor(e, t, n) {
		e.dataset[A.INSTANCE_ID] = n.toString(), this.telInputEl = e, this.#e = t, this.#t = n, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.#n = !!this.telInputEl.closest("[dir=rtl]"), this.#r = this.telInputEl.style.paddingLeft;
	}
	static validateInput(e) {
		let t = e?.tagName;
		if (!(e && typeof e == "object" && t === "INPUT" && typeof e.setAttribute == "function")) {
			let t = Object.prototype.toString.call(e);
			throw TypeError(`The first argument must be an HTMLInputElement, not ${t}`);
		}
	}
	buildMarkup(e) {
		this.#i = e, this.telInputEl.classList.add("iti__tel-input"), this.telInputEl.hasAttribute("type") || this.telInputEl.setAttribute("type", "tel"), this.telInputEl.hasAttribute("autocomplete") || this.telInputEl.setAttribute("autocomplete", "tel"), this.telInputEl.hasAttribute("inputmode") || this.telInputEl.setAttribute("inputmode", "tel");
		let t = this.#E();
		this.#D(t), t.appendChild(this.telInputEl), this.#A(), this.#j(t), this.ensureDropdownWidthSet();
	}
	#E() {
		let { allowDropdown: e, showFlags: t, containerClass: n, useFullscreenPopup: r } = this.#e, i = G("div", { class: W({
			iti: !0,
			"iti--allow-dropdown": e,
			"iti--show-flags": t,
			"iti--inline-dropdown": !r,
			[n]: !!n
		}) });
		return this.#n && i.setAttribute("dir", "ltr"), this.telInputEl.before(i), i;
	}
	#D(e) {
		let { allowDropdown: t, separateDialCode: n, showFlags: r } = this.#e;
		if (!t && !r && !n) return;
		this.#s = G("div", { class: `iti__country-container ${_.V_HIDE}` }, e), t ? (this.#c = G("button", {
			type: "button",
			class: "iti__selected-country",
			[j.EXPANDED]: "false",
			[j.LABEL]: this.#e.i18n.noCountrySelected,
			[j.HASPOPUP]: "dialog",
			[j.CONTROLS]: `iti-${this.#t}__dropdown-content`
		}, this.#s), this.telInputEl.disabled && this.#c.setAttribute("disabled", "true")) : this.#c = G("div", { class: "iti__selected-country" }, this.#s);
		let i = G("div", { class: "iti__selected-country-primary" }, this.#c);
		this.#l = G("div", { class: _.FLAG }, i), t && (this.#d = G("div", {
			class: "iti__arrow",
			[j.HIDDEN]: "true"
		}, i)), n && (this.#u = G("div", { class: "iti__selected-dial-code" }, this.#c)), t && this.#O();
	}
	ensureDropdownWidthSet() {
		let { fixDropdownWidth: e, allowDropdown: t } = this.#e;
		if (!t || !e || this.#f.style.width) return;
		let n = this.telInputEl.offsetWidth;
		n > 0 && (this.#f.style.width = `${n}px`);
	}
	#O() {
		let { fixDropdownWidth: e, useFullscreenPopup: t, countrySearch: n, i18n: r, dropdownContainer: i, containerClass: a } = this.#e, o = e ? "" : "iti--flexible-dropdown-width";
		this.#f = G("div", {
			id: `iti-${this.#t}__dropdown-content`,
			class: `iti__dropdown-content ${_.HIDE} ${o}`,
			role: "dialog",
			[j.MODAL]: "true"
		}), this.#n && this.#f.setAttribute("dir", "rtl"), n && this.#k(), this.#g = G("ul", {
			class: "iti__country-list",
			id: `iti-${this.#t}__country-listbox`,
			role: "listbox",
			[j.LABEL]: r.countryListAriaLabel
		}, this.#f), this.#M(), n && this.#L(), t || (this.#o = this.#I(), n && (this.#f.style.height = `${this.#o}px`)), i ? (this.#x = G("div", { class: W({
			iti: !0,
			"iti--container": !0,
			"iti--fullscreen-popup": t,
			"iti--inline-dropdown": !t,
			[a]: !!a
		}) }), this.#x.appendChild(this.#f)) : this.#s.appendChild(this.#f);
	}
	#k() {
		let { i18n: e, searchInputClass: t } = this.#e, n = G("div", { class: "iti__search-input-wrapper" }, this.#f);
		this.#p = G("span", {
			class: "iti__search-icon",
			[j.HIDDEN]: "true"
		}, n), this.#p.innerHTML = ae(), this.#m = G("input", {
			id: `iti-${this.#t}__search-input`,
			type: "search",
			class: `iti__search-input ${t}`,
			placeholder: e.searchPlaceholder,
			role: "combobox",
			[j.EXPANDED]: "true",
			[j.LABEL]: e.searchPlaceholder,
			[j.CONTROLS]: `iti-${this.#t}__country-listbox`,
			[j.AUTOCOMPLETE]: "list",
			autocomplete: "off"
		}, n), this.#h = G("button", {
			type: "button",
			class: `iti__search-clear ${_.HIDE}`,
			[j.LABEL]: e.clearSearchAriaLabel,
			tabindex: "-1"
		}, n), this.#h.innerHTML = oe(this.#t), this.#b = G("span", { class: "iti__a11y-text" }, this.#f), this.#y = G("div", {
			class: `iti__no-results ${_.HIDE}`,
			[j.HIDDEN]: "true"
		}, this.#f), this.#y.textContent = e.searchEmptyState ?? null;
	}
	#A() {
		this.#s && (this.#N(), this.#s.classList.remove(_.V_HIDE));
	}
	#j(e) {
		let { hiddenInput: t } = this.#e;
		if (!t) return;
		let n = t(this.telInputEl.getAttribute("name") || "");
		if (n.phone) {
			let t = this.telInputEl.form?.querySelector(`input[name="${n.phone}"]`);
			t ? this.#_ = t : (this.#_ = G("input", {
				type: "hidden",
				name: n.phone
			}), e.appendChild(this.#_));
		}
		if (n.country) {
			let t = this.telInputEl.form?.querySelector(`input[name="${n.country}"]`);
			t ? this.#v = t : (this.#v = G("input", {
				type: "hidden",
				name: n.country
			}), e.appendChild(this.#v));
		}
	}
	#M() {
		let e = document.createDocumentFragment();
		for (let t = 0; t < this.#i.length; t++) {
			let n = this.#i[t], r = W({ [_.COUNTRY_ITEM]: !0 }), i = G("li", {
				id: `iti-${this.#t}__item-${n.iso2}`,
				class: r,
				tabindex: "-1",
				role: "option",
				[j.SELECTED]: "false"
			});
			i.dataset[A.DIAL_CODE] = n.dialCode, i.dataset[A.ISO2] = n.iso2, this.#w.set(n.iso2, i), this.#e.showFlags && G("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
			let a = G("span", { class: "iti__country-name" }, i);
			a.textContent = `${n.name} `;
			let o = G("span", { class: "iti__dial-code" }, a);
			this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${n.dialCode})`, e.appendChild(i);
		}
		this.#g.appendChild(e);
	}
	#N() {
		if (this.#c) {
			let e = this.#e.separateDialCode ? C.FALLBACK_SELECTED_WITH_DIAL_WIDTH : C.FALLBACK_SELECTED_NO_DIAL_WIDTH, t = (this.#c.offsetWidth || this.#F() || e) + C.INPUT_PADDING_EXTRA_LEFT;
			this.telInputEl.style.paddingLeft = `${t}px`;
		}
	}
	static #P() {
		let e;
		try {
			e = window.top.document.body;
		} catch {
			e = document.body;
		}
		return e;
	}
	#F() {
		if (!this.telInputEl.parentNode) return 0;
		let t = e.#P(), n = this.telInputEl.parentNode.cloneNode(!1);
		n.style.visibility = "hidden", t.appendChild(n);
		let r = this.#s.cloneNode();
		n.appendChild(r);
		let i = this.#c.cloneNode(!0);
		r.appendChild(i);
		let a = i.offsetWidth;
		return t.removeChild(n), a;
	}
	#I() {
		let t = e.#P();
		this.#f.classList.remove(_.HIDE);
		let n = G("div", { class: "iti iti--inline-dropdown" });
		n.appendChild(this.#f), n.style.visibility = "hidden", t.appendChild(n);
		let r = this.#f.offsetHeight;
		return t.removeChild(n), n.style.visibility = "", this.#f.classList.add(_.HIDE), r > 0 ? r : C.FALLBACK_DROPDOWN_HEIGHT;
	}
	#L() {
		let { i18n: e } = this.#e, t = this.#g.childElementCount;
		this.#b.textContent = e.searchSummaryAria(t);
	}
	#R(e) {
		let t;
		t = e === "" ? this.#i : ce(this.#i, e), this.#$(t);
	}
	prefillSearchWithPlus() {
		this.#m.value = "+", this.#m.focus(), this.#R("");
	}
	#z() {
		let e = this.#m.value.trim();
		this.#R(e), this.#m.value ? this.#h.classList.remove(_.HIDE) : this.#h.classList.add(_.HIDE);
	}
	#B() {
		this.#a && clearTimeout(this.#a), this.#a = setTimeout(() => {
			this.#z(), this.#a = null;
		}, x.SEARCH_DEBOUNCE_MS);
	}
	#V() {
		this.#m.value = "", this.#m.focus(), this.#z();
	}
	#H(e) {
		let t = this.#g, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
		r.top < n.top ? t.scrollTop = i : r.bottom > n.bottom && (t.scrollTop = i - n.height + r.height);
	}
	#U(e, t = !0) {
		if (this.#C?.classList.remove(_.HIGHLIGHT), e) {
			if (e.classList.add(_.HIGHLIGHT), this.#e.countrySearch) {
				let t = e.getAttribute("id") || "";
				this.#m.setAttribute(j.ACTIVE_DESCENDANT, t);
			}
			t && this.#H(e), this.#C = e;
		} else this.#C = null;
	}
	bindHiddenInputSubmitListener(e, t, n) {
		let r = this.telInputEl.form;
		!r || !this.#_ && !this.#v || r.addEventListener("submit", () => {
			this.#_ && (this.#_.value = t()), this.#v && (this.#v.value = n());
		}, { signal: e });
	}
	bindAllInitialDropdownListeners(e, t, n) {
		let r = this.telInputEl.closest("label");
		r && r.addEventListener("click", (e) => {
			this.isDropdownOpen() ? e.preventDefault() : this.telInputEl.focus();
		}, { signal: e }), this.#c.addEventListener("click", () => {
			!this.isDropdownOpen() && !this.telInputEl.disabled && !this.telInputEl.readOnly && t();
		}, { signal: e }), this.#s.addEventListener("keydown", (e) => {
			let r = [
				v.ARROW_UP,
				v.ARROW_DOWN,
				v.SPACE,
				v.ENTER
			];
			!this.isDropdownOpen() && r.includes(e.key) && (e.preventDefault(), e.stopPropagation(), t()), e.key === v.TAB && n();
		}, { signal: e });
	}
	openDropdown(e, t) {
		let { countrySearch: n, dropdownAlwaysOpen: r, dropdownContainer: i } = this.#e;
		if (this.#T = new AbortController(), this.ensureDropdownWidthSet(), i) this.#te();
		else {
			let e = this.#ee(), t = this.telInputEl.offsetHeight + C.DROPDOWN_MARGIN;
			e ? this.#f.style.top = `${t}px` : this.#f.style.bottom = `${t}px`;
		}
		this.#f.classList.remove(_.HIDE), this.#c.setAttribute(j.EXPANDED, "true");
		let a = this.#S ?? this.#g.firstElementChild;
		a && this.#U(a), n && !r && this.#m.focus(), this.#e.useFullscreenPopup && this.#x && window.visualViewport && window.visualViewport.addEventListener("resize", () => {
			this.#ne(), this.#C && this.#H(this.#C);
		}, { signal: this.#T.signal }), this.#d.classList.add(_.ARROW_UP), this.#W(e, t);
	}
	#W(e, t) {
		let n = this.#T.signal;
		this.#G(n), this.#K(n, e), this.#e.dropdownAlwaysOpen || this.#q(n, t), this.#J(n, e, t), this.#e.countrySearch && this.#Y(n), !this.#e.useFullscreenPopup && this.#e.dropdownContainer && window.addEventListener("scroll", t, { signal: n });
	}
	#G(e) {
		this.#g.addEventListener("mouseover", (e) => {
			let t = e.target?.closest(`.${_.COUNTRY_ITEM}`);
			t && this.#U(t, !1);
		}, { signal: e });
	}
	#K(e, t) {
		this.#g.addEventListener("click", (e) => {
			let n = e.target?.closest(`.${_.COUNTRY_ITEM}`);
			n && t(n);
		}, { signal: e });
	}
	#q(e, t) {
		setTimeout(() => {
			document.documentElement.addEventListener("click", (e) => {
				this.#f.contains(e.target) || t();
			}, { signal: e });
		}, 0);
	}
	#J(e, t, n) {
		let r = "", i = null;
		document.addEventListener("keydown", (e) => {
			[
				v.ARROW_UP,
				v.ARROW_DOWN,
				v.ENTER,
				v.ESC
			].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key === v.ARROW_UP || e.key === v.ARROW_DOWN ? this.#Z(e.key) : e.key === v.ENTER && !e.isComposing ? t(this.#C) : e.key === v.ESC && (n(), this.#c.focus())), !this.#e.countrySearch && e.target !== this.telInputEl && b.HIDDEN_SEARCH_CHAR.test(e.key) && (e.stopPropagation(), i && clearTimeout(i), r += e.key.toLowerCase(), this.#X(r), i = setTimeout(() => {
				r = "";
			}, x.HIDDEN_SEARCH_RESET_MS));
		}, { signal: e });
	}
	#Y(e) {
		this.#m.addEventListener("input", () => this.#B(), { signal: e }), this.#h.addEventListener("click", () => this.#V(), { signal: e });
	}
	#X(e) {
		let t = le(this.#i, e);
		if (t) {
			let e = this.#w.get(t.iso2);
			this.#U(e);
		}
	}
	#Z(e) {
		let t = e === v.ARROW_UP ? this.#C?.previousElementSibling : this.#C?.nextElementSibling;
		!t && this.#g.childElementCount > 1 && (t = e === v.ARROW_UP ? this.#g.lastElementChild : this.#g.firstElementChild), t && this.#U(t);
	}
	#Q(e) {
		if (this.#S && this.#S.dataset[A.ISO2] !== e && (this.#S.setAttribute(j.SELECTED, "false"), this.#S.querySelector(".iti__country-check")?.remove(), this.#S = null), e && !this.#S) {
			let t = this.#g.querySelector(`[data-country-code="${e}"]`);
			if (t) {
				t.setAttribute(j.SELECTED, "true");
				let e = G("span", {
					class: "iti__country-check",
					[j.HIDDEN]: "true"
				}, t);
				e.innerHTML = se(), this.#S = t, this.#e.dropdownAlwaysOpen && this.#U(t);
			}
		}
	}
	#$(e) {
		this.#g.replaceChildren();
		let t = !0;
		for (let n of e) {
			let e = this.#w.get(n.iso2);
			e && (this.#g.appendChild(e), t &&= (this.#U(e, !1), !1));
		}
		t ? (this.#U(null), this.#y && this.#y.classList.remove(_.HIDE)) : this.#y && this.#y.classList.add(_.HIDE), this.#g.scrollTop = 0, this.#L();
	}
	closeDropdown() {
		let { countrySearch: e, dropdownContainer: t } = this.#e;
		this.#T.abort(), this.#T = null, this.#f.classList.add(_.HIDE), this.#c.setAttribute(j.EXPANDED, "false"), e && (this.#m.removeAttribute(j.ACTIVE_DESCENDANT), this.#m.value = "", this.#z(), this.#C &&= (this.#C.classList.remove(_.HIGHLIGHT), null)), this.#d.classList.remove(_.ARROW_UP), t ? (this.#x.remove(), this.#x.style.top = "", this.#x.style.bottom = "", this.#x.style.paddingLeft = "", this.#x.style.paddingRight = "") : (this.#f.style.top = "", this.#f.style.bottom = "");
	}
	#ee() {
		if (this.#e.dropdownAlwaysOpen) return !0;
		let e = this.telInputEl.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom;
		return n >= this.#o || n >= t;
	}
	#te() {
		let { dropdownContainer: e, useFullscreenPopup: t } = this.#e;
		if (t) {
			if (window.innerWidth >= C.NARROW_VIEWPORT_WIDTH) {
				let e = this.telInputEl.getBoundingClientRect();
				this.#x.style.paddingLeft = `${e.left}px`, this.#x.style.paddingRight = `${window.innerWidth - e.right}px`;
			}
		} else {
			let e = this.telInputEl.getBoundingClientRect();
			this.#x.style.left = `${e.left}px`, this.#ee() ? this.#x.style.top = `${e.bottom + C.DROPDOWN_MARGIN}px` : (this.#x.style.top = "unset", this.#x.style.bottom = `${window.innerHeight - e.top + C.DROPDOWN_MARGIN}px`);
		}
		e.appendChild(this.#x);
	}
	#ne() {
		let e = window.visualViewport;
		if (!e || !this.#x) return;
		let t = window.innerHeight - e.height;
		this.#x.style.bottom = `${t}px`;
	}
	isDropdownOpen() {
		return !this.#f.classList.contains(_.HIDE);
	}
	setLoading(e) {
		this.#l.classList.toggle(_.LOADING, e);
	}
	isLoading() {
		return this.#l.classList.contains(_.LOADING);
	}
	setDisabled(e) {
		this.telInputEl.disabled = e, this.#c && (e ? this.#c.setAttribute("disabled", "true") : this.#c.removeAttribute("disabled"));
	}
	setReadonly(e) {
		this.telInputEl.readOnly = e, this.#c && (e ? this.#c.setAttribute("disabled", "true") : this.#c.removeAttribute("disabled"));
	}
	setCountry(e) {
		let { allowDropdown: t, showFlags: n, separateDialCode: r, i18n: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
		if (t && this.#Q(s), this.#c) {
			let e = s && n ? `${_.FLAG} iti__${s}` : `${_.FLAG} ${_.GLOBE}`, t, r, c;
			s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), c = n ? "" : K()) : (r = i.noCountrySelected, t = i.noCountrySelected, c = K()), this.#l.className = e, this.#c.setAttribute("title", r), this.#c.setAttribute(j.LABEL, t), this.#l.innerHTML = c;
		}
		if (r) {
			let e = o ? `+${o}` : "";
			this.#u.textContent = e, this.#N();
		}
	}
	destroy() {
		this.telInputEl.iti = void 0, delete this.telInputEl.dataset[A.INSTANCE_ID], this.telInputEl.style.paddingLeft = this.#r;
		let e = this.telInputEl.parentNode;
		e && (e.before(this.telInputEl), e.remove()), this.#w.clear();
	}
}, ue = (e) => {
	let { onlyCountries: t, excludeCountries: n } = e;
	return t?.length ? h.filter((e) => t.includes(e.iso2)) : n?.length ? h.filter((e) => !n.includes(e.iso2)) : [...h];
}, de = (e, t) => {
	let { countryNameLocale: n, i18n: r } = t, i;
	try {
		i = typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? new Intl.DisplayNames(n, { type: "region" }) : null;
	} catch (e) {
		console.error(e), i = null;
	}
	for (let t of e) t.name = r[t.iso2] || i?.of(t.iso2.toUpperCase()) || "";
}, fe = (e) => {
	let t = /* @__PURE__ */ new Set(), n = 0, r = {}, i = (e, t) => {
		if (!e || !t) return;
		t.length > n && (n = t.length), Object.hasOwn(r, t) || (r[t] = []);
		let i = r[t];
		i.includes(e) || i.push(e);
	}, a = [...e].sort((e, t) => e.priority - t.priority);
	for (let e of a) {
		t.has(e.dialCode) || t.add(e.dialCode);
		for (let t = 1; t < e.dialCode.length; t++) {
			let n = e.dialCode.substring(0, t);
			i(e.iso2, n);
		}
		if (i(e.iso2, e.dialCode), e.areaCodes) {
			let t = r[e.dialCode][0];
			for (let n of e.areaCodes) {
				for (let r = 1; r < n.length; r++) {
					let a = n.substring(0, r), o = e.dialCode + a;
					i(t, o), i(e.iso2, o);
				}
				i(e.iso2, e.dialCode + n);
			}
		}
	}
	return {
		dialCodes: t,
		dialCodeMaxLength: n,
		dialCodeToIso2Map: r
	};
}, pe = (e, t) => {
	let { countryOrder: n } = t;
	e.sort((e, t) => {
		if (n) {
			let r = n.indexOf(e.iso2), i = n.indexOf(t.iso2), a = r > -1, o = i > -1;
			if (a || o) return a && o ? r - i : a ? -1 : 1;
		}
		return e.name.localeCompare(t.name);
	});
}, me = (e) => {
	for (let t of e) t.normalisedName = U(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((e) => e[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
}, he = /* @__PURE__ */ new Set([
	"800",
	"808",
	"870",
	"881",
	"882",
	"883",
	"888",
	"979"
]), J = (e) => {
	let t = H(e).slice(0, 3);
	return e.startsWith("+") && he.has(t);
}, Y = (e, t, n, r) => {
	if (!n || !t) return e;
	let i = `+${r.dialCode}`, a = e[i.length] === " " || e[i.length] === "-" ? i.length + 1 : i.length;
	return e.substring(a);
}, ge = (e, t, n, r, i) => {
	let a = n ? n.formatNumberAsYouType(e, r?.iso2) : e, o = r?.dialCode;
	return i && t.charAt(0) !== "+" && a.includes(`+${o}`) ? (a.split(`+${o}`)[1] || "").trim() : a;
}, _e = (e, t, n, r) => {
	if (n === 0 && !r) return 0;
	let i = 0;
	for (let n = 0; n < t.length; n++) {
		if (/[+0-9]/.test(t[n]) && i++, i === e && !r) return n + 1;
		if (r && i === e + 1) return n;
	}
	return t.length;
}, ve = /* @__PURE__ */ new Set([
	"800",
	"822",
	"833",
	"844",
	"855",
	"866",
	"877",
	"880",
	"881",
	"882",
	"883",
	"884",
	"885",
	"886",
	"887",
	"888",
	"889"
]), ye = (e) => {
	let t = H(e);
	if (t.startsWith(w.NANP) && t.length >= 4) {
		let e = t.substring(1, 4);
		return ve.has(e);
	}
	return !1;
}, be = class {
	#e;
	constructor(e) {
		e && this.#t(e);
	}
	#t(e) {
		/[\u0660-\u0669]/.test(e) ? this.#e = "arabic-indic" : /[\u06F0-\u06F9]/.test(e) ? this.#e = "persian" : this.#e = "ascii";
	}
	denormalise(e) {
		if (!this.#e || this.#e === "ascii") return e;
		let t = this.#e === "arabic-indic" ? 1632 : 1776;
		return e.replace(/[0-9]/g, (e) => String.fromCharCode(t + Number(e)));
	}
	normalise(e) {
		if (!e) return "";
		if (this.#t(e), this.#e === "ascii") return e;
		let t = this.#e === "arabic-indic" ? 1632 : 1776, n = this.#e === "arabic-indic" ? /[\u0660-\u0669]/g : /[\u06F0-\u06F9]/g;
		return e.replace(n, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - t)));
	}
	isAscii() {
		return !this.#e || this.#e === "ascii";
	}
}, xe = 0, X = (e) => {
	if (!Q.utils) throw Error(`intlTelInput.utils is required for ${e}(). See: https://intl-tel-input.com/docs/utils`);
}, Se = () => {
	let e, t;
	return {
		promise: new Promise((n, r) => {
			e = n, t = r;
		}),
		resolve: e,
		reject: t
	};
}, Z = class e {
	id;
	promise;
	#e;
	#t;
	#n;
	#r;
	#i;
	#a;
	#o;
	#s;
	#c = null;
	#l = null;
	#u;
	#d = !0;
	#f;
	#p;
	#m = !1;
	#h;
	#g;
	constructor(e, t = {}) {
		this.id = xe++, q.validateInput(e);
		let n = ne(t);
		this.#t = {
			...F,
			...n
		}, re(this.#t), ie(this.#t), this.#e = new q(e, this.#t, this.id), this.#n = typeof navigator < "u" && /Android/i.test(navigator.userAgent), this.#p = new be(e.value), this.promise = this.#y(this.#t), this.#r = ue(this.#t);
		let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } = fe(this.#r);
		this.#o = r, this.#i = i, this.#a = a, this.#s = new Map(this.#r.map((e) => [e.iso2, e])), this.#b();
	}
	#_() {
		let e = this.#e.telInputEl.value.trim();
		return this.#p.normalise(e);
	}
	#v(e) {
		this.#e.telInputEl.value = this.#p.denormalise(e);
	}
	#y(e) {
		let { initialCountry: t, geoIpLookup: n, loadUtils: r } = e, i = t === O.AUTO && !!n, a = !!r && !Q.utils;
		return i && (this.#h = Se()), a && (this.#g = Se()), Promise.all([this.#h?.promise, this.#g?.promise]).then(() => {});
	}
	#b() {
		this.#f = new AbortController(), this.#x(), this.#e.buildMarkup(this.#r), this.#S(), this.#C(), this.#w(), this.#t.dropdownAlwaysOpen && this.#H();
	}
	#x() {
		de(this.#r, this.#t), pe(this.#r, this.#t), me(this.#r);
	}
	#S(e = !1) {
		let t = this.#e.telInputEl.getAttribute("value"), n = this.#p.normalise(t ?? ""), r = this.#_(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#ee(i), o = ye(i), { initialCountry: s, geoIpLookup: c } = this.#t, l = s === O.AUTO && c, u = l && Q.autoCountry ? Q.autoCountry : s, d = l && !e && !Q.autoCountry, f = m(u);
		a ? o ? f ? this.#J(u) : d || this.#J(E.ISO2) : (f && this.#J(u), this.#W(i)) : f ? this.#J(u) : d || this.#J(""), i && this.#U(i);
	}
	#C() {
		this.#O(), this.#t.allowDropdown && this.#e.bindAllInitialDropdownListeners(this.#f.signal, () => this.#H(), () => this.#Q()), this.#e.bindHiddenInputSubmitListener(this.#f.signal, () => this.getNumber(), () => this.#c?.iso2 || "");
	}
	#w() {
		if (this.#g) {
			let { loadUtils: e } = this.#t, t = () => {
				Q.attachUtils(e)?.catch(() => {});
			};
			Q.documentReady() ? t() : window.addEventListener("load", t, { signal: this.#f.signal });
		}
		this.#h && (this.#c ? this.#h.resolve() : this.#T());
	}
	#T() {
		if (Q.autoCountry) {
			this.#oe();
			return;
		}
		this.#e.setLoading(!0), !Q.startedLoadingAutoCountry && (Q.startedLoadingAutoCountry = !0, typeof this.#t.geoIpLookup == "function" && this.#t.geoIpLookup((t = "") => {
			let n = t.toLowerCase();
			m(n) ? (Q.autoCountry = n, setTimeout(() => e.forEachInstance("handleAutoCountryLoaded"))) : e.forEachInstance("handleAutoCountryFailure");
		}, () => {
			e.forEachInstance("handleAutoCountryFailure");
		}));
	}
	#E() {
		this.#H(), this.#e.prefillSearchWithPlus();
	}
	#D(e) {
		let t = this.#e.telInputEl.selectionStart || 0, n = e.substring(0, t - 1), r = e.substring(t);
		return this.#v(n + r), t - 1;
	}
	#O() {
		this.#N(), this.#F(), this.#L();
	}
	#k(e) {
		this.#D(e), this.#E();
	}
	#A(e, t) {
		let n = this.#D(e);
		this.#e.telInputEl.setSelectionRange(n, n), this.#B(), this.#V(g.STRICT_REJECT, {
			source: "key",
			rejectedInput: t,
			reason: "invalid"
		});
	}
	#j(e, t) {
		let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(b.NON_PLUS_NUMERIC_GLOBAL, "").length, i = ge(this.#ne(), e, Q.utils, this.#c, this.#t.separateDialCode), a = _e(r, i, n, t);
		this.#v(i), this.#e.telInputEl.setSelectionRange(a, a);
	}
	#M(e) {
		if (e.startsWith("+") && this.#c && this.#ee(e)) {
			let t = Y(e, !0, !0, this.#c);
			this.#v(t);
		}
	}
	#N() {
		this.#m = b.ALPHA_UNICODE.test(this.#_()), this.#e.telInputEl.addEventListener("input", this.#P, { signal: this.#f.signal });
	}
	#P = (e) => {
		let { strictMode: t, formatAsYouType: n, separateDialCode: r, allowDropdown: i, countrySearch: a } = this.#t, o = e?.detail;
		if (o?.isCountryChange) return;
		let s = this.#_();
		if (this.#n && e?.data === "+" && r && i && a) {
			this.#k(s);
			return;
		}
		if (this.#n && t && (e?.data === " " || e?.data === "-" || e?.data === ".")) {
			this.#A(s, e.data);
			return;
		}
		this.#W(s) && this.#ae();
		let c = e?.data && b.NON_PLUS_NUMERIC.test(e.data), l = e?.inputType === y.PASTE && s;
		c || l && !t ? this.#m = !0 : b.NON_PLUS_NUMERIC.test(s) || (this.#m = !1), n && !this.#m && !o?.isSetNumber && this.#p.isAscii() && this.#j(s, e?.inputType === y.DELETE_FORWARD), r && this.#M(s);
	};
	#F() {
		let { strictMode: e, separateDialCode: t } = this.#t;
		!e && !t || this.#e.telInputEl.addEventListener("keydown", this.#I, { signal: this.#f.signal });
	}
	#I = (e) => {
		let { strictMode: t, separateDialCode: n, allowDropdown: r, countrySearch: i } = this.#t;
		if (!e.key || e.key.length !== 1 || e.altKey || e.ctrlKey || e.metaKey) return;
		if (n && r && i && e.key === "+") {
			e.preventDefault(), this.#E();
			return;
		}
		if (!t) return;
		let a = this.#_(), o = !a.startsWith("+") && this.#e.telInputEl.selectionStart === 0 && e.key === "+", s = this.#p.normalise(e.key), c = /^[0-9]$/.test(s), l = n ? c : o || c, u = this.#e.telInputEl, d = u.selectionStart, f = u.selectionEnd, p = a.slice(0, d ?? void 0), m = a.slice(f ?? void 0), h = p + s + m, _ = this.#te(h), v = !1;
		Q.utils && this.#l && (v = Q.utils.getCoreNumber(_, this.#c?.iso2).length > this.#l);
		let y = this.#K(_) !== null;
		(!l || v && !y && !o) && (this.#B(), this.#V(g.STRICT_REJECT, {
			source: "key",
			rejectedInput: e.key,
			reason: l ? "max-length" : "invalid"
		}), e.preventDefault());
	};
	#L() {
		this.#t.strictMode && this.#e.telInputEl.addEventListener("paste", this.#R, { signal: this.#f.signal });
	}
	#R = (e) => {
		e.preventDefault();
		let t = this.#e.telInputEl, n = t.selectionStart, r = t.selectionEnd, i = this.#_(), a = i.slice(0, n ?? void 0), o = i.slice(r ?? void 0), s = this.#c?.iso2, c = e.clipboardData.getData("text"), l = this.#p.normalise(c), u = n === 0 && r > 0, d = !i.startsWith("+") || u, f = l.replace(b.NON_PLUS_NUMERIC_GLOBAL, ""), p = f.startsWith("+"), m = f.replace(/\+/g, ""), h = p && d ? `+${m}` : m, _ = a + h + o, v = h === l ? null : "invalid";
		if (_.length > 5 && Q.utils) {
			let e = Q.utils.getCoreNumber(_, s);
			for (; e.length === 0 && _.length > 0;) _ = _.slice(0, -1), e = Q.utils.getCoreNumber(_, s);
			if (!e) {
				this.#B(), this.#V(g.STRICT_REJECT, {
					source: "paste",
					rejectedInput: c,
					reason: "max-length"
				});
				return;
			}
			if (this.#l && e.length > this.#l) if (t.selectionEnd === i.length) {
				let t = e.length - this.#l;
				_ = _.slice(0, _.length - t), v = "max-length";
			} else {
				this.#B(), this.#V(g.STRICT_REJECT, {
					source: "paste",
					rejectedInput: c,
					reason: "max-length"
				});
				return;
			}
		}
		this.#v(_);
		let y = n + h.length;
		t.setSelectionRange(y, y), t.dispatchEvent(new InputEvent("input", { bubbles: !0 })), v && (l.length > 0 && h.length === 0 && this.#B(), this.#V(g.STRICT_REJECT, {
			source: "paste",
			rejectedInput: c,
			reason: v
		}));
	};
	#z(e) {
		let t = Number(this.#e.telInputEl.getAttribute("maxlength"));
		return t && e.length > t ? e.substring(0, t) : e;
	}
	#B() {
		if (!this.#t.strictRejectAnimation) return;
		let e = this.#e.telInputEl.parentElement;
		e && (e.classList.remove("iti__strict-reject-animation"), e.offsetWidth, e.classList.add("iti__strict-reject-animation"));
	}
	#V(e, t = {}) {
		let n = new CustomEvent(e, {
			bubbles: !0,
			cancelable: !0,
			detail: t
		});
		this.#e.telInputEl.dispatchEvent(n);
	}
	#H() {
		this.#e.openDropdown((e) => this.#Z(e), () => this.#Q()), this.#V(g.OPEN_COUNTRY_DROPDOWN);
	}
	#U(e) {
		let { formatOnDisplay: t, nationalMode: n, separateDialCode: r } = this.#t, i = e;
		if (t && Q.utils && this.#c) {
			let t = J(e), a = n && !t || !i.startsWith("+") && !r, { NATIONAL: o, INTERNATIONAL: s } = Q.utils.numberFormat, c = a ? o : s;
			i = Q.utils.formatNumber(i, this.#c?.iso2, c);
		}
		i = this.#re(i), this.#v(i);
	}
	#W(e) {
		let t = this.#K(e);
		return t === null ? !1 : this.#J(t);
	}
	#G(e) {
		let t = this.#c?.dialCode, n = this.#c?.nationalPrefix;
		return e.startsWith("+") || !t ? e : `+${t}${n && e.startsWith(n) && !this.#t.separateDialCode ? e.substring(1) : e}`;
	}
	#K(e) {
		let t = e.indexOf("+"), n = t > 0 ? e.substring(t) : e, r = this.#c?.iso2;
		n = this.#G(n);
		let i = this.#ee(n, !0), a = H(n);
		if (i) {
			let e = H(i), t = this.#a[e];
			return t.length === 1 ? t[0] === r ? null : t[0] : this.#q(t, e, a);
		} else if (n.startsWith("+") && a.length) {
			let e = this.#c?.dialCode || "";
			return e && e.startsWith(a) ? null : "";
		} else if ((!n || n === "+") && !r && this.#u) return this.#u;
		return null;
	}
	#q(e, t, n) {
		let r = this.#c?.iso2, i = this.#c?.dialCode;
		if (!r && this.#u && e.includes(this.#u)) return this.#u;
		if (i === w.NANP && ye(n)) return null;
		let a = this.#c?.areaCodes, o = this.#c?.priority;
		if (a) {
			let e = a.map((e) => `${i}${e}`);
			for (let t of e) if (n.startsWith(t)) return null;
		}
		let s = a && o !== 0 && n.length > t.length, c = r && e.includes(r) && !s, l = r === e[0];
		return !c && !l ? e[0] : null;
	}
	#J(e) {
		let t = this.#c?.iso2 || "";
		return this.#c = e ? this.#s.get(e) : null, this.#c && (this.#u = this.#c.iso2), this.#e.setCountry(this.#c), this.#X(), this.#Y(), t !== e;
	}
	#Y() {
		let { strictMode: e, placeholderNumberType: t, allowedNumberTypes: n } = this.#t;
		if (!e || !Q.utils) return;
		let r = this.#c?.iso2;
		if (!r) {
			this.#l = null;
			return;
		}
		let i = Q.utils.numberType[t], a = Q.utils.getExampleNumber(r, !1, i, !0), o = a;
		for (; Q.utils.isPossibleNumber(a, r, n);) o = a, a += "0";
		let s = Q.utils.getCoreNumber(o, r);
		this.#l = s.length, r === "by" && (this.#l = s.length + 1);
	}
	#X() {
		let { autoPlaceholder: e, placeholderNumberType: t, nationalMode: n, customPlaceholder: r } = this.#t, i = e === D.AGGRESSIVE || !this.#e.hadInitialPlaceholder && e === D.POLITE;
		if (!Q.utils || !i) return;
		let a = Q.utils.numberType[t], o = this.#c ? Q.utils.getExampleNumber(this.#c.iso2, n, a) : "";
		o = this.#re(o), typeof r == "function" && (o = r(o, this.#c)), this.#e.telInputEl.setAttribute("placeholder", o);
	}
	#Z(e) {
		if (!e) return;
		let t = e.dataset[A.ISO2], n = this.#J(t);
		this.#Q();
		let r = e.dataset[A.DIAL_CODE];
		if (this.#$(r), this.#t.formatOnDisplay) {
			let e = this.#_();
			this.#U(e);
		}
		this.#e.telInputEl.focus(), n && (this.#ae(), this.#V(g.INPUT, { isCountryChange: !0 }));
	}
	#Q(e) {
		!this.#e.isDropdownOpen() || this.#t.dropdownAlwaysOpen && !e || (this.#e.closeDropdown(), this.#V(g.CLOSE_COUNTRY_DROPDOWN));
	}
	#$(e) {
		let t = this.#_();
		if (!t.startsWith("+")) return;
		let n = `+${e}`, r = this.#ee(t), i;
		i = r ? t.replace(r, n) : n, this.#v(i);
	}
	#ee(e, t) {
		if (!e.startsWith("+")) return "";
		let n = "", r = "", i = !1;
		for (let a = 0; a < e.length; a++) {
			let o = e.charAt(a);
			if (/[0-9]/.test(o)) {
				if (r += o, !this.#a[r]) break;
				if (this.#o.has(r)) {
					if (n = e.substring(0, a + 1), i = !0, !t) break;
				} else t && i && (n = e.substring(0, a + 1));
				if (r.length === this.#i) break;
			}
		}
		return n;
	}
	#te(e) {
		let t = this.#c?.dialCode, n = H(e);
		return (this.#t.separateDialCode && !e.startsWith("+") && t && n ? `+${t}` : "") + e;
	}
	#ne() {
		let e = this.#_();
		return this.#te(e);
	}
	#re(e) {
		let t = Y(e, !!this.#ee(e), this.#t.separateDialCode, this.#c);
		return this.#z(t);
	}
	#ie() {
		let e = this.#c;
		if (!e) return null;
		let { iso2: t, dialCode: n, name: r } = e;
		return {
			iso2: t,
			dialCode: n,
			name: r
		};
	}
	#ae() {
		let e = this.#ie();
		this.#V(g.COUNTRY_CHANGE, e);
	}
	#oe() {
		if (!(!this.#h || !Q.autoCountry)) {
			if (!this.#d) {
				this.#h.resolve();
				return;
			}
			this.#e.isLoading() ? this.setCountry(Q.autoCountry) : this.#u = Q.autoCountry, this.#e.setLoading(!1), this.#h.resolve();
		}
	}
	#se() {
		if (!this.#d) {
			this.#h?.reject();
			return;
		}
		this.#S(!0), this.#e.setLoading(!1), this.#h?.reject();
	}
	#ce() {
		if (!this.#d) {
			this.#g?.resolve();
			return;
		}
		if (!Q.utils) {
			this.#g?.resolve();
			return;
		}
		let e = this.#_();
		e && this.#U(e), this.#c && (this.#X(), this.#Y()), this.#g?.resolve();
	}
	#le(e) {
		if (!this.#d) {
			this.#g?.reject(e);
			return;
		}
		this.#g?.reject(e);
	}
	destroy() {
		this.#d && (this.#d = !1, this.#t.allowDropdown && this.#Q(!0), this.#f.abort(), this.#e.destroy(), Q.instances.delete(String(this.id)));
	}
	isActive() {
		return this.#d;
	}
	getExtension() {
		return this.#d ? (X("getExtension"), Q.utils.getExtension(this.#ne(), this.#c?.iso2)) : "";
	}
	getNumber(e) {
		if (!this.#d) return "";
		X("getNumber");
		let t = this.#c?.iso2, n = this.#ne(), r = Q.utils.formatNumber(n, t, e);
		return this.#p.denormalise(r);
	}
	getNumberType() {
		return this.#d ? (X("getNumberType"), Q.utils.getNumberType(this.#ne(), this.#c?.iso2)) : S.UNKNOWN_NUMBER_TYPE;
	}
	getSelectedCountryData() {
		return this.#ie();
	}
	getValidationError() {
		if (!this.#d) return S.UNKNOWN_VALIDATION_ERROR;
		X("getValidationError");
		let e = this.#c?.iso2;
		return Q.utils.getValidationError(this.#ne(), e);
	}
	isValidNumber() {
		if (!this.#d) return null;
		X("isValidNumber");
		let e = this.#c?.dialCode, t = this.#c?.iso2, n = this.#ne(), r = Q.utils.getCoreNumber(n, t);
		if (r) {
			if (e === T.DIAL_CODE && r[0] === T.MOBILE_PREFIX && r.length !== T.MOBILE_CORE_LENGTH) return !1;
			if (!b.ALPHA_UNICODE.test(n) && e) {
				let t = H(n.startsWith("+") ? n.slice(1 + e.length) : n).length;
				if (r.length > t) return !1;
			}
		}
		return this.#ue("possible");
	}
	isValidNumberPrecise() {
		return this.#d ? (X("isValidNumberPrecise"), this.#ue("precise")) : null;
	}
	#ue(e) {
		let { allowNumberExtensions: t, allowPhonewords: n, allowedNumberTypes: r } = this.#t, i = this.#c?.iso2, a = this.#ne();
		return !this.#c && !J(a) || !(e === "precise" ? Q.utils.isValidNumber : Q.utils.isPossibleNumber)(a, i, r) ? !1 : b.ALPHA_UNICODE.test(a) ? Q.utils.getExtension(a, i) ? t : n : !0;
	}
	setCountry(e) {
		if (!this.#d) return;
		let t = e?.toLowerCase();
		if (!m(t)) throw Error(`Invalid iso2 code: '${t}'`);
		let n = this.#c?.iso2;
		if (e && t !== n || !e && n) {
			if (this.#J(t), this.#$(this.#c?.dialCode || ""), this.#t.formatOnDisplay) {
				let e = this.#_();
				this.#U(e);
			}
			this.#ae(), this.#V(g.INPUT, { isCountryChange: !0 });
		}
	}
	setNumber(e) {
		if (!this.#d) return;
		let t = this.#p.normalise(e), n = this.#W(t);
		this.#U(t), n && this.#ae(), this.#V(g.INPUT, { isSetNumber: !0 });
	}
	setPlaceholderNumberType(e) {
		this.#d && (this.#t.placeholderNumberType = e, this.#X());
	}
	setDisabled(e) {
		this.#d && this.#e.setDisabled(e);
	}
	setReadonly(e) {
		this.#d && this.#e.setReadonly(e);
	}
	static forEachInstance(t, ...n) {
		let r = [...Q.instances.values()], i = n[0];
		r.forEach((n) => {
			if (n instanceof e) switch (t) {
				case "handleUtilsLoaded":
					n.#ce();
					break;
				case "handleUtilsFailure":
					n.#le(i);
					break;
				case "handleAutoCountryLoaded":
					n.#oe();
					break;
				case "handleAutoCountryFailure":
					n.#se();
					break;
			}
		});
	}
}, Q = Object.assign((e, t) => {
	let n = new Z(e, t);
	return Q.instances.set(String(n.id), n), e.iti = n, n;
}, {
	defaults: F,
	documentReady: () => document.readyState === "complete",
	getCountryData: () => h,
	getInstance: (e) => {
		let t = e.dataset[A.INSTANCE_ID];
		return t ? Q.instances.get(t) ?? null : null;
	},
	instances: /* @__PURE__ */ new Map(),
	attachUtils: (e) => {
		if (!Q.utils && !Q.startedLoadingUtils) {
			let t;
			if (typeof e == "function") try {
				t = Promise.resolve(e());
			} catch (e) {
				return Promise.reject(e);
			}
			else return Promise.reject(/* @__PURE__ */ TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof e}`));
			return Q.startedLoadingUtils = !0, t.then((e) => {
				let t = e?.default;
				if (!t || typeof t != "object") throw TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
				return Q.utils = t, Z.forEachInstance("handleUtilsLoaded"), !0;
			}).catch((e) => {
				throw Z.forEachInstance("handleUtilsFailure", e), e;
			});
		}
		return null;
	},
	startedLoadingUtils: !1,
	startedLoadingAutoCountry: !1,
	version: "27.3.0"
}), $ = Q, Ce = /* @__PURE__ */ n({
	inheritAttrs: !1,
	__name: "IntlTelInput",
	props: {
		usePreciseValidation: {
			type: Boolean,
			default: !1
		},
		disabled: {
			type: Boolean,
			default: !1
		},
		readonly: {
			type: Boolean,
			default: !1
		},
		inputProps: { default: () => ({}) },
		initialValue: {},
		modelValue: {},
		allowDropdown: { type: Boolean },
		allowedNumberTypes: {},
		allowNumberExtensions: { type: Boolean },
		allowPhonewords: { type: Boolean },
		autoPlaceholder: {},
		containerClass: {},
		countryNameLocale: {},
		countryOrder: {},
		countrySearch: { type: Boolean },
		customPlaceholder: {},
		dropdownAlwaysOpen: { type: Boolean },
		dropdownContainer: {},
		excludeCountries: {},
		fixDropdownWidth: { type: Boolean },
		formatAsYouType: { type: Boolean },
		formatOnDisplay: { type: Boolean },
		geoIpLookup: {},
		hiddenInput: {},
		i18n: {},
		initialCountry: {},
		loadUtils: {},
		nationalMode: { type: Boolean },
		onlyCountries: {},
		placeholderNumberType: {},
		searchInputClass: {},
		separateDialCode: { type: Boolean },
		strictRejectAnimation: { type: Boolean },
		showFlags: { type: Boolean },
		strictMode: { type: Boolean },
		useFullscreenPopup: { type: Boolean }
	},
	emits: [
		"changeNumber",
		"changeCountry",
		"changeValidity",
		"changeErrorCode",
		"openCountryDropdown",
		"closeCountryDropdown",
		"strictReject",
		"update:modelValue"
	],
	setup(n, { expose: d, emit: f }) {
		let p = n, m = f, h = (e) => {
			console.warn(`intl-tel-input: ignoring inputProps.${e} - see docs for more info.`);
		}, g = new Set([
			"type",
			"value",
			"disabled",
			"readonly",
			"onInput",
			"oninput"
		]), _ = c(""), v = e(() => {
			let e = p.inputProps ?? {}, t = {};
			for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : n === "class" ? t[n] = `${_.value} ${r}` : t[n] = r;
			return t;
		}), y = e(() => p.modelValue ?? p.initialValue ?? ""), b = r(), x = Object.keys($.defaults), S = e(() => {
			let e = b?.vnode.props ?? {}, t = new Set(Object.keys(e).map((e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()))), n = {};
			return x.forEach((e) => {
				if (!t.has(e)) return;
				let r = p[e];
				r !== void 0 && (n[e] = r);
			}), n;
		}), C = c(null), w = l(null), T = c(), E = c(), D = c(), O = c(), k = !1, A = () => (p.usePreciseValidation ? w.value.isValidNumberPrecise() : w.value.isValidNumber()) ?? !1, j = () => {
			if (!w.value?.isActive()) return;
			if (!$.utils) {
				k = !0;
				return;
			}
			let e = A(), t = e ? null : w.value.getValidationError();
			e !== D.value && (D.value = e, m("changeValidity", e)), t !== O.value && (O.value = t, m("changeErrorCode", t));
		}, M = () => {
			if (!w.value?.isActive()) return;
			if (!$.utils) {
				k = !0;
				return;
			}
			let e = w.value.getNumber() ?? "";
			e !== T.value && (T.value = e, m("changeNumber", e), m("update:modelValue", e)), j();
		}, N = () => {
			if (!w.value?.isActive()) return;
			let e = w.value.getSelectedCountryData()?.iso2 ?? "";
			e !== E.value && (E.value = e, m("changeCountry", e)), M();
		}, P = () => m("openCountryDropdown"), F = () => m("closeCountryDropdown"), I = (e) => {
			let { source: t, rejectedInput: n, reason: r } = e.detail;
			m("strictReject", t, n, r);
		};
		return a(() => {
			C.value && (w.value = $(C.value, S.value), _.value = C.value.className, C.value.addEventListener("open:countrydropdown", P), C.value.addEventListener("close:countrydropdown", F), C.value.addEventListener("strict:reject", I), p.disabled && w.value.setDisabled(p.disabled), p.readonly && w.value.setReadonly(p.readonly), E.value = w.value.getSelectedCountryData()?.iso2 ?? "", w.value.promise.then(() => {
				w.value?.isActive() && (y.value && w.value.setNumber(y.value), k ? (k = !1, N()) : (T.value = w.value.getNumber() ?? "", D.value = A(), O.value = D.value ? null : w.value.getValidationError()));
			}));
		}), u(() => p.disabled, (e) => w.value?.setDisabled(e)), u(() => p.readonly, (e) => w.value?.setReadonly(e)), u(() => y.value, (e) => {
			w.value && w.value.promise.then(() => {
				if (!w.value?.isActive()) return;
				let t = e ?? "", n = w.value.getNumber() ?? "";
				document.activeElement === C.value || n === t || (w.value.setNumber(t), j());
			});
		}, { flush: "post" }), o(() => {
			C.value && (C.value.removeEventListener("open:countrydropdown", P), C.value.removeEventListener("close:countrydropdown", F), C.value.removeEventListener("strict:reject", I)), w.value?.destroy();
		}), d({
			instance: w,
			input: C
		}), (e, n) => (s(), t("input", i(v.value, {
			ref_key: "input",
			ref: C,
			type: "tel",
			onInput: N
		}), null, 16));
	}
});
//#endregion
export { $ as n, Ce as t };
