"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var jsx_runtime_1 = require("react/jsx-runtime");
/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var A_1 = __importDefault(require("components/misc/A"));
var logo_rectangular_1 = __importDefault(require("components/logo-rectangular"));
var antd_1 = require("antd");
var customize_1 = require("lib/customize");
var contact_1 = __importDefault(require("./contact"));
function Item(_a) {
    var first = _a.first, children = _a.children;
    if (first)
        return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u00A0", " – ", "\u00A0", children] }));
}
function Footer() {
    var _a = (0, customize_1.useCustomize)(), siteName = _a.siteName, organizationName = _a.organizationName, organizationURL = _a.organizationURL, termsOfServiceURL = _a.termsOfServiceURL, contactEmail = _a.contactEmail, landingPages = _a.landingPages, zendesk = _a.zendesk, imprint = _a.imprint, policies = _a.policies, onCoCalcCom = _a.onCoCalcCom;
    function organization() {
        if (organizationURL) {
            return (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: organizationURL }, { children: organizationName }));
        }
        else {
            return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: organizationName });
        }
    }
    function renderOrganization() {
        if (!organizationName)
            return null;
        return (0, jsx_runtime_1.jsx)(Item, { children: organization() });
    }
    return ((0, jsx_runtime_1.jsxs)(antd_1.Layout.Footer, __assign({ style: {
            textAlign: "center",
            borderTop: "1px solid lightgrey",
            backgroundColor: "white",
        } }, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Item, __assign({ first: true }, { children: siteName !== null && siteName !== void 0 ? siteName : "CoCalc" })), onCoCalcCom && (0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: "https://about.cocalc.com/" }, { children: "About" })) }), (0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: "https://cocalc.com" }, { children: "CoCalc" })) }), renderOrganization(), !landingPages && termsOfServiceURL && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: termsOfServiceURL }, { children: "Terms of Service" })) })), contactEmail && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(contact_1.default, { showEmail: false }) })), zendesk && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: "/support/new" }, { children: "Support Ticket" })) })), imprint && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: "/policies/imprint" }, { children: "Imprint" })) })), policies && ((0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: "/policies/policies" }, { children: "Policies" })) })), (0, jsx_runtime_1.jsx)(Item, { children: (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: "/info/status" }, { children: "Status" })) })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(logo_rectangular_1.default, { style: { height: "40px", width: "40px" } }) })] })));
}
exports.default = Footer;
//# sourceMappingURL=footer.js.map