"use strict";
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServerSideProps = void 0;
// Page for a project that is owned by a named account
// or organization.
const public_path_1 = __importDefault(require("lib/names/public-path"));
const get_public_path_info_1 = __importDefault(require("lib/share/get-public-path-info"));
const with_customize_1 = __importDefault(require("lib/with-customize"));
const path_1 = __importDefault(require("components/path/path"));
exports.default = path_1.default;
async function getServerSideProps(context) {
    const { owner, project, public_path } = context.params;
    try {
        const id = await (0, public_path_1.default)(owner, project, public_path);
        const props = await (0, get_public_path_info_1.default)({
            id,
            public_path,
            req: context.req,
        });
        return await (0, with_customize_1.default)({ context, props });
    }
    catch (_err) {
        console.log(_err);
        return { notFound: true };
    }
}
exports.getServerSideProps = getServerSideProps;
//# sourceMappingURL=%5B...public_path%5D.js.map