{"version":3,"file":"index.mjs","sources":["../../../../src/phoneNumberInput/utils/findCountryByPrefix/index.ts"],"sourcesContent":["import countries from '../../data/countries';\nimport { longestMatchingPrefix } from '../longestMatchingPrefix';\n\nexport const findCountryByPrefix = (number: string) => {\n  if (number.length > 1) {\n    const matchingCodes = countries.filter((country) => number.startsWith(country.phone));\n    if (matchingCodes.length > 0) {\n      return longestMatchingPrefix(matchingCodes);\n    }\n  }\n  return null;\n};\n"],"names":["findCountryByPrefix","number","length","matchingCodes","countries","filter","country","startsWith","phone","longestMatchingPrefix"],"mappings":";;;AAGO,MAAMA,mBAAmB,GAAIC,MAAc,IAAI;AACpD,EAAA,IAAIA,MAAM,CAACC,MAAM,GAAG,CAAC,EAAE;AACrB,IAAA,MAAMC,aAAa,GAAGC,SAAS,CAACC,MAAM,CAAEC,OAAO,IAAKL,MAAM,CAACM,UAAU,CAACD,OAAO,CAACE,KAAK,CAAC,CAAC;AACrF,IAAA,IAAIL,aAAa,CAACD,MAAM,GAAG,CAAC,EAAE;MAC5B,OAAOO,qBAAqB,CAACN,aAAa,CAAC;AAC7C,IAAA;AACF,EAAA;AACA,EAAA,OAAO,IAAI;AACb;;;;"}