-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
802 lines (738 loc) · 66.5 KB
/
Copy pathindex.html
File metadata and controls
802 lines (738 loc) · 66.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Country Calling Codes & ISO Lookup (Offline HTML) – Search by Country / Dial Code / ISO</title>
<meta name="description" content="Offline-friendly country lookup: search international calling codes and ISO country codes (ISO2/ISO3), plus capital and continent. Includes quick links to CountryCode.online for deeper details." />
<meta name="robots" content="index,follow" />
<meta name="theme-color" content="#0b1220" />
<!-- Open Graph -->
<meta property="og:title" content="Country Calling Codes & ISO Lookup (Offline HTML)" />
<meta property="og:description" content="Search country calling codes and ISO codes instantly. Works as a single HTML file; includes links to CountryCode.online." />
<meta property="og:type" content="website" />
<style>
:root{
--bg:#0b1220;
--panel:#101a31;
--card:#0f1a33;
--text:#e7ecff;
--muted:#a9b3d6;
--muted2:#7f8bb8;
--line:rgba(255,255,255,.10);
--brand:#4f8cff;
--brand2:#8a5bff;
--good:#3dd68c;
--warn:#ffcc66;
--bad:#ff6b7a;
--shadow: 0 10px 30px rgba(0,0,0,.35);
--radius: 18px;
--radius2: 14px;
--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
margin:0;
font-family:var(--sans);
color:var(--text);
background:
radial-gradient(1200px 700px at 20% -10%, rgba(79,140,255,.35), transparent 60%),
radial-gradient(900px 600px at 100% 10%, rgba(138,91,255,.25), transparent 55%),
radial-gradient(1000px 700px at 20% 110%, rgba(61,214,140,.15), transparent 55%),
linear-gradient(180deg, var(--bg), #070b14 70%);
}
a{color:inherit; text-decoration:none}
a:hover{text-decoration:underline}
.container{max-width:1100px; margin:0 auto; padding:24px}
.topbar{
display:flex; align-items:center; justify-content:space-between; gap:14px;
padding:16px 18px; border:1px solid var(--line); background:rgba(16,26,49,.75);
backdrop-filter: blur(10px);
border-radius: var(--radius);
box-shadow: var(--shadow);
position: sticky; top: 16px; z-index: 10;
}
.brand{display:flex; align-items:center; gap:12px; min-width: 260px}
.logo{
width:38px; height:38px; border-radius: 12px;
background: conic-gradient(from 210deg, var(--brand), var(--brand2), var(--good), var(--brand));
box-shadow: 0 10px 25px rgba(79,140,255,.25);
}
.brand h1{margin:0; font-size:15px; line-height:1.2}
.brand p{margin:2px 0 0; font-size:12px; color:var(--muted)}
.cta{
display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; align-items:center;
}
.pill{
display:inline-flex; align-items:center; gap:8px;
padding:9px 12px; border-radius: 999px;
border: 1px solid var(--line);
background: rgba(15,26,51,.6);
font-size: 12px; color: var(--muted);
white-space: nowrap;
}
.pill strong{color:var(--text); font-weight:700}
.btn{
display:inline-flex; align-items:center; justify-content:center; gap:8px;
padding:10px 12px; border-radius: 999px;
border: 1px solid rgba(79,140,255,.35);
background: linear-gradient(180deg, rgba(79,140,255,.22), rgba(79,140,255,.10));
font-weight: 650;
font-size: 12px;
cursor: pointer;
user-select:none;
transition: transform .08s ease, filter .2s ease;
}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:translateY(1px)}
.btn.secondary{
border-color: rgba(255,255,255,.14);
background: rgba(15,26,51,.6);
font-weight: 600;
}
.hero{padding:26px 2px 8px}
.hero h2{margin:0; font-size:30px; letter-spacing:-.02em}
.hero p{margin:10px 0 0; color:var(--muted); font-size:14px; line-height:1.55; max-width: 78ch}
.hero .links{margin-top:14px; display:flex; flex-wrap:wrap; gap:10px}
.klink{
display:inline-flex; gap:8px; align-items:center;
padding:10px 12px; border-radius: 14px;
background: rgba(15,26,51,.55);
border: 1px solid var(--line);
font-size: 13px; color: var(--muted);
}
.klink span{color:var(--text)}
.grid{
display:grid; grid-template-columns: 1.4fr .6fr;
gap:16px; margin-top:16px;
}
@media (max-width: 920px){
.grid{grid-template-columns: 1fr}
.brand{min-width: 0}
.topbar{position: static}
}
.panel{
border:1px solid var(--line);
background: rgba(16,26,49,.65);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow:hidden;
}
.panel-head{
padding:16px 16px 12px;
border-bottom: 1px solid var(--line);
display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.panel-head h3{margin:0; font-size:15px}
.panel-head .meta{font-size:12px; color:var(--muted)}
.searchbar{padding:14px 16px 16px}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.input{
flex: 1;
display:flex; align-items:center; gap:10px;
padding:12px 12px;
border-radius: 14px;
border: 1px solid rgba(255,255,255,.14);
background: rgba(15,26,51,.65);
box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.input input{
width:100%;
border:0; outline:none;
background: transparent;
color: var(--text);
font-size: 14px;
}
.input input::placeholder{color: rgba(169,179,214,.65)}
.select{
padding:12px 12px;
border-radius: 14px;
border: 1px solid rgba(255,255,255,.14);
background: rgba(15,26,51,.65);
color: var(--text);
font-size: 13px;
outline:none;
}
.hint{margin-top:10px; color:var(--muted2); font-size:12px; line-height:1.5}
.hint code{font-family:var(--mono); background:rgba(255,255,255,.06); border:1px solid var(--line); padding:2px 6px; border-radius:8px; color:var(--text)}
.results{padding: 0 16px 16px}
.result-top{display:flex; justify-content:space-between; align-items:center; gap:10px; margin: 0 0 12px}
.badge{
display:inline-flex; align-items:center; gap:8px;
font-size:12px; color:var(--muted);
padding:8px 10px;
border-radius: 999px;
border: 1px solid var(--line);
background: rgba(15,26,51,.55);
}
.badge b{color:var(--text)}
.cards{display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px}
@media (max-width: 620px){ .cards{grid-template-columns: 1fr} }
.card{
border: 1px solid var(--line);
background: rgba(15,26,51,.55);
border-radius: var(--radius2);
padding: 14px;
cursor: pointer;
transition: transform .08s ease, border-color .2s ease, background .2s ease;
position: relative;
overflow:hidden;
}
.card:hover{transform: translateY(-1px); border-color: rgba(79,140,255,.35); background: rgba(15,26,51,.72)}
.card .name{font-size: 15px; font-weight: 750; margin:0 0 6px}
.card .sub{margin:0; color:var(--muted); font-size: 12px; display:flex; flex-wrap:wrap; gap:8px}
.tag{font-family: var(--mono); font-size: 11.5px; padding: 4px 8px; border-radius: 999px; border:1px solid var(--line); background: rgba(255,255,255,.05);}
.tag.blue{border-color: rgba(79,140,255,.35);}
.tag.green{border-color: rgba(61,214,140,.25);}
.tag.purple{border-color: rgba(138,91,255,.25);}
.tag.warn{border-color: rgba(255,204,102,.25);}
.card .right{
position:absolute; right: 12px; top: 12px; font-size: 12px; color: rgba(169,179,214,.9);
background: rgba(11,18,32,.55); border:1px solid var(--line); border-radius: 999px; padding: 6px 8px;
}
.side{padding:16px}
.side h4{margin:0 0 10px; font-size:14px}
.side p{margin:0 0 12px; color:var(--muted); font-size: 13px; line-height:1.55}
.list{display:grid; gap:10px}
.item{
border: 1px solid var(--line);
background: rgba(15,26,51,.55);
border-radius: 14px;
padding: 12px;
}
.item .t{font-weight: 700; font-size: 13px; margin:0 0 4px}
.item .d{margin:0; font-size:12px; color: var(--muted); line-height:1.5}
.item a{text-decoration: none}
.item a:hover{text-decoration: underline}
.foot{
padding: 18px 0 28px;
color: var(--muted2);
font-size: 12px;
line-height: 1.55;
text-align:center;
}
/* Modal */
.modal-backdrop{
position: fixed; inset: 0;
display:none;
place-items: center;
background: rgba(0,0,0,.55);
z-index: 50;
padding: 18px;
}
.modal{
width: min(880px, 100%);
border-radius: 18px;
border: 1px solid rgba(255,255,255,.14);
background: rgba(16,26,49,.92);
box-shadow: var(--shadow);
overflow: hidden;
}
.modal-head{
padding: 14px 16px;
border-bottom: 1px solid var(--line);
display:flex; align-items:center; justify-content: space-between; gap: 10px;
}
.modal-head .title{display:flex; flex-direction:column; gap:2px}
.modal-head .title b{font-size: 15px}
.modal-head .title span{font-size: 12px; color: var(--muted)}
.iconbtn{
border:1px solid rgba(255,255,255,.16);
background: rgba(15,26,51,.65);
color: var(--text);
border-radius: 12px;
padding: 8px 10px;
cursor:pointer;
}
.modal-body{padding: 14px 16px 16px}
.cols{display:grid; grid-template-columns: 1fr 1fr; gap: 12px}
@media (max-width: 760px){ .cols{grid-template-columns:1fr} }
.kv{
border:1px solid var(--line);
background: rgba(15,26,51,.55);
border-radius: 14px;
padding: 12px;
}
.kv .k{font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing:.08em}
.kv .v{margin-top: 6px; font-size: 14px; font-weight: 700}
.mono{font-family: var(--mono)}
.actions{margin-top: 12px; display:flex; gap:10px; flex-wrap:wrap}
.toast{
position: fixed;
right: 16px;
bottom: 16px;
background: rgba(15,26,51,.92);
border: 1px solid rgba(255,255,255,.14);
padding: 10px 12px;
border-radius: 14px;
color: var(--text);
box-shadow: var(--shadow);
display:none;
z-index: 60;
font-size: 12px;
}
.kbd{font-family:var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 8px; border:1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text)}
</style>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Country Calling Codes & ISO Lookup (Offline HTML)",
"applicationCategory": "ReferenceApplication",
"operatingSystem": "Any",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"publisher": {
"@type": "Organization",
"name": "CountryCode.online",
"url": "https://countrycode.online/"
}
}
</script>
</head>
<body>
<div class="container">
<div class="topbar">
<div class="brand">
<div class="logo" aria-hidden="true"></div>
<div>
<h1>Country Calling Codes & ISO Lookup</h1>
<p>Single-file HTML • Works offline • Fast search</p>
</div>
</div>
<div class="cta">
<div class="pill" title="Tip: Works offline after you download the HTML">
<span>Try: <strong>+1</strong>, <strong>KR</strong>, <strong>KOR</strong>, <strong>China</strong></span>
</div>
<a class="btn" href="https://countrycode.online/" target="_blank" rel="noopener">Visit CountryCode.online ↗</a>
<button class="btn secondary" id="btnDownload">Download HTML</button>
</div>
</div>
<div class="hero">
<h2>Search any country by name, calling code, or ISO.</h2>
<p>
This page is designed to be hosted on GitHub Pages <em>and</em> also work as a downloadable HTML file.
It includes country calling codes, ISO-3166 alpha-2 / alpha-3 codes, capital, and continent.
For full dialing guides (examples, number formatting, local time, troubleshooting), open the country on
<a href="https://countrycode.online/" target="_blank" rel="noopener">CountryCode.online</a>.
</p>
<div class="links">
<a class="klink" href="https://countrycode.online/tools/international-dialing/" target="_blank" rel="noopener"><span>International Dialing Tool</span> ↗</a>
<a class="klink" href="https://countrycode.online/tools/world-time/" target="_blank" rel="noopener"><span>World Time</span> ↗</a>
<a class="klink" href="https://countrycode.online/tools/time-difference-calculator/" target="_blank" rel="noopener"><span>Time Difference Calculator</span> ↗</a>
<a class="klink" href="https://countrycode.online/countries/" target="_blank" rel="noopener"><span>Country Directory</span> ↗</a>
</div>
</div>
<div class="grid">
<div class="panel">
<div class="panel-head">
<div>
<h3>Instant Lookup</h3>
<div class="meta">Search across <span id="countryCount">—</span> entries • Press <span class="kbd">Esc</span> to close details</div>
</div>
<div class="meta" id="buildInfo"></div>
</div>
<div class="searchbar">
<div class="row">
<div class="input" role="search">
<span aria-hidden="true">🔎</span>
<input id="q" type="text" inputmode="search" autocomplete="off" placeholder="Search: country (Japan), calling code (+81), ISO (JP / JPN) …" />
</div>
<select class="select" id="mode" aria-label="Search mode">
<option value="all">All fields</option>
<option value="name">Country name</option>
<option value="phone">Calling code</option>
<option value="iso2">ISO2</option>
<option value="iso3">ISO3</option>
<option value="capital">Capital</option>
</select>
<button class="btn secondary" id="btnClear" title="Clear search">Clear</button>
</div>
<div class="hint">
Tips:
<code>+86</code> or <code>86</code> for calling codes,
<code>US</code>/<code>USA</code> for ISO,
and partial matches like <code>congo</code> or <code>kingston</code>.
Click a result to open details and get the <strong>CountryCode.online</strong> link.
</div>
</div>
<div class="results">
<div class="result-top">
<div class="badge"><b id="resultCount">0</b> results</div>
<div class="badge" id="statusBadge">Ready</div>
</div>
<div class="cards" id="cards"></div>
</div>
</div>
<aside class="panel">
<div class="side">
<h4>Why this page exists</h4>
<p>
Many people search “country code” or “ISO code” when calling overseas, building forms, or cleaning datasets.
This is a tiny, fast reference. For complete guides, visit:
<a href="https://countrycode.online/" target="_blank" rel="noopener">CountryCode.online</a>.
</p>
<div class="list">
<div class="item">
<p class="t">Deep country pages</p>
<p class="d">
Dialing steps, E.164 formatting, example numbers, and local time:
<a href="https://countrycode.online/countries/" target="_blank" rel="noopener">browse the directory</a>.
</p>
</div>
<div class="item">
<p class="t">Tools you might need</p>
<p class="d">
<a href="https://countrycode.online/tools/international-dialing/" target="_blank" rel="noopener">International Dialing</a> ·
<a href="https://countrycode.online/tools/world-time/" target="_blank" rel="noopener">World Time</a> ·
<a href="https://countrycode.online/tools/country-time/" target="_blank" rel="noopener">Country Time</a>
</p>
</div>
<div class="item">
<p class="t">Dataset / bulk downloads</p>
<p class="d">
If you work with CSV/JSON regularly, you’ll probably prefer a cleaned dataset:
<a href="https://countrycode.online/product/all-country-code-list/" target="_blank" rel="noopener">All Country Code List</a>.
</p>
</div>
<div class="item">
<p class="t">Embed on your own site</p>
<p class="d">
You can fork this repo, customize the styling, and keep your own “offline lookup” page.
</p>
</div>
</div>
</div>
</aside>
</div>
<div class="foot">
Data snapshot from an open dataset (MIT).
<br/>
For the most complete dialing guide and updated country pages, visit
<a href="https://countrycode.online/" target="_blank" rel="noopener">CountryCode.online</a>.
</div>
</div>
<!-- Embedded data (kept as JSON for easy updates) -->
<script id="countries-data" type="application/json">{"AD":{"name":"Andorra","native":"Andorra","phone":"376","continent":"EU","capital":"Andorra la Vella","currency":"EUR","languages":["ca"]},"AE":{"name":"United Arab Emirates","native":"دولة الإمارات العربية المتحدة","phone":"971","continent":"AS","capital":"Abu Dhabi","currency":"AED","languages":["ar"]},"AF":{"name":"Afghanistan","native":"افغانستان","phone":"93","continent":"AS","capital":"Kabul","currency":"AFN","languages":["ps","uz","tk"]},"AG":{"name":"Antigua and Barbuda","native":"Antigua and Barbuda","phone":"1268","continent":"NA","capital":"Saint John's","currency":"XCD","languages":["en"]},"AI":{"name":"Anguilla","native":"Anguilla","phone":"1264","continent":"NA","capital":"The Valley","currency":"XCD","languages":["en"]},"AL":{"name":"Albania","native":"Shqipëria","phone":"355","continent":"EU","capital":"Tirana","currency":"ALL","languages":["sq"]},"AM":{"name":"Armenia","native":"Հայաստան","phone":"374","continent":"AS","capital":"Yerevan","currency":"AMD","languages":["hy","ru"]},"AO":{"name":"Angola","native":"Angola","phone":"244","continent":"AF","capital":"Luanda","currency":"AOA","languages":["pt"]},"AQ":{"name":"Antarctica","native":"Antarctica","phone":"672","continent":"AN","capital":"","currency":"","languages":[]},"AR":{"name":"Argentina","native":"Argentina","phone":"54","continent":"SA","capital":"Buenos Aires","currency":"ARS","languages":["es","gn"]},"AS":{"name":"American Samoa","native":"American Samoa","phone":"1684","continent":"OC","capital":"Pago Pago","currency":"USD","languages":["en","sm"]},"AT":{"name":"Austria","native":"Österreich","phone":"43","continent":"EU","capital":"Vienna","currency":"EUR","languages":["de"]},"AU":{"name":"Australia","native":"Australia","phone":"61","continent":"OC","capital":"Canberra","currency":"AUD","languages":["en"]},"AW":{"name":"Aruba","native":"Aruba","phone":"297","continent":"NA","capital":"Oranjestad","currency":"AWG","languages":["nl","pa"]},"AX":{"name":"Åland Islands","native":"Åland","phone":"358","continent":"EU","capital":"Mariehamn","currency":"EUR","languages":["sv"]},"AZ":{"name":"Azerbaijan","native":"Azərbaycan","phone":"994","continent":"AS","capital":"Baku","currency":"AZN","languages":["az"]},"BA":{"name":"Bosnia and Herzegovina","native":"Bosna i Hercegovina","phone":"387","continent":"EU","capital":"Sarajevo","currency":"BAM","languages":["bs","hr","sr"]},"BB":{"name":"Barbados","native":"Barbados","phone":"1246","continent":"NA","capital":"Bridgetown","currency":"BBD","languages":["en"]},"BD":{"name":"Bangladesh","native":"বাংলাদেশ","phone":"880","continent":"AS","capital":"Dhaka","currency":"BDT","languages":["bn"]},"BE":{"name":"Belgium","native":"België","phone":"32","continent":"EU","capital":"Brussels","currency":"EUR","languages":["nl","fr","de"]},"BF":{"name":"Burkina Faso","native":"Burkina Faso","phone":"226","continent":"AF","capital":"Ouagadougou","currency":"XOF","languages":["fr","ff"]},"BG":{"name":"Bulgaria","native":"България","phone":"359","continent":"EU","capital":"Sofia","currency":"BGN","languages":["bg"]},"BH":{"name":"Bahrain","native":"البحرين","phone":"973","continent":"AS","capital":"Manama","currency":"BHD","languages":["ar"]},"BI":{"name":"Burundi","native":"Burundi","phone":"257","continent":"AF","capital":"Gitega","currency":"BIF","languages":["fr","rn"]},"BJ":{"name":"Benin","native":"Bénin","phone":"229","continent":"AF","capital":"Porto-Novo","currency":"XOF","languages":["fr"]},"BL":{"name":"Saint Barthélemy","native":"Saint-Barthélemy","phone":"590","continent":"NA","capital":"Gustavia","currency":"EUR","languages":["fr"]},"BM":{"name":"Bermuda","native":"Bermuda","phone":"1441","continent":"NA","capital":"Hamilton","currency":"BMD","languages":["en"]},"BN":{"name":"Brunei","native":"Negara Brunei Darussalam","phone":"673","continent":"AS","capital":"Bandar Seri Begawan","currency":"BND","languages":["ms"]},"BO":{"name":"Bolivia","native":"Bolivia","phone":"591","continent":"SA","capital":"Sucre","currency":"BOB","languages":["es","ay","qu"]},"BQ":{"name":"Bonaire, Sint Eustatius and Saba","native":"Bonaire","phone":"599","continent":"NA","capital":"Kralendijk","currency":"USD","languages":["nl"]},"BR":{"name":"Brazil","native":"Brasil","phone":"55","continent":"SA","capital":"Brasília","currency":"BRL","languages":["pt"]},"BS":{"name":"Bahamas","native":"Bahamas","phone":"1242","continent":"NA","capital":"Nassau","currency":"BSD","languages":["en"]},"BT":{"name":"Bhutan","native":"འབྲུག་ཡུལ","phone":"975","continent":"AS","capital":"Thimphu","currency":"BTN","languages":["dz"]},"BV":{"name":"Bouvet Island","native":"Bouvetøya","phone":"47","continent":"AN","capital":"","currency":"NOK","languages":["no","nb","nn"]},"BW":{"name":"Botswana","native":"Botswana","phone":"267","continent":"AF","capital":"Gaborone","currency":"BWP","languages":["en","tn"]},"BY":{"name":"Belarus","native":"Белару́сь","phone":"375","continent":"EU","capital":"Minsk","currency":"BYN","languages":["be","ru"]},"BZ":{"name":"Belize","native":"Belize","phone":"501","continent":"NA","capital":"Belmopan","currency":"BZD","languages":["en","es"]},"CA":{"name":"Canada","native":"Canada","phone":"1","continent":"NA","capital":"Ottawa","currency":"CAD","languages":["en","fr"]},"CC":{"name":"Cocos (Keeling) Islands","native":"Cocos (Keeling) Islands","phone":"61","continent":"AS","capital":"West Island","currency":"AUD","languages":["en"]},"CD":{"name":"Democratic Republic of the Congo","native":"République démocratique du Congo","phone":"243","continent":"AF","capital":"Kinshasa","currency":"CDF","languages":["fr","ln","kg","sw","lu"]},"CF":{"name":"Central African Republic","native":"Ködörösêse tî Bêafrîka","phone":"236","continent":"AF","capital":"Bangui","currency":"XAF","languages":["fr","sg"]},"CG":{"name":"Republic of the Congo","native":"République du Congo","phone":"242","continent":"AF","capital":"Brazzaville","currency":"XAF","languages":["fr","ln"]},"CH":{"name":"Switzerland","native":"Schweiz","phone":"41","continent":"EU","capital":"Bern","currency":"CHF","languages":["de","fr","it"]},"CI":{"name":"Ivory Coast","native":"Côte d'Ivoire","phone":"225","continent":"AF","capital":"Yamoussoukro","currency":"XOF","languages":["fr"]},"CK":{"name":"Cook Islands","native":"Cook Islands","phone":"682","continent":"OC","capital":"Avarua","currency":"NZD","languages":["en","mi"]},"CL":{"name":"Chile","native":"Chile","phone":"56","continent":"SA","capital":"Santiago","currency":"CLP","languages":["es"]},"CM":{"name":"Cameroon","native":"Cameroon","phone":"237","continent":"AF","capital":"Yaoundé","currency":"XAF","languages":["en","fr"]},"CN":{"name":"China","native":"中国","phone":"86","continent":"AS","capital":"Beijing","currency":"CNY","languages":["zh"]},"CO":{"name":"Colombia","native":"Colombia","phone":"57","continent":"SA","capital":"Bogotá","currency":"COP","languages":["es"]},"CR":{"name":"Costa Rica","native":"Costa Rica","phone":"506","continent":"NA","capital":"San José","currency":"CRC","languages":["es"]},"CU":{"name":"Cuba","native":"Cuba","phone":"53","continent":"NA","capital":"Havana","currency":"CUP","languages":["es"]},"CV":{"name":"Cape Verde","native":"Cabo Verde","phone":"238","continent":"AF","capital":"Praia","currency":"CVE","languages":["pt"]},"CW":{"name":"Curaçao","native":"Curaçao","phone":"599","continent":"NA","capital":"Willemstad","currency":"ANG","languages":["nl","pa","en"]},"CX":{"name":"Christmas Island","native":"Christmas Island","phone":"61","continent":"AS","capital":"Flying Fish Cove","currency":"AUD","languages":["en"]},"CY":{"name":"Cyprus","native":"Κύπρος","phone":"357","continent":"EU","capital":"Nicosia","currency":"EUR","languages":["el","tr","hy"]},"CZ":{"name":"Czech Republic","native":"Česká republika","phone":"420","continent":"EU","capital":"Prague","currency":"CZK","languages":["cs","sk"]},"DE":{"name":"Germany","native":"Deutschland","phone":"49","continent":"EU","capital":"Berlin","currency":"EUR","languages":["de"]},"DJ":{"name":"Djibouti","native":"Djibouti","phone":"253","continent":"AF","capital":"Djibouti","currency":"DJF","languages":["fr","ar"]},"DK":{"name":"Denmark","native":"Danmark","phone":"45","continent":"EU","capital":"Copenhagen","currency":"DKK","languages":["da"]},"DM":{"name":"Dominica","native":"Dominica","phone":"1767","continent":"NA","capital":"Roseau","currency":"XCD","languages":["en"]},"DO":{"name":"Dominican Republic","native":"República Dominicana","phone":"1809,1829,1849","continent":"NA","capital":"Santo Domingo","currency":"DOP","languages":["es"]},"DZ":{"name":"Algeria","native":"الجزائر","phone":"213","continent":"AF","capital":"Algiers","currency":"DZD","languages":["ar"]},"EC":{"name":"Ecuador","native":"Ecuador","phone":"593","continent":"SA","capital":"Quito","currency":"USD","languages":["es"]},"EE":{"name":"Estonia","native":"Eesti","phone":"372","continent":"EU","capital":"Tallinn","currency":"EUR","languages":["et"]},"EG":{"name":"Egypt","native":"مصر","phone":"20","continent":"AF","capital":"Cairo","currency":"EGP","languages":["ar"]},"EH":{"name":"Western Sahara","native":"الصحراء الغربية","phone":"212","continent":"AF","capital":"El Aaiún","currency":"MAD","languages":["es"]},"ER":{"name":"Eritrea","native":"ኤርትራ","phone":"291","continent":"AF","capital":"Asmara","currency":"ERN","languages":["ti","ar","en"]},"ES":{"name":"Spain","native":"España","phone":"34","continent":"EU","capital":"Madrid","currency":"EUR","languages":["es","eu","ca","gl","oc"]},"ET":{"name":"Ethiopia","native":"ኢትዮጵያ","phone":"251","continent":"AF","capital":"Addis Ababa","currency":"ETB","languages":["am"]},"FI":{"name":"Finland","native":"Suomi","phone":"358","continent":"EU","capital":"Helsinki","currency":"EUR","languages":["fi","sv"]},"FJ":{"name":"Fiji","native":"Fiji","phone":"679","continent":"OC","capital":"Suva","currency":"FJD","languages":["en","fj","hi","ur"]},"FK":{"name":"Falkland Islands","native":"Falkland Islands","phone":"500","continent":"SA","capital":"Stanley","currency":"FKP","languages":["en"]},"FM":{"name":"Micronesia","native":"Micronesia","phone":"691","continent":"OC","capital":"Palikir","currency":"USD","languages":["en"]},"FO":{"name":"Faroe Islands","native":"Føroyar","phone":"298","continent":"EU","capital":"Tórshavn","currency":"DKK","languages":["fo"]},"FR":{"name":"France","native":"France","phone":"33","continent":"EU","capital":"Paris","currency":"EUR","languages":["fr"]},"GA":{"name":"Gabon","native":"Gabon","phone":"241","continent":"AF","capital":"Libreville","currency":"XAF","languages":["fr"]},"GB":{"name":"United Kingdom","native":"United Kingdom","phone":"44","continent":"EU","capital":"London","currency":"GBP","languages":["en"]},"GD":{"name":"Grenada","native":"Grenada","phone":"1473","continent":"NA","capital":"St. George's","currency":"XCD","languages":["en"]},"GE":{"name":"Georgia","native":"საქართველო","phone":"995","continent":"AS","capital":"Tbilisi","currency":"GEL","languages":["ka"]},"GF":{"name":"French Guiana","native":"Guyane française","phone":"594","continent":"SA","capital":"Cayenne","currency":"EUR","languages":["fr"]},"GG":{"name":"Guernsey","native":"Guernsey","phone":"44","continent":"EU","capital":"St Peter Port","currency":"GBP","languages":["en","fr"]},"GH":{"name":"Ghana","native":"Ghana","phone":"233","continent":"AF","capital":"Accra","currency":"GHS","languages":["en"]},"GI":{"name":"Gibraltar","native":"Gibraltar","phone":"350","continent":"EU","capital":"Gibraltar","currency":"GIP","languages":["en"]},"GL":{"name":"Greenland","native":"Kalaallit Nunaat","phone":"299","continent":"NA","capital":"Nuuk","currency":"DKK","languages":["kl"]},"GM":{"name":"Gambia","native":"Gambia","phone":"220","continent":"AF","capital":"Banjul","currency":"GMD","languages":["en"]},"GN":{"name":"Guinea","native":"Guinée","phone":"224","continent":"AF","capital":"Conakry","currency":"GNF","languages":["fr"]},"GP":{"name":"Guadeloupe","native":"Guadeloupe","phone":"590","continent":"NA","capital":"Basse-Terre","currency":"EUR","languages":["fr"]},"GQ":{"name":"Equatorial Guinea","native":"Guinea Ecuatorial","phone":"240","continent":"AF","capital":"Malabo","currency":"XAF","languages":["es","fr"]},"GR":{"name":"Greece","native":"Ελλάδα","phone":"30","continent":"EU","capital":"Athens","currency":"EUR","languages":["el"]},"GS":{"name":"South Georgia and the South Sandwich Islands","native":"South Georgia","phone":"500","continent":"AN","capital":"Grytviken","currency":"GBP","languages":["en"]},"GT":{"name":"Guatemala","native":"Guatemala","phone":"502","continent":"NA","capital":"Guatemala City","currency":"GTQ","languages":["es"]},"GU":{"name":"Guam","native":"Guam","phone":"1671","continent":"OC","capital":"Hagåtña","currency":"USD","languages":["en","ch","es"]},"GW":{"name":"Guinea-Bissau","native":"Guiné-Bissau","phone":"245","continent":"AF","capital":"Bissau","currency":"XOF","languages":["pt"]},"GY":{"name":"Guyana","native":"Guyana","phone":"592","continent":"SA","capital":"Georgetown","currency":"GYD","languages":["en"]},"HK":{"name":"Hong Kong","native":"香港","phone":"852","continent":"AS","capital":"Hong Kong","currency":"HKD","languages":["zh","en"]},"HM":{"name":"Heard Island and McDonald Islands","native":"Heard Island and McDonald Islands","phone":"672","continent":"AN","capital":"","currency":"AUD","languages":["en"]},"HN":{"name":"Honduras","native":"Honduras","phone":"504","continent":"NA","capital":"Tegucigalpa","currency":"HNL","languages":["es"]},"HR":{"name":"Croatia","native":"Hrvatska","phone":"385","continent":"EU","capital":"Zagreb","currency":"HRK","languages":["hr"]},"HT":{"name":"Haiti","native":"Haïti","phone":"509","continent":"NA","capital":"Port-au-Prince","currency":"HTG","languages":["fr","ht"]},"HU":{"name":"Hungary","native":"Magyarország","phone":"36","continent":"EU","capital":"Budapest","currency":"HUF","languages":["hu"]},"ID":{"name":"Indonesia","native":"Indonesia","phone":"62","continent":"AS","capital":"Jakarta","currency":"IDR","languages":["id"]},"IE":{"name":"Ireland","native":"Éire","phone":"353","continent":"EU","capital":"Dublin","currency":"EUR","languages":["ga","en"]},"IL":{"name":"Israel","native":"יִשְׂרָאֵל","phone":"972","continent":"AS","capital":"Jerusalem","currency":"ILS","languages":["he","ar"]},"IM":{"name":"Isle of Man","native":"Isle of Man","phone":"44","continent":"EU","capital":"Douglas","currency":"GBP","languages":["en","gv"]},"IN":{"name":"India","native":"भारत","phone":"91","continent":"AS","capital":"New Delhi","currency":"INR","languages":["hi","en"]},"IO":{"name":"British Indian Ocean Territory","native":"British Indian Ocean Territory","phone":"246","continent":"AS","capital":"Diego Garcia","currency":"USD","languages":["en"]},"IQ":{"name":"Iraq","native":"العراق","phone":"964","continent":"AS","capital":"Baghdad","currency":"IQD","languages":["ar","ku"]},"IR":{"name":"Iran","native":"ایران","phone":"98","continent":"AS","capital":"Tehran","currency":"IRR","languages":["fa"]},"IS":{"name":"Iceland","native":"Ísland","phone":"354","continent":"EU","capital":"Reykjavik","currency":"ISK","languages":["is"]},"IT":{"name":"Italy","native":"Italia","phone":"39","continent":"EU","capital":"Rome","currency":"EUR","languages":["it"]},"JE":{"name":"Jersey","native":"Jersey","phone":"44","continent":"EU","capital":"Saint Helier","currency":"GBP","languages":["en","fr"]},"JM":{"name":"Jamaica","native":"Jamaica","phone":"1876","continent":"NA","capital":"Kingston","currency":"JMD","languages":["en"]},"JO":{"name":"Jordan","native":"الأردن","phone":"962","continent":"AS","capital":"Amman","currency":"JOD","languages":["ar"]},"JP":{"name":"Japan","native":"日本","phone":"81","continent":"AS","capital":"Tokyo","currency":"JPY","languages":["ja"]},"KE":{"name":"Kenya","native":"Kenya","phone":"254","continent":"AF","capital":"Nairobi","currency":"KES","languages":["en","sw"]},"KG":{"name":"Kyrgyzstan","native":"Кыргызстан","phone":"996","continent":"AS","capital":"Bishkek","currency":"KGS","languages":["ky","ru"]},"KH":{"name":"Cambodia","native":"កម្ពុជា","phone":"855","continent":"AS","capital":"Phnom Penh","currency":"KHR","languages":["km"]},"KI":{"name":"Kiribati","native":"Kiribati","phone":"686","continent":"OC","capital":"South Tarawa","currency":"AUD","languages":["en"]},"KM":{"name":"Comoros","native":"Komori","phone":"269","continent":"AF","capital":"Moroni","currency":"KMF","languages":["ar","fr"]},"KN":{"name":"Saint Kitts and Nevis","native":"Saint Kitts and Nevis","phone":"1869","continent":"NA","capital":"Basseterre","currency":"XCD","languages":["en"]},"KP":{"name":"North Korea","native":"북한","phone":"850","continent":"AS","capital":"Pyongyang","currency":"KPW","languages":["ko"]},"KR":{"name":"South Korea","native":"대한민국","phone":"82","continent":"AS","capital":"Seoul","currency":"KRW","languages":["ko"]},"KW":{"name":"Kuwait","native":"الكويت","phone":"965","continent":"AS","capital":"Kuwait City","currency":"KWD","languages":["ar"]},"KY":{"name":"Cayman Islands","native":"Cayman Islands","phone":"1345","continent":"NA","capital":"George Town","currency":"KYD","languages":["en"]},"KZ":{"name":"Kazakhstan","native":"Қазақстан","phone":"7","continent":"AS","capital":"Astana","currency":"KZT","languages":["kk","ru"]},"LA":{"name":"Laos","native":"ສປປລາວ","phone":"856","continent":"AS","capital":"Vientiane","currency":"LAK","languages":["lo"]},"LB":{"name":"Lebanon","native":"لبنان","phone":"961","continent":"AS","capital":"Beirut","currency":"LBP","languages":["ar","fr"]},"LC":{"name":"Saint Lucia","native":"Saint Lucia","phone":"1758","continent":"NA","capital":"Castries","currency":"XCD","languages":["en"]},"LI":{"name":"Liechtenstein","native":"Liechtenstein","phone":"423","continent":"EU","capital":"Vaduz","currency":"CHF","languages":["de"]},"LK":{"name":"Sri Lanka","native":"ශ්රී ලංකාව","phone":"94","continent":"AS","capital":"Sri Jayawardenepura Kotte","currency":"LKR","languages":["si","ta"]},"LR":{"name":"Liberia","native":"Liberia","phone":"231","continent":"AF","capital":"Monrovia","currency":"LRD","languages":["en"]},"LS":{"name":"Lesotho","native":"Lesotho","phone":"266","continent":"AF","capital":"Maseru","currency":"LSL","languages":["en","st"]},"LT":{"name":"Lithuania","native":"Lietuva","phone":"370","continent":"EU","capital":"Vilnius","currency":"EUR","languages":["lt"]},"LU":{"name":"Luxembourg","native":"Luxembourg","phone":"352","continent":"EU","capital":"Luxembourg","currency":"EUR","languages":["fr","de","lb"]},"LV":{"name":"Latvia","native":"Latvija","phone":"371","continent":"EU","capital":"Riga","currency":"EUR","languages":["lv"]},"LY":{"name":"Libya","native":"ليبيا","phone":"218","continent":"AF","capital":"Tripoli","currency":"LYD","languages":["ar"]},"MA":{"name":"Morocco","native":"المغرب","phone":"212","continent":"AF","capital":"Rabat","currency":"MAD","languages":["ar"]},"MC":{"name":"Monaco","native":"Monaco","phone":"377","continent":"EU","capital":"Monaco","currency":"EUR","languages":["fr"]},"MD":{"name":"Moldova","native":"Moldova","phone":"373","continent":"EU","capital":"Chișinău","currency":"MDL","languages":["ro"]},"ME":{"name":"Montenegro","native":"Црна Гора","phone":"382","continent":"EU","capital":"Podgorica","currency":"EUR","languages":["sr","bs","sq","hr"]},"MF":{"name":"Saint Martin","native":"Saint-Martin","phone":"590","continent":"NA","capital":"Marigot","currency":"EUR","languages":["fr"]},"MG":{"name":"Madagascar","native":"Madagasikara","phone":"261","continent":"AF","capital":"Antananarivo","currency":"MGA","languages":["fr","mg"]},"MH":{"name":"Marshall Islands","native":"M̧ajeļ","phone":"692","continent":"OC","capital":"Majuro","currency":"USD","languages":["en","mh"]},"MK":{"name":"North Macedonia","native":"Македонија","phone":"389","continent":"EU","capital":"Skopje","currency":"MKD","languages":["mk"]},"ML":{"name":"Mali","native":"Mali","phone":"223","continent":"AF","capital":"Bamako","currency":"XOF","languages":["fr"]},"MM":{"name":"Myanmar","native":"မြန်မာ","phone":"95","continent":"AS","capital":"Naypyidaw","currency":"MMK","languages":["my"]},"MN":{"name":"Mongolia","native":"Монгол улс","phone":"976","continent":"AS","capital":"Ulaanbaatar","currency":"MNT","languages":["mn"]},"MO":{"name":"Macao","native":"澳門","phone":"853","continent":"AS","capital":"Macao","currency":"MOP","languages":["zh","pt"]},"MP":{"name":"Northern Mariana Islands","native":"Northern Mariana Islands","phone":"1670","continent":"OC","capital":"Saipan","currency":"USD","languages":["en","ch"]},"MQ":{"name":"Martinique","native":"Martinique","phone":"596","continent":"NA","capital":"Fort-de-France","currency":"EUR","languages":["fr"]},"MR":{"name":"Mauritania","native":"موريتانيا","phone":"222","continent":"AF","capital":"Nouakchott","currency":"MRU","languages":["ar"]},"MS":{"name":"Montserrat","native":"Montserrat","phone":"1664","continent":"NA","capital":"Plymouth","currency":"XCD","languages":["en"]},"MT":{"name":"Malta","native":"Malta","phone":"356","continent":"EU","capital":"Valletta","currency":"EUR","languages":["mt","en"]},"MU":{"name":"Mauritius","native":"Maurice","phone":"230","continent":"AF","capital":"Port Louis","currency":"MUR","languages":["en"]},"MV":{"name":"Maldives","native":"Maldives","phone":"960","continent":"AS","capital":"Malé","currency":"MVR","languages":["dv"]},"MW":{"name":"Malawi","native":"Malawi","phone":"265","continent":"AF","capital":"Lilongwe","currency":"MWK","languages":["en","ny"]},"MX":{"name":"Mexico","native":"México","phone":"52","continent":"NA","capital":"Mexico City","currency":"MXN","languages":["es"]},"MY":{"name":"Malaysia","native":"Malaysia","phone":"60","continent":"AS","capital":"Kuala Lumpur","currency":"MYR","languages":["ms"]},"MZ":{"name":"Mozambique","native":"Moçambique","phone":"258","continent":"AF","capital":"Maputo","currency":"MZN","languages":["pt"]},"NA":{"name":"Namibia","native":"Namibia","phone":"264","continent":"AF","capital":"Windhoek","currency":"NAD","languages":["en"]},"NC":{"name":"New Caledonia","native":"Nouvelle-Calédonie","phone":"687","continent":"OC","capital":"Nouméa","currency":"XPF","languages":["fr"]},"NE":{"name":"Niger","native":"Niger","phone":"227","continent":"AF","capital":"Niamey","currency":"XOF","languages":["fr"]},"NF":{"name":"Norfolk Island","native":"Norfolk Island","phone":"672","continent":"OC","capital":"Kingston","currency":"AUD","languages":["en"]},"NG":{"name":"Nigeria","native":"Nigeria","phone":"234","continent":"AF","capital":"Abuja","currency":"NGN","languages":["en"]},"NI":{"name":"Nicaragua","native":"Nicaragua","phone":"505","continent":"NA","capital":"Managua","currency":"NIO","languages":["es"]},"NL":{"name":"Netherlands","native":"Nederland","phone":"31","continent":"EU","capital":"Amsterdam","currency":"EUR","languages":["nl"]},"NO":{"name":"Norway","native":"Norge","phone":"47","continent":"EU","capital":"Oslo","currency":"NOK","languages":["no","nb","nn"]},"NP":{"name":"Nepal","native":"नेपाल","phone":"977","continent":"AS","capital":"Kathmandu","currency":"NPR","languages":["ne"]},"NR":{"name":"Nauru","native":"Nauru","phone":"674","continent":"OC","capital":"Yaren","currency":"AUD","languages":["en","na"]},"NU":{"name":"Niue","native":"Niuē","phone":"683","continent":"OC","capital":"Alofi","currency":"NZD","languages":["en","ni"]},"NZ":{"name":"New Zealand","native":"New Zealand","phone":"64","continent":"OC","capital":"Wellington","currency":"NZD","languages":["en","mi"]},"OM":{"name":"Oman","native":"عُمان","phone":"968","continent":"AS","capital":"Muscat","currency":"OMR","languages":["ar"]},"PA":{"name":"Panama","native":"Panamá","phone":"507","continent":"NA","capital":"Panama City","currency":"PAB","languages":["es"]},"PE":{"name":"Peru","native":"Perú","phone":"51","continent":"SA","capital":"Lima","currency":"PEN","languages":["es","qu","ay"]},"PF":{"name":"French Polynesia","native":"Polynésie française","phone":"689","continent":"OC","capital":"Papeetē","currency":"XPF","languages":["fr"]},"PG":{"name":"Papua New Guinea","native":"Papua Niugini","phone":"675","continent":"OC","capital":"Port Moresby","currency":"PGK","languages":["en"]},"PH":{"name":"Philippines","native":"Pilipinas","phone":"63","continent":"AS","capital":"Manila","currency":"PHP","languages":["en"]},"PK":{"name":"Pakistan","native":"پاکستان","phone":"92","continent":"AS","capital":"Islamabad","currency":"PKR","languages":["en","ur"]},"PL":{"name":"Poland","native":"Polska","phone":"48","continent":"EU","capital":"Warsaw","currency":"PLN","languages":["pl"]},"PM":{"name":"Saint Pierre and Miquelon","native":"Saint-Pierre-et-Miquelon","phone":"508","continent":"NA","capital":"Saint-Pierre","currency":"EUR","languages":["fr"]},"PN":{"name":"Pitcairn Islands","native":"Pitcairn Islands","phone":"64","continent":"OC","capital":"Adamstown","currency":"NZD","languages":["en"]},"PR":{"name":"Puerto Rico","native":"Puerto Rico","phone":"1787,1939","continent":"NA","capital":"San Juan","currency":"USD","languages":["es","en"]},"PS":{"name":"Palestine","native":"فلسطين","phone":"970","continent":"AS","capital":"Ramallah","currency":"ILS","languages":["ar"]},"PT":{"name":"Portugal","native":"Portugal","phone":"351","continent":"EU","capital":"Lisbon","currency":"EUR","languages":["pt"]},"PW":{"name":"Palau","native":"Palau","phone":"680","continent":"OC","capital":"Ngerulmud","currency":"USD","languages":["en"]},"PY":{"name":"Paraguay","native":"Paraguay","phone":"595","continent":"SA","capital":"Asunción","currency":"PYG","languages":["es","gn"]},"QA":{"name":"Qatar","native":"قطر","phone":"974","continent":"AS","capital":"Doha","currency":"QAR","languages":["ar"]},"RE":{"name":"Réunion","native":"La Réunion","phone":"262","continent":"AF","capital":"Saint-Denis","currency":"EUR","languages":["fr"]},"RO":{"name":"Romania","native":"România","phone":"40","continent":"EU","capital":"Bucharest","currency":"RON","languages":["ro"]},"RS":{"name":"Serbia","native":"Србија","phone":"381","continent":"EU","capital":"Belgrade","currency":"RSD","languages":["sr"]},"RU":{"name":"Russia","native":"Россия","phone":"7","continent":"EU","capital":"Moscow","currency":"RUB","languages":["ru"]},"RW":{"name":"Rwanda","native":"Rwanda","phone":"250","continent":"AF","capital":"Kigali","currency":"RWF","languages":["rw","en","fr"]},"SA":{"name":"Saudi Arabia","native":"المملكة العربية السعودية","phone":"966","continent":"AS","capital":"Riyadh","currency":"SAR","languages":["ar"]},"SB":{"name":"Solomon Islands","native":"Solomon Islands","phone":"677","continent":"OC","capital":"Honiara","currency":"SBD","languages":["en"]},"SC":{"name":"Seychelles","native":"Seychelles","phone":"248","continent":"AF","capital":"Victoria","currency":"SCR","languages":["fr","en"]},"SD":{"name":"Sudan","native":"السودان","phone":"249","continent":"AF","capital":"Khartoum","currency":"SDG","languages":["ar","en"]},"SE":{"name":"Sweden","native":"Sverige","phone":"46","continent":"EU","capital":"Stockholm","currency":"SEK","languages":["sv"]},"SG":{"name":"Singapore","native":"Singapore","phone":"65","continent":"AS","capital":"Singapore","currency":"SGD","languages":["en","ms","ta","zh"]},"SH":{"name":"Saint Helena","native":"Saint Helena","phone":"290","continent":"AF","capital":"Jamestown","currency":"SHP","languages":["en"]},"SI":{"name":"Slovenia","native":"Slovenija","phone":"386","continent":"EU","capital":"Ljubljana","currency":"EUR","languages":["sl"]},"SJ":{"name":"Svalbard and Jan Mayen","native":"Svalbard og Jan Mayen","phone":"47","continent":"EU","capital":"Longyearbyen","currency":"NOK","languages":["no"]},"SK":{"name":"Slovakia","native":"Slovensko","phone":"421","continent":"EU","capital":"Bratislava","currency":"EUR","languages":["sk"]},"SL":{"name":"Sierra Leone","native":"Sierra Leone","phone":"232","continent":"AF","capital":"Freetown","currency":"SLL","languages":["en"]},"SM":{"name":"San Marino","native":"San Marino","phone":"378","continent":"EU","capital":"City of San Marino","currency":"EUR","languages":["it"]},"SN":{"name":"Senegal","native":"Sénégal","phone":"221","continent":"AF","capital":"Dakar","currency":"XOF","languages":["fr"]},"SO":{"name":"Somalia","native":"Soomaaliya","phone":"252","continent":"AF","capital":"Mogadishu","currency":"SOS","languages":["so","ar"]},"SR":{"name":"Suriname","native":"Suriname","phone":"597","continent":"SA","capital":"Paramaribo","currency":"SRD","languages":["nl"]},"SS":{"name":"South Sudan","native":"South Sudan","phone":"211","continent":"AF","capital":"Juba","currency":"SSP","languages":["en"]},"ST":{"name":"São Tomé and Príncipe","native":"São Tomé e Príncipe","phone":"239","continent":"AF","capital":"São Tomé","currency":"STN","languages":["pt"]},"SV":{"name":"El Salvador","native":"El Salvador","phone":"503","continent":"NA","capital":"San Salvador","currency":"USD","languages":["es"]},"SX":{"name":"Sint Maarten","native":"Sint Maarten","phone":"1721","continent":"NA","capital":"Philipsburg","currency":"ANG","languages":["nl","en"]},"SY":{"name":"Syria","native":"سوريا","phone":"963","continent":"AS","capital":"Damascus","currency":"SYP","languages":["ar"]},"SZ":{"name":"Eswatini","native":"Eswatini","phone":"268","continent":"AF","capital":"Mbabane","currency":"SZL","languages":["en","ss"]},"TC":{"name":"Turks and Caicos Islands","native":"Turks and Caicos Islands","phone":"1649","continent":"NA","capital":"Cockburn Town","currency":"USD","languages":["en"]},"TD":{"name":"Chad","native":"Tchad","phone":"235","continent":"AF","capital":"N'Djamena","currency":"XAF","languages":["fr","ar"]},"TF":{"name":"French Southern Territories","native":"Territoire des Terres australes et antarctiques françaises","phone":"262","continent":"AN","capital":"Port-aux-Français","currency":"EUR","languages":["fr"]},"TG":{"name":"Togo","native":"Togo","phone":"228","continent":"AF","capital":"Lomé","currency":"XOF","languages":["fr"]},"TH":{"name":"Thailand","native":"ประเทศไทย","phone":"66","continent":"AS","capital":"Bangkok","currency":"THB","languages":["th"]},"TJ":{"name":"Tajikistan","native":"Тоҷикистон","phone":"992","continent":"AS","capital":"Dushanbe","currency":"TJS","languages":["tg","ru"]},"TK":{"name":"Tokelau","native":"Tokelau","phone":"690","continent":"OC","capital":"Fakaofo","currency":"NZD","languages":["en","to"]},"TL":{"name":"Timor-Leste","native":"Timor-Leste","phone":"670","continent":"OC","capital":"Dili","currency":"USD","languages":["pt"]},"TM":{"name":"Turkmenistan","native":"Türkmenistan","phone":"993","continent":"AS","capital":"Ashgabat","currency":"TMT","languages":["tk","ru"]},"TN":{"name":"Tunisia","native":"تونس","phone":"216","continent":"AF","capital":"Tunis","currency":"TND","languages":["ar"]},"TO":{"name":"Tonga","native":"Tonga","phone":"676","continent":"OC","capital":"Nuku'alofa","currency":"TOP","languages":["en","to"]},"TR":{"name":"Turkey","native":"Türkiye","phone":"90","continent":"AS","capital":"Ankara","currency":"TRY","languages":["tr"]},"TT":{"name":"Trinidad and Tobago","native":"Trinidad and Tobago","phone":"1868","continent":"NA","capital":"Port of Spain","currency":"TTD","languages":["en"]},"TV":{"name":"Tuvalu","native":"Tuvalu","phone":"688","continent":"OC","capital":"Funafuti","currency":"AUD","languages":["en","tv"]},"TW":{"name":"Taiwan","native":"臺灣","phone":"886","continent":"AS","capital":"Taipei","currency":"TWD","languages":["zh"]},"TZ":{"name":"Tanzania","native":"Tanzania","phone":"255","continent":"AF","capital":"Dodoma","currency":"TZS","languages":["sw","en"]},"UA":{"name":"Ukraine","native":"Україна","phone":"380","continent":"EU","capital":"Kyiv","currency":"UAH","languages":["uk"]},"UG":{"name":"Uganda","native":"Uganda","phone":"256","continent":"AF","capital":"Kampala","currency":"UGX","languages":["en","sw"]},"UM":{"name":"U.S. Minor Outlying Islands","native":"United States Minor Outlying Islands","phone":"1","continent":"OC","capital":"","currency":"USD","languages":["en"]},"US":{"name":"United States","native":"United States","phone":"1","continent":"NA","capital":"Washington D.C.","currency":"USD","languages":["en"]},"UY":{"name":"Uruguay","native":"Uruguay","phone":"598","continent":"SA","capital":"Montevideo","currency":"UYU","languages":["es"]},"UZ":{"name":"Uzbekistan","native":"O‘zbekiston","phone":"998","continent":"AS","capital":"Tashkent","currency":"UZS","languages":["uz","ru"]},"VA":{"name":"Vatican City","native":"Vaticano","phone":"3906698,379","continent":"EU","capital":"Vatican City","currency":"EUR","languages":["it","la"]},"VC":{"name":"Saint Vincent and the Grenadines","native":"Saint Vincent and the Grenadines","phone":"1784","continent":"NA","capital":"Kingstown","currency":"XCD","languages":["en"]},"VE":{"name":"Venezuela","native":"Venezuela","phone":"58","continent":"SA","capital":"Caracas","currency":"VES","languages":["es"]},"VG":{"name":"British Virgin Islands","native":"British Virgin Islands","phone":"1284","continent":"NA","capital":"Road Town","currency":"USD","languages":["en"]},"VI":{"name":"U.S. Virgin Islands","native":"United States Virgin Islands","phone":"1340","continent":"NA","capital":"Charlotte Amalie","currency":"USD","languages":["en"]},"VN":{"name":"Vietnam","native":"Việt Nam","phone":"84","continent":"AS","capital":"Hanoi","currency":"VND","languages":["vi"]},"VU":{"name":"Vanuatu","native":"Vanuatu","phone":"678","continent":"OC","capital":"Port Vila","currency":"VUV","languages":["bi","en","fr"]},"WF":{"name":"Wallis and Futuna","native":"Wallis et Futuna","phone":"681","continent":"OC","capital":"Mata-Utu","currency":"XPF","languages":["fr"]},"WS":{"name":"Samoa","native":"Samoa","phone":"685","continent":"OC","capital":"Apia","currency":"WST","languages":["sm","en"]},"XK":{"name":"Kosovo","native":"Republika e Kosovës","phone":"383","continent":"EU","capital":"Pristina","currency":"EUR","languages":["sq","sr"]},"YE":{"name":"Yemen","native":"اليَمَن","phone":"967","continent":"AS","capital":"Sana'a","currency":"YER","languages":["ar"]},"YT":{"name":"Mayotte","native":"Mayotte","phone":"262","continent":"AF","capital":"Mamoudzou","currency":"EUR","languages":["fr"]},"ZA":{"name":"South Africa","native":"South Africa","phone":"27","continent":"AF","capital":"Pretoria","currency":"ZAR","languages":["af","en","nr","st","ss","tn","ts","ve","xh","zu"]},"ZM":{"name":"Zambia","native":"Zambia","phone":"260","continent":"AF","capital":"Lusaka","currency":"ZMW","languages":["en"]},"ZW":{"name":"Zimbabwe","native":"Zimbabwe","phone":"263","continent":"AF","capital":"Harare","currency":"ZWL","languages":["en","sn","nd"]}}</script>
<script id="iso2to3-data" type="application/json">{"AD":"AND","AE":"ARE","AF":"AFG","AG":"ATG","AI":"AIA","AL":"ALB","AM":"ARM","AO":"AGO","AQ":"ATA","AR":"ARG","AS":"ASM","AT":"AUT","AU":"AUS","AW":"ABW","AX":"ALA","AZ":"AZE","BA":"BIH","BB":"BRB","BD":"BGD","BE":"BEL","BF":"BFA","BG":"BGR","BH":"BHR","BI":"BDI","BJ":"BEN","BL":"BLM","BM":"BMU","BN":"BRN","BO":"BOL","BQ":"BES","BR":"BRA","BS":"BHS","BT":"BTN","BV":"BVT","BW":"BWA","BY":"BLR","BZ":"BLZ","CA":"CAN","CC":"CCK","CD":"COD","CF":"CAF","CG":"COG","CH":"CHE","CI":"CIV","CK":"COK","CL":"CHL","CM":"CMR","CN":"CHN","CO":"COL","CR":"CRI","CU":"CUB","CV":"CPV","CW":"CUW","CX":"CXR","CY":"CYP","CZ":"CZE","DE":"DEU","DJ":"DJI","DK":"DNK","DM":"DMA","DO":"DOM","DZ":"DZA","EC":"ECU","EE":"EST","EG":"EGY","EH":"ESH","ER":"ERI","ES":"ESP","ET":"ETH","FI":"FIN","FJ":"FJI","FK":"FLK","FM":"FSM","FO":"FRO","FR":"FRA","GA":"GAB","GB":"GBR","GD":"GRD","GE":"GEO","GF":"GUF","GG":"GGY","GH":"GHA","GI":"GIB","GL":"GRL","GM":"GMB","GN":"GIN","GP":"GLP","GQ":"GNQ","GR":"GRC","GS":"SGS","GT":"GTM","GU":"GUM","GW":"GNB","GY":"GUY","HK":"HKG","HM":"HMD","HN":"HND","HR":"HRV","HT":"HTI","HU":"HUN","ID":"IDN","IE":"IRL","IL":"ISR","IM":"IMN","IN":"IND","IO":"IOT","IQ":"IRQ","IR":"IRN","IS":"ISL","IT":"ITA","JE":"JEY","JM":"JAM","JO":"JOR","JP":"JPN","KE":"KEN","KG":"KGZ","KH":"KHM","KI":"KIR","KM":"COM","KN":"KNA","KP":"PRK","KR":"KOR","KW":"KWT","KY":"CYM","KZ":"KAZ","LA":"LAO","LB":"LBN","LC":"LCA","LI":"LIE","LK":"LKA","LR":"LBR","LS":"LSO","LT":"LTU","LU":"LUX","LV":"LVA","LY":"LBY","MA":"MAR","MC":"MCO","MD":"MDA","ME":"MNE","MF":"MAF","MG":"MDG","MH":"MHL","MK":"MKD","ML":"MLI","MM":"MMR","MN":"MNG","MO":"MAC","MP":"MNP","MQ":"MTQ","MR":"MRT","MS":"MSR","MT":"MLT","MU":"MUS","MV":"MDV","MW":"MWI","MX":"MEX","MY":"MYS","MZ":"MOZ","NA":"NAM","NC":"NCL","NE":"NER","NF":"NFK","NG":"NGA","NI":"NIC","NL":"NLD","NO":"NOR","NP":"NPL","NR":"NRU","NU":"NIU","NZ":"NZL","OM":"OMN","PA":"PAN","PE":"PER","PF":"PYF","PG":"PNG","PH":"PHL","PK":"PAK","PL":"POL","PM":"SPM","PN":"PCN","PR":"PRI","PS":"PSE","PT":"PRT","PW":"PLW","PY":"PRY","QA":"QAT","RE":"REU","RO":"ROU","RS":"SRB","RU":"RUS","RW":"RWA","SA":"SAU","SB":"SLB","SC":"SYC","SD":"SDN","SE":"SWE","SG":"SGP","SH":"SHN","SI":"SVN","SJ":"SJM","SK":"SVK","SL":"SLE","SM":"SMR","SN":"SEN","SO":"SOM","SR":"SUR","SS":"SSD","ST":"STP","SV":"SLV","SX":"SXM","SY":"SYR","SZ":"SWZ","TC":"TCA","TD":"TCD","TF":"ATF","TG":"TGO","TH":"THA","TJ":"TJK","TK":"TKL","TL":"TLS","TM":"TKM","TN":"TUN","TO":"TON","TR":"TUR","TT":"TTO","TV":"TUV","TW":"TWN","TZ":"TZA","UA":"UKR","UG":"UGA","UM":"UMI","US":"USA","UY":"URY","UZ":"UZB","VA":"VAT","VC":"VCT","VE":"VEN","VG":"VGB","VI":"VIR","VN":"VNM","VU":"VUT","WF":"WLF","WS":"WSM","XK":"XKX","YE":"YEM","YT":"MYT","ZA":"ZAF","ZM":"ZMB","ZW":"ZWE"}</script>
<!-- Modal -->
<div class="modal-backdrop" id="modalBackdrop" role="dialog" aria-modal="true" aria-label="Country details">
<div class="modal">
<div class="modal-head">
<div class="title">
<b id="mTitle">—</b>
<span id="mSub">—</span>
</div>
<button class="iconbtn" id="btnClose" title="Close (Esc)">✕</button>
</div>
<div class="modal-body">
<div class="cols" id="mCols"></div>
<div class="actions" id="mActions"></div>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
// ---------- Utilities ----------
const $ = (sel) => document.querySelector(sel);
function toast(msg) {
const el = $("#toast");
el.textContent = msg;
el.style.display = "block";
clearTimeout(toast._t);
toast._t = setTimeout(() => (el.style.display = "none"), 1400);
}
function copyText(text) {
if (!text) return;
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(text)
.then(() => toast(`Copied: ${text}`))
.catch(() => fallbackCopy(text));
} else {
fallbackCopy(text);
}
}
function fallbackCopy(text) {
const ta = document.createElement("textarea");
ta.value = text;
ta.setAttribute("readonly", "");
ta.style.position = "fixed";
ta.style.left = "-9999px";
document.body.appendChild(ta);
ta.select();
try { document.execCommand("copy"); toast(`Copied: ${text}`); } catch(e){ toast("Copy failed"); }
document.body.removeChild(ta);
}
function slugify(name) {
return (name || "")
.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
.replace(/&/g, " and ")
.replace(/\[[^\]]*\]/g, " ")
.replace(/[^a-zA-Z0-9\s-]/g, " ")
.trim().toLowerCase()
.replace(/\s+/g, "-")
.replace(/-+/g, "-");
}
function escapeHtml(str) {
return String(str).replace(/[&<>"']/g, (m) => ({"&":"&","<":"<",">":">",'"':""","'":"'"}[m]));
}
const CONTINENTS = {
AF: "Africa",
AN: "Antarctica",
AS: "Asia",
EU: "Europe",
NA: "North America",
OC: "Oceania",
SA: "South America"
};
// ---------- Load embedded datasets ----------
const COUNTRIES_RAW = JSON.parse($("#countries-data").textContent);
const ISO2_TO_ISO3 = JSON.parse($("#iso2to3-data").textContent);
const DATA = Object.entries(COUNTRIES_RAW).map(([iso2, d]) => {
const phones = String(d.phone || "")
.split(",")
.map(s => s.trim())
.filter(Boolean);
const iso3 = ISO2_TO_ISO3[iso2] || "";
const continentName = CONTINENTS[d.continent] || d.continent || "";
const languages = Array.isArray(d.languages) ? d.languages : String(d.languages || "").split(",").map(s=>s.trim()).filter(Boolean);
const name = d.name || "";
const native = d.native || "";
const capital = d.capital || "";
const currency = d.currency || "";
const hay = [
name, native, iso2, iso3, capital, currency, continentName, phones.join(" ")
].join(" | ").toLowerCase();
return {
iso2,
iso3,
name,
native,
capital,
continent: d.continent || "",
continentName,
currency,
languages,
phones,
_hay: hay
};
});
const BY_ISO2 = new Map(DATA.map(x => [x.iso2, x]));
$("#countryCount").textContent = DATA.length.toLocaleString();
// ---------- Render ----------
const cardsEl = $("#cards");
const statusBadge = $("#statusBadge");
const resultCountEl = $("#resultCount");
const MAX_RESULTS = 60;
function scoreItem(item, q, mode, digitsOnly) {
let s = 0;
const qUpper = q.toUpperCase();
const qLower = q.toLowerCase();
if (mode === "all" || mode === "iso2") {
if (item.iso2 === qUpper) s += 1000;
}
if (mode === "all" || mode === "iso3") {
if (item.iso3 === qUpper) s += 980;
}
if (mode === "all" || mode === "phone") {
if (digitsOnly) {
if (item.phones.includes(digitsOnly)) s += 970;
if (item.phones.some(p => p.startsWith(digitsOnly))) s += 700;
}
}
if (mode === "all" || mode === "name") {
const n = item.name.toLowerCase();
if (n === qLower) s += 960;
if (n.startsWith(qLower)) s += 500;
}
if (mode === "capital") {
const c = (item.capital || "").toLowerCase();
if (c === qLower) s += 520;
if (c.startsWith(qLower)) s += 260;
}
if (item._hay.includes(qLower)) s += 120;
if (digitsOnly && !item.phones.some(p => p.includes(digitsOnly))) s -= 10;
return s;
}
function formatPhoneTag(phones) {
if (!phones.length) return "";
if (phones.length === 1) return `+${phones[0]}`;
return `+${phones[0]} +${phones[1]}${phones.length > 2 ? "…" : ""}`;
}
function renderCards(items) {
if (!items.length) {
cardsEl.innerHTML = `<div class="item" style="grid-column:1/-1">
<p class="t">No results</p>
<p class="d">Try a different spelling, or search by calling code (example: <span class="mono">+44</span>) or ISO (example: <span class="mono">GB</span> / <span class="mono">GBR</span>).</p>
</div>`;
return;
}
cardsEl.innerHTML = items.map((c) => {
const phoneTag = formatPhoneTag(c.phones);
const isoTag = `${c.iso2}${c.iso3 ? " / " + c.iso3 : ""}`;
const cont = c.continentName ? c.continentName : "—";
return `
<div class="card" data-iso2="${c.iso2}">
<div class="right" title="Calling code(s)">${phoneTag || "—"}</div>
<p class="name">${escapeHtml(c.name)}</p>
<p class="sub">
<span class="tag blue mono">${escapeHtml(isoTag)}</span>
<span class="tag green">${escapeHtml(cont)}</span>
${c.capital ? `<span class="tag purple">Capital: ${escapeHtml(c.capital)}</span>` : `<span class="tag">Capital: —</span>`}
</p>
</div>
`;
}).join("");
}
function search() {
const qRaw = $("#q").value.trim();
const mode = $("#mode").value;
if (!qRaw) {
statusBadge.textContent = "Ready";
resultCountEl.textContent = "0";
cardsEl.innerHTML = `<div class="item" style="grid-column:1/-1">
<p class="t">Start typing</p>
<p class="d">Search by <b>country name</b>, <b>calling code</b>, <b>ISO2</b>, <b>ISO3</b>, or <b>capital</b>.</p>
<p class="d">Examples: <span class="mono">Japan</span>, <span class="mono">+81</span>, <span class="mono">KR</span>, <span class="mono">KOR</span>, <span class="mono">Seoul</span>.</p>
</div>`;
return;
}
const digitsOnly = qRaw.replace(/[^0-9]/g, "");
const t0 = performance.now();
const matches = DATA
.map(item => ({ item, s: scoreItem(item, qRaw, mode, digitsOnly) }))
.filter(x => x.s > 0 || x.item._hay.includes(qRaw.toLowerCase()))
.sort((a,b) => b.s - a.s || a.item.name.localeCompare(b.item.name))
.slice(0, MAX_RESULTS)
.map(x => x.item);
const dt = Math.round(performance.now() - t0);
statusBadge.textContent = `Found in ${dt}ms`;
resultCountEl.textContent = matches.length.toLocaleString();
renderCards(matches);
}
// ---------- Modal ----------
const modalBackdrop = $("#modalBackdrop");
function closeModal() {
modalBackdrop.style.display = "none";
document.body.style.overflow = "";
}
function openModal(country) {
$("#mTitle").textContent = country.name || "—";
$("#mSub").textContent = `${country.iso2}${country.iso3 ? " / " + country.iso3 : ""} • ${country.continentName || "—"}`;
const phoneDisplay = country.phones.length ? country.phones.map(p => `+${p}`).join(", ") : "—";
const languagesDisplay = country.languages.length ? country.languages.join(", ") : "—";
const cols = [
{ k:"Calling code(s)", v: phoneDisplay, mono:true },
{ k:"ISO codes", v: `${country.iso2}${country.iso3 ? " / " + country.iso3 : ""}`, mono:true },
{ k:"Country name (native)", v: country.native || "—" },
{ k:"Capital", v: country.capital || "—" },
{ k:"Continent", v: country.continentName || "—" },
{ k:"Languages (ISO 639-1)", v: languagesDisplay, mono:true },
{ k:"Currency (ISO 4217)", v: country.currency || "—", mono:true }
];
$("#mCols").innerHTML = cols.map(x => `
<div class="kv">
<div class="k">${escapeHtml(x.k)}</div>
<div class="v ${x.mono ? "mono" : ""}">${escapeHtml(x.v)}</div>
</div>
`).join("");
const slug = slugify(country.name);
const linkCountry = `https://countrycode.online/countries/${slug}/`;
const linkSearch = `https://countrycode.online/?s=${encodeURIComponent(country.name)}`;
const actions = [];
if (country.phones.length) actions.push({
label: "Copy calling code",
on: () => copyText("+" + country.phones[0]),
cls: ""
});
actions.push({
label: "Copy ISO2",
on: () => copyText(country.iso2),
cls: "secondary"
});
if (country.iso3) actions.push({
label: "Copy ISO3",
on: () => copyText(country.iso3),
cls: "secondary"
});
actions.push({
label: "Open on CountryCode.online",
href: linkCountry,
cls: ""
});
actions.push({
label: "Search on CountryCode.online",
href: linkSearch,
cls: "secondary"
});
$("#mActions").innerHTML = actions.map(a => {
if (a.href) {
return `<a class="btn ${a.cls || ""}" href="${a.href}" target="_blank" rel="noopener">🌍 ${escapeHtml(a.label)} ↗</a>`;
}
return `<button class="btn ${a.cls || ""}" type="button">📋 ${escapeHtml(a.label)}</button>`;
}).join("");
// Wire up action buttons
const btns = Array.from($("#mActions").querySelectorAll("button.btn"));
let bi = 0;
for (const a of actions) {
if (a.href) continue;
const btn = btns[bi++];
btn.addEventListener("click", a.on);
}
modalBackdrop.style.display = "grid";
document.body.style.overflow = "hidden";
}
cardsEl.addEventListener("click", (e) => {
const card = e.target.closest(".card");
if (!card) return;
const iso2 = card.getAttribute("data-iso2");
const c = BY_ISO2.get(iso2);
if (c) openModal(c);
});
$("#btnClose").addEventListener("click", closeModal);
modalBackdrop.addEventListener("click", (e) => {
if (e.target === modalBackdrop) closeModal();
});
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") closeModal();
});
// ---------- UI wiring ----------
const debounce = (() => {
let t = null;
return (fn, ms=60) => {
clearTimeout(t);
t = setTimeout(fn, ms);
};
})();
$("#q").addEventListener("input", () => debounce(search, 60));
$("#mode").addEventListener("change", search);
$("#btnClear").addEventListener("click", () => {
$("#q").value = "";
$("#q").focus();
search();
});
$("#btnDownload").addEventListener("click", () => {
const html = "<!doctype html>\n" + document.documentElement.outerHTML;
const blob = new Blob([html], { type: "text/html;charset=utf-8" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "index.html";
document.body.appendChild(a);
a.click();
a.remove();
URL.revokeObjectURL(url);
toast("Downloaded index.html");
});
const now = new Date();
$("#buildInfo").textContent = `Snapshot loaded • ${now.toISOString().slice(0,10)}`;
// Initial render
search();
</script>
</body>
</html>