import { experimentsFallbackApi } from '@wix/bex-core';
import { useExperiments } from '@wix/yoshi-flow-bm';
import { useState } from 'react';
export function useExperimentsCompat() {
    const [fallbackApi] = useState(() => experimentsFallbackApi());
    try {
        // eslint-disable-next-line react-hooks/rules-of-hooks
        const { experiments } = useExperiments() ?? {};
        return experiments ?? fallbackApi;
    }
    catch (e) {
        console.error(e);
        return fallbackApi;
    }
}
//# sourceMappingURL=useExperimentsCompat.js.map