// src/utils/simpleSearch.ts
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
  return objects.filter((object) => {
    const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
    if (!mappedSearchKeywords) {
      return true;
    }
    return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
  });
};
var MultiSearchWithMapping = (search, objects, mapping) => {
  return objects.filter((object) => {
    const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
    if (!mappedSearchKeywords) {
      return true;
    }
    return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
  });
};
var SimpleSearchWithMapping = (search, objects, mapping) => {
  return MultiSearchWithMapping(search, objects, (value) => [mapping(value)]);
};
var SimpleSearch = (search, objects) => {
  return SimpleSearchWithMapping(search, objects, (value) => value);
};
export {
  MultiSearchWithMapping,
  MultiSubjectSearchWithMapping,
  SimpleSearch,
  SimpleSearchWithMapping
};
//# sourceMappingURL=simpleSearch.js.map