@intl-tel-input/vue 29.1.3 → 29.2.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.
|
@@ -1200,7 +1200,29 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1200
1200
|
COUNTRY_CHANGE: "countrychange",
|
|
1201
1201
|
INPUT: "input",
|
|
1202
1202
|
STRICT_REJECT: "strict:reject"
|
|
1203
|
-
}, _ =
|
|
1203
|
+
}, _ = [
|
|
1204
|
+
"container",
|
|
1205
|
+
"input",
|
|
1206
|
+
"countryContainer",
|
|
1207
|
+
"selectedCountry",
|
|
1208
|
+
"selectedCountryPrimary",
|
|
1209
|
+
"selectedFlag",
|
|
1210
|
+
"arrow",
|
|
1211
|
+
"selectedDialCode",
|
|
1212
|
+
"countrySelector",
|
|
1213
|
+
"countrySelectorContainer",
|
|
1214
|
+
"searchWrapper",
|
|
1215
|
+
"searchIcon",
|
|
1216
|
+
"searchInput",
|
|
1217
|
+
"searchClear",
|
|
1218
|
+
"countryList",
|
|
1219
|
+
"countryListItem",
|
|
1220
|
+
"countryListItemFlag",
|
|
1221
|
+
"countryName",
|
|
1222
|
+
"dialCode",
|
|
1223
|
+
"countryCheck",
|
|
1224
|
+
"noResults"
|
|
1225
|
+
], v = {
|
|
1204
1226
|
HIDE: "iti__hide",
|
|
1205
1227
|
V_HIDE: "iti__v-hide",
|
|
1206
1228
|
ARROW_UP: "iti__arrow--up",
|
|
@@ -1210,58 +1232,58 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1210
1232
|
COUNTRY_ITEM: "iti__country",
|
|
1211
1233
|
HIGHLIGHT: "iti__highlight",
|
|
1212
1234
|
STRICT_REJECT_ANIMATION: "iti__strict-reject-animation"
|
|
1213
|
-
},
|
|
1235
|
+
}, y = {
|
|
1214
1236
|
ARROW_UP: "ArrowUp",
|
|
1215
1237
|
ARROW_DOWN: "ArrowDown",
|
|
1216
1238
|
SPACE: " ",
|
|
1217
1239
|
ENTER: "Enter",
|
|
1218
1240
|
ESC: "Escape",
|
|
1219
1241
|
TAB: "Tab"
|
|
1220
|
-
},
|
|
1242
|
+
}, b = {
|
|
1221
1243
|
PASTE: "insertFromPaste",
|
|
1222
1244
|
DELETE_FORWARD: "deleteContentForward"
|
|
1223
|
-
},
|
|
1245
|
+
}, x = {
|
|
1224
1246
|
ALPHA_UNICODE: /\p{L}/u,
|
|
1225
1247
|
NON_PLUS_NUMERIC: /[^+0-9]/,
|
|
1226
1248
|
NON_PLUS_NUMERIC_GLOBAL: /[^+0-9]/g,
|
|
1227
1249
|
HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
|
|
1228
|
-
},
|
|
1250
|
+
}, S = {
|
|
1229
1251
|
SEARCH_DEBOUNCE_MS: 100,
|
|
1230
1252
|
HIDDEN_SEARCH_RESET_MS: 1e3,
|
|
1231
1253
|
NEXT_TICK: 0
|
|
1232
|
-
},
|
|
1254
|
+
}, C = {
|
|
1233
1255
|
NARROW_VIEWPORT_WIDTH: 500,
|
|
1234
1256
|
FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH: 78,
|
|
1235
1257
|
FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH: 42,
|
|
1236
1258
|
INPUT_PADDING_EXTRA_LEFT: 6,
|
|
1237
1259
|
DROPDOWN_MARGIN: 3,
|
|
1238
1260
|
FALLBACK_DROPDOWN_HEIGHT: 200
|
|
1239
|
-
},
|
|
1261
|
+
}, w = {
|
|
1240
1262
|
PLUS: "+",
|
|
1241
1263
|
NANP: "1"
|
|
1242
|
-
},
|
|
1264
|
+
}, T = {
|
|
1243
1265
|
ISO2: "gb",
|
|
1244
1266
|
DIAL_CODE: "44",
|
|
1245
1267
|
MOBILE_PREFIX: "7",
|
|
1246
1268
|
MOBILE_CORE_LENGTH: 10
|
|
1247
|
-
},
|
|
1269
|
+
}, E = {
|
|
1248
1270
|
ISO2: "us",
|
|
1249
1271
|
DIAL_CODE: "1"
|
|
1250
|
-
},
|
|
1272
|
+
}, D = {
|
|
1251
1273
|
AGGRESSIVE: "AGGRESSIVE",
|
|
1252
1274
|
POLITE: "POLITE",
|
|
1253
1275
|
OFF: "OFF"
|
|
1254
|
-
},
|
|
1276
|
+
}, O = [
|
|
1255
1277
|
"OFF",
|
|
1256
1278
|
"DROPDOWN",
|
|
1257
1279
|
"FULLSCREEN",
|
|
1258
1280
|
"AUTO"
|
|
1259
|
-
],
|
|
1281
|
+
], k = [
|
|
1260
1282
|
"E164",
|
|
1261
1283
|
"INTERNATIONAL",
|
|
1262
1284
|
"NATIONAL",
|
|
1263
1285
|
"RFC3966"
|
|
1264
|
-
],
|
|
1286
|
+
], A = [
|
|
1265
1287
|
"FIXED_LINE",
|
|
1266
1288
|
"MOBILE",
|
|
1267
1289
|
"FIXED_LINE_OR_MOBILE",
|
|
@@ -1274,18 +1296,18 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1274
1296
|
"UAN",
|
|
1275
1297
|
"VOICEMAIL",
|
|
1276
1298
|
"UNKNOWN"
|
|
1277
|
-
],
|
|
1299
|
+
], j = [
|
|
1278
1300
|
"IS_POSSIBLE",
|
|
1279
1301
|
"INVALID_COUNTRY_CODE",
|
|
1280
1302
|
"TOO_SHORT",
|
|
1281
1303
|
"TOO_LONG",
|
|
1282
1304
|
"IS_POSSIBLE_LOCAL_ONLY",
|
|
1283
1305
|
"INVALID_LENGTH"
|
|
1284
|
-
],
|
|
1306
|
+
], M = (e) => Object.fromEntries(e.map((e) => [e, e])), N = M(k), P = M(A), F = M(j), I = M(O), L = {
|
|
1285
1307
|
ISO2: "iso2",
|
|
1286
1308
|
DIAL_CODE: "dialCode",
|
|
1287
1309
|
INSTANCE_ID: "intlTelInputId"
|
|
1288
|
-
},
|
|
1310
|
+
}, R = {
|
|
1289
1311
|
EXPANDED: "aria-expanded",
|
|
1290
1312
|
LABEL: "aria-label",
|
|
1291
1313
|
SELECTED: "aria-selected",
|
|
@@ -1305,17 +1327,18 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1305
1327
|
searchSummaryAria(e) {
|
|
1306
1328
|
return e === 0 ? "No results found" : e === 1 ? "1 result found" : `${e} results found`;
|
|
1307
1329
|
}
|
|
1308
|
-
},
|
|
1330
|
+
}, z = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, te = () => z(`(max-width: ${C.NARROW_VIEWPORT_WIDTH}px)`), ne = () => {
|
|
1309
1331
|
if (typeof navigator < "u" && typeof window < "u") {
|
|
1310
|
-
let e =
|
|
1311
|
-
if (te() || t && e) return
|
|
1332
|
+
let e = z("(max-height: 600px)"), t = z("(pointer: coarse)");
|
|
1333
|
+
if (te() || t && e) return I.FULLSCREEN;
|
|
1312
1334
|
}
|
|
1313
|
-
return
|
|
1314
|
-
},
|
|
1315
|
-
countrySelectorMode:
|
|
1316
|
-
allowedNumberTypes: [
|
|
1335
|
+
return I.DROPDOWN;
|
|
1336
|
+
}, B = {
|
|
1337
|
+
countrySelectorMode: I.AUTO,
|
|
1338
|
+
allowedNumberTypes: [P.MOBILE, P.FIXED_LINE],
|
|
1317
1339
|
allowNumberExtensions: !1,
|
|
1318
1340
|
allowPhonewords: !1,
|
|
1341
|
+
classNames: {},
|
|
1319
1342
|
containerClass: "",
|
|
1320
1343
|
countryNameLocale: "en",
|
|
1321
1344
|
countryNameOverrides: {},
|
|
@@ -1332,39 +1355,39 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1332
1355
|
initialCountry: "",
|
|
1333
1356
|
initialCountryLookup: null,
|
|
1334
1357
|
loadUtils: null,
|
|
1335
|
-
numberDisplayFormat:
|
|
1358
|
+
numberDisplayFormat: N.INTERNATIONAL,
|
|
1336
1359
|
onlyCountries: null,
|
|
1337
|
-
placeholderNumberPolicy:
|
|
1338
|
-
placeholderNumberType:
|
|
1360
|
+
placeholderNumberPolicy: D.POLITE,
|
|
1361
|
+
placeholderNumberType: P.MOBILE,
|
|
1339
1362
|
searchInputClass: "",
|
|
1340
1363
|
separateDialCode: !0,
|
|
1341
1364
|
strictRejectAnimation: !0,
|
|
1342
1365
|
showFlags: !0,
|
|
1343
1366
|
strictMode: !0
|
|
1344
|
-
},
|
|
1367
|
+
}, re = (e) => JSON.stringify(e), V = (e) => !!e && typeof e == "object" && !Array.isArray(e), ie = (e) => typeof e == "function", ae = (e) => {
|
|
1345
1368
|
if (!e || typeof e != "object") return !1;
|
|
1346
1369
|
let t = e;
|
|
1347
1370
|
return t.nodeType === 1 && typeof t.tagName == "string" && typeof t.appendChild == "function";
|
|
1348
|
-
},
|
|
1371
|
+
}, H = new Set(Object.values(D)), oe = new Set(_), U = (e) => {
|
|
1349
1372
|
console.warn(`[intl-tel-input] ${e}`);
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1352
|
-
},
|
|
1373
|
+
}, W = (e, t, n) => {
|
|
1374
|
+
U(`Option '${e}' must be ${t}; got ${re(n)}. Ignoring.`);
|
|
1375
|
+
}, G = (e, t) => {
|
|
1353
1376
|
let n = "an array of iso2 country code strings";
|
|
1354
|
-
if (!Array.isArray(t)) return
|
|
1377
|
+
if (!Array.isArray(t)) return W(e, n, t), !1;
|
|
1355
1378
|
let r = [];
|
|
1356
1379
|
for (let i of t) {
|
|
1357
|
-
if (typeof i != "string") return
|
|
1358
|
-
m(i.toLowerCase()) ? r.push(i) :
|
|
1380
|
+
if (typeof i != "string") return W(e, n, t), !1;
|
|
1381
|
+
m(i.toLowerCase()) ? r.push(i) : U(`Invalid iso2 code in '${e}': '${i}'. Skipping.`);
|
|
1359
1382
|
}
|
|
1360
1383
|
return r;
|
|
1361
1384
|
}, se = (e) => {
|
|
1362
1385
|
if (e === void 0) return {};
|
|
1363
|
-
if (!V(e)) return
|
|
1386
|
+
if (!V(e)) return U(`The second argument must be an options object; got ${re(e)}. Using defaults.`), {};
|
|
1364
1387
|
let t = {};
|
|
1365
1388
|
for (let [n, r] of Object.entries(e)) {
|
|
1366
|
-
if (!Object.hasOwn(
|
|
1367
|
-
|
|
1389
|
+
if (!Object.hasOwn(B, n)) {
|
|
1390
|
+
U(`Unknown option '${n}'. Ignoring.`);
|
|
1368
1391
|
continue;
|
|
1369
1392
|
}
|
|
1370
1393
|
switch (n) {
|
|
@@ -1379,28 +1402,28 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1379
1402
|
case "strictMode":
|
|
1380
1403
|
case "strictRejectAnimation":
|
|
1381
1404
|
if (typeof r != "boolean") {
|
|
1382
|
-
|
|
1405
|
+
W(n, "a boolean", r);
|
|
1383
1406
|
break;
|
|
1384
1407
|
}
|
|
1385
1408
|
t[n] = r;
|
|
1386
1409
|
break;
|
|
1387
1410
|
case "countrySelectorMode":
|
|
1388
|
-
if (typeof r != "string" || !
|
|
1389
|
-
|
|
1411
|
+
if (typeof r != "string" || !O.includes(r)) {
|
|
1412
|
+
W("countrySelectorMode", `one of ${O.map((e) => `"${e}"`).join(", ")}`, r);
|
|
1390
1413
|
break;
|
|
1391
1414
|
}
|
|
1392
1415
|
t[n] = r;
|
|
1393
1416
|
break;
|
|
1394
1417
|
case "numberDisplayFormat":
|
|
1395
|
-
if (typeof r != "string" || r ===
|
|
1396
|
-
|
|
1418
|
+
if (typeof r != "string" || r === N.RFC3966 || !(r === N.E164 || r === N.INTERNATIONAL || r === N.NATIONAL)) {
|
|
1419
|
+
W("numberDisplayFormat", "one of \"E164\", \"INTERNATIONAL\", \"NATIONAL\"", r);
|
|
1397
1420
|
break;
|
|
1398
1421
|
}
|
|
1399
1422
|
t[n] = r;
|
|
1400
1423
|
break;
|
|
1401
1424
|
case "placeholderNumberPolicy":
|
|
1402
|
-
if (typeof r != "string" || !
|
|
1403
|
-
|
|
1425
|
+
if (typeof r != "string" || !H.has(r)) {
|
|
1426
|
+
W("placeholderNumberPolicy", `one of ${Array.from(H).join(", ")}`, r);
|
|
1404
1427
|
break;
|
|
1405
1428
|
}
|
|
1406
1429
|
t[n] = r;
|
|
@@ -1409,15 +1432,25 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1409
1432
|
case "searchInputClass":
|
|
1410
1433
|
case "countryNameLocale":
|
|
1411
1434
|
if (typeof r != "string") {
|
|
1412
|
-
|
|
1435
|
+
W(n, "a string", r);
|
|
1413
1436
|
break;
|
|
1414
1437
|
}
|
|
1415
1438
|
t[n] = r;
|
|
1416
1439
|
break;
|
|
1440
|
+
case "classNames": {
|
|
1441
|
+
if (!V(r)) {
|
|
1442
|
+
W("classNames", "an object", r);
|
|
1443
|
+
break;
|
|
1444
|
+
}
|
|
1445
|
+
let e = {};
|
|
1446
|
+
for (let [t, n] of Object.entries(r)) oe.has(t) ? typeof n == "string" ? e[t] = n.trim().replace(/\s+/g, " ") : W(`classNames.${t}`, "a string", n) : U(`Unknown slot '${t}' in 'classNames'. Valid slots: ${_.join(", ")}. Skipping.`);
|
|
1447
|
+
t[n] = e;
|
|
1448
|
+
break;
|
|
1449
|
+
}
|
|
1417
1450
|
case "countryOrder":
|
|
1418
1451
|
if (r === null) t[n] = r;
|
|
1419
1452
|
else {
|
|
1420
|
-
let e =
|
|
1453
|
+
let e = G(n, r);
|
|
1421
1454
|
e !== !1 && (t[n] = e);
|
|
1422
1455
|
}
|
|
1423
1456
|
break;
|
|
@@ -1425,15 +1458,15 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1425
1458
|
case "hiddenInputs":
|
|
1426
1459
|
case "initialCountryLookup":
|
|
1427
1460
|
case "loadUtils":
|
|
1428
|
-
if (r !== null && !
|
|
1429
|
-
|
|
1461
|
+
if (r !== null && !ie(r)) {
|
|
1462
|
+
W(n, "a function or null", r);
|
|
1430
1463
|
break;
|
|
1431
1464
|
}
|
|
1432
1465
|
t[n] = r;
|
|
1433
1466
|
break;
|
|
1434
1467
|
case "dropdownParent":
|
|
1435
|
-
if (r !== null && !
|
|
1436
|
-
|
|
1468
|
+
if (r !== null && !ae(r)) {
|
|
1469
|
+
W("dropdownParent", "an HTMLElement or null", r);
|
|
1437
1470
|
break;
|
|
1438
1471
|
}
|
|
1439
1472
|
t[n] = r;
|
|
@@ -1442,40 +1475,40 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1442
1475
|
case "onlyCountries":
|
|
1443
1476
|
if (r === null) t[n] = r;
|
|
1444
1477
|
else {
|
|
1445
|
-
let e =
|
|
1478
|
+
let e = G(n, r);
|
|
1446
1479
|
e !== !1 && (t[n] = e);
|
|
1447
1480
|
}
|
|
1448
1481
|
break;
|
|
1449
1482
|
case "uiTranslations":
|
|
1450
1483
|
if (r && !V(r)) {
|
|
1451
|
-
|
|
1484
|
+
W("uiTranslations", "an object", r);
|
|
1452
1485
|
break;
|
|
1453
1486
|
}
|
|
1454
1487
|
t[n] = r;
|
|
1455
1488
|
break;
|
|
1456
1489
|
case "countryNameOverrides":
|
|
1457
1490
|
if (r && !V(r)) {
|
|
1458
|
-
|
|
1491
|
+
W("countryNameOverrides", "an object", r);
|
|
1459
1492
|
break;
|
|
1460
1493
|
}
|
|
1461
1494
|
t[n] = r;
|
|
1462
1495
|
break;
|
|
1463
1496
|
case "initialCountry": {
|
|
1464
1497
|
if (typeof r != "string") {
|
|
1465
|
-
|
|
1498
|
+
W("initialCountry", "a string", r);
|
|
1466
1499
|
break;
|
|
1467
1500
|
}
|
|
1468
1501
|
let e = r.toLowerCase();
|
|
1469
1502
|
if (e && !m(e)) {
|
|
1470
|
-
|
|
1503
|
+
W("initialCountry", "a valid iso2 country code", r);
|
|
1471
1504
|
break;
|
|
1472
1505
|
}
|
|
1473
1506
|
t[n] = r;
|
|
1474
1507
|
break;
|
|
1475
1508
|
}
|
|
1476
1509
|
case "placeholderNumberType":
|
|
1477
|
-
if (typeof r != "string" || !
|
|
1478
|
-
|
|
1510
|
+
if (typeof r != "string" || !A.includes(r)) {
|
|
1511
|
+
W("placeholderNumberType", `one of ${A.join(", ")}`, r);
|
|
1479
1512
|
break;
|
|
1480
1513
|
}
|
|
1481
1514
|
t[n] = r;
|
|
@@ -1483,12 +1516,12 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1483
1516
|
case "allowedNumberTypes":
|
|
1484
1517
|
if (r !== null) {
|
|
1485
1518
|
if (!Array.isArray(r)) {
|
|
1486
|
-
|
|
1519
|
+
W("allowedNumberTypes", "an array of number types or null", r);
|
|
1487
1520
|
break;
|
|
1488
1521
|
}
|
|
1489
1522
|
let e = !0;
|
|
1490
|
-
for (let t of r) if (typeof t != "string" || !
|
|
1491
|
-
|
|
1523
|
+
for (let t of r) if (typeof t != "string" || !A.includes(t)) {
|
|
1524
|
+
W("allowedNumberTypes", `an array of valid number types (${A.join(", ")})`, t), e = !1;
|
|
1492
1525
|
break;
|
|
1493
1526
|
}
|
|
1494
1527
|
e && (t[n] = r);
|
|
@@ -1500,19 +1533,19 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1500
1533
|
}, ce = (e) => {
|
|
1501
1534
|
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());
|
|
1502
1535
|
}, le = (e) => {
|
|
1503
|
-
e.countrySelectorMode ===
|
|
1536
|
+
e.countrySelectorMode === I.AUTO && (e.countrySelectorMode = ne()), e.dropdownAlwaysOpen && (e.countrySelectorMode = I.DROPDOWN), e.countrySelectorMode === I.FULLSCREEN ? e.matchDropdownWidth = !1 : te() && (e.matchDropdownWidth = !0), e.onlyCountries?.length === 1 && (e.initialCountry = e.onlyCountries[0]), e.separateDialCode && e.numberDisplayFormat === N.NATIONAL && (e.numberDisplayFormat = N.INTERNATIONAL), e.countrySelectorMode !== I.OFF && !e.showFlags && !e.separateDialCode && e.numberDisplayFormat === N.NATIONAL && (e.numberDisplayFormat = N.INTERNATIONAL), e.uiTranslations = {
|
|
1504
1537
|
...ee,
|
|
1505
1538
|
...e.uiTranslations
|
|
1506
1539
|
};
|
|
1507
|
-
},
|
|
1540
|
+
}, K = (e) => e.replace(/\D/g, ""), ue = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), de = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), q = (e, t, n) => {
|
|
1508
1541
|
let r = document.createElement(e);
|
|
1509
1542
|
return t && Object.entries(t).forEach(([e, t]) => r.setAttribute(e, t)), n && n.appendChild(r), r;
|
|
1510
|
-
},
|
|
1511
|
-
let r = document.createElementNS(
|
|
1543
|
+
}, fe = "http://www.w3.org/2000/svg", J = ([e, t, n]) => {
|
|
1544
|
+
let r = document.createElementNS(fe, e);
|
|
1512
1545
|
if (t) for (let e in t) r.setAttribute(e, String(t[e]));
|
|
1513
1546
|
if (n) for (let e of n) r.appendChild(J(e));
|
|
1514
1547
|
return r;
|
|
1515
|
-
},
|
|
1548
|
+
}, pe = () => J([
|
|
1516
1549
|
"svg",
|
|
1517
1550
|
{
|
|
1518
1551
|
class: "iti__search-icon-svg",
|
|
@@ -1520,7 +1553,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1520
1553
|
height: 14,
|
|
1521
1554
|
viewBox: "0 0 24 24",
|
|
1522
1555
|
focusable: "false",
|
|
1523
|
-
[
|
|
1556
|
+
[R.HIDDEN]: "true"
|
|
1524
1557
|
},
|
|
1525
1558
|
[["circle", {
|
|
1526
1559
|
cx: 11,
|
|
@@ -1532,7 +1565,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1532
1565
|
x2: 16.65,
|
|
1533
1566
|
y2: 16.65
|
|
1534
1567
|
}]]
|
|
1535
|
-
]),
|
|
1568
|
+
]), me = (e) => {
|
|
1536
1569
|
let t = `iti-${e}-clear-mask`;
|
|
1537
1570
|
return J([
|
|
1538
1571
|
"svg",
|
|
@@ -1541,7 +1574,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1541
1574
|
width: 12,
|
|
1542
1575
|
height: 12,
|
|
1543
1576
|
viewBox: "0 0 16 16",
|
|
1544
|
-
[
|
|
1577
|
+
[R.HIDDEN]: "true",
|
|
1545
1578
|
focusable: "false"
|
|
1546
1579
|
},
|
|
1547
1580
|
[[
|
|
@@ -1568,7 +1601,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1568
1601
|
mask: `url(#${t})`
|
|
1569
1602
|
}]]
|
|
1570
1603
|
]);
|
|
1571
|
-
},
|
|
1604
|
+
}, he = () => J([
|
|
1572
1605
|
"svg",
|
|
1573
1606
|
{
|
|
1574
1607
|
class: "iti__country-check-svg",
|
|
@@ -1577,10 +1610,10 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1577
1610
|
viewBox: "0 0 16 16",
|
|
1578
1611
|
fill: "currentColor",
|
|
1579
1612
|
focusable: "false",
|
|
1580
|
-
[
|
|
1613
|
+
[R.HIDDEN]: "true"
|
|
1581
1614
|
},
|
|
1582
1615
|
[["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" }]]
|
|
1583
|
-
]),
|
|
1616
|
+
]), ge = () => J([
|
|
1584
1617
|
"svg",
|
|
1585
1618
|
{
|
|
1586
1619
|
width: 256,
|
|
@@ -1589,7 +1622,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1589
1622
|
class: "iti__globe-svg"
|
|
1590
1623
|
},
|
|
1591
1624
|
[["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" }], ["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" }]]
|
|
1592
|
-
]), Y = (e) =>
|
|
1625
|
+
]), Y = (e) => ue(e).replace(/[^\p{L}]+/gu, " ").trim(), _e = (e) => {
|
|
1593
1626
|
let t = /* @__PURE__ */ new Map();
|
|
1594
1627
|
for (let n of e) {
|
|
1595
1628
|
let e = Y(n.name), r = e.split(" ").filter(Boolean), i = r.map((e) => e[0] || "").join("");
|
|
@@ -1601,8 +1634,8 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1601
1634
|
});
|
|
1602
1635
|
}
|
|
1603
1636
|
return t;
|
|
1604
|
-
},
|
|
1605
|
-
let r =
|
|
1637
|
+
}, ve = (e, t, n) => {
|
|
1638
|
+
let r = ue(n), i = Y(n), a = r !== "" && i === "", o = [], s = [], c = [], l = [], u = [], d = [], f = [];
|
|
1606
1639
|
for (let n of e) {
|
|
1607
1640
|
let e = t.get(n.iso2);
|
|
1608
1641
|
n.iso2 === r ? o.push(n) : !a && e.normalisedName.startsWith(i) ? s.push(n) : !a && e.normalisedName.includes(i) ? c.push(n) : r === n.dialCode || r === e.dialCodePlus ? l.push(n) : e.dialCodePlus.includes(r) ? u.push(n) : e.initials.includes(r) && d.push(n);
|
|
@@ -1630,14 +1663,14 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1630
1663
|
...d,
|
|
1631
1664
|
...f
|
|
1632
1665
|
];
|
|
1633
|
-
},
|
|
1666
|
+
}, ye = (e, t, n) => {
|
|
1634
1667
|
let r = Y(n);
|
|
1635
1668
|
for (let n of e) {
|
|
1636
1669
|
let { normalisedName: e } = t.get(n.iso2);
|
|
1637
1670
|
if (e.startsWith(r)) return n;
|
|
1638
1671
|
}
|
|
1639
1672
|
return null;
|
|
1640
|
-
},
|
|
1673
|
+
}, be = class e {
|
|
1641
1674
|
#e;
|
|
1642
1675
|
static toAscii(e) {
|
|
1643
1676
|
return e ? e.replace(/[٠-٩]/g, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - 1632))).replace(/[۰-۹]/g, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - 1776))) : "";
|
|
@@ -1659,7 +1692,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1659
1692
|
isAscii() {
|
|
1660
1693
|
return !this.#e || this.#e === "ascii";
|
|
1661
1694
|
}
|
|
1662
|
-
},
|
|
1695
|
+
}, xe = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --x"), Se = class {
|
|
1663
1696
|
#e;
|
|
1664
1697
|
#t;
|
|
1665
1698
|
#n;
|
|
@@ -1692,7 +1725,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1692
1725
|
telInputEl;
|
|
1693
1726
|
hadInitialPlaceholder;
|
|
1694
1727
|
constructor(e, t, n) {
|
|
1695
|
-
e.dataset[
|
|
1728
|
+
e.dataset[L.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;
|
|
1696
1729
|
}
|
|
1697
1730
|
static validateInput(e) {
|
|
1698
1731
|
let t = e?.tagName;
|
|
@@ -1701,99 +1734,106 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1701
1734
|
throw TypeError(`The first argument must be an HTMLInputElement, not ${t}`);
|
|
1702
1735
|
}
|
|
1703
1736
|
}
|
|
1737
|
+
#k(e, t) {
|
|
1738
|
+
let n = this.#e.classNames[e];
|
|
1739
|
+
return n ? `${t} ${n}` : t;
|
|
1740
|
+
}
|
|
1704
1741
|
buildMarkup(e, t) {
|
|
1705
|
-
this.#i = e, this.#a = t, 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");
|
|
1706
|
-
let n = this.#
|
|
1707
|
-
this.#
|
|
1742
|
+
this.#i = e, this.#a = t, this.telInputEl.classList.add(...this.#k("input", "iti__tel-input").split(" ")), 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");
|
|
1743
|
+
let n = this.#A();
|
|
1744
|
+
this.#j(n), n.appendChild(this.telInputEl), this.#F(), this.#z(), this.#I(n), this.ensureDropdownWidthSet();
|
|
1708
1745
|
}
|
|
1709
|
-
#
|
|
1710
|
-
let { countrySelectorMode: e, showFlags: t, containerClass: n } = this.#e, r =
|
|
1746
|
+
#A() {
|
|
1747
|
+
let { countrySelectorMode: e, showFlags: t, containerClass: n } = this.#e, r = de({
|
|
1711
1748
|
iti: !0,
|
|
1712
1749
|
"iti--input-container": !0,
|
|
1713
|
-
"iti--has-country-selector": e !==
|
|
1750
|
+
"iti--has-country-selector": e !== I.OFF,
|
|
1714
1751
|
"iti--show-flags": t,
|
|
1715
|
-
"iti--inline-country-selector": e !==
|
|
1752
|
+
"iti--inline-country-selector": e !== I.FULLSCREEN,
|
|
1716
1753
|
[n]: !!n
|
|
1717
|
-
}) });
|
|
1718
|
-
return this.#n &&
|
|
1754
|
+
}), i = q("div", { class: this.#k("container", r) });
|
|
1755
|
+
return this.#n && i.setAttribute("dir", "ltr"), this.telInputEl.before(i), i;
|
|
1719
1756
|
}
|
|
1720
|
-
#
|
|
1721
|
-
let { countrySelectorMode: t, separateDialCode: n, showFlags: r } = this.#e, i = t !==
|
|
1757
|
+
#j(e) {
|
|
1758
|
+
let { countrySelectorMode: t, separateDialCode: n, showFlags: r } = this.#e, i = t !== I.OFF;
|
|
1722
1759
|
if (!i && !r && !n) return;
|
|
1723
|
-
this.#l = q("div", { class: `iti__country-container ${
|
|
1760
|
+
this.#l = q("div", { class: this.#k("countryContainer", `iti__country-container ${v.V_HIDE}`) }, e), i ? (this.#u = q("button", {
|
|
1724
1761
|
type: "button",
|
|
1725
|
-
class: "iti__selected-country",
|
|
1726
|
-
[
|
|
1727
|
-
[
|
|
1728
|
-
[
|
|
1729
|
-
[
|
|
1730
|
-
}, this.#l), this.telInputEl.disabled && this.#u.setAttribute("disabled", "true")) : this.#u = q("div", { class: "iti__selected-country" }, this.#l);
|
|
1731
|
-
let a = q("div", { class: "iti__selected-country-primary" }, this.#u);
|
|
1732
|
-
this.#d = q("div", { class:
|
|
1733
|
-
class: "iti__arrow",
|
|
1734
|
-
[
|
|
1735
|
-
}, a)), n && (this.#f = q("div", { class: "iti__selected-dial-code" }, this.#u)), i && this.#
|
|
1762
|
+
class: this.#k("selectedCountry", "iti__selected-country"),
|
|
1763
|
+
[R.EXPANDED]: "false",
|
|
1764
|
+
[R.LABEL]: this.#e.uiTranslations.noCountrySelected,
|
|
1765
|
+
[R.HASPOPUP]: "dialog",
|
|
1766
|
+
[R.CONTROLS]: `iti-${this.#t}__country-selector`
|
|
1767
|
+
}, this.#l), this.telInputEl.disabled && this.#u.setAttribute("disabled", "true")) : this.#u = q("div", { class: this.#k("selectedCountry", "iti__selected-country") }, this.#l);
|
|
1768
|
+
let a = q("div", { class: this.#k("selectedCountryPrimary", "iti__selected-country-primary") }, this.#u);
|
|
1769
|
+
this.#d = q("div", { class: this.#k("selectedFlag", v.FLAG) }, a), i && (this.#p = q("div", {
|
|
1770
|
+
class: this.#k("arrow", "iti__arrow"),
|
|
1771
|
+
[R.HIDDEN]: "true"
|
|
1772
|
+
}, a)), n && (this.#f = q("div", { class: this.#k("selectedDialCode", "iti__selected-dial-code") }, this.#u)), i && this.#M();
|
|
1736
1773
|
}
|
|
1737
1774
|
ensureDropdownWidthSet() {
|
|
1738
1775
|
let { matchDropdownWidth: e, countrySelectorMode: t } = this.#e;
|
|
1739
|
-
if (t ===
|
|
1776
|
+
if (t === I.OFF || !e || this.#m.style.width) return;
|
|
1740
1777
|
let n = this.telInputEl.offsetWidth;
|
|
1741
1778
|
n > 0 && (this.#m.style.width = `${n}px`);
|
|
1742
1779
|
}
|
|
1743
|
-
#
|
|
1744
|
-
let { matchDropdownWidth: e, countrySelectorMode: t, countrySearch: n, uiTranslations: r, containerClass: i } = this.#e, a = t ===
|
|
1745
|
-
this.#m = q("div", {
|
|
1780
|
+
#M() {
|
|
1781
|
+
let { matchDropdownWidth: e, countrySelectorMode: t, countrySearch: n, uiTranslations: r, containerClass: i } = this.#e, a = t === I.FULLSCREEN, o = this.#N(), s = e ? "" : "iti--flexible-dropdown-width";
|
|
1782
|
+
if (this.#m = q("div", {
|
|
1746
1783
|
id: `iti-${this.#t}__country-selector`,
|
|
1747
|
-
class: `iti__country-selector ${
|
|
1784
|
+
class: this.#k("countrySelector", `iti__country-selector ${v.HIDE} ${s}`),
|
|
1748
1785
|
role: "dialog",
|
|
1749
|
-
[
|
|
1750
|
-
}), this.#n && this.#m.setAttribute("dir", "rtl"), n && this.#
|
|
1751
|
-
class: "iti__country-list",
|
|
1786
|
+
[R.MODAL]: "true"
|
|
1787
|
+
}), this.#n && this.#m.setAttribute("dir", "rtl"), n && this.#P(), this.#v = q("ul", {
|
|
1788
|
+
class: this.#k("countryList", "iti__country-list"),
|
|
1752
1789
|
id: `iti-${this.#t}__country-listbox`,
|
|
1753
1790
|
role: "listbox",
|
|
1754
|
-
[
|
|
1755
|
-
}, this.#m), this.#
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1791
|
+
[R.LABEL]: r.countryListAriaLabel
|
|
1792
|
+
}, this.#m), this.#L(), n && this.#U(), o) {
|
|
1793
|
+
let e = de({
|
|
1794
|
+
iti: !0,
|
|
1795
|
+
"iti--detached-country-selector": !0,
|
|
1796
|
+
"iti--fullscreen-popup": a,
|
|
1797
|
+
"iti--inline-country-selector": !a,
|
|
1798
|
+
[i]: !!i
|
|
1799
|
+
});
|
|
1800
|
+
this.#C = q("div", { class: this.#k("countrySelectorContainer", e) }), this.#C.appendChild(this.#m);
|
|
1801
|
+
} else this.#l.appendChild(this.#m);
|
|
1762
1802
|
}
|
|
1763
|
-
#
|
|
1803
|
+
#N() {
|
|
1764
1804
|
let { countrySelectorMode: e, dropdownParent: t } = this.#e;
|
|
1765
|
-
return e ===
|
|
1805
|
+
return e === I.FULLSCREEN ? document.body : e === I.DROPDOWN ? t : null;
|
|
1766
1806
|
}
|
|
1767
|
-
#
|
|
1768
|
-
let { uiTranslations: e, searchInputClass: t } = this.#e, n = q("div", { class: "iti__search-input-wrapper" }, this.#m);
|
|
1807
|
+
#P() {
|
|
1808
|
+
let { uiTranslations: e, searchInputClass: t } = this.#e, n = q("div", { class: this.#k("searchWrapper", "iti__search-input-wrapper") }, this.#m);
|
|
1769
1809
|
this.#h = q("span", {
|
|
1770
|
-
class: "iti__search-icon",
|
|
1771
|
-
[
|
|
1772
|
-
}, n), this.#h.appendChild(
|
|
1810
|
+
class: this.#k("searchIcon", "iti__search-icon"),
|
|
1811
|
+
[R.HIDDEN]: "true"
|
|
1812
|
+
}, n), this.#h.appendChild(pe()), this.#g = q("input", {
|
|
1773
1813
|
id: `iti-${this.#t}__search-input`,
|
|
1774
1814
|
type: "search",
|
|
1775
|
-
class: `iti__search-input ${t}
|
|
1815
|
+
class: this.#k("searchInput", `iti__search-input ${t}`),
|
|
1776
1816
|
placeholder: e.searchPlaceholder,
|
|
1777
1817
|
role: "combobox",
|
|
1778
|
-
[
|
|
1779
|
-
[
|
|
1780
|
-
[
|
|
1781
|
-
[
|
|
1818
|
+
[R.EXPANDED]: "true",
|
|
1819
|
+
[R.LABEL]: e.searchPlaceholder,
|
|
1820
|
+
[R.CONTROLS]: `iti-${this.#t}__country-listbox`,
|
|
1821
|
+
[R.AUTOCOMPLETE]: "list",
|
|
1782
1822
|
autocomplete: "off"
|
|
1783
1823
|
}, n), this.#_ = q("button", {
|
|
1784
1824
|
type: "button",
|
|
1785
|
-
class: `iti__search-clear ${
|
|
1786
|
-
[
|
|
1825
|
+
class: this.#k("searchClear", `iti__search-clear ${v.HIDE}`),
|
|
1826
|
+
[R.LABEL]: e.clearSearchAriaLabel,
|
|
1787
1827
|
tabindex: "-1"
|
|
1788
|
-
}, n), this.#_.appendChild(
|
|
1789
|
-
class: `iti__no-results ${
|
|
1790
|
-
[
|
|
1828
|
+
}, n), this.#_.appendChild(me(this.#t)), this.#S = q("span", { class: "iti__a11y-text" }, this.#m), this.#x = q("div", {
|
|
1829
|
+
class: this.#k("noResults", `iti__no-results ${v.HIDE}`),
|
|
1830
|
+
[R.HIDDEN]: "true"
|
|
1791
1831
|
}, this.#m), this.#x.textContent = e.searchEmptyState ?? null;
|
|
1792
1832
|
}
|
|
1793
|
-
#
|
|
1794
|
-
this.#l && (this.#
|
|
1833
|
+
#F() {
|
|
1834
|
+
this.#l && (this.#R(), this.#l.classList.remove(v.V_HIDE));
|
|
1795
1835
|
}
|
|
1796
|
-
#
|
|
1836
|
+
#I(e) {
|
|
1797
1837
|
let { hiddenInputs: t } = this.#e;
|
|
1798
1838
|
if (!t) return;
|
|
1799
1839
|
let n = t(this.telInputEl.getAttribute("name") || "");
|
|
@@ -1812,36 +1852,36 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1812
1852
|
}), e.appendChild(this.#b));
|
|
1813
1853
|
}
|
|
1814
1854
|
}
|
|
1815
|
-
#
|
|
1816
|
-
let e = document.createDocumentFragment();
|
|
1817
|
-
for (let
|
|
1818
|
-
let
|
|
1819
|
-
id: `iti-${this.#t}__item-${
|
|
1820
|
-
class:
|
|
1855
|
+
#L() {
|
|
1856
|
+
let e = document.createDocumentFragment(), t = this.#k("countryListItem", v.COUNTRY_ITEM);
|
|
1857
|
+
for (let n = 0; n < this.#i.length; n++) {
|
|
1858
|
+
let r = this.#i[n], i = q("li", {
|
|
1859
|
+
id: `iti-${this.#t}__item-${r.iso2}`,
|
|
1860
|
+
class: t,
|
|
1821
1861
|
tabindex: "-1",
|
|
1822
1862
|
role: "option",
|
|
1823
|
-
[
|
|
1863
|
+
[R.SELECTED]: "false"
|
|
1824
1864
|
});
|
|
1825
|
-
i.dataset[
|
|
1826
|
-
let a = q("span", { class: "iti__country-name" }, i);
|
|
1827
|
-
a.textContent = `${
|
|
1828
|
-
let o = q("span", { class: "iti__dial-code" }, a);
|
|
1829
|
-
this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${
|
|
1865
|
+
i.dataset[L.DIAL_CODE] = r.dialCode, i.dataset[L.ISO2] = r.iso2, this.#E.set(r.iso2, i), this.#e.showFlags && q("div", { class: this.#k("countryListItemFlag", `${v.FLAG} iti__${r.iso2}`) }, i);
|
|
1866
|
+
let a = q("span", { class: this.#k("countryName", "iti__country-name") }, i);
|
|
1867
|
+
a.textContent = `${r.name} `;
|
|
1868
|
+
let o = q("span", { class: this.#k("dialCode", "iti__dial-code") }, a);
|
|
1869
|
+
this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${r.dialCode})`, e.appendChild(i);
|
|
1830
1870
|
}
|
|
1831
1871
|
this.#v.appendChild(e);
|
|
1832
1872
|
}
|
|
1833
|
-
#
|
|
1873
|
+
#R() {
|
|
1834
1874
|
if (this.#u) {
|
|
1835
|
-
let e = this.#e.separateDialCode ?
|
|
1875
|
+
let e = this.#e.separateDialCode ? C.FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH : C.FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH, t = (this.#u.offsetWidth || this.#B() || e) + C.INPUT_PADDING_EXTRA_LEFT;
|
|
1836
1876
|
this.telInputEl.style.paddingLeft = `${t}px`;
|
|
1837
1877
|
}
|
|
1838
1878
|
}
|
|
1839
|
-
#
|
|
1879
|
+
#z() {
|
|
1840
1880
|
!this.#u || typeof ResizeObserver > "u" || (this.#O = new ResizeObserver(() => {
|
|
1841
|
-
this.#u?.offsetWidth && this.#
|
|
1881
|
+
this.#u?.offsetWidth && this.#R();
|
|
1842
1882
|
}), this.#O.observe(this.#u));
|
|
1843
1883
|
}
|
|
1844
|
-
#
|
|
1884
|
+
#B() {
|
|
1845
1885
|
if (!this.telInputEl.parentNode) return 0;
|
|
1846
1886
|
let e = document.body, t = this.telInputEl.parentNode.cloneNode(!1);
|
|
1847
1887
|
t.style.visibility = "hidden", e.appendChild(t);
|
|
@@ -1852,61 +1892,61 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1852
1892
|
let i = r.offsetWidth;
|
|
1853
1893
|
return e.removeChild(t), i;
|
|
1854
1894
|
}
|
|
1855
|
-
#
|
|
1895
|
+
#V() {
|
|
1856
1896
|
if (this.#s !== void 0) return;
|
|
1857
|
-
let { countrySearch: e, matchDropdownWidth: t } = this.#e, { height: n, width: r } = this.#
|
|
1897
|
+
let { countrySearch: e, matchDropdownWidth: t } = this.#e, { height: n, width: r } = this.#H();
|
|
1858
1898
|
this.#s = n, e && (this.#m.style.height = `${n}px`, !t && r > 0 && (this.#m.style.width = `${r}px`));
|
|
1859
1899
|
}
|
|
1860
|
-
#
|
|
1900
|
+
#H() {
|
|
1861
1901
|
let e = document.body, t = this.#m, n = t.parentNode, r = t.nextSibling;
|
|
1862
|
-
t.classList.remove(
|
|
1902
|
+
t.classList.remove(v.HIDE);
|
|
1863
1903
|
let i = q("div", { class: "iti iti--inline-country-selector" });
|
|
1864
1904
|
i.appendChild(t), i.style.visibility = "hidden", e.appendChild(i);
|
|
1865
1905
|
let a = t.offsetHeight, o = t.offsetWidth;
|
|
1866
|
-
return e.removeChild(i), t.classList.add(
|
|
1867
|
-
height: a > 0 ? a :
|
|
1906
|
+
return e.removeChild(i), t.classList.add(v.HIDE), n && n.insertBefore(t, r), {
|
|
1907
|
+
height: a > 0 ? a : C.FALLBACK_DROPDOWN_HEIGHT,
|
|
1868
1908
|
width: o
|
|
1869
1909
|
};
|
|
1870
1910
|
}
|
|
1871
|
-
#
|
|
1911
|
+
#U() {
|
|
1872
1912
|
let { uiTranslations: e } = this.#e, t = this.#v.childElementCount;
|
|
1873
1913
|
this.#S.textContent = e.searchSummaryAria(t);
|
|
1874
1914
|
}
|
|
1875
|
-
#
|
|
1915
|
+
#W(e) {
|
|
1876
1916
|
let t;
|
|
1877
1917
|
if (e === "") t = this.#i;
|
|
1878
1918
|
else {
|
|
1879
|
-
let n =
|
|
1880
|
-
t =
|
|
1919
|
+
let n = be.toAscii(e);
|
|
1920
|
+
t = ve(this.#i, this.#a, n);
|
|
1881
1921
|
}
|
|
1882
|
-
this.#
|
|
1922
|
+
this.#ae(t);
|
|
1883
1923
|
}
|
|
1884
1924
|
prefillSearchWithPlus() {
|
|
1885
|
-
this.#g.value = "+", this.#g.focus(), this.#
|
|
1925
|
+
this.#g.value = "+", this.#g.focus(), this.#W("");
|
|
1886
1926
|
}
|
|
1887
|
-
#
|
|
1927
|
+
#G() {
|
|
1888
1928
|
let e = this.#g.value.trim();
|
|
1889
|
-
this.#
|
|
1929
|
+
this.#W(e), this.#g.value ? this.#_.classList.remove(v.HIDE) : this.#_.classList.add(v.HIDE);
|
|
1890
1930
|
}
|
|
1891
|
-
#
|
|
1931
|
+
#K() {
|
|
1892
1932
|
this.#o && clearTimeout(this.#o), this.#o = setTimeout(() => {
|
|
1893
|
-
this.#
|
|
1894
|
-
},
|
|
1933
|
+
this.#G(), this.#o = null;
|
|
1934
|
+
}, S.SEARCH_DEBOUNCE_MS);
|
|
1895
1935
|
}
|
|
1896
|
-
#
|
|
1897
|
-
this.#g.value = "", this.#g.focus(), this.#
|
|
1936
|
+
#q() {
|
|
1937
|
+
this.#g.value = "", this.#g.focus(), this.#G();
|
|
1898
1938
|
}
|
|
1899
|
-
#
|
|
1939
|
+
#J(e) {
|
|
1900
1940
|
let t = this.#v, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
|
|
1901
1941
|
r.top < n.top ? t.scrollTop = i : r.bottom > n.bottom && (t.scrollTop = i - n.height + r.height);
|
|
1902
1942
|
}
|
|
1903
|
-
#
|
|
1904
|
-
if (this.#T?.classList.remove(
|
|
1905
|
-
if (e.classList.add(
|
|
1943
|
+
#Y(e, t = !0) {
|
|
1944
|
+
if (this.#T?.classList.remove(v.HIGHLIGHT), e) {
|
|
1945
|
+
if (e.classList.add(v.HIGHLIGHT), this.#e.countrySearch) {
|
|
1906
1946
|
let t = e.getAttribute("id") || "";
|
|
1907
|
-
this.#g.setAttribute(
|
|
1947
|
+
this.#g.setAttribute(R.ACTIVE_DESCENDANT, t);
|
|
1908
1948
|
}
|
|
1909
|
-
t && this.#
|
|
1949
|
+
t && this.#J(e), this.#T = e;
|
|
1910
1950
|
} else this.#T = null;
|
|
1911
1951
|
}
|
|
1912
1952
|
bindHiddenInputSubmitListener(e, t, n) {
|
|
@@ -1923,147 +1963,147 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1923
1963
|
!this.isCountrySelectorOpen() && !this.telInputEl.disabled && !this.telInputEl.readOnly && t();
|
|
1924
1964
|
}, { signal: e }), this.#l.addEventListener("keydown", (e) => {
|
|
1925
1965
|
let r = [
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1966
|
+
y.ARROW_UP,
|
|
1967
|
+
y.ARROW_DOWN,
|
|
1968
|
+
y.SPACE,
|
|
1969
|
+
y.ENTER
|
|
1930
1970
|
];
|
|
1931
|
-
!this.isCountrySelectorOpen() && r.includes(e.key) && (e.preventDefault(), e.stopPropagation(), t()), e.key ===
|
|
1971
|
+
!this.isCountrySelectorOpen() && r.includes(e.key) && (e.preventDefault(), e.stopPropagation(), t()), e.key === y.TAB && n();
|
|
1932
1972
|
}, { signal: e });
|
|
1933
1973
|
}
|
|
1934
1974
|
openCountrySelector(e, t) {
|
|
1935
1975
|
let { countrySearch: n, dropdownAlwaysOpen: r } = this.#e;
|
|
1936
|
-
if (this.#D = new AbortController(), this.#e.countrySelectorMode !==
|
|
1976
|
+
if (this.#D = new AbortController(), this.#e.countrySelectorMode !== I.FULLSCREEN && this.#V(), this.ensureDropdownWidthSet(), this.#C) this.#se();
|
|
1937
1977
|
else {
|
|
1938
|
-
let e = this.#
|
|
1978
|
+
let e = this.#oe(), t = this.telInputEl.offsetHeight + C.DROPDOWN_MARGIN;
|
|
1939
1979
|
e ? this.#m.style.top = `${t}px` : this.#m.style.bottom = `${t}px`;
|
|
1940
1980
|
}
|
|
1941
|
-
this.#m.classList.remove(
|
|
1981
|
+
this.#m.classList.remove(v.HIDE), this.#u.setAttribute(R.EXPANDED, "true");
|
|
1942
1982
|
let i = this.#w ?? this.#v.firstElementChild;
|
|
1943
|
-
i && this.#
|
|
1944
|
-
this.#
|
|
1945
|
-
}, { signal: this.#D.signal }), this.#p.classList.add(
|
|
1983
|
+
i && this.#Y(i), n && !r && this.#g.focus(), this.#e.countrySelectorMode === I.FULLSCREEN && this.#C && window.visualViewport && window.visualViewport.addEventListener("resize", () => {
|
|
1984
|
+
this.#le(), this.#T && this.#J(this.#T);
|
|
1985
|
+
}, { signal: this.#D.signal }), this.#p.classList.add(v.ARROW_UP), this.#X(e, t);
|
|
1946
1986
|
}
|
|
1947
|
-
#
|
|
1987
|
+
#X(e, t) {
|
|
1948
1988
|
let n = this.#D.signal;
|
|
1949
|
-
this.#
|
|
1989
|
+
this.#Z(n), this.#Q(n, e), this.#e.dropdownAlwaysOpen || this.#$(n, t), this.#ee(n, e, t), this.#e.countrySearch && this.#te(n), this.#e.countrySelectorMode === I.DROPDOWN && this.#e.dropdownParent && !xe && document.addEventListener("scroll", t, {
|
|
1950
1990
|
signal: n,
|
|
1951
1991
|
capture: !0,
|
|
1952
1992
|
passive: !0
|
|
1953
1993
|
});
|
|
1954
1994
|
}
|
|
1955
|
-
#
|
|
1995
|
+
#Z(e) {
|
|
1956
1996
|
this.#v.addEventListener("mouseover", (e) => {
|
|
1957
|
-
let t = e.target?.closest(`.${
|
|
1958
|
-
t && this.#
|
|
1997
|
+
let t = e.target?.closest(`.${v.COUNTRY_ITEM}`);
|
|
1998
|
+
t && this.#Y(t, !1);
|
|
1959
1999
|
}, { signal: e });
|
|
1960
2000
|
}
|
|
1961
|
-
#
|
|
2001
|
+
#Q(e, t) {
|
|
1962
2002
|
this.#v.addEventListener("click", (e) => {
|
|
1963
|
-
let n = e.target?.closest(`.${
|
|
2003
|
+
let n = e.target?.closest(`.${v.COUNTRY_ITEM}`);
|
|
1964
2004
|
n && t(n);
|
|
1965
2005
|
}, { signal: e });
|
|
1966
2006
|
}
|
|
1967
|
-
|
|
2007
|
+
#$(e, t) {
|
|
1968
2008
|
setTimeout(() => {
|
|
1969
2009
|
document.documentElement.addEventListener("click", (e) => {
|
|
1970
2010
|
this.#m.contains(e.target) || t();
|
|
1971
2011
|
}, { signal: e });
|
|
1972
2012
|
}, 0);
|
|
1973
2013
|
}
|
|
1974
|
-
|
|
2014
|
+
#ee(e, t, n) {
|
|
1975
2015
|
let r = "", i = null, a = (e) => {
|
|
1976
2016
|
[
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key ===
|
|
2017
|
+
y.ARROW_UP,
|
|
2018
|
+
y.ARROW_DOWN,
|
|
2019
|
+
y.ENTER,
|
|
2020
|
+
y.ESC
|
|
2021
|
+
].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key === y.ARROW_UP || e.key === y.ARROW_DOWN ? this.#re(e.key) : e.key === y.ENTER && !e.isComposing ? t(this.#T) : e.key === y.ESC && (n(), this.#u.focus())), !this.#e.countrySearch && x.HIDDEN_SEARCH_CHAR.test(e.key) && (e.stopPropagation(), i && clearTimeout(i), r += e.key.toLowerCase(), this.#ne(r), i = setTimeout(() => {
|
|
1982
2022
|
r = "";
|
|
1983
|
-
},
|
|
2023
|
+
}, S.HIDDEN_SEARCH_RESET_MS));
|
|
1984
2024
|
};
|
|
1985
2025
|
this.#u?.addEventListener("keydown", a, { signal: e }), this.#m?.addEventListener("keydown", a, { signal: e });
|
|
1986
2026
|
}
|
|
1987
|
-
#ee(e) {
|
|
1988
|
-
this.#g.addEventListener("input", () => this.#G(), { signal: e }), this.#_.addEventListener("click", () => this.#K(), { signal: e });
|
|
1989
|
-
}
|
|
1990
2027
|
#te(e) {
|
|
1991
|
-
|
|
2028
|
+
this.#g.addEventListener("input", () => this.#K(), { signal: e }), this.#_.addEventListener("click", () => this.#q(), { signal: e });
|
|
2029
|
+
}
|
|
2030
|
+
#ne(e) {
|
|
2031
|
+
let t = ye(this.#i, this.#a, e);
|
|
1992
2032
|
if (t) {
|
|
1993
2033
|
let e = this.#E.get(t.iso2);
|
|
1994
|
-
this.#
|
|
2034
|
+
this.#Y(e);
|
|
1995
2035
|
}
|
|
1996
2036
|
}
|
|
1997
|
-
#ne(e) {
|
|
1998
|
-
let t = e === v.ARROW_UP ? this.#T?.previousElementSibling : this.#T?.nextElementSibling;
|
|
1999
|
-
!t && this.#v.childElementCount > 1 && (t = e === v.ARROW_UP ? this.#v.lastElementChild : this.#v.firstElementChild), t && this.#J(t);
|
|
2000
|
-
}
|
|
2001
2037
|
#re(e) {
|
|
2002
|
-
|
|
2038
|
+
let t = e === y.ARROW_UP ? this.#T?.previousElementSibling : this.#T?.nextElementSibling;
|
|
2039
|
+
!t && this.#v.childElementCount > 1 && (t = e === y.ARROW_UP ? this.#v.lastElementChild : this.#v.firstElementChild), t && this.#Y(t);
|
|
2040
|
+
}
|
|
2041
|
+
#ie(e) {
|
|
2042
|
+
if (this.#w && this.#w.dataset[L.ISO2] !== e && (this.#w.setAttribute(R.SELECTED, "false"), this.#w.querySelector(".iti__country-check")?.remove(), this.#w = null), e && !this.#w) {
|
|
2003
2043
|
let t = this.#v.querySelector(`[data-iso2="${e}"]`);
|
|
2004
|
-
t && (t.setAttribute(
|
|
2005
|
-
class: "iti__country-check",
|
|
2006
|
-
[
|
|
2007
|
-
}, t).appendChild(
|
|
2044
|
+
t && (t.setAttribute(R.SELECTED, "true"), q("span", {
|
|
2045
|
+
class: this.#k("countryCheck", "iti__country-check"),
|
|
2046
|
+
[R.HIDDEN]: "true"
|
|
2047
|
+
}, t).appendChild(he()), this.#w = t, this.#e.dropdownAlwaysOpen && this.#Y(t));
|
|
2008
2048
|
}
|
|
2009
2049
|
}
|
|
2010
|
-
#
|
|
2050
|
+
#ae(e) {
|
|
2011
2051
|
this.#v.replaceChildren();
|
|
2012
2052
|
let t = !0;
|
|
2013
2053
|
for (let n of e) {
|
|
2014
2054
|
let e = this.#E.get(n.iso2);
|
|
2015
|
-
e && (this.#v.appendChild(e), t &&= (this.#
|
|
2055
|
+
e && (this.#v.appendChild(e), t &&= (this.#Y(e, !1), !1));
|
|
2016
2056
|
}
|
|
2017
|
-
t ? (this.#
|
|
2057
|
+
t ? (this.#Y(null), this.#x && this.#x.classList.remove(v.HIDE)) : this.#x && this.#x.classList.add(v.HIDE), this.#v.scrollTop = 0, this.#U();
|
|
2018
2058
|
}
|
|
2019
2059
|
closeCountrySelector() {
|
|
2020
2060
|
let { countrySearch: e } = this.#e;
|
|
2021
|
-
this.#D.abort(), this.#D = null, this.#m.classList.add(
|
|
2061
|
+
this.#D.abort(), this.#D = null, this.#m.classList.add(v.HIDE), this.#u.setAttribute(R.EXPANDED, "false"), e && (this.#g.removeAttribute(R.ACTIVE_DESCENDANT), this.#g.value = "", this.#G(), this.#T &&= (this.#T.classList.remove(v.HIGHLIGHT), null)), this.#p.classList.remove(v.ARROW_UP), this.#C ? (this.#C.remove(), this.#C.style.top = "", this.#C.style.bottom = "", this.#C.style.paddingLeft = "", this.#C.style.paddingRight = "") : (this.#m.style.top = "", this.#m.style.bottom = "");
|
|
2022
2062
|
}
|
|
2023
|
-
#
|
|
2063
|
+
#oe() {
|
|
2024
2064
|
if (this.#e.dropdownAlwaysOpen) return !0;
|
|
2025
2065
|
let e = this.telInputEl.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom;
|
|
2026
2066
|
return n >= this.#s || n >= t;
|
|
2027
2067
|
}
|
|
2028
|
-
#
|
|
2029
|
-
let e = this.#e.countrySelectorMode ===
|
|
2068
|
+
#se() {
|
|
2069
|
+
let e = this.#e.countrySelectorMode === I.FULLSCREEN, t = this.#N();
|
|
2030
2070
|
if (e) {
|
|
2031
|
-
if (window.innerWidth >=
|
|
2071
|
+
if (window.innerWidth >= C.NARROW_VIEWPORT_WIDTH) {
|
|
2032
2072
|
let e = this.telInputEl.getBoundingClientRect();
|
|
2033
2073
|
this.#C.style.paddingLeft = `${e.left}px`, this.#C.style.paddingRight = `${window.innerWidth - e.right}px`;
|
|
2034
2074
|
}
|
|
2035
|
-
} else this.#
|
|
2036
|
-
if (!e && !
|
|
2075
|
+
} else this.#ce();
|
|
2076
|
+
if (!e && !xe) {
|
|
2037
2077
|
let e = this.telInputEl.getBoundingClientRect();
|
|
2038
|
-
this.#C.style.left = `${e.left}px`, this.#
|
|
2078
|
+
this.#C.style.left = `${e.left}px`, this.#oe() ? this.#C.style.top = `${e.bottom + C.DROPDOWN_MARGIN}px` : (this.#C.style.top = "unset", this.#C.style.bottom = `${window.innerHeight - e.top + C.DROPDOWN_MARGIN}px`);
|
|
2039
2079
|
}
|
|
2040
2080
|
t.appendChild(this.#C);
|
|
2041
2081
|
}
|
|
2042
|
-
#
|
|
2082
|
+
#ce() {
|
|
2043
2083
|
if (this.#c) return;
|
|
2044
2084
|
this.#c = !0;
|
|
2045
2085
|
let e = `--iti-anchor-${this.#t}`, t = getComputedStyle(this.telInputEl).anchorName;
|
|
2046
2086
|
this.telInputEl.style.anchorName = t && t !== "none" ? `${t}, ${e}` : e, this.#C.style.positionAnchor = e;
|
|
2047
2087
|
}
|
|
2048
|
-
#
|
|
2088
|
+
#le() {
|
|
2049
2089
|
let e = window.visualViewport;
|
|
2050
2090
|
if (!e || !this.#C) return;
|
|
2051
2091
|
let t = window.innerHeight - e.height;
|
|
2052
2092
|
this.#C.style.bottom = `${t}px`;
|
|
2053
2093
|
}
|
|
2054
2094
|
isCountrySelectorOpen() {
|
|
2055
|
-
return !this.#m.classList.contains(
|
|
2095
|
+
return !this.#m.classList.contains(v.HIDE);
|
|
2056
2096
|
}
|
|
2057
2097
|
setLoading(e) {
|
|
2058
|
-
this.#d.classList.toggle(
|
|
2098
|
+
this.#d.classList.toggle(v.LOADING, e);
|
|
2059
2099
|
}
|
|
2060
2100
|
playStrictRejectAnimation() {
|
|
2061
2101
|
if (!this.#e.strictRejectAnimation) return;
|
|
2062
2102
|
let e = this.telInputEl.parentElement;
|
|
2063
|
-
e && (e.classList.remove(
|
|
2103
|
+
e && (e.classList.remove(v.STRICT_REJECT_ANIMATION), e.offsetWidth, e.classList.add(v.STRICT_REJECT_ANIMATION), e.addEventListener("animationend", () => e.classList.remove(v.STRICT_REJECT_ANIMATION), { once: !0 }));
|
|
2064
2104
|
}
|
|
2065
2105
|
isLoading() {
|
|
2066
|
-
return this.#d.classList.contains(
|
|
2106
|
+
return this.#d.classList.contains(v.LOADING);
|
|
2067
2107
|
}
|
|
2068
2108
|
setDisabled(e) {
|
|
2069
2109
|
this.telInputEl.disabled = e, this.#u && (e ? this.#u.setAttribute("disabled", "true") : this.#u.removeAttribute("disabled"));
|
|
@@ -2073,24 +2113,24 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2073
2113
|
}
|
|
2074
2114
|
setSelectedCountry(e) {
|
|
2075
2115
|
let { countrySelectorMode: t, showFlags: n, separateDialCode: r, uiTranslations: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
|
|
2076
|
-
if (t !==
|
|
2077
|
-
let e = s && n ? `${
|
|
2078
|
-
s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), n || (c =
|
|
2116
|
+
if (t !== I.OFF && this.#ie(s), this.#u) {
|
|
2117
|
+
let e = this.#k("selectedFlag", s && n ? `${v.FLAG} iti__${s}` : `${v.FLAG} ${v.GLOBE}`), t, r, c = null;
|
|
2118
|
+
s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), n || (c = ge())) : (r = i.noCountrySelected, t = i.noCountrySelected, c = ge()), this.#d.className = e, this.#u.setAttribute("title", r), this.#u.setAttribute(R.LABEL, t), c ? this.#d.replaceChildren(c) : this.#d.replaceChildren();
|
|
2079
2119
|
}
|
|
2080
2120
|
if (r) {
|
|
2081
2121
|
let e = o ? `+${o}` : "";
|
|
2082
|
-
this.#f.textContent = e, this.#
|
|
2122
|
+
this.#f.textContent = e, this.#R();
|
|
2083
2123
|
}
|
|
2084
2124
|
}
|
|
2085
2125
|
destroy() {
|
|
2086
|
-
this.telInputEl.iti = void 0, delete this.telInputEl.dataset[
|
|
2126
|
+
this.telInputEl.iti = void 0, delete this.telInputEl.dataset[L.INSTANCE_ID], this.#O?.disconnect(), this.telInputEl.style.paddingLeft = this.#r;
|
|
2087
2127
|
let e = this.telInputEl.parentNode;
|
|
2088
2128
|
e && (e.before(this.telInputEl), e.remove()), this.#E.clear();
|
|
2089
2129
|
}
|
|
2090
|
-
},
|
|
2130
|
+
}, Ce = (e) => {
|
|
2091
2131
|
let { onlyCountries: t, excludeCountries: n } = e;
|
|
2092
2132
|
return t?.length ? h.filter((e) => t.includes(e.iso2)) : n?.length ? h.filter((e) => !n.includes(e.iso2)) : [...h];
|
|
2093
|
-
},
|
|
2133
|
+
}, we = (e, t) => {
|
|
2094
2134
|
let { countryNameLocale: n, countryNameOverrides: r, uiTranslations: i } = t, a = i?.countryNames, o;
|
|
2095
2135
|
try {
|
|
2096
2136
|
o = typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? new Intl.DisplayNames(n, { type: "region" }) : null;
|
|
@@ -2098,7 +2138,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2098
2138
|
console.error(e), o = null;
|
|
2099
2139
|
}
|
|
2100
2140
|
for (let t of e) t.name = r[t.iso2] || a?.[t.iso2] || o?.of(t.iso2.toUpperCase()) || "";
|
|
2101
|
-
},
|
|
2141
|
+
}, Te = (e) => {
|
|
2102
2142
|
let t = /* @__PURE__ */ new Set(), n = 0, r = {}, i = (e, t) => {
|
|
2103
2143
|
if (!e || !t) return;
|
|
2104
2144
|
t.length > n && (n = t.length), Object.hasOwn(r, t) || (r[t] = []);
|
|
@@ -2127,7 +2167,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2127
2167
|
dialCodeMaxLength: n,
|
|
2128
2168
|
dialCodeToIso2Map: r
|
|
2129
2169
|
};
|
|
2130
|
-
},
|
|
2170
|
+
}, Ee = (e, t) => {
|
|
2131
2171
|
let { countryOrder: n } = t;
|
|
2132
2172
|
e.sort((e, t) => {
|
|
2133
2173
|
if (n) {
|
|
@@ -2136,7 +2176,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2136
2176
|
}
|
|
2137
2177
|
return e.name.localeCompare(t.name);
|
|
2138
2178
|
});
|
|
2139
|
-
},
|
|
2179
|
+
}, De = /* @__PURE__ */ new Set([
|
|
2140
2180
|
"800",
|
|
2141
2181
|
"808",
|
|
2142
2182
|
"870",
|
|
@@ -2145,17 +2185,17 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2145
2185
|
"883",
|
|
2146
2186
|
"888",
|
|
2147
2187
|
"979"
|
|
2148
|
-
]),
|
|
2149
|
-
let t =
|
|
2150
|
-
return e.startsWith("+") &&
|
|
2151
|
-
},
|
|
2188
|
+
]), Oe = (e) => {
|
|
2189
|
+
let t = K(e).slice(0, 3);
|
|
2190
|
+
return e.startsWith("+") && De.has(t);
|
|
2191
|
+
}, ke = (e, t, n, r) => {
|
|
2152
2192
|
if (!n || !t) return e;
|
|
2153
2193
|
let i = `+${r.dialCode}`, a = e[i.length] === " " || e[i.length] === "-" ? i.length + 1 : i.length;
|
|
2154
2194
|
return e.substring(a);
|
|
2155
|
-
},
|
|
2195
|
+
}, Ae = (e, t, n, r, i) => {
|
|
2156
2196
|
let a = n ? n.formatNumberAsYouType(e, r?.iso2) : e, o = r?.dialCode;
|
|
2157
2197
|
return i && t.charAt(0) !== "+" && a.includes(`+${o}`) ? (a.split(`+${o}`)[1] || "").trim() : a;
|
|
2158
|
-
},
|
|
2198
|
+
}, je = (e, t, n, r) => {
|
|
2159
2199
|
if (n === 0 && !r) return 0;
|
|
2160
2200
|
let i = 0;
|
|
2161
2201
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -2163,7 +2203,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2163
2203
|
if (r && i === e + 1) return n;
|
|
2164
2204
|
}
|
|
2165
2205
|
return t.length;
|
|
2166
|
-
},
|
|
2206
|
+
}, Me = /* @__PURE__ */ new Set([
|
|
2167
2207
|
"800",
|
|
2168
2208
|
"822",
|
|
2169
2209
|
"833",
|
|
@@ -2181,16 +2221,16 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2181
2221
|
"887",
|
|
2182
2222
|
"888",
|
|
2183
2223
|
"889"
|
|
2184
|
-
]),
|
|
2185
|
-
let t =
|
|
2186
|
-
if (t.startsWith(
|
|
2224
|
+
]), Ne = (e) => {
|
|
2225
|
+
let t = K(e);
|
|
2226
|
+
if (t.startsWith(w.NANP) && t.length >= 4) {
|
|
2187
2227
|
let e = t.substring(1, 4);
|
|
2188
|
-
return
|
|
2228
|
+
return Me.has(e);
|
|
2189
2229
|
}
|
|
2190
2230
|
return !1;
|
|
2191
|
-
},
|
|
2231
|
+
}, Pe = 0, X = (e) => {
|
|
2192
2232
|
if (!Q.utils) throw Error(`intlTelInput.utils is required for ${e}(). See: https://intl-tel-input.com/docs/utils`);
|
|
2193
|
-
},
|
|
2233
|
+
}, Fe = () => {
|
|
2194
2234
|
let e, t;
|
|
2195
2235
|
return {
|
|
2196
2236
|
promise: new Promise((n, r) => {
|
|
@@ -2222,13 +2262,13 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2222
2262
|
#_;
|
|
2223
2263
|
#v;
|
|
2224
2264
|
constructor(e, t = {}) {
|
|
2225
|
-
this.id =
|
|
2265
|
+
this.id = Pe++, Se.validateInput(e);
|
|
2226
2266
|
let n = se(t);
|
|
2227
2267
|
this.#t = {
|
|
2228
|
-
...
|
|
2268
|
+
...B,
|
|
2229
2269
|
...n
|
|
2230
|
-
}, ce(this.#t), le(this.#t), this.#e = new
|
|
2231
|
-
let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } =
|
|
2270
|
+
}, ce(this.#t), le(this.#t), this.#e = new Se(e, this.#t, this.id), this.#n = typeof navigator < "u" && /Android/i.test(navigator.userAgent), this.#m = new be(e.value), this.promise = this.#x(this.#t), this.#r = Ce(this.#t);
|
|
2271
|
+
let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } = Te(this.#r);
|
|
2232
2272
|
this.#o = r, this.#i = i, this.#a = a, this.#s = new Map(this.#r.map((e) => [e.iso2, e])), this.#S();
|
|
2233
2273
|
}
|
|
2234
2274
|
#y() {
|
|
@@ -2240,20 +2280,20 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2240
2280
|
}
|
|
2241
2281
|
#x(e) {
|
|
2242
2282
|
let { initialCountry: t, initialCountryLookup: n, loadUtils: r } = e, i = !t && !!n, a = !!r && !Q.utils;
|
|
2243
|
-
return i && (this.#_ =
|
|
2283
|
+
return i && (this.#_ = Fe()), a && (this.#v = Fe()), Promise.all([this.#_?.promise, this.#v?.promise]).then(() => {});
|
|
2244
2284
|
}
|
|
2245
2285
|
#S() {
|
|
2246
2286
|
this.#p = new AbortController(), this.#C(), this.#e.buildMarkup(this.#r, this.#c), this.#w(), this.#T(), this.#E(), this.#t.dropdownAlwaysOpen && this.openCountrySelector();
|
|
2247
2287
|
}
|
|
2248
2288
|
#C() {
|
|
2249
|
-
|
|
2289
|
+
we(this.#r, this.#t), Ee(this.#r, this.#t), this.#c = _e(this.#r);
|
|
2250
2290
|
}
|
|
2251
2291
|
#w(e = !1) {
|
|
2252
|
-
let t = this.#e.telInputEl.getAttribute("value"), n = this.#m.normalise(t ?? ""), r = this.#y(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#ne(i), o =
|
|
2253
|
-
a ? o ? f ? this.#X(u) : d || this.#X(
|
|
2292
|
+
let t = this.#e.telInputEl.getAttribute("value"), n = this.#m.normalise(t ?? ""), r = this.#y(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#ne(i), o = Ne(i), { initialCountry: s, initialCountryLookup: c } = this.#t, l = !s && !!c, u = l && Q.autoCountry ? Q.autoCountry : s, d = l && !e && !Q.autoCountry, f = m(u);
|
|
2293
|
+
a ? o ? f ? this.#X(u) : d || this.#X(E.ISO2) : (f && this.#X(u), this.#K(i)) : f ? this.#X(u) : d || this.#X(""), i && this.#G(i);
|
|
2254
2294
|
}
|
|
2255
2295
|
#T() {
|
|
2256
|
-
this.#A(), this.#t.countrySelectorMode !==
|
|
2296
|
+
this.#A(), this.#t.countrySelectorMode !== I.OFF && this.#e.bindAllInitialCountrySelectorListeners(this.#p.signal, () => this.openCountrySelector(), () => this.#ee()), this.#e.bindHiddenInputSubmitListener(this.#p.signal, () => this.getNumber(), () => this.#l?.iso2 || "");
|
|
2257
2297
|
}
|
|
2258
2298
|
#E() {
|
|
2259
2299
|
if (this.#v) {
|
|
@@ -2309,23 +2349,23 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2309
2349
|
});
|
|
2310
2350
|
}
|
|
2311
2351
|
#N(e, t) {
|
|
2312
|
-
let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(
|
|
2352
|
+
let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(x.NON_PLUS_NUMERIC_GLOBAL, "").length, i = Ae(this.#ie(), e, Q.utils, this.#l, this.#t.separateDialCode), a = je(r, i, n, t);
|
|
2313
2353
|
this.#b(i), this.#e.telInputEl.setSelectionRange(a, a);
|
|
2314
2354
|
}
|
|
2315
2355
|
#P(e) {
|
|
2316
2356
|
if (e.startsWith("+") && this.#l && this.#ne(e)) {
|
|
2317
|
-
let t =
|
|
2357
|
+
let t = ke(e, !0, !0, this.#l);
|
|
2318
2358
|
this.#b(t);
|
|
2319
2359
|
}
|
|
2320
2360
|
}
|
|
2321
2361
|
#F() {
|
|
2322
|
-
this.#h =
|
|
2362
|
+
this.#h = x.ALPHA_UNICODE.test(this.#y()), this.#e.telInputEl.addEventListener("input", this.#I, { signal: this.#p.signal });
|
|
2323
2363
|
}
|
|
2324
2364
|
#I = (e) => {
|
|
2325
2365
|
let { strictMode: t, formatAsYouType: n, separateDialCode: r, countrySelectorMode: i, countrySearch: a } = this.#t, o = e?.detail;
|
|
2326
2366
|
if (o?.isCountryChange) return;
|
|
2327
|
-
let s = this.#y(), c = e?.inputType ===
|
|
2328
|
-
if (this.#n && !c && e?.data === "+" && r && i !==
|
|
2367
|
+
let s = this.#y(), c = e?.inputType === b.PASTE, l = t && c;
|
|
2368
|
+
if (this.#n && !c && e?.data === "+" && r && i !== I.OFF && a) {
|
|
2329
2369
|
this.#j(s);
|
|
2330
2370
|
return;
|
|
2331
2371
|
}
|
|
@@ -2337,7 +2377,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2337
2377
|
if (this.#V()) return;
|
|
2338
2378
|
s = this.#y();
|
|
2339
2379
|
}
|
|
2340
|
-
this.#K(s) && (this.#oe(), this.#W(g.INPUT, { isCountryChange: !0 })), !l && e?.data &&
|
|
2380
|
+
this.#K(s) && (this.#oe(), this.#W(g.INPUT, { isCountryChange: !0 })), !l && e?.data && x.NON_PLUS_NUMERIC.test(e.data) || c && s && !t ? this.#h = !0 : x.NON_PLUS_NUMERIC.test(s) || (this.#h = !1), n && !this.#h && !o?.isSetNumber && this.#m.isAscii() && this.#N(s, e?.inputType === b.DELETE_FORWARD), r && this.#P(s);
|
|
2341
2381
|
};
|
|
2342
2382
|
#L() {
|
|
2343
2383
|
let { strictMode: e, separateDialCode: t } = this.#t;
|
|
@@ -2346,7 +2386,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2346
2386
|
#R = (e) => {
|
|
2347
2387
|
let { strictMode: t, separateDialCode: n, countrySelectorMode: r, countrySearch: i } = this.#t;
|
|
2348
2388
|
if (!e.key || e.key.length !== 1 || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
2349
|
-
if (n && r !==
|
|
2389
|
+
if (n && r !== I.OFF && i && e.key === "+") {
|
|
2350
2390
|
e.preventDefault(), this.#O();
|
|
2351
2391
|
return;
|
|
2352
2392
|
}
|
|
@@ -2375,7 +2415,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2375
2415
|
#V() {
|
|
2376
2416
|
let e = this.#e.telInputEl, t = this.#g;
|
|
2377
2417
|
if (this.#g = null, !t) return !1;
|
|
2378
|
-
let n = t.pastedRaw, r = t.value, i = t.selectionStart, a = t.selectionEnd, o = r.slice(0, i), s = r.slice(a), c = this.#l?.iso2, l = this.#m.normalise(n), u = i === 0 && a > 0, d = !r.startsWith("+") || u, f = l.replace(
|
|
2418
|
+
let n = t.pastedRaw, r = t.value, i = t.selectionStart, a = t.selectionEnd, o = r.slice(0, i), s = r.slice(a), c = this.#l?.iso2, l = this.#m.normalise(n), u = i === 0 && a > 0, d = !r.startsWith("+") || u, f = l.replace(x.NON_PLUS_NUMERIC_GLOBAL, ""), p = f.startsWith("+"), m = f.replace(/\+/g, ""), h = p && d ? `+${m}` : m, _ = o + h + s, v = h === l ? null : "invalid";
|
|
2379
2419
|
if (_.length > 30) return this.#e.playStrictRejectAnimation(), this.#W(g.STRICT_REJECT, {
|
|
2380
2420
|
source: "paste",
|
|
2381
2421
|
rejectedInput: n,
|
|
@@ -2427,8 +2467,8 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2427
2467
|
#G(e) {
|
|
2428
2468
|
let { numberDisplayFormat: t, separateDialCode: n } = this.#t, r = e;
|
|
2429
2469
|
if (Q.utils && this.#l) {
|
|
2430
|
-
let i =
|
|
2431
|
-
s = o ?
|
|
2470
|
+
let i = Oe(e), a = !r.startsWith("+") && !n, o = t === N.NATIONAL && !i || a, s;
|
|
2471
|
+
s = o ? N.NATIONAL : t === N.E164 && !i ? N.E164 : N.INTERNATIONAL, r = Q.utils.formatNumber(r, this.#l?.iso2, s);
|
|
2432
2472
|
}
|
|
2433
2473
|
r = this.#ae(r), this.#b(r);
|
|
2434
2474
|
}
|
|
@@ -2443,9 +2483,9 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2443
2483
|
#J(e) {
|
|
2444
2484
|
let t = e.indexOf("+"), n = t > 0 ? e.substring(t) : e, r = this.#l?.iso2;
|
|
2445
2485
|
n = this.#q(n);
|
|
2446
|
-
let i = this.#ne(n, !0), a =
|
|
2486
|
+
let i = this.#ne(n, !0), a = K(n);
|
|
2447
2487
|
if (i) {
|
|
2448
|
-
let e =
|
|
2488
|
+
let e = K(i), t = this.#a[e];
|
|
2449
2489
|
return t.length === 1 ? t[0] === r ? null : t[0] : this.#Y(t, e, a);
|
|
2450
2490
|
} else if (n.startsWith("+") && a.length) {
|
|
2451
2491
|
let e = this.#l?.dialCode || "";
|
|
@@ -2456,7 +2496,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2456
2496
|
#Y(e, t, n) {
|
|
2457
2497
|
let r = this.#l?.iso2, i = this.#l?.dialCode;
|
|
2458
2498
|
if (!r && this.#d && e.includes(this.#d)) return this.#d;
|
|
2459
|
-
if (i ===
|
|
2499
|
+
if (i === w.NANP && Ne(n)) return null;
|
|
2460
2500
|
let a = this.#l?.areaCodes, o = this.#l?.priority;
|
|
2461
2501
|
if (a) {
|
|
2462
2502
|
let e = a.map((e) => `${i}${e}`);
|
|
@@ -2477,22 +2517,22 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2477
2517
|
this.#u = null;
|
|
2478
2518
|
return;
|
|
2479
2519
|
}
|
|
2480
|
-
let i = Q.utils.getExampleNumber(r, t,
|
|
2520
|
+
let i = Q.utils.getExampleNumber(r, t, N.E164), a = i;
|
|
2481
2521
|
for (; Q.utils.isValidNumber(i, r, n);) a = i, i += "0";
|
|
2482
2522
|
let o = Q.utils.getCoreNumber(a, r);
|
|
2483
2523
|
this.#u = o.length, r === "by" && (this.#u = o.length + 1);
|
|
2484
2524
|
}
|
|
2485
2525
|
#Q() {
|
|
2486
|
-
let { placeholderNumberPolicy: e, placeholderNumberType: t, numberDisplayFormat: n, customPlaceholder: r } = this.#t, i = e ===
|
|
2526
|
+
let { placeholderNumberPolicy: e, placeholderNumberType: t, numberDisplayFormat: n, customPlaceholder: r } = this.#t, i = e === D.AGGRESSIVE || !this.#e.hadInitialPlaceholder && e === D.POLITE;
|
|
2487
2527
|
if (!Q.utils || !i) return;
|
|
2488
2528
|
let a = this.#l ? Q.utils.getExampleNumber(this.#l.iso2, t, n) : "";
|
|
2489
2529
|
a = this.#ae(a), typeof r == "function" && (a = r(a, this.#l)), this.#e.telInputEl.setAttribute("placeholder", a);
|
|
2490
2530
|
}
|
|
2491
2531
|
#$(e) {
|
|
2492
2532
|
if (!e) return;
|
|
2493
|
-
let t = e.dataset[
|
|
2533
|
+
let t = e.dataset[L.ISO2], n = this.#X(t);
|
|
2494
2534
|
this.#ee();
|
|
2495
|
-
let r = e.dataset[
|
|
2535
|
+
let r = e.dataset[L.DIAL_CODE];
|
|
2496
2536
|
this.#te(r);
|
|
2497
2537
|
let i = this.#y();
|
|
2498
2538
|
this.#G(i), this.#e.telInputEl.focus(), n && (this.#oe(), this.#W(g.INPUT, { isCountryChange: !0 }));
|
|
@@ -2525,7 +2565,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2525
2565
|
return n;
|
|
2526
2566
|
}
|
|
2527
2567
|
#re(e) {
|
|
2528
|
-
let t = this.#l?.dialCode, n =
|
|
2568
|
+
let t = this.#l?.dialCode, n = K(e);
|
|
2529
2569
|
return (this.#t.separateDialCode && !e.startsWith("+") && t && n ? `+${t}` : "") + e;
|
|
2530
2570
|
}
|
|
2531
2571
|
#ie() {
|
|
@@ -2533,7 +2573,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2533
2573
|
return this.#re(e);
|
|
2534
2574
|
}
|
|
2535
2575
|
#ae(e) {
|
|
2536
|
-
let t =
|
|
2576
|
+
let t = ke(e, !!this.#ne(e), this.#t.separateDialCode, this.#l);
|
|
2537
2577
|
return this.#U(t);
|
|
2538
2578
|
}
|
|
2539
2579
|
#oe() {
|
|
@@ -2575,7 +2615,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2575
2615
|
this.#v?.reject(e);
|
|
2576
2616
|
}
|
|
2577
2617
|
destroy() {
|
|
2578
|
-
this.#f && (this.#f = !1, this.#t.countrySelectorMode !==
|
|
2618
|
+
this.#f && (this.#f = !1, this.#t.countrySelectorMode !== I.OFF && this.#ee(!0), this.#p.abort(), this.#e.destroy(), Q.instances.delete(String(this.id)));
|
|
2579
2619
|
}
|
|
2580
2620
|
isActive() {
|
|
2581
2621
|
return this.#f;
|
|
@@ -2606,9 +2646,9 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2606
2646
|
X("isValidNumber");
|
|
2607
2647
|
let e = this.#l?.dialCode, t = this.#l?.iso2, n = this.#ie(), r = Q.utils.getCoreNumber(n, t);
|
|
2608
2648
|
if (r) {
|
|
2609
|
-
if (e ===
|
|
2610
|
-
if (!
|
|
2611
|
-
let t =
|
|
2649
|
+
if (e === T.DIAL_CODE && r[0] === T.MOBILE_PREFIX && r.length !== T.MOBILE_CORE_LENGTH) return !1;
|
|
2650
|
+
if (!x.ALPHA_UNICODE.test(n) && e) {
|
|
2651
|
+
let t = K(n.startsWith("+") ? n.slice(1 + e.length) : n).length;
|
|
2612
2652
|
if (r.length > t) return !1;
|
|
2613
2653
|
}
|
|
2614
2654
|
}
|
|
@@ -2619,7 +2659,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2619
2659
|
}
|
|
2620
2660
|
#de(e) {
|
|
2621
2661
|
let { allowNumberExtensions: t, allowPhonewords: n, allowedNumberTypes: r } = this.#t, i = this.#l?.iso2, a = this.#ie();
|
|
2622
|
-
return !this.#l && !
|
|
2662
|
+
return !this.#l && !Oe(a) || !(e === "precise" ? Q.utils.isValidNumberPrecise : Q.utils.isValidNumber)(a, i, r) ? !1 : x.ALPHA_UNICODE.test(a) ? Q.utils.getExtension(a, i) ? t : n : !0;
|
|
2623
2663
|
}
|
|
2624
2664
|
setSelectedCountry(e) {
|
|
2625
2665
|
if (!this.#f) return;
|
|
@@ -2668,11 +2708,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2668
2708
|
let n = new Z(e, t);
|
|
2669
2709
|
return Q.instances.set(String(n.id), n), e.iti = n, n;
|
|
2670
2710
|
}, {
|
|
2671
|
-
defaults:
|
|
2711
|
+
defaults: B,
|
|
2672
2712
|
documentReady: () => document.readyState === "complete",
|
|
2673
2713
|
getAllCountries: () => h,
|
|
2674
2714
|
getInstance: (e) => {
|
|
2675
|
-
let t = e.dataset[
|
|
2715
|
+
let t = e.dataset[L.INSTANCE_ID];
|
|
2676
2716
|
return t ? Q.instances.get(t) ?? null : null;
|
|
2677
2717
|
},
|
|
2678
2718
|
instances: /* @__PURE__ */ new Map(),
|
|
@@ -2690,13 +2730,13 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2690
2730
|
},
|
|
2691
2731
|
startedLoadingUtils: !1,
|
|
2692
2732
|
startedLoadingAutoCountry: !1,
|
|
2693
|
-
version: "29.
|
|
2694
|
-
NUMBER_FORMAT:
|
|
2695
|
-
NUMBER_TYPE:
|
|
2696
|
-
VALIDATION_ERROR:
|
|
2697
|
-
PLACEHOLDER_POLICY:
|
|
2698
|
-
COUNTRY_SELECTOR_MODE:
|
|
2699
|
-
}), $ = Q,
|
|
2733
|
+
version: "29.2.0",
|
|
2734
|
+
NUMBER_FORMAT: N,
|
|
2735
|
+
NUMBER_TYPE: P,
|
|
2736
|
+
VALIDATION_ERROR: F,
|
|
2737
|
+
PLACEHOLDER_POLICY: D,
|
|
2738
|
+
COUNTRY_SELECTOR_MODE: I
|
|
2739
|
+
}), $ = Q, Ie = /* @__PURE__ */ n({
|
|
2700
2740
|
inheritAttrs: !1,
|
|
2701
2741
|
__name: "IntlTelInput",
|
|
2702
2742
|
props: {
|
|
@@ -2719,6 +2759,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2719
2759
|
allowedNumberTypes: {},
|
|
2720
2760
|
allowNumberExtensions: { type: Boolean },
|
|
2721
2761
|
allowPhonewords: { type: Boolean },
|
|
2762
|
+
classNames: {},
|
|
2722
2763
|
containerClass: {},
|
|
2723
2764
|
countryNameLocale: {},
|
|
2724
2765
|
countryNameOverrides: {},
|
|
@@ -2767,7 +2808,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2767
2808
|
"oninput"
|
|
2768
2809
|
]), _ = c(""), v = e(() => {
|
|
2769
2810
|
let e = p.inputProps ?? {}, t = {};
|
|
2770
|
-
for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : n === "class" ? t[n] =
|
|
2811
|
+
for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : n === "class" ? t[n] = [_.value, r].filter(Boolean).join(" ") : t[n] = r;
|
|
2771
2812
|
return t;
|
|
2772
2813
|
}), y = e(() => p.modelValue ?? p.initialValue ?? ""), b = r(), x = Object.keys($.defaults), S = e(() => {
|
|
2773
2814
|
let e = b?.vnode.props ?? {}, t = new Set(Object.keys(e).map((e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()))), n = {};
|
|
@@ -2801,9 +2842,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2801
2842
|
m("strictReject", t, n, r);
|
|
2802
2843
|
};
|
|
2803
2844
|
return a(() => {
|
|
2804
|
-
|
|
2845
|
+
if (!C.value) return;
|
|
2846
|
+
let e = new Set(C.value.classList);
|
|
2847
|
+
w.value = $(C.value, S.value), _.value = Array.from(C.value.classList).filter((t) => !e.has(t)).join(" "), C.value.addEventListener("input", N), C.value.addEventListener("open:countryselector", P), C.value.addEventListener("close:countryselector", 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.getSelectedCountry()?.iso2 ?? "", w.value.promise.then(() => {
|
|
2805
2848
|
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()));
|
|
2806
|
-
})
|
|
2849
|
+
});
|
|
2807
2850
|
}), u(() => p.disabled, (e) => w.value?.setDisabled(e)), u(() => p.readonly, (e) => w.value?.setReadonly(e)), u(() => y.value, (e) => {
|
|
2808
2851
|
w.value && w.value.promise.then(() => {
|
|
2809
2852
|
if (!w.value?.isActive()) return;
|
|
@@ -2823,4 +2866,4 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2823
2866
|
}
|
|
2824
2867
|
});
|
|
2825
2868
|
//#endregion
|
|
2826
|
-
export { $ as n,
|
|
2869
|
+
export { $ as n, Ie as t };
|