intl-tel-input 27.3.1 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/css/intlTelInput-no-assets.css +2 -2
  2. package/dist/css/intlTelInput.css +3 -3
  3. package/dist/js/data.js +2 -2
  4. package/dist/js/data.min.js +1 -1
  5. package/dist/js/data.mjs +1 -1
  6. package/dist/js/i18n.d.ts +1 -1592
  7. package/dist/js/intlTelInput.d.ts +61 -45
  8. package/dist/js/intlTelInput.js +109 -104
  9. package/dist/js/intlTelInput.min.js +6 -6
  10. package/dist/js/intlTelInput.mjs +107 -102
  11. package/dist/js/intlTelInputWithUtils.js +510 -490
  12. package/dist/js/intlTelInputWithUtils.min.js +9 -9
  13. package/dist/js/intlTelInputWithUtils.mjs +508 -488
  14. package/dist/js/utils.js +56 -55
  15. package/package.json +14 -181
  16. package/CHANGELOG.md +0 -33
  17. package/angular/README.md +0 -13
  18. package/angular/dist/IntlTelInput.d.ts +0 -110
  19. package/angular/dist/IntlTelInput.js +0 -5130
  20. package/angular/dist/IntlTelInputWithUtils.d.ts +0 -3
  21. package/angular/dist/IntlTelInputWithUtils.js +0 -11469
  22. package/react/README.md +0 -13
  23. package/react/dist/IntlTelInput.d.ts +0 -25
  24. package/react/dist/IntlTelInput.js +0 -4822
  25. package/react/dist/IntlTelInputWithUtils.d.ts +0 -4
  26. package/react/dist/IntlTelInputWithUtils.js +0 -11161
  27. package/svelte/README.md +0 -14
  28. package/svelte/src/IntlTelInput.svelte +0 -233
  29. package/svelte/src/IntlTelInput.svelte.d.ts +0 -36
  30. package/svelte/src/IntlTelInputWithUtils.svelte +0 -24
  31. package/vue/README.md +0 -14
  32. package/vue/dist/IntlTelInput-DWpqqgvZ.js +0 -2684
  33. package/vue/dist/IntlTelInput.js +0 -5
  34. package/vue/dist/IntlTelInput.vue.d.ts +0 -43
  35. package/vue/dist/IntlTelInputWithUtils.js +0 -49403
  36. package/vue/dist/index.d.ts +0 -4
  37. package/vue/dist/indexWithUtils.d.ts +0 -3
@@ -1,2684 +0,0 @@
1
- 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";
2
- //#region dist/js/intlTelInput.mjs
3
- var d = [
4
- [
5
- "af",
6
- "93",
7
- 0,
8
- null,
9
- "0"
10
- ],
11
- [
12
- "ax",
13
- "358",
14
- 1,
15
- ["18", "4"],
16
- "0"
17
- ],
18
- [
19
- "al",
20
- "355",
21
- 0,
22
- null,
23
- "0"
24
- ],
25
- [
26
- "dz",
27
- "213",
28
- 0,
29
- null,
30
- "0"
31
- ],
32
- [
33
- "as",
34
- "1",
35
- 5,
36
- ["684"],
37
- "1"
38
- ],
39
- ["ad", "376"],
40
- ["ao", "244"],
41
- [
42
- "ai",
43
- "1",
44
- 6,
45
- ["264"],
46
- "1"
47
- ],
48
- [
49
- "ag",
50
- "1",
51
- 7,
52
- ["268"],
53
- "1"
54
- ],
55
- [
56
- "ar",
57
- "54",
58
- 0,
59
- null,
60
- "0"
61
- ],
62
- [
63
- "am",
64
- "374",
65
- 0,
66
- null,
67
- "0"
68
- ],
69
- ["aw", "297"],
70
- ["ac", "247"],
71
- [
72
- "au",
73
- "61",
74
- 0,
75
- ["4"],
76
- "0"
77
- ],
78
- [
79
- "at",
80
- "43",
81
- 0,
82
- null,
83
- "0"
84
- ],
85
- [
86
- "az",
87
- "994",
88
- 0,
89
- null,
90
- "0"
91
- ],
92
- [
93
- "bs",
94
- "1",
95
- 8,
96
- ["242"],
97
- "1"
98
- ],
99
- ["bh", "973"],
100
- [
101
- "bd",
102
- "880",
103
- 0,
104
- null,
105
- "0"
106
- ],
107
- [
108
- "bb",
109
- "1",
110
- 9,
111
- ["246"],
112
- "1"
113
- ],
114
- [
115
- "by",
116
- "375",
117
- 0,
118
- null,
119
- "8"
120
- ],
121
- [
122
- "be",
123
- "32",
124
- 0,
125
- null,
126
- "0"
127
- ],
128
- ["bz", "501"],
129
- ["bj", "229"],
130
- [
131
- "bm",
132
- "1",
133
- 10,
134
- ["441"],
135
- "1"
136
- ],
137
- ["bt", "975"],
138
- [
139
- "bo",
140
- "591",
141
- 0,
142
- null,
143
- "0"
144
- ],
145
- [
146
- "ba",
147
- "387",
148
- 0,
149
- null,
150
- "0"
151
- ],
152
- ["bw", "267"],
153
- [
154
- "br",
155
- "55",
156
- 0,
157
- null,
158
- "0"
159
- ],
160
- ["io", "246"],
161
- [
162
- "vg",
163
- "1",
164
- 11,
165
- ["284"],
166
- "1"
167
- ],
168
- ["bn", "673"],
169
- [
170
- "bg",
171
- "359",
172
- 0,
173
- null,
174
- "0"
175
- ],
176
- ["bf", "226"],
177
- ["bi", "257"],
178
- [
179
- "kh",
180
- "855",
181
- 0,
182
- null,
183
- "0"
184
- ],
185
- ["cm", "237"],
186
- [
187
- "ca",
188
- "1",
189
- 1,
190
- /* @__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("."),
191
- "1"
192
- ],
193
- ["cv", "238"],
194
- [
195
- "bq",
196
- "599",
197
- 1,
198
- [
199
- "3",
200
- "4",
201
- "7"
202
- ]
203
- ],
204
- [
205
- "ky",
206
- "1",
207
- 12,
208
- ["345"],
209
- "1"
210
- ],
211
- ["cf", "236"],
212
- ["td", "235"],
213
- ["cl", "56"],
214
- [
215
- "cn",
216
- "86",
217
- 0,
218
- null,
219
- "0"
220
- ],
221
- [
222
- "cx",
223
- "61",
224
- 2,
225
- ["4", "89164"],
226
- "0"
227
- ],
228
- [
229
- "cc",
230
- "61",
231
- 1,
232
- ["4", "89162"],
233
- "0"
234
- ],
235
- [
236
- "co",
237
- "57",
238
- 0,
239
- null,
240
- "0"
241
- ],
242
- ["km", "269"],
243
- ["cg", "242"],
244
- [
245
- "cd",
246
- "243",
247
- 0,
248
- null,
249
- "0"
250
- ],
251
- ["ck", "682"],
252
- ["cr", "506"],
253
- ["ci", "225"],
254
- [
255
- "hr",
256
- "385",
257
- 0,
258
- null,
259
- "0"
260
- ],
261
- [
262
- "cu",
263
- "53",
264
- 0,
265
- null,
266
- "0"
267
- ],
268
- [
269
- "cw",
270
- "599",
271
- 0
272
- ],
273
- ["cy", "357"],
274
- ["cz", "420"],
275
- ["dk", "45"],
276
- ["dj", "253"],
277
- [
278
- "dm",
279
- "1",
280
- 13,
281
- ["767"],
282
- "1"
283
- ],
284
- [
285
- "do",
286
- "1",
287
- 2,
288
- [
289
- "809",
290
- "829",
291
- "849"
292
- ],
293
- "1"
294
- ],
295
- [
296
- "ec",
297
- "593",
298
- 0,
299
- null,
300
- "0"
301
- ],
302
- [
303
- "eg",
304
- "20",
305
- 0,
306
- null,
307
- "0"
308
- ],
309
- ["sv", "503"],
310
- ["gq", "240"],
311
- [
312
- "er",
313
- "291",
314
- 0,
315
- null,
316
- "0"
317
- ],
318
- ["ee", "372"],
319
- ["sz", "268"],
320
- [
321
- "et",
322
- "251",
323
- 0,
324
- null,
325
- "0"
326
- ],
327
- ["fk", "500"],
328
- ["fo", "298"],
329
- ["fj", "679"],
330
- [
331
- "fi",
332
- "358",
333
- 0,
334
- ["4"],
335
- "0"
336
- ],
337
- [
338
- "fr",
339
- "33",
340
- 0,
341
- null,
342
- "0"
343
- ],
344
- [
345
- "gf",
346
- "594",
347
- 0,
348
- null,
349
- "0"
350
- ],
351
- ["pf", "689"],
352
- ["ga", "241"],
353
- ["gm", "220"],
354
- [
355
- "ge",
356
- "995",
357
- 0,
358
- null,
359
- "0"
360
- ],
361
- [
362
- "de",
363
- "49",
364
- 0,
365
- null,
366
- "0"
367
- ],
368
- [
369
- "gh",
370
- "233",
371
- 0,
372
- null,
373
- "0"
374
- ],
375
- ["gi", "350"],
376
- ["gr", "30"],
377
- ["gl", "299"],
378
- [
379
- "gd",
380
- "1",
381
- 14,
382
- ["473"],
383
- "1"
384
- ],
385
- [
386
- "gp",
387
- "590",
388
- 0,
389
- null,
390
- "0"
391
- ],
392
- [
393
- "gu",
394
- "1",
395
- 15,
396
- ["671"],
397
- "1"
398
- ],
399
- ["gt", "502"],
400
- [
401
- "gg",
402
- "44",
403
- 1,
404
- [
405
- "1481",
406
- "7781",
407
- "7839",
408
- "7911"
409
- ],
410
- "0"
411
- ],
412
- ["gn", "224"],
413
- ["gw", "245"],
414
- ["gy", "592"],
415
- ["ht", "509"],
416
- ["hn", "504"],
417
- ["hk", "852"],
418
- [
419
- "hu",
420
- "36",
421
- 0,
422
- null,
423
- "06"
424
- ],
425
- ["is", "354"],
426
- [
427
- "in",
428
- "91",
429
- 0,
430
- null,
431
- "0"
432
- ],
433
- [
434
- "id",
435
- "62",
436
- 0,
437
- null,
438
- "0"
439
- ],
440
- [
441
- "ir",
442
- "98",
443
- 0,
444
- null,
445
- "0"
446
- ],
447
- [
448
- "iq",
449
- "964",
450
- 0,
451
- null,
452
- "0"
453
- ],
454
- [
455
- "ie",
456
- "353",
457
- 0,
458
- null,
459
- "0"
460
- ],
461
- [
462
- "im",
463
- "44",
464
- 2,
465
- [
466
- "1624",
467
- "74576",
468
- "7524",
469
- "7624",
470
- "7924"
471
- ],
472
- "0"
473
- ],
474
- [
475
- "il",
476
- "972",
477
- 0,
478
- null,
479
- "0"
480
- ],
481
- [
482
- "it",
483
- "39",
484
- 0,
485
- ["3"]
486
- ],
487
- [
488
- "jm",
489
- "1",
490
- 4,
491
- ["658", "876"],
492
- "1"
493
- ],
494
- [
495
- "jp",
496
- "81",
497
- 0,
498
- null,
499
- "0"
500
- ],
501
- [
502
- "je",
503
- "44",
504
- 3,
505
- [
506
- "1534",
507
- "7509",
508
- "7700",
509
- "7797",
510
- "7829",
511
- "7937"
512
- ],
513
- "0"
514
- ],
515
- [
516
- "jo",
517
- "962",
518
- 0,
519
- null,
520
- "0"
521
- ],
522
- [
523
- "kz",
524
- "7",
525
- 1,
526
- ["33", "7"],
527
- "8"
528
- ],
529
- [
530
- "ke",
531
- "254",
532
- 0,
533
- null,
534
- "0"
535
- ],
536
- [
537
- "ki",
538
- "686",
539
- 0,
540
- null,
541
- "0"
542
- ],
543
- [
544
- "xk",
545
- "383",
546
- 0,
547
- null,
548
- "0"
549
- ],
550
- ["kw", "965"],
551
- [
552
- "kg",
553
- "996",
554
- 0,
555
- null,
556
- "0"
557
- ],
558
- [
559
- "la",
560
- "856",
561
- 0,
562
- null,
563
- "0"
564
- ],
565
- ["lv", "371"],
566
- [
567
- "lb",
568
- "961",
569
- 0,
570
- null,
571
- "0"
572
- ],
573
- ["ls", "266"],
574
- [
575
- "lr",
576
- "231",
577
- 0,
578
- null,
579
- "0"
580
- ],
581
- [
582
- "ly",
583
- "218",
584
- 0,
585
- null,
586
- "0"
587
- ],
588
- [
589
- "li",
590
- "423",
591
- 0,
592
- null,
593
- "0"
594
- ],
595
- [
596
- "lt",
597
- "370",
598
- 0,
599
- null,
600
- "0"
601
- ],
602
- ["lu", "352"],
603
- ["mo", "853"],
604
- [
605
- "mg",
606
- "261",
607
- 0,
608
- null,
609
- "0"
610
- ],
611
- [
612
- "mw",
613
- "265",
614
- 0,
615
- null,
616
- "0"
617
- ],
618
- [
619
- "my",
620
- "60",
621
- 0,
622
- null,
623
- "0"
624
- ],
625
- ["mv", "960"],
626
- ["ml", "223"],
627
- ["mt", "356"],
628
- [
629
- "mh",
630
- "692",
631
- 0,
632
- null,
633
- "1"
634
- ],
635
- [
636
- "mq",
637
- "596",
638
- 0,
639
- null,
640
- "0"
641
- ],
642
- ["mr", "222"],
643
- ["mu", "230"],
644
- [
645
- "yt",
646
- "262",
647
- 1,
648
- ["269", "639"],
649
- "0"
650
- ],
651
- ["mx", "52"],
652
- ["fm", "691"],
653
- [
654
- "md",
655
- "373",
656
- 0,
657
- null,
658
- "0"
659
- ],
660
- [
661
- "mc",
662
- "377",
663
- 0,
664
- null,
665
- "0"
666
- ],
667
- [
668
- "mn",
669
- "976",
670
- 0,
671
- null,
672
- "0"
673
- ],
674
- [
675
- "me",
676
- "382",
677
- 0,
678
- null,
679
- "0"
680
- ],
681
- [
682
- "ms",
683
- "1",
684
- 16,
685
- ["664"],
686
- "1"
687
- ],
688
- [
689
- "ma",
690
- "212",
691
- 0,
692
- ["6", "7"],
693
- "0"
694
- ],
695
- ["mz", "258"],
696
- [
697
- "mm",
698
- "95",
699
- 0,
700
- null,
701
- "0"
702
- ],
703
- [
704
- "na",
705
- "264",
706
- 0,
707
- null,
708
- "0"
709
- ],
710
- ["nr", "674"],
711
- [
712
- "np",
713
- "977",
714
- 0,
715
- null,
716
- "0"
717
- ],
718
- [
719
- "nl",
720
- "31",
721
- 0,
722
- null,
723
- "0"
724
- ],
725
- ["nc", "687"],
726
- [
727
- "nz",
728
- "64",
729
- 0,
730
- null,
731
- "0"
732
- ],
733
- ["ni", "505"],
734
- ["ne", "227"],
735
- [
736
- "ng",
737
- "234",
738
- 0,
739
- null,
740
- "0"
741
- ],
742
- ["nu", "683"],
743
- ["nf", "672"],
744
- [
745
- "kp",
746
- "850",
747
- 0,
748
- null,
749
- "0"
750
- ],
751
- [
752
- "mk",
753
- "389",
754
- 0,
755
- null,
756
- "0"
757
- ],
758
- [
759
- "mp",
760
- "1",
761
- 17,
762
- ["670"],
763
- "1"
764
- ],
765
- [
766
- "no",
767
- "47",
768
- 0,
769
- ["4", "9"]
770
- ],
771
- ["om", "968"],
772
- [
773
- "pk",
774
- "92",
775
- 0,
776
- null,
777
- "0"
778
- ],
779
- ["pw", "680"],
780
- [
781
- "ps",
782
- "970",
783
- 0,
784
- null,
785
- "0"
786
- ],
787
- ["pa", "507"],
788
- ["pg", "675"],
789
- [
790
- "py",
791
- "595",
792
- 0,
793
- null,
794
- "0"
795
- ],
796
- [
797
- "pe",
798
- "51",
799
- 0,
800
- null,
801
- "0"
802
- ],
803
- [
804
- "ph",
805
- "63",
806
- 0,
807
- null,
808
- "0"
809
- ],
810
- ["pl", "48"],
811
- ["pt", "351"],
812
- [
813
- "pr",
814
- "1",
815
- 3,
816
- ["787", "939"],
817
- "1"
818
- ],
819
- ["qa", "974"],
820
- [
821
- "re",
822
- "262",
823
- 0,
824
- null,
825
- "0"
826
- ],
827
- [
828
- "ro",
829
- "40",
830
- 0,
831
- null,
832
- "0"
833
- ],
834
- [
835
- "ru",
836
- "7",
837
- 0,
838
- ["33"],
839
- "8"
840
- ],
841
- [
842
- "rw",
843
- "250",
844
- 0,
845
- null,
846
- "0"
847
- ],
848
- ["ws", "685"],
849
- ["sm", "378"],
850
- ["st", "239"],
851
- [
852
- "sa",
853
- "966",
854
- 0,
855
- null,
856
- "0"
857
- ],
858
- ["sn", "221"],
859
- [
860
- "rs",
861
- "381",
862
- 0,
863
- null,
864
- "0"
865
- ],
866
- ["sc", "248"],
867
- [
868
- "sl",
869
- "232",
870
- 0,
871
- null,
872
- "0"
873
- ],
874
- ["sg", "65"],
875
- [
876
- "sx",
877
- "1",
878
- 21,
879
- ["721"],
880
- "1"
881
- ],
882
- [
883
- "sk",
884
- "421",
885
- 0,
886
- null,
887
- "0"
888
- ],
889
- [
890
- "si",
891
- "386",
892
- 0,
893
- null,
894
- "0"
895
- ],
896
- ["sb", "677"],
897
- [
898
- "so",
899
- "252",
900
- 0,
901
- null,
902
- "0"
903
- ],
904
- [
905
- "za",
906
- "27",
907
- 0,
908
- null,
909
- "0"
910
- ],
911
- [
912
- "kr",
913
- "82",
914
- 0,
915
- null,
916
- "0"
917
- ],
918
- [
919
- "ss",
920
- "211",
921
- 0,
922
- null,
923
- "0"
924
- ],
925
- ["es", "34"],
926
- [
927
- "lk",
928
- "94",
929
- 0,
930
- null,
931
- "0"
932
- ],
933
- [
934
- "bl",
935
- "590",
936
- 1,
937
- null,
938
- "0"
939
- ],
940
- ["sh", "290"],
941
- [
942
- "kn",
943
- "1",
944
- 18,
945
- ["869"],
946
- "1"
947
- ],
948
- [
949
- "lc",
950
- "1",
951
- 19,
952
- ["758"],
953
- "1"
954
- ],
955
- [
956
- "mf",
957
- "590",
958
- 2,
959
- null,
960
- "0"
961
- ],
962
- [
963
- "pm",
964
- "508",
965
- 0,
966
- null,
967
- "0"
968
- ],
969
- [
970
- "vc",
971
- "1",
972
- 20,
973
- ["784"],
974
- "1"
975
- ],
976
- [
977
- "sd",
978
- "249",
979
- 0,
980
- null,
981
- "0"
982
- ],
983
- ["sr", "597"],
984
- [
985
- "sj",
986
- "47",
987
- 1,
988
- [
989
- "4",
990
- "79",
991
- "9"
992
- ]
993
- ],
994
- [
995
- "se",
996
- "46",
997
- 0,
998
- null,
999
- "0"
1000
- ],
1001
- [
1002
- "ch",
1003
- "41",
1004
- 0,
1005
- null,
1006
- "0"
1007
- ],
1008
- [
1009
- "sy",
1010
- "963",
1011
- 0,
1012
- null,
1013
- "0"
1014
- ],
1015
- [
1016
- "tw",
1017
- "886",
1018
- 0,
1019
- null,
1020
- "0"
1021
- ],
1022
- ["tj", "992"],
1023
- [
1024
- "tz",
1025
- "255",
1026
- 0,
1027
- null,
1028
- "0"
1029
- ],
1030
- [
1031
- "th",
1032
- "66",
1033
- 0,
1034
- null,
1035
- "0"
1036
- ],
1037
- ["tl", "670"],
1038
- ["tg", "228"],
1039
- ["tk", "690"],
1040
- ["to", "676"],
1041
- [
1042
- "tt",
1043
- "1",
1044
- 22,
1045
- ["868"],
1046
- "1"
1047
- ],
1048
- ["tn", "216"],
1049
- [
1050
- "tr",
1051
- "90",
1052
- 0,
1053
- null,
1054
- "0"
1055
- ],
1056
- [
1057
- "tm",
1058
- "993",
1059
- 0,
1060
- null,
1061
- "8"
1062
- ],
1063
- [
1064
- "tc",
1065
- "1",
1066
- 23,
1067
- ["649"],
1068
- "1"
1069
- ],
1070
- ["tv", "688"],
1071
- [
1072
- "vi",
1073
- "1",
1074
- 24,
1075
- ["340"],
1076
- "1"
1077
- ],
1078
- [
1079
- "ug",
1080
- "256",
1081
- 0,
1082
- null,
1083
- "0"
1084
- ],
1085
- [
1086
- "ua",
1087
- "380",
1088
- 0,
1089
- null,
1090
- "0"
1091
- ],
1092
- [
1093
- "ae",
1094
- "971",
1095
- 0,
1096
- null,
1097
- "0"
1098
- ],
1099
- [
1100
- "gb",
1101
- "44",
1102
- 0,
1103
- null,
1104
- "0"
1105
- ],
1106
- [
1107
- "us",
1108
- "1",
1109
- 0,
1110
- null,
1111
- "1"
1112
- ],
1113
- [
1114
- "uy",
1115
- "598",
1116
- 0,
1117
- null,
1118
- "0"
1119
- ],
1120
- ["uz", "998"],
1121
- ["vu", "678"],
1122
- [
1123
- "va",
1124
- "39",
1125
- 1,
1126
- ["06698", "3"]
1127
- ],
1128
- [
1129
- "ve",
1130
- "58",
1131
- 0,
1132
- null,
1133
- "0"
1134
- ],
1135
- [
1136
- "vn",
1137
- "84",
1138
- 0,
1139
- null,
1140
- "0"
1141
- ],
1142
- ["wf", "681"],
1143
- [
1144
- "eh",
1145
- "212",
1146
- 1,
1147
- [
1148
- "5288",
1149
- "5289",
1150
- "6",
1151
- "7"
1152
- ],
1153
- "0"
1154
- ],
1155
- [
1156
- "ye",
1157
- "967",
1158
- 0,
1159
- null,
1160
- "0"
1161
- ],
1162
- [
1163
- "zm",
1164
- "260",
1165
- 0,
1166
- null,
1167
- "0"
1168
- ],
1169
- [
1170
- "zw",
1171
- "263",
1172
- 0,
1173
- null,
1174
- "0"
1175
- ]
1176
- ], f = [];
1177
- for (let e of d) f.push({
1178
- name: "",
1179
- iso2: e[0],
1180
- dialCode: e[1],
1181
- priority: e[2] || 0,
1182
- areaCodes: e[3] || null,
1183
- nationalPrefix: e[4] || null
1184
- });
1185
- var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1186
- OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
1187
- CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
1188
- COUNTRY_CHANGE: "countrychange",
1189
- INPUT: "input",
1190
- STRICT_REJECT: "strict:reject"
1191
- }, _ = {
1192
- HIDE: "iti__hide",
1193
- V_HIDE: "iti__v-hide",
1194
- ARROW_UP: "iti__arrow--up",
1195
- GLOBE: "iti__globe",
1196
- FLAG: "iti__flag",
1197
- LOADING: "iti__loading",
1198
- COUNTRY_ITEM: "iti__country",
1199
- HIGHLIGHT: "iti__highlight"
1200
- }, v = {
1201
- ARROW_UP: "ArrowUp",
1202
- ARROW_DOWN: "ArrowDown",
1203
- SPACE: " ",
1204
- ENTER: "Enter",
1205
- ESC: "Escape",
1206
- TAB: "Tab"
1207
- }, y = {
1208
- PASTE: "insertFromPaste",
1209
- DELETE_FORWARD: "deleteContentForward"
1210
- }, b = {
1211
- ALPHA_UNICODE: /\p{L}/u,
1212
- NON_PLUS_NUMERIC: /[^+0-9]/,
1213
- NON_PLUS_NUMERIC_GLOBAL: /[^+0-9]/g,
1214
- HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
1215
- }, x = {
1216
- SEARCH_DEBOUNCE_MS: 100,
1217
- HIDDEN_SEARCH_RESET_MS: 1e3,
1218
- NEXT_TICK: 0
1219
- }, S = {
1220
- UNKNOWN_NUMBER_TYPE: -99,
1221
- UNKNOWN_VALIDATION_ERROR: -99
1222
- }, C = {
1223
- NARROW_VIEWPORT_WIDTH: 500,
1224
- FALLBACK_SELECTED_WITH_DIAL_WIDTH: 78,
1225
- FALLBACK_SELECTED_NO_DIAL_WIDTH: 42,
1226
- INPUT_PADDING_EXTRA_LEFT: 6,
1227
- DROPDOWN_MARGIN: 3,
1228
- FALLBACK_DROPDOWN_HEIGHT: 200
1229
- }, w = {
1230
- PLUS: "+",
1231
- NANP: "1"
1232
- }, T = {
1233
- ISO2: "gb",
1234
- DIAL_CODE: "44",
1235
- MOBILE_PREFIX: "7",
1236
- MOBILE_CORE_LENGTH: 10
1237
- }, E = {
1238
- ISO2: "us",
1239
- DIAL_CODE: "1"
1240
- }, D = {
1241
- AGGRESSIVE: "aggressive",
1242
- POLITE: "polite",
1243
- OFF: "off"
1244
- }, O = { AUTO: "auto" }, k = new Set([
1245
- "FIXED_LINE",
1246
- "MOBILE",
1247
- "FIXED_LINE_OR_MOBILE",
1248
- "TOLL_FREE",
1249
- "PREMIUM_RATE",
1250
- "SHARED_COST",
1251
- "VOIP",
1252
- "PERSONAL_NUMBER",
1253
- "PAGER",
1254
- "UAN",
1255
- "VOICEMAIL",
1256
- "UNKNOWN"
1257
- ]), A = {
1258
- ISO2: "countryCode",
1259
- DIAL_CODE: "dialCode",
1260
- INSTANCE_ID: "intlTelInputId"
1261
- }, j = {
1262
- EXPANDED: "aria-expanded",
1263
- LABEL: "aria-label",
1264
- SELECTED: "aria-selected",
1265
- ACTIVE_DESCENDANT: "aria-activedescendant",
1266
- HASPOPUP: "aria-haspopup",
1267
- CONTROLS: "aria-controls",
1268
- HIDDEN: "aria-hidden",
1269
- AUTOCOMPLETE: "aria-autocomplete",
1270
- MODAL: "aria-modal"
1271
- }, M = {
1272
- selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
1273
- noCountrySelected: "Select country for phone number",
1274
- countryListAriaLabel: "List of countries",
1275
- searchPlaceholder: "Search",
1276
- clearSearchAriaLabel: "Clear search",
1277
- searchEmptyState: "No results found",
1278
- searchSummaryAria(e) {
1279
- return e === 0 ? "No results found" : e === 1 ? "1 result found" : `${e} results found`;
1280
- }
1281
- }, N = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, P = () => N(`(max-width: ${C.NARROW_VIEWPORT_WIDTH}px)`), F = {
1282
- allowDropdown: !0,
1283
- allowedNumberTypes: ["MOBILE", "FIXED_LINE"],
1284
- allowNumberExtensions: !1,
1285
- allowPhonewords: !1,
1286
- autoPlaceholder: D.POLITE,
1287
- containerClass: "",
1288
- countryNameLocale: "en",
1289
- countryOrder: null,
1290
- countrySearch: !0,
1291
- customPlaceholder: null,
1292
- dropdownAlwaysOpen: !1,
1293
- dropdownContainer: null,
1294
- excludeCountries: null,
1295
- fixDropdownWidth: !0,
1296
- formatAsYouType: !0,
1297
- formatOnDisplay: !0,
1298
- geoIpLookup: null,
1299
- hiddenInput: null,
1300
- i18n: {},
1301
- initialCountry: "",
1302
- loadUtils: null,
1303
- nationalMode: !0,
1304
- onlyCountries: null,
1305
- placeholderNumberType: "MOBILE",
1306
- searchInputClass: "",
1307
- separateDialCode: !1,
1308
- strictRejectAnimation: !1,
1309
- showFlags: !0,
1310
- strictMode: !1,
1311
- useFullscreenPopup: (() => {
1312
- if (typeof navigator < "u" && typeof window < "u") {
1313
- let e = N("(max-height: 600px)"), t = N("(pointer: coarse)");
1314
- return P() || t && e;
1315
- }
1316
- return !1;
1317
- })()
1318
- }, I = (e) => JSON.stringify(e), L = (e) => !!e && typeof e == "object" && !Array.isArray(e), ee = (e) => typeof e == "function", te = (e) => {
1319
- if (!e || typeof e != "object") return !1;
1320
- let t = e;
1321
- return t.nodeType === 1 && typeof t.tagName == "string" && typeof t.appendChild == "function";
1322
- }, R = new Set(Object.values(D)), z = (e) => {
1323
- console.warn(`[intl-tel-input] ${e}`);
1324
- }, B = (e, t, n) => {
1325
- z(`Option '${e}' must be ${t}; got ${I(n)}. Ignoring.`);
1326
- }, V = (e, t) => {
1327
- let n = "an array of iso2 country code strings";
1328
- if (!Array.isArray(t)) return B(e, n, t), !1;
1329
- let r = [];
1330
- for (let i of t) {
1331
- if (typeof i != "string") return B(e, n, t), !1;
1332
- m(i.toLowerCase()) ? r.push(i) : z(`Invalid iso2 code in '${e}': '${i}'. Skipping.`);
1333
- }
1334
- return r;
1335
- }, ne = (e) => {
1336
- if (e === void 0) return {};
1337
- if (!L(e)) return z(`The second argument must be an options object; got ${I(e)}. Using defaults.`), {};
1338
- let t = {};
1339
- for (let [n, r] of Object.entries(e)) {
1340
- if (!Object.hasOwn(F, n)) {
1341
- z(`Unknown option '${n}'. Ignoring.`);
1342
- continue;
1343
- }
1344
- switch (n) {
1345
- case "allowDropdown":
1346
- case "allowNumberExtensions":
1347
- case "allowPhonewords":
1348
- case "countrySearch":
1349
- case "dropdownAlwaysOpen":
1350
- case "fixDropdownWidth":
1351
- case "formatAsYouType":
1352
- case "formatOnDisplay":
1353
- case "nationalMode":
1354
- case "showFlags":
1355
- case "separateDialCode":
1356
- case "strictMode":
1357
- case "strictRejectAnimation":
1358
- case "useFullscreenPopup":
1359
- if (typeof r != "boolean") {
1360
- B(n, "a boolean", r);
1361
- break;
1362
- }
1363
- t[n] = r;
1364
- break;
1365
- case "autoPlaceholder":
1366
- if (typeof r != "string" || !R.has(r)) {
1367
- B("autoPlaceholder", `one of ${Array.from(R).join(", ")}`, r);
1368
- break;
1369
- }
1370
- t[n] = r;
1371
- break;
1372
- case "containerClass":
1373
- case "searchInputClass":
1374
- case "countryNameLocale":
1375
- if (typeof r != "string") {
1376
- B(n, "a string", r);
1377
- break;
1378
- }
1379
- t[n] = r;
1380
- break;
1381
- case "countryOrder":
1382
- if (r === null) t[n] = r;
1383
- else {
1384
- let e = V(n, r);
1385
- e !== !1 && (t[n] = e);
1386
- }
1387
- break;
1388
- case "customPlaceholder":
1389
- case "geoIpLookup":
1390
- case "hiddenInput":
1391
- case "loadUtils":
1392
- if (r !== null && !ee(r)) {
1393
- B(n, "a function or null", r);
1394
- break;
1395
- }
1396
- t[n] = r;
1397
- break;
1398
- case "dropdownContainer":
1399
- if (r !== null && !te(r)) {
1400
- B("dropdownContainer", "an HTMLElement or null", r);
1401
- break;
1402
- }
1403
- t[n] = r;
1404
- break;
1405
- case "excludeCountries":
1406
- case "onlyCountries":
1407
- if (r === null) t[n] = r;
1408
- else {
1409
- let e = V(n, r);
1410
- e !== !1 && (t[n] = e);
1411
- }
1412
- break;
1413
- case "i18n":
1414
- if (r && !L(r)) {
1415
- B("i18n", "an object", r);
1416
- break;
1417
- }
1418
- t[n] = r;
1419
- break;
1420
- case "initialCountry": {
1421
- if (typeof r != "string") {
1422
- B("initialCountry", "a string", r);
1423
- break;
1424
- }
1425
- let e = r.toLowerCase();
1426
- if (e && e !== O.AUTO && !m(e)) {
1427
- B("initialCountry", "a valid iso2 country code or 'auto'", r);
1428
- break;
1429
- }
1430
- t[n] = r;
1431
- break;
1432
- }
1433
- case "placeholderNumberType":
1434
- if (typeof r != "string" || !k.has(r)) {
1435
- B("placeholderNumberType", `one of ${Array.from(k).join(", ")}`, r);
1436
- break;
1437
- }
1438
- t[n] = r;
1439
- break;
1440
- case "allowedNumberTypes":
1441
- if (r !== null) {
1442
- if (!Array.isArray(r)) {
1443
- B("allowedNumberTypes", "an array of number types or null", r);
1444
- break;
1445
- }
1446
- let e = !0;
1447
- for (let t of r) if (typeof t != "string" || !k.has(t)) {
1448
- B("allowedNumberTypes", `an array of valid number types (${Array.from(k).join(", ")})`, t), e = !1;
1449
- break;
1450
- }
1451
- e && (t[n] = r);
1452
- } else t[n] = null;
1453
- break;
1454
- }
1455
- }
1456
- return t;
1457
- }, re = (e) => {
1458
- 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());
1459
- }, ie = (e) => {
1460
- 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 = {
1461
- ...M,
1462
- ...e.i18n
1463
- };
1464
- }, 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) => {
1465
- let r = document.createElement(e);
1466
- return t && Object.entries(t).forEach(([e, t]) => r.setAttribute(e, t)), n && n.appendChild(r), r;
1467
- }, ae = () => `
1468
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${j.HIDDEN}="true">
1469
- <circle cx="11" cy="11" r="7" />
1470
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
1471
- </svg>`, oe = (e) => {
1472
- let t = `iti-${e}-clear-mask`;
1473
- return `
1474
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${j.HIDDEN}="true" focusable="false">
1475
- <mask id="${t}" maskUnits="userSpaceOnUse">
1476
- <rect width="16" height="16" fill="white" />
1477
- <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" />
1478
- </mask>
1479
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
1480
- </svg>`;
1481
- }, se = () => `
1482
- <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${j.HIDDEN}="true">
1483
- <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"/>
1484
- </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) => {
1485
- let t = /* @__PURE__ */ new Map();
1486
- for (let n of e) {
1487
- let e = U(n.name), r = e.split(/[^a-z]/).map((e) => e[0]).join("");
1488
- t.set(n.iso2, {
1489
- normalisedName: e,
1490
- initials: r,
1491
- dialCodePlus: `+${n.dialCode}`
1492
- });
1493
- }
1494
- return t;
1495
- }, le = (e, t, n) => {
1496
- let r = U(n), i = [], a = [], o = [], s = [], c = [], l = [];
1497
- for (let n of e) {
1498
- let e = t.get(n.iso2);
1499
- n.iso2 === r ? i.push(n) : e.normalisedName.startsWith(r) ? a.push(n) : e.normalisedName.includes(r) ? o.push(n) : r === n.dialCode || r === e.dialCodePlus ? s.push(n) : e.dialCodePlus.includes(r) ? c.push(n) : e.initials.includes(r) && l.push(n);
1500
- }
1501
- let u = (e, t) => e.priority - t.priority;
1502
- return [
1503
- ...i,
1504
- ...a,
1505
- ...o,
1506
- ...s.sort(u),
1507
- ...c.sort(u),
1508
- ...l
1509
- ];
1510
- }, ue = (e, t, n) => {
1511
- let r = U(n);
1512
- for (let n of e) {
1513
- let { normalisedName: e } = t.get(n.iso2);
1514
- if (e.startsWith(r)) return n;
1515
- }
1516
- return null;
1517
- }, q = class e {
1518
- #e;
1519
- static toAscii(e) {
1520
- return e ? e.replace(/[٠-٩]/g, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - 1632))).replace(/[۰-۹]/g, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - 1776))) : "";
1521
- }
1522
- constructor(e) {
1523
- e && this.#t(e);
1524
- }
1525
- #t(e) {
1526
- /[٠-٩]/.test(e) ? this.#e = "arabic-indic" : /[۰-۹]/.test(e) ? this.#e = "persian" : this.#e = "ascii";
1527
- }
1528
- denormalise(e) {
1529
- if (!this.#e || this.#e === "ascii") return e;
1530
- let t = this.#e === "arabic-indic" ? 1632 : 1776;
1531
- return e.replace(/[0-9]/g, (e) => String.fromCharCode(t + Number(e)));
1532
- }
1533
- normalise(t) {
1534
- return t ? (this.#t(t), this.#e === "ascii" ? t : e.toAscii(t)) : "";
1535
- }
1536
- isAscii() {
1537
- return !this.#e || this.#e === "ascii";
1538
- }
1539
- }, J = class e {
1540
- #e;
1541
- #t;
1542
- #n;
1543
- #r = "";
1544
- #i;
1545
- #a;
1546
- #o = null;
1547
- #s;
1548
- #c;
1549
- #l;
1550
- #u;
1551
- #d;
1552
- #f;
1553
- #p;
1554
- #m;
1555
- #h;
1556
- #g;
1557
- #_;
1558
- #v;
1559
- #y;
1560
- #b;
1561
- #x;
1562
- #S;
1563
- #C = null;
1564
- #w = null;
1565
- #T = /* @__PURE__ */ new Map();
1566
- #E = null;
1567
- telInputEl;
1568
- hadInitialPlaceholder;
1569
- constructor(e, t, n) {
1570
- 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;
1571
- }
1572
- static validateInput(e) {
1573
- let t = e?.tagName;
1574
- if (!(e && typeof e == "object" && t === "INPUT" && typeof e.setAttribute == "function")) {
1575
- let t = Object.prototype.toString.call(e);
1576
- throw TypeError(`The first argument must be an HTMLInputElement, not ${t}`);
1577
- }
1578
- }
1579
- buildMarkup(e, t) {
1580
- 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");
1581
- let n = this.#D();
1582
- this.#O(n), n.appendChild(this.telInputEl), this.#j(), this.#M(n), this.ensureDropdownWidthSet();
1583
- }
1584
- #D() {
1585
- let { allowDropdown: e, showFlags: t, containerClass: n, useFullscreenPopup: r } = this.#e, i = G("div", { class: W({
1586
- iti: !0,
1587
- "iti--allow-dropdown": e,
1588
- "iti--show-flags": t,
1589
- "iti--inline-dropdown": !r,
1590
- [n]: !!n
1591
- }) });
1592
- return this.#n && i.setAttribute("dir", "ltr"), this.telInputEl.before(i), i;
1593
- }
1594
- #O(e) {
1595
- let { allowDropdown: t, separateDialCode: n, showFlags: r } = this.#e;
1596
- if (!t && !r && !n) return;
1597
- this.#c = G("div", { class: `iti__country-container ${_.V_HIDE}` }, e), t ? (this.#l = G("button", {
1598
- type: "button",
1599
- class: "iti__selected-country",
1600
- [j.EXPANDED]: "false",
1601
- [j.LABEL]: this.#e.i18n.noCountrySelected,
1602
- [j.HASPOPUP]: "dialog",
1603
- [j.CONTROLS]: `iti-${this.#t}__dropdown-content`
1604
- }, this.#c), this.telInputEl.disabled && this.#l.setAttribute("disabled", "true")) : this.#l = G("div", { class: "iti__selected-country" }, this.#c);
1605
- let i = G("div", { class: "iti__selected-country-primary" }, this.#l);
1606
- this.#u = G("div", { class: _.FLAG }, i), t && (this.#f = G("div", {
1607
- class: "iti__arrow",
1608
- [j.HIDDEN]: "true"
1609
- }, i)), n && (this.#d = G("div", { class: "iti__selected-dial-code" }, this.#l)), t && this.#k();
1610
- }
1611
- ensureDropdownWidthSet() {
1612
- let { fixDropdownWidth: e, allowDropdown: t } = this.#e;
1613
- if (!t || !e || this.#p.style.width) return;
1614
- let n = this.telInputEl.offsetWidth;
1615
- n > 0 && (this.#p.style.width = `${n}px`);
1616
- }
1617
- #k() {
1618
- let { fixDropdownWidth: e, useFullscreenPopup: t, countrySearch: n, i18n: r, dropdownContainer: i, containerClass: a } = this.#e, o = e ? "" : "iti--flexible-dropdown-width";
1619
- this.#p = G("div", {
1620
- id: `iti-${this.#t}__dropdown-content`,
1621
- class: `iti__dropdown-content ${_.HIDE} ${o}`,
1622
- role: "dialog",
1623
- [j.MODAL]: "true"
1624
- }), this.#n && this.#p.setAttribute("dir", "rtl"), n && this.#A(), this.#_ = G("ul", {
1625
- class: "iti__country-list",
1626
- id: `iti-${this.#t}__country-listbox`,
1627
- role: "listbox",
1628
- [j.LABEL]: r.countryListAriaLabel
1629
- }, this.#p), this.#N(), n && this.#R(), t || (this.#s = this.#L(), n && (this.#p.style.height = `${this.#s}px`)), i ? (this.#S = G("div", { class: W({
1630
- iti: !0,
1631
- "iti--container": !0,
1632
- "iti--fullscreen-popup": t,
1633
- "iti--inline-dropdown": !t,
1634
- [a]: !!a
1635
- }) }), this.#S.appendChild(this.#p)) : this.#c.appendChild(this.#p);
1636
- }
1637
- #A() {
1638
- let { i18n: e, searchInputClass: t } = this.#e, n = G("div", { class: "iti__search-input-wrapper" }, this.#p);
1639
- this.#m = G("span", {
1640
- class: "iti__search-icon",
1641
- [j.HIDDEN]: "true"
1642
- }, n), this.#m.innerHTML = ae(), this.#h = G("input", {
1643
- id: `iti-${this.#t}__search-input`,
1644
- type: "search",
1645
- class: `iti__search-input ${t}`,
1646
- placeholder: e.searchPlaceholder,
1647
- role: "combobox",
1648
- [j.EXPANDED]: "true",
1649
- [j.LABEL]: e.searchPlaceholder,
1650
- [j.CONTROLS]: `iti-${this.#t}__country-listbox`,
1651
- [j.AUTOCOMPLETE]: "list",
1652
- autocomplete: "off"
1653
- }, n), this.#g = G("button", {
1654
- type: "button",
1655
- class: `iti__search-clear ${_.HIDE}`,
1656
- [j.LABEL]: e.clearSearchAriaLabel,
1657
- tabindex: "-1"
1658
- }, n), this.#g.innerHTML = oe(this.#t), this.#x = G("span", { class: "iti__a11y-text" }, this.#p), this.#b = G("div", {
1659
- class: `iti__no-results ${_.HIDE}`,
1660
- [j.HIDDEN]: "true"
1661
- }, this.#p), this.#b.textContent = e.searchEmptyState ?? null;
1662
- }
1663
- #j() {
1664
- this.#c && (this.#P(), this.#c.classList.remove(_.V_HIDE));
1665
- }
1666
- #M(e) {
1667
- let { hiddenInput: t } = this.#e;
1668
- if (!t) return;
1669
- let n = t(this.telInputEl.getAttribute("name") || "");
1670
- if (n.phone) {
1671
- let t = this.telInputEl.form?.querySelector(`input[name="${n.phone}"]`);
1672
- t ? this.#v = t : (this.#v = G("input", {
1673
- type: "hidden",
1674
- name: n.phone
1675
- }), e.appendChild(this.#v));
1676
- }
1677
- if (n.country) {
1678
- let t = this.telInputEl.form?.querySelector(`input[name="${n.country}"]`);
1679
- t ? this.#y = t : (this.#y = G("input", {
1680
- type: "hidden",
1681
- name: n.country
1682
- }), e.appendChild(this.#y));
1683
- }
1684
- }
1685
- #N() {
1686
- let e = document.createDocumentFragment();
1687
- for (let t = 0; t < this.#i.length; t++) {
1688
- let n = this.#i[t], r = W({ [_.COUNTRY_ITEM]: !0 }), i = G("li", {
1689
- id: `iti-${this.#t}__item-${n.iso2}`,
1690
- class: r,
1691
- tabindex: "-1",
1692
- role: "option",
1693
- [j.SELECTED]: "false"
1694
- });
1695
- i.dataset[A.DIAL_CODE] = n.dialCode, i.dataset[A.ISO2] = n.iso2, this.#T.set(n.iso2, i), this.#e.showFlags && G("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
1696
- let a = G("span", { class: "iti__country-name" }, i);
1697
- a.textContent = `${n.name} `;
1698
- let o = G("span", { class: "iti__dial-code" }, a);
1699
- this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${n.dialCode})`, e.appendChild(i);
1700
- }
1701
- this.#_.appendChild(e);
1702
- }
1703
- #P() {
1704
- if (this.#l) {
1705
- let e = this.#e.separateDialCode ? C.FALLBACK_SELECTED_WITH_DIAL_WIDTH : C.FALLBACK_SELECTED_NO_DIAL_WIDTH, t = (this.#l.offsetWidth || this.#I() || e) + C.INPUT_PADDING_EXTRA_LEFT;
1706
- this.telInputEl.style.paddingLeft = `${t}px`;
1707
- }
1708
- }
1709
- static #F() {
1710
- let e;
1711
- try {
1712
- e = window.top.document.body;
1713
- } catch {
1714
- e = document.body;
1715
- }
1716
- return e;
1717
- }
1718
- #I() {
1719
- if (!this.telInputEl.parentNode) return 0;
1720
- let t = e.#F(), n = this.telInputEl.parentNode.cloneNode(!1);
1721
- n.style.visibility = "hidden", t.appendChild(n);
1722
- let r = this.#c.cloneNode();
1723
- n.appendChild(r);
1724
- let i = this.#l.cloneNode(!0);
1725
- r.appendChild(i);
1726
- let a = i.offsetWidth;
1727
- return t.removeChild(n), a;
1728
- }
1729
- #L() {
1730
- let t = e.#F();
1731
- this.#p.classList.remove(_.HIDE);
1732
- let n = G("div", { class: "iti iti--inline-dropdown" });
1733
- n.appendChild(this.#p), n.style.visibility = "hidden", t.appendChild(n);
1734
- let r = this.#p.offsetHeight;
1735
- return t.removeChild(n), n.style.visibility = "", this.#p.classList.add(_.HIDE), r > 0 ? r : C.FALLBACK_DROPDOWN_HEIGHT;
1736
- }
1737
- #R() {
1738
- let { i18n: e } = this.#e, t = this.#_.childElementCount;
1739
- this.#x.textContent = e.searchSummaryAria(t);
1740
- }
1741
- #z(e) {
1742
- let t;
1743
- if (e === "") t = this.#i;
1744
- else {
1745
- let n = q.toAscii(e);
1746
- t = le(this.#i, this.#a, n);
1747
- }
1748
- this.#ee(t);
1749
- }
1750
- prefillSearchWithPlus() {
1751
- this.#h.value = "+", this.#h.focus(), this.#z("");
1752
- }
1753
- #B() {
1754
- let e = this.#h.value.trim();
1755
- this.#z(e), this.#h.value ? this.#g.classList.remove(_.HIDE) : this.#g.classList.add(_.HIDE);
1756
- }
1757
- #V() {
1758
- this.#o && clearTimeout(this.#o), this.#o = setTimeout(() => {
1759
- this.#B(), this.#o = null;
1760
- }, x.SEARCH_DEBOUNCE_MS);
1761
- }
1762
- #H() {
1763
- this.#h.value = "", this.#h.focus(), this.#B();
1764
- }
1765
- #U(e) {
1766
- let t = this.#_, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
1767
- r.top < n.top ? t.scrollTop = i : r.bottom > n.bottom && (t.scrollTop = i - n.height + r.height);
1768
- }
1769
- #W(e, t = !0) {
1770
- if (this.#w?.classList.remove(_.HIGHLIGHT), e) {
1771
- if (e.classList.add(_.HIGHLIGHT), this.#e.countrySearch) {
1772
- let t = e.getAttribute("id") || "";
1773
- this.#h.setAttribute(j.ACTIVE_DESCENDANT, t);
1774
- }
1775
- t && this.#U(e), this.#w = e;
1776
- } else this.#w = null;
1777
- }
1778
- bindHiddenInputSubmitListener(e, t, n) {
1779
- let r = this.telInputEl.form;
1780
- !r || !this.#v && !this.#y || r.addEventListener("submit", () => {
1781
- this.#v && (this.#v.value = t()), this.#y && (this.#y.value = n());
1782
- }, { signal: e });
1783
- }
1784
- bindAllInitialDropdownListeners(e, t, n) {
1785
- let r = this.telInputEl.closest("label");
1786
- r && r.addEventListener("click", (e) => {
1787
- this.isDropdownOpen() ? e.preventDefault() : this.telInputEl.focus();
1788
- }, { signal: e }), this.#l.addEventListener("click", () => {
1789
- !this.isDropdownOpen() && !this.telInputEl.disabled && !this.telInputEl.readOnly && t();
1790
- }, { signal: e }), this.#c.addEventListener("keydown", (e) => {
1791
- let r = [
1792
- v.ARROW_UP,
1793
- v.ARROW_DOWN,
1794
- v.SPACE,
1795
- v.ENTER
1796
- ];
1797
- !this.isDropdownOpen() && r.includes(e.key) && (e.preventDefault(), e.stopPropagation(), t()), e.key === v.TAB && n();
1798
- }, { signal: e });
1799
- }
1800
- openDropdown(e, t) {
1801
- let { countrySearch: n, dropdownAlwaysOpen: r, dropdownContainer: i } = this.#e;
1802
- if (this.#E = new AbortController(), this.ensureDropdownWidthSet(), i) this.#ne();
1803
- else {
1804
- let e = this.#te(), t = this.telInputEl.offsetHeight + C.DROPDOWN_MARGIN;
1805
- e ? this.#p.style.top = `${t}px` : this.#p.style.bottom = `${t}px`;
1806
- }
1807
- this.#p.classList.remove(_.HIDE), this.#l.setAttribute(j.EXPANDED, "true");
1808
- let a = this.#C ?? this.#_.firstElementChild;
1809
- a && this.#W(a), n && !r && this.#h.focus(), this.#e.useFullscreenPopup && this.#S && window.visualViewport && window.visualViewport.addEventListener("resize", () => {
1810
- this.#re(), this.#w && this.#U(this.#w);
1811
- }, { signal: this.#E.signal }), this.#f.classList.add(_.ARROW_UP), this.#G(e, t);
1812
- }
1813
- #G(e, t) {
1814
- let n = this.#E.signal;
1815
- this.#K(n), this.#q(n, e), this.#e.dropdownAlwaysOpen || this.#J(n, t), this.#Y(n, e, t), this.#e.countrySearch && this.#X(n), !this.#e.useFullscreenPopup && this.#e.dropdownContainer && window.addEventListener("scroll", t, { signal: n });
1816
- }
1817
- #K(e) {
1818
- this.#_.addEventListener("mouseover", (e) => {
1819
- let t = e.target?.closest(`.${_.COUNTRY_ITEM}`);
1820
- t && this.#W(t, !1);
1821
- }, { signal: e });
1822
- }
1823
- #q(e, t) {
1824
- this.#_.addEventListener("click", (e) => {
1825
- let n = e.target?.closest(`.${_.COUNTRY_ITEM}`);
1826
- n && t(n);
1827
- }, { signal: e });
1828
- }
1829
- #J(e, t) {
1830
- setTimeout(() => {
1831
- document.documentElement.addEventListener("click", (e) => {
1832
- this.#p.contains(e.target) || t();
1833
- }, { signal: e });
1834
- }, 0);
1835
- }
1836
- #Y(e, t, n) {
1837
- let r = "", i = null;
1838
- document.addEventListener("keydown", (e) => {
1839
- [
1840
- v.ARROW_UP,
1841
- v.ARROW_DOWN,
1842
- v.ENTER,
1843
- v.ESC
1844
- ].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key === v.ARROW_UP || e.key === v.ARROW_DOWN ? this.#Q(e.key) : e.key === v.ENTER && !e.isComposing ? t(this.#w) : e.key === v.ESC && (n(), this.#l.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.#Z(r), i = setTimeout(() => {
1845
- r = "";
1846
- }, x.HIDDEN_SEARCH_RESET_MS));
1847
- }, { signal: e });
1848
- }
1849
- #X(e) {
1850
- this.#h.addEventListener("input", () => this.#V(), { signal: e }), this.#g.addEventListener("click", () => this.#H(), { signal: e });
1851
- }
1852
- #Z(e) {
1853
- let t = ue(this.#i, this.#a, e);
1854
- if (t) {
1855
- let e = this.#T.get(t.iso2);
1856
- this.#W(e);
1857
- }
1858
- }
1859
- #Q(e) {
1860
- let t = e === v.ARROW_UP ? this.#w?.previousElementSibling : this.#w?.nextElementSibling;
1861
- !t && this.#_.childElementCount > 1 && (t = e === v.ARROW_UP ? this.#_.lastElementChild : this.#_.firstElementChild), t && this.#W(t);
1862
- }
1863
- #$(e) {
1864
- if (this.#C && this.#C.dataset[A.ISO2] !== e && (this.#C.setAttribute(j.SELECTED, "false"), this.#C.querySelector(".iti__country-check")?.remove(), this.#C = null), e && !this.#C) {
1865
- let t = this.#_.querySelector(`[data-country-code="${e}"]`);
1866
- if (t) {
1867
- t.setAttribute(j.SELECTED, "true");
1868
- let e = G("span", {
1869
- class: "iti__country-check",
1870
- [j.HIDDEN]: "true"
1871
- }, t);
1872
- e.innerHTML = se(), this.#C = t, this.#e.dropdownAlwaysOpen && this.#W(t);
1873
- }
1874
- }
1875
- }
1876
- #ee(e) {
1877
- this.#_.replaceChildren();
1878
- let t = !0;
1879
- for (let n of e) {
1880
- let e = this.#T.get(n.iso2);
1881
- e && (this.#_.appendChild(e), t &&= (this.#W(e, !1), !1));
1882
- }
1883
- t ? (this.#W(null), this.#b && this.#b.classList.remove(_.HIDE)) : this.#b && this.#b.classList.add(_.HIDE), this.#_.scrollTop = 0, this.#R();
1884
- }
1885
- closeDropdown() {
1886
- let { countrySearch: e, dropdownContainer: t } = this.#e;
1887
- this.#E.abort(), this.#E = null, this.#p.classList.add(_.HIDE), this.#l.setAttribute(j.EXPANDED, "false"), e && (this.#h.removeAttribute(j.ACTIVE_DESCENDANT), this.#h.value = "", this.#B(), this.#w &&= (this.#w.classList.remove(_.HIGHLIGHT), null)), this.#f.classList.remove(_.ARROW_UP), t ? (this.#S.remove(), this.#S.style.top = "", this.#S.style.bottom = "", this.#S.style.paddingLeft = "", this.#S.style.paddingRight = "") : (this.#p.style.top = "", this.#p.style.bottom = "");
1888
- }
1889
- #te() {
1890
- if (this.#e.dropdownAlwaysOpen) return !0;
1891
- let e = this.telInputEl.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom;
1892
- return n >= this.#s || n >= t;
1893
- }
1894
- #ne() {
1895
- let { dropdownContainer: e, useFullscreenPopup: t } = this.#e;
1896
- if (t) {
1897
- if (window.innerWidth >= C.NARROW_VIEWPORT_WIDTH) {
1898
- let e = this.telInputEl.getBoundingClientRect();
1899
- this.#S.style.paddingLeft = `${e.left}px`, this.#S.style.paddingRight = `${window.innerWidth - e.right}px`;
1900
- }
1901
- } else {
1902
- let e = this.telInputEl.getBoundingClientRect();
1903
- this.#S.style.left = `${e.left}px`, this.#te() ? this.#S.style.top = `${e.bottom + C.DROPDOWN_MARGIN}px` : (this.#S.style.top = "unset", this.#S.style.bottom = `${window.innerHeight - e.top + C.DROPDOWN_MARGIN}px`);
1904
- }
1905
- e.appendChild(this.#S);
1906
- }
1907
- #re() {
1908
- let e = window.visualViewport;
1909
- if (!e || !this.#S) return;
1910
- let t = window.innerHeight - e.height;
1911
- this.#S.style.bottom = `${t}px`;
1912
- }
1913
- isDropdownOpen() {
1914
- return !this.#p.classList.contains(_.HIDE);
1915
- }
1916
- setLoading(e) {
1917
- this.#u.classList.toggle(_.LOADING, e);
1918
- }
1919
- isLoading() {
1920
- return this.#u.classList.contains(_.LOADING);
1921
- }
1922
- setDisabled(e) {
1923
- this.telInputEl.disabled = e, this.#l && (e ? this.#l.setAttribute("disabled", "true") : this.#l.removeAttribute("disabled"));
1924
- }
1925
- setReadonly(e) {
1926
- this.telInputEl.readOnly = e, this.#l && (e ? this.#l.setAttribute("disabled", "true") : this.#l.removeAttribute("disabled"));
1927
- }
1928
- setCountry(e) {
1929
- let { allowDropdown: t, showFlags: n, separateDialCode: r, i18n: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
1930
- if (t && this.#$(s), this.#l) {
1931
- let e = s && n ? `${_.FLAG} iti__${s}` : `${_.FLAG} ${_.GLOBE}`, t, r, c;
1932
- s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), c = n ? "" : K()) : (r = i.noCountrySelected, t = i.noCountrySelected, c = K()), this.#u.className = e, this.#l.setAttribute("title", r), this.#l.setAttribute(j.LABEL, t), this.#u.innerHTML = c;
1933
- }
1934
- if (r) {
1935
- let e = o ? `+${o}` : "";
1936
- this.#d.textContent = e, this.#P();
1937
- }
1938
- }
1939
- destroy() {
1940
- this.telInputEl.iti = void 0, delete this.telInputEl.dataset[A.INSTANCE_ID], this.telInputEl.style.paddingLeft = this.#r;
1941
- let e = this.telInputEl.parentNode;
1942
- e && (e.before(this.telInputEl), e.remove()), this.#T.clear();
1943
- }
1944
- }, de = (e) => {
1945
- let { onlyCountries: t, excludeCountries: n } = e;
1946
- return t?.length ? h.filter((e) => t.includes(e.iso2)) : n?.length ? h.filter((e) => !n.includes(e.iso2)) : [...h];
1947
- }, fe = (e, t) => {
1948
- let { countryNameLocale: n, i18n: r } = t, i;
1949
- try {
1950
- i = typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? new Intl.DisplayNames(n, { type: "region" }) : null;
1951
- } catch (e) {
1952
- console.error(e), i = null;
1953
- }
1954
- for (let t of e) t.name = r[t.iso2] || i?.of(t.iso2.toUpperCase()) || "";
1955
- }, pe = (e) => {
1956
- let t = /* @__PURE__ */ new Set(), n = 0, r = {}, i = (e, t) => {
1957
- if (!e || !t) return;
1958
- t.length > n && (n = t.length), Object.hasOwn(r, t) || (r[t] = []);
1959
- let i = r[t];
1960
- i.includes(e) || i.push(e);
1961
- }, a = [...e].sort((e, t) => e.priority - t.priority);
1962
- for (let e of a) {
1963
- t.has(e.dialCode) || t.add(e.dialCode);
1964
- for (let t = 1; t < e.dialCode.length; t++) {
1965
- let n = e.dialCode.substring(0, t);
1966
- i(e.iso2, n);
1967
- }
1968
- if (i(e.iso2, e.dialCode), e.areaCodes) {
1969
- let t = r[e.dialCode][0];
1970
- for (let n of e.areaCodes) {
1971
- for (let r = 1; r < n.length; r++) {
1972
- let a = n.substring(0, r), o = e.dialCode + a;
1973
- i(t, o), i(e.iso2, o);
1974
- }
1975
- i(e.iso2, e.dialCode + n);
1976
- }
1977
- }
1978
- }
1979
- return {
1980
- dialCodes: t,
1981
- dialCodeMaxLength: n,
1982
- dialCodeToIso2Map: r
1983
- };
1984
- }, me = (e, t) => {
1985
- let { countryOrder: n } = t;
1986
- e.sort((e, t) => {
1987
- if (n) {
1988
- let r = n.indexOf(e.iso2), i = n.indexOf(t.iso2), a = r > -1, o = i > -1;
1989
- if (a || o) return a && o ? r - i : a ? -1 : 1;
1990
- }
1991
- return e.name.localeCompare(t.name);
1992
- });
1993
- }, he = /* @__PURE__ */ new Set([
1994
- "800",
1995
- "808",
1996
- "870",
1997
- "881",
1998
- "882",
1999
- "883",
2000
- "888",
2001
- "979"
2002
- ]), Y = (e) => {
2003
- let t = H(e).slice(0, 3);
2004
- return e.startsWith("+") && he.has(t);
2005
- }, ge = (e, t, n, r) => {
2006
- if (!n || !t) return e;
2007
- let i = `+${r.dialCode}`, a = e[i.length] === " " || e[i.length] === "-" ? i.length + 1 : i.length;
2008
- return e.substring(a);
2009
- }, _e = (e, t, n, r, i) => {
2010
- let a = n ? n.formatNumberAsYouType(e, r?.iso2) : e, o = r?.dialCode;
2011
- return i && t.charAt(0) !== "+" && a.includes(`+${o}`) ? (a.split(`+${o}`)[1] || "").trim() : a;
2012
- }, ve = (e, t, n, r) => {
2013
- if (n === 0 && !r) return 0;
2014
- let i = 0;
2015
- for (let n = 0; n < t.length; n++) {
2016
- if (/[+0-9]/.test(t[n]) && i++, i === e && !r) return n + 1;
2017
- if (r && i === e + 1) return n;
2018
- }
2019
- return t.length;
2020
- }, ye = /* @__PURE__ */ new Set([
2021
- "800",
2022
- "822",
2023
- "833",
2024
- "844",
2025
- "855",
2026
- "866",
2027
- "877",
2028
- "880",
2029
- "881",
2030
- "882",
2031
- "883",
2032
- "884",
2033
- "885",
2034
- "886",
2035
- "887",
2036
- "888",
2037
- "889"
2038
- ]), be = (e) => {
2039
- let t = H(e);
2040
- if (t.startsWith(w.NANP) && t.length >= 4) {
2041
- let e = t.substring(1, 4);
2042
- return ye.has(e);
2043
- }
2044
- return !1;
2045
- }, xe = 0, X = (e) => {
2046
- if (!Q.utils) throw Error(`intlTelInput.utils is required for ${e}(). See: https://intl-tel-input.com/docs/utils`);
2047
- }, Se = () => {
2048
- let e, t;
2049
- return {
2050
- promise: new Promise((n, r) => {
2051
- e = n, t = r;
2052
- }),
2053
- resolve: e,
2054
- reject: t
2055
- };
2056
- }, Z = class e {
2057
- id;
2058
- promise;
2059
- #e;
2060
- #t;
2061
- #n;
2062
- #r;
2063
- #i;
2064
- #a;
2065
- #o;
2066
- #s;
2067
- #c;
2068
- #l = null;
2069
- #u = null;
2070
- #d;
2071
- #f = !0;
2072
- #p;
2073
- #m;
2074
- #h = !1;
2075
- #g;
2076
- #_;
2077
- constructor(e, t = {}) {
2078
- this.id = xe++, J.validateInput(e);
2079
- let n = ne(t);
2080
- this.#t = {
2081
- ...F,
2082
- ...n
2083
- }, re(this.#t), ie(this.#t), this.#e = new J(e, this.#t, this.id), this.#n = typeof navigator < "u" && /Android/i.test(navigator.userAgent), this.#m = new q(e.value), this.promise = this.#b(this.#t), this.#r = de(this.#t);
2084
- let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } = pe(this.#r);
2085
- this.#o = r, this.#i = i, this.#a = a, this.#s = new Map(this.#r.map((e) => [e.iso2, e])), this.#x();
2086
- }
2087
- #v() {
2088
- let e = this.#e.telInputEl.value.trim();
2089
- return this.#m.normalise(e);
2090
- }
2091
- #y(e) {
2092
- this.#e.telInputEl.value = this.#m.denormalise(e);
2093
- }
2094
- #b(e) {
2095
- let { initialCountry: t, geoIpLookup: n, loadUtils: r } = e, i = t === O.AUTO && !!n, a = !!r && !Q.utils;
2096
- return i && (this.#g = Se()), a && (this.#_ = Se()), Promise.all([this.#g?.promise, this.#_?.promise]).then(() => {});
2097
- }
2098
- #x() {
2099
- this.#p = new AbortController(), this.#S(), this.#e.buildMarkup(this.#r, this.#c), this.#C(), this.#w(), this.#T(), this.#t.dropdownAlwaysOpen && this.#U();
2100
- }
2101
- #S() {
2102
- fe(this.#r, this.#t), me(this.#r, this.#t), this.#c = ce(this.#r);
2103
- }
2104
- #C(e = !1) {
2105
- let t = this.#e.telInputEl.getAttribute("value"), n = this.#m.normalise(t ?? ""), r = this.#v(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#te(i), o = be(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);
2106
- a ? o ? f ? this.#Y(u) : d || this.#Y(E.ISO2) : (f && this.#Y(u), this.#G(i)) : f ? this.#Y(u) : d || this.#Y(""), i && this.#W(i);
2107
- }
2108
- #w() {
2109
- this.#k(), this.#t.allowDropdown && this.#e.bindAllInitialDropdownListeners(this.#p.signal, () => this.#U(), () => this.#$()), this.#e.bindHiddenInputSubmitListener(this.#p.signal, () => this.getNumber(), () => this.#l?.iso2 || "");
2110
- }
2111
- #T() {
2112
- if (this.#_) {
2113
- let { loadUtils: e } = this.#t, t = () => {
2114
- Q.attachUtils(e)?.catch(() => {});
2115
- };
2116
- Q.documentReady() ? t() : window.addEventListener("load", t, { signal: this.#p.signal });
2117
- }
2118
- this.#g && (this.#l ? this.#g.resolve() : this.#E());
2119
- }
2120
- #E() {
2121
- if (Q.autoCountry) {
2122
- this.#se();
2123
- return;
2124
- }
2125
- this.#e.setLoading(!0), !Q.startedLoadingAutoCountry && (Q.startedLoadingAutoCountry = !0, typeof this.#t.geoIpLookup == "function" && this.#t.geoIpLookup((t = "") => {
2126
- let n = t.toLowerCase();
2127
- m(n) ? (Q.autoCountry = n, setTimeout(() => e.forEachInstance("handleAutoCountryLoaded"))) : e.forEachInstance("handleAutoCountryFailure");
2128
- }, () => {
2129
- e.forEachInstance("handleAutoCountryFailure");
2130
- }));
2131
- }
2132
- #D() {
2133
- this.#U(), this.#e.prefillSearchWithPlus();
2134
- }
2135
- #O(e) {
2136
- let t = this.#e.telInputEl.selectionStart || 0, n = e.substring(0, t - 1), r = e.substring(t);
2137
- return this.#y(n + r), t - 1;
2138
- }
2139
- #k() {
2140
- this.#P(), this.#I(), this.#R();
2141
- }
2142
- #A(e) {
2143
- this.#O(e), this.#D();
2144
- }
2145
- #j(e, t) {
2146
- let n = this.#O(e);
2147
- this.#e.telInputEl.setSelectionRange(n, n), this.#V(), this.#H(g.STRICT_REJECT, {
2148
- source: "key",
2149
- rejectedInput: t,
2150
- reason: "invalid"
2151
- });
2152
- }
2153
- #M(e, t) {
2154
- let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(b.NON_PLUS_NUMERIC_GLOBAL, "").length, i = _e(this.#re(), e, Q.utils, this.#l, this.#t.separateDialCode), a = ve(r, i, n, t);
2155
- this.#y(i), this.#e.telInputEl.setSelectionRange(a, a);
2156
- }
2157
- #N(e) {
2158
- if (e.startsWith("+") && this.#l && this.#te(e)) {
2159
- let t = ge(e, !0, !0, this.#l);
2160
- this.#y(t);
2161
- }
2162
- }
2163
- #P() {
2164
- this.#h = b.ALPHA_UNICODE.test(this.#v()), this.#e.telInputEl.addEventListener("input", this.#F, { signal: this.#p.signal });
2165
- }
2166
- #F = (e) => {
2167
- let { strictMode: t, formatAsYouType: n, separateDialCode: r, allowDropdown: i, countrySearch: a } = this.#t, o = e?.detail;
2168
- if (o?.isCountryChange) return;
2169
- let s = this.#v();
2170
- if (this.#n && e?.data === "+" && r && i && a) {
2171
- this.#A(s);
2172
- return;
2173
- }
2174
- if (this.#n && t && (e?.data === " " || e?.data === "-" || e?.data === ".")) {
2175
- this.#j(s, e.data);
2176
- return;
2177
- }
2178
- this.#G(s) && this.#oe();
2179
- let c = e?.data && b.NON_PLUS_NUMERIC.test(e.data), l = e?.inputType === y.PASTE && s;
2180
- c || l && !t ? this.#h = !0 : b.NON_PLUS_NUMERIC.test(s) || (this.#h = !1), n && !this.#h && !o?.isSetNumber && this.#m.isAscii() && this.#M(s, e?.inputType === y.DELETE_FORWARD), r && this.#N(s);
2181
- };
2182
- #I() {
2183
- let { strictMode: e, separateDialCode: t } = this.#t;
2184
- !e && !t || this.#e.telInputEl.addEventListener("keydown", this.#L, { signal: this.#p.signal });
2185
- }
2186
- #L = (e) => {
2187
- let { strictMode: t, separateDialCode: n, allowDropdown: r, countrySearch: i } = this.#t;
2188
- if (!e.key || e.key.length !== 1 || e.altKey || e.ctrlKey || e.metaKey) return;
2189
- if (n && r && i && e.key === "+") {
2190
- e.preventDefault(), this.#D();
2191
- return;
2192
- }
2193
- if (!t) return;
2194
- let a = this.#v(), o = !a.startsWith("+") && this.#e.telInputEl.selectionStart === 0 && e.key === "+", s = this.#m.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.#ne(h), v = !1;
2195
- Q.utils && this.#u && (v = Q.utils.getCoreNumber(_, this.#l?.iso2).length > this.#u);
2196
- let y = this.#q(_) !== null;
2197
- (!l || v && !y && !o) && (this.#V(), this.#H(g.STRICT_REJECT, {
2198
- source: "key",
2199
- rejectedInput: e.key,
2200
- reason: l ? "max-length" : "invalid"
2201
- }), e.preventDefault());
2202
- };
2203
- #R() {
2204
- this.#t.strictMode && this.#e.telInputEl.addEventListener("paste", this.#z, { signal: this.#p.signal });
2205
- }
2206
- #z = (e) => {
2207
- e.preventDefault();
2208
- let t = this.#e.telInputEl, n = t.selectionStart, r = t.selectionEnd, i = this.#v(), a = i.slice(0, n ?? void 0), o = i.slice(r ?? void 0), s = this.#l?.iso2, c = e.clipboardData.getData("text"), l = this.#m.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";
2209
- if (_.length > 30) {
2210
- this.#V(), this.#H(g.STRICT_REJECT, {
2211
- source: "paste",
2212
- rejectedInput: c,
2213
- reason: "max-length"
2214
- });
2215
- return;
2216
- }
2217
- if (_.length > 5 && Q.utils) {
2218
- let e = Q.utils.getCoreNumber(_, s);
2219
- for (; e.length === 0 && _.length > 0;) _ = _.slice(0, -1), e = Q.utils.getCoreNumber(_, s);
2220
- if (!e) {
2221
- this.#V(), this.#H(g.STRICT_REJECT, {
2222
- source: "paste",
2223
- rejectedInput: c,
2224
- reason: "max-length"
2225
- });
2226
- return;
2227
- }
2228
- if (this.#u && e.length > this.#u) if (t.selectionEnd === i.length) {
2229
- let t = e.length - this.#u;
2230
- _ = _.slice(0, _.length - t), v = "max-length";
2231
- } else {
2232
- this.#V(), this.#H(g.STRICT_REJECT, {
2233
- source: "paste",
2234
- rejectedInput: c,
2235
- reason: "max-length"
2236
- });
2237
- return;
2238
- }
2239
- }
2240
- this.#y(_);
2241
- let y = n + h.length;
2242
- t.setSelectionRange(y, y), t.dispatchEvent(new InputEvent("input", { bubbles: !0 })), v && (l.length > 0 && h.length === 0 && this.#V(), this.#H(g.STRICT_REJECT, {
2243
- source: "paste",
2244
- rejectedInput: c,
2245
- reason: v
2246
- }));
2247
- };
2248
- #B(e) {
2249
- let t = Number(this.#e.telInputEl.getAttribute("maxlength"));
2250
- return t && e.length > t ? e.substring(0, t) : e;
2251
- }
2252
- #V() {
2253
- if (!this.#t.strictRejectAnimation) return;
2254
- let e = this.#e.telInputEl.parentElement;
2255
- e && (e.classList.remove("iti__strict-reject-animation"), e.offsetWidth, e.classList.add("iti__strict-reject-animation"));
2256
- }
2257
- #H(e, t = {}) {
2258
- let n = new CustomEvent(e, {
2259
- bubbles: !0,
2260
- cancelable: !0,
2261
- detail: t
2262
- });
2263
- this.#e.telInputEl.dispatchEvent(n);
2264
- }
2265
- #U() {
2266
- this.#e.openDropdown((e) => this.#Q(e), () => this.#$()), this.#H(g.OPEN_COUNTRY_DROPDOWN);
2267
- }
2268
- #W(e) {
2269
- let { formatOnDisplay: t, nationalMode: n, separateDialCode: r } = this.#t, i = e;
2270
- if (t && Q.utils && this.#l) {
2271
- let t = Y(e), a = n && !t || !i.startsWith("+") && !r, { NATIONAL: o, INTERNATIONAL: s } = Q.utils.numberFormat, c = a ? o : s;
2272
- i = Q.utils.formatNumber(i, this.#l?.iso2, c);
2273
- }
2274
- i = this.#ie(i), this.#y(i);
2275
- }
2276
- #G(e) {
2277
- let t = this.#q(e);
2278
- return t === null ? !1 : this.#Y(t);
2279
- }
2280
- #K(e) {
2281
- let t = this.#l?.dialCode, n = this.#l?.nationalPrefix;
2282
- return e.startsWith("+") || !t ? e : `+${t}${n && e.startsWith(n) && !this.#t.separateDialCode ? e.substring(1) : e}`;
2283
- }
2284
- #q(e) {
2285
- let t = e.indexOf("+"), n = t > 0 ? e.substring(t) : e, r = this.#l?.iso2;
2286
- n = this.#K(n);
2287
- let i = this.#te(n, !0), a = H(n);
2288
- if (i) {
2289
- let e = H(i), t = this.#a[e];
2290
- return t.length === 1 ? t[0] === r ? null : t[0] : this.#J(t, e, a);
2291
- } else if (n.startsWith("+") && a.length) {
2292
- let e = this.#l?.dialCode || "";
2293
- return e && e.startsWith(a) ? null : "";
2294
- } else if ((!n || n === "+") && !r && this.#d) return this.#d;
2295
- return null;
2296
- }
2297
- #J(e, t, n) {
2298
- let r = this.#l?.iso2, i = this.#l?.dialCode;
2299
- if (!r && this.#d && e.includes(this.#d)) return this.#d;
2300
- if (i === w.NANP && be(n)) return null;
2301
- let a = this.#l?.areaCodes, o = this.#l?.priority;
2302
- if (a) {
2303
- let e = a.map((e) => `${i}${e}`);
2304
- for (let t of e) if (n.startsWith(t)) return null;
2305
- }
2306
- let s = a && o !== 0 && n.length > t.length, c = r && e.includes(r) && !s, l = r === e[0];
2307
- return !c && !l ? e[0] : null;
2308
- }
2309
- #Y(e) {
2310
- let t = this.#l?.iso2 || "";
2311
- return this.#l = e ? this.#s.get(e) : null, this.#l && (this.#d = this.#l.iso2), this.#e.setCountry(this.#l), this.#Z(), this.#X(), t !== e;
2312
- }
2313
- #X() {
2314
- let { strictMode: e, placeholderNumberType: t, allowedNumberTypes: n } = this.#t;
2315
- if (!e || !Q.utils) return;
2316
- let r = this.#l?.iso2;
2317
- if (!r) {
2318
- this.#u = null;
2319
- return;
2320
- }
2321
- let i = Q.utils.numberType[t], a = Q.utils.getExampleNumber(r, !1, i, !0), o = a;
2322
- for (; Q.utils.isPossibleNumber(a, r, n);) o = a, a += "0";
2323
- let s = Q.utils.getCoreNumber(o, r);
2324
- this.#u = s.length, r === "by" && (this.#u = s.length + 1);
2325
- }
2326
- #Z() {
2327
- let { autoPlaceholder: e, placeholderNumberType: t, nationalMode: n, customPlaceholder: r } = this.#t, i = e === D.AGGRESSIVE || !this.#e.hadInitialPlaceholder && e === D.POLITE;
2328
- if (!Q.utils || !i) return;
2329
- let a = Q.utils.numberType[t], o = this.#l ? Q.utils.getExampleNumber(this.#l.iso2, n, a) : "";
2330
- o = this.#ie(o), typeof r == "function" && (o = r(o, this.#l)), this.#e.telInputEl.setAttribute("placeholder", o);
2331
- }
2332
- #Q(e) {
2333
- if (!e) return;
2334
- let t = e.dataset[A.ISO2], n = this.#Y(t);
2335
- this.#$();
2336
- let r = e.dataset[A.DIAL_CODE];
2337
- if (this.#ee(r), this.#t.formatOnDisplay) {
2338
- let e = this.#v();
2339
- this.#W(e);
2340
- }
2341
- this.#e.telInputEl.focus(), n && (this.#oe(), this.#H(g.INPUT, { isCountryChange: !0 }));
2342
- }
2343
- #$(e) {
2344
- !this.#e.isDropdownOpen() || this.#t.dropdownAlwaysOpen && !e || (this.#e.closeDropdown(), this.#H(g.CLOSE_COUNTRY_DROPDOWN));
2345
- }
2346
- #ee(e) {
2347
- let t = this.#v();
2348
- if (!t.startsWith("+")) return;
2349
- let n = `+${e}`, r = this.#te(t), i;
2350
- i = r ? t.replace(r, n) : n, this.#y(i);
2351
- }
2352
- #te(e, t) {
2353
- if (!e.startsWith("+")) return "";
2354
- let n = "", r = "", i = !1;
2355
- for (let a = 0; a < e.length; a++) {
2356
- let o = e.charAt(a);
2357
- if (/[0-9]/.test(o)) {
2358
- if (r += o, !this.#a[r]) break;
2359
- if (this.#o.has(r)) {
2360
- if (n = e.substring(0, a + 1), i = !0, !t) break;
2361
- } else t && i && (n = e.substring(0, a + 1));
2362
- if (r.length === this.#i) break;
2363
- }
2364
- }
2365
- return n;
2366
- }
2367
- #ne(e) {
2368
- let t = this.#l?.dialCode, n = H(e);
2369
- return (this.#t.separateDialCode && !e.startsWith("+") && t && n ? `+${t}` : "") + e;
2370
- }
2371
- #re() {
2372
- let e = this.#v();
2373
- return this.#ne(e);
2374
- }
2375
- #ie(e) {
2376
- let t = ge(e, !!this.#te(e), this.#t.separateDialCode, this.#l);
2377
- return this.#B(t);
2378
- }
2379
- #ae() {
2380
- let e = this.#l;
2381
- if (!e) return null;
2382
- let { iso2: t, dialCode: n, name: r } = e;
2383
- return {
2384
- iso2: t,
2385
- dialCode: n,
2386
- name: r
2387
- };
2388
- }
2389
- #oe() {
2390
- let e = this.#ae();
2391
- this.#H(g.COUNTRY_CHANGE, e);
2392
- }
2393
- #se() {
2394
- if (!(!this.#g || !Q.autoCountry)) {
2395
- if (!this.#f) {
2396
- this.#g.resolve();
2397
- return;
2398
- }
2399
- this.#e.isLoading() ? this.setCountry(Q.autoCountry) : this.#d = Q.autoCountry, this.#e.setLoading(!1), this.#g.resolve();
2400
- }
2401
- }
2402
- #ce() {
2403
- if (!this.#f) {
2404
- this.#g?.reject();
2405
- return;
2406
- }
2407
- this.#C(!0), this.#e.setLoading(!1), this.#g?.reject();
2408
- }
2409
- #le() {
2410
- if (!this.#f) {
2411
- this.#_?.resolve();
2412
- return;
2413
- }
2414
- if (!Q.utils) {
2415
- this.#_?.resolve();
2416
- return;
2417
- }
2418
- let e = this.#v();
2419
- e && this.#W(e), this.#l && (this.#Z(), this.#X()), this.#_?.resolve();
2420
- }
2421
- #ue(e) {
2422
- if (!this.#f) {
2423
- this.#_?.reject(e);
2424
- return;
2425
- }
2426
- this.#_?.reject(e);
2427
- }
2428
- destroy() {
2429
- this.#f && (this.#f = !1, this.#t.allowDropdown && this.#$(!0), this.#p.abort(), this.#e.destroy(), Q.instances.delete(String(this.id)));
2430
- }
2431
- isActive() {
2432
- return this.#f;
2433
- }
2434
- getExtension() {
2435
- return this.#f ? (X("getExtension"), Q.utils.getExtension(this.#re(), this.#l?.iso2)) : "";
2436
- }
2437
- getNumber(e) {
2438
- if (!this.#f) return "";
2439
- X("getNumber");
2440
- let t = this.#l?.iso2, n = this.#re(), r = Q.utils.formatNumber(n, t, e);
2441
- return this.#m.denormalise(r);
2442
- }
2443
- getNumberType() {
2444
- return this.#f ? (X("getNumberType"), Q.utils.getNumberType(this.#re(), this.#l?.iso2)) : S.UNKNOWN_NUMBER_TYPE;
2445
- }
2446
- getSelectedCountryData() {
2447
- return this.#ae();
2448
- }
2449
- getValidationError() {
2450
- if (!this.#f) return S.UNKNOWN_VALIDATION_ERROR;
2451
- X("getValidationError");
2452
- let e = this.#l?.iso2;
2453
- return Q.utils.getValidationError(this.#re(), e);
2454
- }
2455
- isValidNumber() {
2456
- if (!this.#f) return null;
2457
- X("isValidNumber");
2458
- let e = this.#l?.dialCode, t = this.#l?.iso2, n = this.#re(), r = Q.utils.getCoreNumber(n, t);
2459
- if (r) {
2460
- if (e === T.DIAL_CODE && r[0] === T.MOBILE_PREFIX && r.length !== T.MOBILE_CORE_LENGTH) return !1;
2461
- if (!b.ALPHA_UNICODE.test(n) && e) {
2462
- let t = H(n.startsWith("+") ? n.slice(1 + e.length) : n).length;
2463
- if (r.length > t) return !1;
2464
- }
2465
- }
2466
- return this.#de("possible");
2467
- }
2468
- isValidNumberPrecise() {
2469
- return this.#f ? (X("isValidNumberPrecise"), this.#de("precise")) : null;
2470
- }
2471
- #de(e) {
2472
- let { allowNumberExtensions: t, allowPhonewords: n, allowedNumberTypes: r } = this.#t, i = this.#l?.iso2, a = this.#re();
2473
- return !this.#l && !Y(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;
2474
- }
2475
- setCountry(e) {
2476
- if (!this.#f) return;
2477
- let t = e?.toLowerCase();
2478
- if (!m(t)) throw Error(`Invalid iso2 code: '${t}'`);
2479
- let n = this.#l?.iso2;
2480
- if (e && t !== n || !e && n) {
2481
- if (this.#Y(t), this.#ee(this.#l?.dialCode || ""), this.#t.formatOnDisplay) {
2482
- let e = this.#v();
2483
- this.#W(e);
2484
- }
2485
- this.#oe(), this.#H(g.INPUT, { isCountryChange: !0 });
2486
- }
2487
- }
2488
- setNumber(e) {
2489
- if (!this.#f) return;
2490
- let t = this.#m.normalise(e), n = this.#G(t);
2491
- this.#W(t), n && this.#oe(), this.#H(g.INPUT, { isSetNumber: !0 });
2492
- }
2493
- setPlaceholderNumberType(e) {
2494
- this.#f && (this.#t.placeholderNumberType = e, this.#Z());
2495
- }
2496
- setDisabled(e) {
2497
- this.#f && this.#e.setDisabled(e);
2498
- }
2499
- setReadonly(e) {
2500
- this.#f && this.#e.setReadonly(e);
2501
- }
2502
- static forEachInstance(t, ...n) {
2503
- let r = [...Q.instances.values()], i = n[0];
2504
- r.forEach((n) => {
2505
- if (n instanceof e) switch (t) {
2506
- case "handleUtilsLoaded":
2507
- n.#le();
2508
- break;
2509
- case "handleUtilsFailure":
2510
- n.#ue(i);
2511
- break;
2512
- case "handleAutoCountryLoaded":
2513
- n.#se();
2514
- break;
2515
- case "handleAutoCountryFailure":
2516
- n.#ce();
2517
- break;
2518
- }
2519
- });
2520
- }
2521
- }, Q = Object.assign((e, t) => {
2522
- let n = new Z(e, t);
2523
- return Q.instances.set(String(n.id), n), e.iti = n, n;
2524
- }, {
2525
- defaults: F,
2526
- documentReady: () => document.readyState === "complete",
2527
- getCountryData: () => h,
2528
- getInstance: (e) => {
2529
- let t = e.dataset[A.INSTANCE_ID];
2530
- return t ? Q.instances.get(t) ?? null : null;
2531
- },
2532
- instances: /* @__PURE__ */ new Map(),
2533
- attachUtils: (e) => {
2534
- if (!Q.utils && !Q.startedLoadingUtils) {
2535
- let t;
2536
- if (typeof e == "function") try {
2537
- t = Promise.resolve(e());
2538
- } catch (e) {
2539
- return Promise.reject(e);
2540
- }
2541
- 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}`));
2542
- return Q.startedLoadingUtils = !0, t.then((e) => {
2543
- let t = e?.default;
2544
- 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.");
2545
- return Q.utils = t, Z.forEachInstance("handleUtilsLoaded"), !0;
2546
- }).catch((e) => {
2547
- throw Z.forEachInstance("handleUtilsFailure", e), e;
2548
- });
2549
- }
2550
- return null;
2551
- },
2552
- startedLoadingUtils: !1,
2553
- startedLoadingAutoCountry: !1,
2554
- version: "27.3.1"
2555
- }), $ = Q, Ce = /* @__PURE__ */ n({
2556
- inheritAttrs: !1,
2557
- __name: "IntlTelInput",
2558
- props: {
2559
- usePreciseValidation: {
2560
- type: Boolean,
2561
- default: !1
2562
- },
2563
- disabled: {
2564
- type: Boolean,
2565
- default: !1
2566
- },
2567
- readonly: {
2568
- type: Boolean,
2569
- default: !1
2570
- },
2571
- inputProps: { default: () => ({}) },
2572
- initialValue: {},
2573
- modelValue: {},
2574
- allowDropdown: { type: Boolean },
2575
- allowedNumberTypes: {},
2576
- allowNumberExtensions: { type: Boolean },
2577
- allowPhonewords: { type: Boolean },
2578
- autoPlaceholder: {},
2579
- containerClass: {},
2580
- countryNameLocale: {},
2581
- countryOrder: {},
2582
- countrySearch: { type: Boolean },
2583
- customPlaceholder: {},
2584
- dropdownAlwaysOpen: { type: Boolean },
2585
- dropdownContainer: {},
2586
- excludeCountries: {},
2587
- fixDropdownWidth: { type: Boolean },
2588
- formatAsYouType: { type: Boolean },
2589
- formatOnDisplay: { type: Boolean },
2590
- geoIpLookup: {},
2591
- hiddenInput: {},
2592
- i18n: {},
2593
- initialCountry: {},
2594
- loadUtils: {},
2595
- nationalMode: { type: Boolean },
2596
- onlyCountries: {},
2597
- placeholderNumberType: {},
2598
- searchInputClass: {},
2599
- separateDialCode: { type: Boolean },
2600
- strictRejectAnimation: { type: Boolean },
2601
- showFlags: { type: Boolean },
2602
- strictMode: { type: Boolean },
2603
- useFullscreenPopup: { type: Boolean }
2604
- },
2605
- emits: [
2606
- "changeNumber",
2607
- "changeCountry",
2608
- "changeValidity",
2609
- "changeErrorCode",
2610
- "openCountryDropdown",
2611
- "closeCountryDropdown",
2612
- "strictReject",
2613
- "update:modelValue"
2614
- ],
2615
- setup(n, { expose: d, emit: f }) {
2616
- let p = n, m = f, h = (e) => {
2617
- console.warn(`intl-tel-input: ignoring inputProps.${e} - see docs for more info.`);
2618
- }, g = new Set([
2619
- "type",
2620
- "value",
2621
- "disabled",
2622
- "readonly",
2623
- "onInput",
2624
- "oninput"
2625
- ]), _ = c(""), v = e(() => {
2626
- let e = p.inputProps ?? {}, t = {};
2627
- for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : n === "class" ? t[n] = `${_.value} ${r}` : t[n] = r;
2628
- return t;
2629
- }), y = e(() => p.modelValue ?? p.initialValue ?? ""), b = r(), x = Object.keys($.defaults), S = e(() => {
2630
- let e = b?.vnode.props ?? {}, t = new Set(Object.keys(e).map((e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()))), n = {};
2631
- return x.forEach((e) => {
2632
- if (!t.has(e)) return;
2633
- let r = p[e];
2634
- r !== void 0 && (n[e] = r);
2635
- }), n;
2636
- }), 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 = () => {
2637
- if (!w.value?.isActive()) return;
2638
- if (!$.utils) {
2639
- k = !0;
2640
- return;
2641
- }
2642
- let e = A(), t = e ? null : w.value.getValidationError();
2643
- e !== D.value && (D.value = e, m("changeValidity", e)), t !== O.value && (O.value = t, m("changeErrorCode", t));
2644
- }, M = () => {
2645
- if (!w.value?.isActive()) return;
2646
- if (!$.utils) {
2647
- k = !0;
2648
- return;
2649
- }
2650
- let e = w.value.getNumber() ?? "";
2651
- e !== T.value && (T.value = e, m("changeNumber", e), m("update:modelValue", e)), j();
2652
- }, N = () => {
2653
- if (!w.value?.isActive()) return;
2654
- let e = w.value.getSelectedCountryData()?.iso2 ?? "";
2655
- e !== E.value && (E.value = e, m("changeCountry", e)), M();
2656
- }, P = () => m("openCountryDropdown"), F = () => m("closeCountryDropdown"), I = (e) => {
2657
- let { source: t, rejectedInput: n, reason: r } = e.detail;
2658
- m("strictReject", t, n, r);
2659
- };
2660
- return a(() => {
2661
- 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(() => {
2662
- 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()));
2663
- }));
2664
- }), u(() => p.disabled, (e) => w.value?.setDisabled(e)), u(() => p.readonly, (e) => w.value?.setReadonly(e)), u(() => y.value, (e) => {
2665
- w.value && w.value.promise.then(() => {
2666
- if (!w.value?.isActive()) return;
2667
- let t = e ?? "", n = w.value.getNumber() ?? "";
2668
- document.activeElement === C.value || n === t || (w.value.setNumber(t), j());
2669
- });
2670
- }, { flush: "post" }), o(() => {
2671
- C.value && (C.value.removeEventListener("open:countrydropdown", P), C.value.removeEventListener("close:countrydropdown", F), C.value.removeEventListener("strict:reject", I)), w.value?.destroy();
2672
- }), d({
2673
- instance: w,
2674
- input: C
2675
- }), (e, n) => (s(), t("input", i(v.value, {
2676
- ref_key: "input",
2677
- ref: C,
2678
- type: "tel",
2679
- onInput: N
2680
- }), null, 16));
2681
- }
2682
- });
2683
- //#endregion
2684
- export { $ as n, Ce as t };