"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoggedOutHeader = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const box_1 = __importDefault(require("../box"));
const core_1 = require("../core");
const utils_1 = require("../utils");
const header_1 = __importDefault(require("./header"));
/** Displays Header content appropriate for logged out users, such as sign in button or create account prompt. */
exports.LoggedOutHeader = (0, core_1.vui)((props, ref) => {
    const { applicationName, applicationUrl, children, className, isApplication = false, createAccount, logo, mainLinks, signIn } = props, rest = __rest(props, ["applicationName", "applicationUrl", "children", "className", "isApplication", "createAccount", "logo", "mainLinks", "signIn"]);
    if (isApplication) {
        if (!applicationName) {
            console.error('Header: isApplication is true but applicationName is not set.');
        }
    }
    const isSmallScreen = (0, core_1.useDown)('md');
    const isLessThanMD = (0, core_1.useDown)('sm');
    const localTextColor = (rest === null || rest === void 0 ? void 0 : rest.variant) === 'dark' ? 'white' : 'darkBlue.main';
    return ((0, jsx_runtime_1.jsx)(header_1.default, Object.assign({ className: (0, utils_1.cs)('vui-loggedOutHeader', isApplication ? 'vui-loggedOutAppHeader' : undefined, className), mb: isApplication && isSmallScreen ? '41px' : 'inherited', ref: ref }, rest, { children: (0, jsx_runtime_1.jsxs)(header_1.default.Content, { children: [(!isApplication || !isLessThanMD) && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [" ", (0, utils_1.isJsx)(logo) ? logo : (0, jsx_runtime_1.jsx)(header_1.default.Logo, Object.assign({}, logo))] }), isApplication && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(core_1.RenderOnScreen, { minWidth: "sm", children: (0, jsx_runtime_1.jsx)(header_1.default.Divider, { mr: 2 }) }), (0, jsx_runtime_1.jsx)(header_1.default.ApplicationName, { color: localTextColor, title: applicationName, url: applicationUrl || '/' })] })), (0, jsx_runtime_1.jsx)(core_1.RenderOnScreen, { minWidth: "lg", children: children }), (0, jsx_runtime_1.jsx)(box_1.default, { ml: "auto" }), (0, jsx_runtime_1.jsxs)(core_1.RenderOnScreen, { minWidth: "lg", children: [(0, utils_1.isJsx)(mainLinks) ? mainLinks : (0, jsx_runtime_1.jsx)(header_1.default.MainLinks, { links: mainLinks }), mainLinks !== undefined && (0, jsx_runtime_1.jsx)(header_1.default.Divider, { ml: 1, mr: 3 }), (0, utils_1.isJsx)(signIn) ? signIn : (0, jsx_runtime_1.jsx)(header_1.default.SignIn, Object.assign({}, signIn)), (0, utils_1.isJsx)(createAccount) ? createAccount : (0, jsx_runtime_1.jsx)(header_1.default.CreateAccount, Object.assign({}, createAccount))] }), (0, jsx_runtime_1.jsxs)(core_1.RenderOnScreen, { maxWidth: "lg", children: [(0, utils_1.isJsx)(signIn) ? signIn : (0, jsx_runtime_1.jsx)(header_1.default.SignIn, Object.assign({}, signIn)), (0, jsx_runtime_1.jsx)(header_1.default.Divider, { ml: 2 }), (0, jsx_runtime_1.jsx)(header_1.default.MobileToggle, {}), (0, jsx_runtime_1.jsxs)(header_1.default.MobileContent, { children: [children, (0, utils_1.isJsx)(createAccount) ? createAccount : (0, jsx_runtime_1.jsx)(header_1.default.CreateAccount, Object.assign({}, createAccount)), (0, utils_1.isJsx)(mainLinks) ? mainLinks : (0, jsx_runtime_1.jsx)(header_1.default.MainLinks, { links: mainLinks })] })] })] }) })));
});
exports.LoggedOutHeader.displayName = 'LoggedOutHeader';
exports.default = exports.LoggedOutHeader;
//# sourceMappingURL=loggedOutHeader.js.map