/**
 * Стандартизированный справочник стран (ISO 3166-1 alpha-2) с русскими названиями.
 * Источник: общедоступный справочник. Не зависит от данных в БД vps-tracker.
 */

export interface CountryRef {
  /** ISO 3166-1 alpha-2 код */
  code: string
  /** Русское название */
  name: string
  /** Английское название */
  nameEn: string
}

export const COUNTRIES: readonly CountryRef[] = [
  { code: 'AU', name: 'Австралия', nameEn: 'Australia' },
  { code: 'AT', name: 'Австрия', nameEn: 'Austria' },
  { code: 'AZ', name: 'Азербайджан', nameEn: 'Azerbaijan' },
  { code: 'AL', name: 'Албания', nameEn: 'Albania' },
  { code: 'DZ', name: 'Алжир', nameEn: 'Algeria' },
  { code: 'AO', name: 'Ангола', nameEn: 'Angola' },
  { code: 'AR', name: 'Аргентина', nameEn: 'Argentina' },
  { code: 'AM', name: 'Армения', nameEn: 'Armenia' },
  { code: 'AF', name: 'Афганистан', nameEn: 'Afghanistan' },
  { code: 'BE', name: 'Бельгия', nameEn: 'Belgium' },
  { code: 'BG', name: 'Болгария', nameEn: 'Bulgaria' },
  { code: 'BO', name: 'Боливия', nameEn: 'Bolivia' },
  { code: 'BA', name: 'Босния и Герцеговина', nameEn: 'Bosnia and Herzegovina' },
  { code: 'BR', name: 'Бразилия', nameEn: 'Brazil' },
  { code: 'GB', name: 'Великобритания', nameEn: 'United Kingdom' },
  { code: 'HU', name: 'Венгрия', nameEn: 'Hungary' },
  { code: 'VE', name: 'Венесуэла', nameEn: 'Venezuela' },
  { code: 'VN', name: 'Вьетнам', nameEn: 'Vietnam' },
  { code: 'GA', name: 'Габон', nameEn: 'Gabon' },
  { code: 'HT', name: 'Гаити', nameEn: 'Haiti' },
  { code: 'GY', name: 'Гайана', nameEn: 'Guyana' },
  { code: 'GM', name: 'Гамбия', nameEn: 'Gambia' },
  { code: 'GH', name: 'Гана', nameEn: 'Ghana' },
  { code: 'GT', name: 'Гватемала', nameEn: 'Guatemala' },
  { code: 'GN', name: 'Гвинея', nameEn: 'Guinea' },
  { code: 'DE', name: 'Германия', nameEn: 'Germany' },
  { code: 'HN', name: 'Гондурас', nameEn: 'Honduras' },
  { code: 'GR', name: 'Греция', nameEn: 'Greece' },
  { code: 'GE', name: 'Грузия', nameEn: 'Georgia' },
  { code: 'DK', name: 'Дания', nameEn: 'Denmark' },
  { code: 'CD', name: 'ДР Конго', nameEn: 'DR Congo' },
  { code: 'EG', name: 'Египет', nameEn: 'Egypt' },
  { code: 'ZM', name: 'Замбия', nameEn: 'Zambia' },
  { code: 'ZW', name: 'Зимбабве', nameEn: 'Zimbabwe' },
  { code: 'IL', name: 'Израиль', nameEn: 'Israel' },
  { code: 'IN', name: 'Индия', nameEn: 'India' },
  { code: 'ID', name: 'Индонезия', nameEn: 'Indonesia' },
  { code: 'JO', name: 'Иордания', nameEn: 'Jordan' },
  { code: 'IQ', name: 'Ирак', nameEn: 'Iraq' },
  { code: 'IR', name: 'Иран', nameEn: 'Iran' },
  { code: 'IE', name: 'Ирландия', nameEn: 'Ireland' },
  { code: 'IS', name: 'Исландия', nameEn: 'Iceland' },
  { code: 'ES', name: 'Испания', nameEn: 'Spain' },
  { code: 'IT', name: 'Италия', nameEn: 'Italy' },
  { code: 'YE', name: 'Йемен', nameEn: 'Yemen' },
  { code: 'KZ', name: 'Казахстан', nameEn: 'Kazakhstan' },
  { code: 'KH', name: 'Камбоджа', nameEn: 'Cambodia' },
  { code: 'CM', name: 'Камерун', nameEn: 'Cameroon' },
  { code: 'CA', name: 'Канада', nameEn: 'Canada' },
  { code: 'QA', name: 'Катар', nameEn: 'Qatar' },
  { code: 'KE', name: 'Кения', nameEn: 'Kenya' },
  { code: 'CY', name: 'Кипр', nameEn: 'Cyprus' },
  { code: 'KG', name: 'Киргизия', nameEn: 'Kyrgyzstan' },
  { code: 'CN', name: 'Китай', nameEn: 'China' },
  { code: 'CO', name: 'Колумбия', nameEn: 'Colombia' },
  { code: 'CG', name: 'Конго', nameEn: 'Congo' },
  { code: 'KR', name: 'Южная Корея', nameEn: 'South Korea' },
  { code: 'KP', name: 'Северная Корея', nameEn: 'North Korea' },
  { code: 'XK', name: 'Косово', nameEn: 'Kosovo' },
  { code: 'CR', name: 'Коста-Рика', nameEn: 'Costa Rica' },
  { code: 'CI', name: "Кот-д'Ивуар", nameEn: "Côte d'Ivoire" },
  { code: 'CU', name: 'Куба', nameEn: 'Cuba' },
  { code: 'KW', name: 'Кувейт', nameEn: 'Kuwait' },
  { code: 'LA', name: 'Лаос', nameEn: 'Laos' },
  { code: 'LV', name: 'Латвия', nameEn: 'Latvia' },
  { code: 'LR', name: 'Либерия', nameEn: 'Liberia' },
  { code: 'LB', name: 'Ливан', nameEn: 'Lebanon' },
  { code: 'LY', name: 'Ливия', nameEn: 'Libya' },
  { code: 'LT', name: 'Литва', nameEn: 'Lithuania' },
  { code: 'LI', name: 'Лихтенштейн', nameEn: 'Liechtenstein' },
  { code: 'LU', name: 'Люксембург', nameEn: 'Luxembourg' },
  { code: 'MU', name: 'Маврикий', nameEn: 'Mauritius' },
  { code: 'MR', name: 'Мавритания', nameEn: 'Mauritania' },
  { code: 'MG', name: 'Мадагаскар', nameEn: 'Madagascar' },
  { code: 'MO', name: 'Макао', nameEn: 'Macao' },
  { code: 'MW', name: 'Малави', nameEn: 'Malawi' },
  { code: 'MY', name: 'Малайзия', nameEn: 'Malaysia' },
  { code: 'ML', name: 'Мали', nameEn: 'Mali' },
  { code: 'MT', name: 'Мальта', nameEn: 'Malta' },
  { code: 'MA', name: 'Марокко', nameEn: 'Morocco' },
  { code: 'MX', name: 'Мексика', nameEn: 'Mexico' },
  { code: 'MZ', name: 'Мозамбик', nameEn: 'Mozambique' },
  { code: 'MD', name: 'Молдавия', nameEn: 'Moldova' },
  { code: 'MC', name: 'Монако', nameEn: 'Monaco' },
  { code: 'MN', name: 'Монголия', nameEn: 'Mongolia' },
  { code: 'MM', name: 'Мьянма', nameEn: 'Myanmar' },
  { code: 'NA', name: 'Намибия', nameEn: 'Namibia' },
  { code: 'NP', name: 'Непал', nameEn: 'Nepal' },
  { code: 'NE', name: 'Нигер', nameEn: 'Niger' },
  { code: 'NG', name: 'Нигерия', nameEn: 'Nigeria' },
  { code: 'NL', name: 'Нидерланды', nameEn: 'Netherlands' },
  { code: 'NI', name: 'Никарагуа', nameEn: 'Nicaragua' },
  { code: 'NZ', name: 'Новая Зеландия', nameEn: 'New Zealand' },
  { code: 'NO', name: 'Норвегия', nameEn: 'Norway' },
  { code: 'AE', name: 'ОАЭ', nameEn: 'United Arab Emirates' },
  { code: 'OM', name: 'Оман', nameEn: 'Oman' },
  { code: 'PK', name: 'Пакистан', nameEn: 'Pakistan' },
  { code: 'PA', name: 'Панама', nameEn: 'Panama' },
  { code: 'PG', name: 'Папуа — Новая Гвинея', nameEn: 'Papua New Guinea' },
  { code: 'PY', name: 'Парагвай', nameEn: 'Paraguay' },
  { code: 'PE', name: 'Перу', nameEn: 'Peru' },
  { code: 'PL', name: 'Польша', nameEn: 'Poland' },
  { code: 'PT', name: 'Португалия', nameEn: 'Portugal' },
  { code: 'RU', name: 'Россия', nameEn: 'Russia' },
  { code: 'RW', name: 'Руанда', nameEn: 'Rwanda' },
  { code: 'RO', name: 'Румыния', nameEn: 'Romania' },
  { code: 'SV', name: 'Сальвадор', nameEn: 'El Salvador' },
  { code: 'SA', name: 'Саудовская Аравия', nameEn: 'Saudi Arabia' },
  { code: 'MK', name: 'Северная Македония', nameEn: 'North Macedonia' },
  { code: 'SC', name: 'Сейшелы', nameEn: 'Seychelles' },
  { code: 'SN', name: 'Сенегал', nameEn: 'Senegal' },
  { code: 'RS', name: 'Сербия', nameEn: 'Serbia' },
  { code: 'SG', name: 'Сингапур', nameEn: 'Singapore' },
  { code: 'SK', name: 'Словакия', nameEn: 'Slovakia' },
  { code: 'SI', name: 'Словения', nameEn: 'Slovenia' },
  { code: 'SO', name: 'Сомали', nameEn: 'Somalia' },
  { code: 'SD', name: 'Судан', nameEn: 'Sudan' },
  { code: 'US', name: 'США', nameEn: 'United States' },
  { code: 'TJ', name: 'Таджикистан', nameEn: 'Tajikistan' },
  { code: 'TH', name: 'Таиланд', nameEn: 'Thailand' },
  { code: 'TZ', name: 'Танзания', nameEn: 'Tanzania' },
  { code: 'TG', name: 'Того', nameEn: 'Togo' },
  { code: 'TT', name: 'Тринидад и Тобаго', nameEn: 'Trinidad and Tobago' },
  { code: 'TV', name: 'Тувалу', nameEn: 'Tuvalu' },
  { code: 'TN', name: 'Тунис', nameEn: 'Tunisia' },
  { code: 'TM', name: 'Туркмения', nameEn: 'Turkmenistan' },
  { code: 'TR', name: 'Турция', nameEn: 'Turkey' },
  { code: 'UG', name: 'Уганда', nameEn: 'Uganda' },
  { code: 'UZ', name: 'Узбекистан', nameEn: 'Uzbekistan' },
  { code: 'UA', name: 'Украина', nameEn: 'Ukraine' },
  { code: 'UY', name: 'Уругвай', nameEn: 'Uruguay' },
  { code: 'FJ', name: 'Фиджи', nameEn: 'Fiji' },
  { code: 'PH', name: 'Филиппины', nameEn: 'Philippines' },
  { code: 'FI', name: 'Финляндия', nameEn: 'Finland' },
  { code: 'FR', name: 'Франция', nameEn: 'France' },
  { code: 'HR', name: 'Хорватия', nameEn: 'Croatia' },
  { code: 'TD', name: 'Чад', nameEn: 'Chad' },
  { code: 'ME', name: 'Черногория', nameEn: 'Montenegro' },
  { code: 'CZ', name: 'Чехия', nameEn: 'Czechia' },
  { code: 'CL', name: 'Чили', nameEn: 'Chile' },
  { code: 'CH', name: 'Швейцария', nameEn: 'Switzerland' },
  { code: 'SE', name: 'Швеция', nameEn: 'Sweden' },
  { code: 'LK', name: 'Шри-Ланка', nameEn: 'Sri Lanka' },
  { code: 'EC', name: 'Эквадор', nameEn: 'Ecuador' },
  { code: 'GQ', name: 'Экваториальная Гвинея', nameEn: 'Equatorial Guinea' },
  { code: 'ER', name: 'Эритрея', nameEn: 'Eritrea' },
  { code: 'EE', name: 'Эстония', nameEn: 'Estonia' },
  { code: 'ET', name: 'Эфиопия', nameEn: 'Ethiopia' },
  { code: 'ZA', name: 'ЮАР', nameEn: 'South Africa' },
  { code: 'JM', name: 'Ямайка', nameEn: 'Jamaica' },
  { code: 'JP', name: 'Япония', nameEn: 'Japan' },
]

export const COUNTRY_BY_CODE: Record<string, CountryRef> = Object.fromEntries(
  COUNTRIES.map((c) => [c.code, c]),
)

export const COUNTRY_BY_NAME_RU: Record<string, CountryRef> = Object.fromEntries(
  COUNTRIES.map((c) => [c.name.toLowerCase(), c]),
)
