import React__default from 'react';
import Logo from '../components/atoms/Logo.mjs';
import MainContainer from '../components/molecules/MainContainer.mjs';
import { usePresentation } from '../components/PresentationConfig.mjs';
import { useIsOnlyFloatingOneTap } from '../hooks/useIsOnlyFloatingOneTap.mjs';
import { useGlobalReducer, useConfig, AppScreens } from './GlobalContextProvider.mjs';
import { MainScreen } from './screens/Main/index.mjs';
import { useProductComponents } from './utils.mjs';

const AppContainer$1 = ()=>{
    const [state] = useGlobalReducer();
    const config = useConfig();
    const { displayWatermark, theme, options } = usePresentation();
    const isOnlyFloatingOneTap = useIsOnlyFloatingOneTap(config);
    const currentScreen = state.screen;
    const screenComponentMap = useProductComponents(config.products, 'screens');
    if (isOnlyFloatingOneTap) {
        const { FloatingOneTap } = screenComponentMap;
        return /*#__PURE__*/ React__default.createElement(FloatingOneTap, null);
    }
    // MainScreen is omitted from StytchProduct since it's used by everything
    const ScreenComponent = currentScreen === AppScreens.Main ? MainScreen : screenComponentMap[currentScreen];
    return /*#__PURE__*/ React__default.createElement(MainContainer, {
        theme: theme,
        displayWatermark: displayWatermark
    }, options.logo && /*#__PURE__*/ React__default.createElement(Logo, {
        appLogo: options.logo
    }), /*#__PURE__*/ React__default.createElement(ScreenComponent, null));
};

export { AppContainer$1 as default };
//# sourceMappingURL=Container.mjs.map
