import { CriteriaType } from './types';
/**
 * Returns the criteria types that are not yet selected, filtered to `allowed`,
 * excluding ALL (which is never offered via CriteriaAutocomplete).
 * Defaults to [SEGMENTATION, INDIVIDUAL] when `allowed` is omitted.
 */
export const getAvailableCriteriaTypes = (criterias, allowed = [
    CriteriaType.SEGMENTATION,
    CriteriaType.INDIVIDUAL,
]) => {
    const selectedTypes = new Set(criterias.map(c => c.type));
    if (selectedTypes.has(CriteriaType.ALL))
        return [];
    return allowed
        .filter(t => t !== CriteriaType.ALL)
        .filter(type => !selectedTypes.has(type));
};
