// (C) 2021-2026 GoodData Corporation
import { createSelector } from "@reduxjs/toolkit";
import { invariant } from "ts-invariant";
const selectSelf = createSelector((state) => state, (state) => state.backendCapabilities);
/**
 * This selector returns capabilities of the backend with which the dashboard works.
 *
 * @public
 */
export const selectBackendCapabilities = createSelector(selectSelf, (state) => {
    invariant(state.backendCapabilities, "attempting to access uninitialized backend capabilities");
    return state.backendCapabilities;
});
/**
 * This selector returns capability if parent child filtering is enabled.
 *
 * @public
 */
export const selectSupportsElementsQueryParentFiltering = () => true;
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsKpiWidget}
 *
 * @internal
 */
export const selectSupportsKpiWidgetCapability = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsKpiWidget ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsAccessControl}
 *
 * @internal
 */
export const selectSupportsAccessControlCapability = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsAccessControl ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsHierarchicalWorkspaces}
 *
 * @internal
 */
export const selectSupportsHierarchicalWorkspacesCapability = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsHierarchicalWorkspaces ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsElementUris}
 *
 * @internal
 */
export const selectSupportsElementUris = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsElementUris ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.canExportCsv}
 *
 * @internal
 */
export const selectSupportsExportToCsv = createSelector(selectBackendCapabilities, (capabilities) => capabilities.canExportCsv ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.canExportXlsx}
 *
 * @internal
 */
export const selectSupportsExportToXlsx = createSelector(selectBackendCapabilities, (capabilities) => capabilities.canExportXlsx ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsObjectUris}
 *
 * @internal
 */
export const selectSupportsObjectUris = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsObjectUris ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsSettingConnectingAttributes}
 *
 * @internal
 */
export const selectSupportsSettingConnectingAttributes = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsSettingConnectingAttributes ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsKeepingDependentFiltersSelection}
 *
 * @internal
 */
export const selectSupportsKeepingDependentFiltersSelection = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsKeepingDependentFiltersSelection ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsCircularDependencyInFilters}
 *
 * @internal
 */
export const selectSupportsCircularDependencyInFilters = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsCircularDependencyInFilters ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.allowMultipleInteractionsPerAttributeAndMeasure}
 *
 * @internal
 */
export const selectAllowMultipleInteractionsPerAttributeAndMeasure = createSelector(selectBackendCapabilities, (capabilities) => capabilities.allowMultipleInteractionsPerAttributeAndMeasure ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.selectSupportsAttributeHierarchies}
 *
 * @internal
 */
export const selectSupportsAttributeHierarchies = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsAttributeHierarchies ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsSingleSelectDependentFilters}
 *
 * @internal
 */
export const selectSupportsSingleSelectDependentFilters = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsSingleSelectDependentFilters ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsCrossFiltering}
 *
 * @internal
 */
export const selectSupportsCrossFiltering = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsCrossFiltering ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsMultipleDateFilters}
 *
 * @internal
 */
export const selectSupportsMultipleDateFilters = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsMultipleDateFilters ?? false);
/**
 * Selector for {@link @gooddata/sdk-backend-spi#IBackendCapabilities.supportsRichTextWidgets}
 *
 * @internal
 */
export const selectSupportsRichTextWidgets = createSelector(selectBackendCapabilities, (capabilities) => capabilities.supportsRichTextWidgets ?? false);
//# sourceMappingURL=backendCapabilitiesSelectors.js.map