import { useMemo } from 'react';
import { getShouldRenderFloatingOneTap } from '../../oneTap/positionModes.mjs';
import { hasProduct } from '../b2c/utils.mjs';
import { OAuthProviders } from '../../../../core/src/public/ui.mjs';

const useIsOnlyFloatingOneTap = (config)=>{
    return useMemo(()=>{
        const position = config.oauthOptions?.providers[0].position;
        return config.products.length === 1 && hasProduct(config.products, 'oauth') && config.oauthOptions?.providers.length === 1 && config.oauthOptions?.providers[0].type === OAuthProviders.Google && config.oauthOptions?.providers[0].one_tap === true && getShouldRenderFloatingOneTap(position);
    }, [
        config
    ]);
};

export { useIsOnlyFloatingOneTap };
//# sourceMappingURL=useIsOnlyFloatingOneTap.mjs.map
