// (C) 2021-2026 GoodData Corporation
import { areObjRefsEqual } from "@gooddata/sdk-model";
export function canFilterBeAdded(addedDateDataSetRef, allFilters) {
    // first filter is always ok, save some useless work upfront
    if (allFilters.length === 0) {
        return true;
    }
    const existingDateDataSets = allFilters.map((df) => df.dateFilter.dataSet);
    return !existingDateDataSets.some((existing) => areObjRefsEqual(existing, addedDateDataSetRef));
}
//# sourceMappingURL=uniqueFiltersValidation.js.map