import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import Box from '../box';
import { RenderOnScreen, useDown, vui } from '../core';
import { cs, isJsx } from '../utils';
import Header from './header';
/** Displays Header content appropriate for logged out users, such as sign in button or create account prompt. */
export const LoggedOutHeader = vui((props, ref) => {
    const { applicationName, applicationUrl, children, className, isApplication = false, createAccount, logo, mainLinks, signIn, ...rest } = props;
    if (isApplication) {
        if (!applicationName) {
            console.error('Header: isApplication is true but applicationName is not set.');
        }
    }
    const isSmallScreen = useDown('md');
    const isLessThanMD = useDown('sm');
    const localTextColor = rest?.variant === 'dark' ? 'white' : 'darkBlue.main';
    return (_jsx(Header, { className: cs('vui-loggedOutHeader', isApplication ? 'vui-loggedOutAppHeader' : undefined, className), mb: isApplication && isSmallScreen ? '41px' : 'inherited', ref: ref, ...rest, children: _jsxs(Header.Content, { children: [(!isApplication || !isLessThanMD) && _jsxs(_Fragment, { children: [" ", isJsx(logo) ? logo : _jsx(Header.Logo, { ...logo })] }), isApplication && (_jsxs(_Fragment, { children: [_jsx(RenderOnScreen, { minWidth: "sm", children: _jsx(Header.Divider, { mr: 2 }) }), _jsx(Header.ApplicationName, { color: localTextColor, title: applicationName, url: applicationUrl || '/' })] })), _jsx(RenderOnScreen, { minWidth: "lg", children: children }), _jsx(Box, { ml: "auto" }), _jsxs(RenderOnScreen, { minWidth: "lg", children: [isJsx(mainLinks) ? mainLinks : _jsx(Header.MainLinks, { links: mainLinks }), mainLinks !== undefined && _jsx(Header.Divider, { ml: 1, mr: 3 }), isJsx(signIn) ? signIn : _jsx(Header.SignIn, { ...signIn }), isJsx(createAccount) ? createAccount : _jsx(Header.CreateAccount, { ...createAccount })] }), _jsxs(RenderOnScreen, { maxWidth: "lg", children: [isJsx(signIn) ? signIn : _jsx(Header.SignIn, { ...signIn }), _jsx(Header.Divider, { ml: 2 }), _jsx(Header.MobileToggle, {}), _jsxs(Header.MobileContent, { children: [children, isJsx(createAccount) ? createAccount : _jsx(Header.CreateAccount, { ...createAccount }), isJsx(mainLinks) ? mainLinks : _jsx(Header.MainLinks, { links: mainLinks })] })] })] }) }));
});
LoggedOutHeader.displayName = 'LoggedOutHeader';
export default LoggedOutHeader;
//# sourceMappingURL=loggedOutHeader.js.map