import { ensureAtLeastOneSolutionType } from '../../../../app/commerce-ssr-engine/common.js';
import { SolutionType, } from '../../../../app/commerce-ssr-engine/types/common.js';
import { buildProductListing } from '../../product-listing/headless-product-listing.js';
import { buildSearch } from '../../search/headless-search.js';
/**
 * Defines a `BreadcrumbManager` controller instance.
 * @group Definers
 *
 * @returns The `BreadcrumbManager` controller definition.
 */
export function defineBreadcrumbManager(options) {
    ensureAtLeastOneSolutionType(options);
    return {
        listing: true,
        search: true,
        ...options,
        build: (engine, solutionType) => solutionType === SolutionType.listing
            ? buildProductListing(engine).breadcrumbManager()
            : buildSearch(engine).breadcrumbManager(),
    };
}
