{"version":3,"file":"excludeCountries.mjs","sources":["../../../../src/phoneNumberInput/utils/excludeCountries/excludeCountries.ts"],"sourcesContent":["import type { Country } from '../../data/countries';\n\n// Reference fro localeCompare : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare\nconst filterCountriesByIso3 = (countries: readonly Country[], iso3Codes: readonly string[]) => {\n  const iso3CodesSet = new Set(iso3Codes);\n  return countries.filter((country) => !iso3CodesSet.has(country.iso3));\n};\n\n/**\n * Removes the countries sepecified in the second param\n *\n * @param countries list of country metadata objects\n * @param disabledCountries list of iso3 country codes to remove from the list\n */\nexport const excludeCountries = (\n  countries: readonly Country[],\n  disabledCountries: readonly string[],\n) => {\n  return disabledCountries.length > 0\n    ? filterCountriesByIso3(countries, disabledCountries)\n    : countries;\n};\n"],"names":["filterCountriesByIso3","countries","iso3Codes","iso3CodesSet","Set","filter","country","has","iso3","excludeCountries","disabledCountries","length"],"mappings":"AAEA;AACA,MAAMA,qBAAqB,GAAGA,CAACC,SAA6B,EAAEC,SAA4B,KAAI;AAC5F,EAAA,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAACF,SAAS,CAAC;AACvC,EAAA,OAAOD,SAAS,CAACI,MAAM,CAAEC,OAAO,IAAK,CAACH,YAAY,CAACI,GAAG,CAACD,OAAO,CAACE,IAAI,CAAC,CAAC;AACvE,CAAC;AAED;;;;;AAKG;MACUC,gBAAgB,GAAGA,CAC9BR,SAA6B,EAC7BS,iBAAoC,KAClC;AACF,EAAA,OAAOA,iBAAiB,CAACC,MAAM,GAAG,CAAC,GAC/BX,qBAAqB,CAACC,SAAS,EAAES,iBAAiB,CAAC,GACnDT,SAAS;AACf;;;;"}