import { createSelector } from "reselect";
import { omitBy } from "lodash";
import featuresSelector from "./featuresSelector";
import sequenceLengthSelector from "./sequenceLengthSelector";
import { hideAnnByLengthFilter } from "../utils/editorUtils";
function filteredFeaturesSelector(features, seqLen, featureIndividualToHide, featureTypesToHide, lengthsToHide) {
  return omitBy(features, function (ann) {
    var hideIndividually = featureIndividualToHide[ann.id];
    var hideFeaturesByType = featureTypesToHide[ann.type];
    return hideAnnByLengthFilter(lengthsToHide, ann, seqLen) || hideFeaturesByType || hideIndividually;
  });
}
export default createSelector(featuresSelector, sequenceLengthSelector, function (state) {
  return state.annotationVisibility.featureIndividualToHide;
}, function (state) {
  return state.annotationVisibility.featureTypesToHide;
}, function (state) {
  return state.featureLengthsToHide;
}, filteredFeaturesSelector);