import { s as state } from './store-75674961.js';

function cleanAndLowerString(str) {
  if (!str)
    return str;
  return str
    .replace(/\s{2,}/g, " ")
    .trim()
    .toLowerCase();
}

function getServiceTypes({ filterBy, } = {}) {
  const services = filterBy
    ? ((state === null || state === void 0 ? void 0 : state.services) || []).filter(filterBy)
    : (state === null || state === void 0 ? void 0 : state.services) || [];
  return [
    ...new Set(services.map((service) => cleanAndLowerString(service === null || service === void 0 ? void 0 : service.tab))),
  ]
    .sort((a, b) => (a > b ? 1 : -1))
    .filter((value) => value === null || value === void 0 ? void 0 : value.length)
    .map((value) => ({
    label: value,
    value,
  }));
}

export { cleanAndLowerString as c, getServiceTypes as g };
