import { recommendationInternalOptionKey, } from '../../../app/commerce-ssr-engine/types/common.js';
import { createControllerWithKind, Kind, } from '../../../app/commerce-ssr-engine/types/kind.js';
import { buildRecommendations, } from './headless-recommendations.js';
/**
 * Defines a `Recommendations` controller instance.
 * @group Definers
 *
 * @param props - The configurable `Recommendations` properties.
 * @returns The `Recommendations` controller definition.
 * */
export function defineRecommendations(props) {
    return {
        recommendation: true,
        [recommendationInternalOptionKey]: {
            ...props.options,
        },
        buildWithProps: (engine, options) => {
            const staticOptions = props.options;
            const controller = buildRecommendations(engine, {
                options: { ...staticOptions, ...options },
            });
            return createControllerWithKind(controller, Kind.Recommendations);
        },
    };
}
