import { SolutionType } from '../types/controller-constants.js';
import { buildFactory, } from './build-factory.js';
export function hydratedRecommendationStaticStateFactory(controllerDefinitions, options) {
    return async (...params) => {
        const solutionTypeBuild = await buildFactory(controllerDefinitions, options)(SolutionType.recommendation);
        const { engine, controllers } = (await solutionTypeBuild(
        // @ts-expect-error: TODO: KIT-4742: the wiring will fix also the type inconsistencies
        ...params));
        params[0].searchActions.forEach((action) => {
            engine.dispatch(action);
        });
        await engine.waitForRequestCompletedAction();
        return { engine, controllers };
    };
}
