import React__default, { useMemo } from 'react';
import { messages } from '../messages/adminPortal/en.mjs';
import { I18nProviderWrapper } from '../ui/components/atoms/I18nProviderWrapper.mjs';
import { ToastContextProvider } from './components/Toast.mjs';
import { MainContainer } from './MainContainer.mjs';
import { StytchClientContext } from './StytchClientContext.mjs';
import { getTheme } from './utils/theme.mjs';
import ThemeProvider from '../../../../node_modules/@mui/material/styles/ThemeProvider.mjs';

const ContextProvider = ({ theme, options, children })=>{
    const clientAndConfig = useMemo(()=>({
            client: options.client,
            config: options.config
        }), [
        options
    ]);
    return /*#__PURE__*/ React__default.createElement(ThemeProvider, {
        theme: theme
    }, /*#__PURE__*/ React__default.createElement(I18nProviderWrapper, {
        messages: messages
    }, /*#__PURE__*/ React__default.createElement(StytchClientContext.Provider, {
        value: clientAndConfig
    }, children)));
};
const AdminPortalWrapper = ({ children, options })=>{
    const theme = getTheme(options.styles);
    return /*#__PURE__*/ React__default.createElement(ContextProvider, {
        options: options,
        theme: theme
    }, /*#__PURE__*/ React__default.createElement(MainContainer, null, /*#__PURE__*/ React__default.createElement(ToastContextProvider, null, children)));
};

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