import { BooleanValue, NumberValue } from '@coveo/bueno';
import { createAction } from '@reduxjs/toolkit';
import { requiredNonEmptyString, validatePayload, } from '../../../../utils/validate-payload.js';
export const updateCoreFacetNumberOfValues = createAction('commerce/facets/core/updateNumberOfValues', (payload) => validatePayload(payload, {
    facetId: requiredNonEmptyString,
    numberOfValues: new NumberValue({ required: true, min: 1 }),
}));
export const updateCoreFacetIsFieldExpanded = createAction('commerce/facets/core/updateIsFieldExpanded', (payload) => validatePayload(payload, {
    facetId: requiredNonEmptyString,
    isFieldExpanded: new BooleanValue({ required: true }),
}));
export const clearAllCoreFacets = createAction('commerce/facets/core/clearAll');
export const deleteAllCoreFacets = createAction('commerce/facets/core/deleteAll');
export const deselectAllValuesInCoreFacet = createAction('commerce/facets/core/deselectAllValues', (payload) => validatePayload(payload, {
    facetId: requiredNonEmptyString,
}));
export const updateCoreFacetFreezeCurrentValues = createAction('commerce/facets/core/updateFreezeCurrentValues', (payload) => validatePayload(payload, {
    facetId: requiredNonEmptyString,
    freezeCurrentValues: new BooleanValue({ required: true }),
}));
export const updateAutoSelectionForAllCoreFacets = createAction('commerce/facets/core/updateAutoSelectionForAll', (payload) => validatePayload(payload, {
    allow: new BooleanValue({ required: true }),
}));
