"use strict";
(() => {
var exports = {};
exports.id = 6107;
exports.ids = [6107,2438,7206];
exports.modules = {

/***/ 292654:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PublicPath),
/* harmony export */   "getServerSideProps": () => (/* binding */ getServerSideProps)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(545725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(741664);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var components_share_path_contents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(329794);
/* harmony import */ var components_share_path_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(332627);
/* harmony import */ var components_share_loading__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(976087);
/* harmony import */ var lib_share_get_public_path_info__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(974889);
/* harmony import */ var lib_share_counter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(403066);
/* harmony import */ var components_share_layout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(216284);
/* harmony import */ var lib_with_customize__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(601880);
/* harmony import */ var lib_share_customize__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(158742);
/* harmony import */ var lib_share_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(809774);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lib_share_get_public_path_info__WEBPACK_IMPORTED_MODULE_6__]);
lib_share_get_public_path_info__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */ 











function PublicPath({ id , project_id , path , relativePath , contents , error , customize ,  }) {
    (0,lib_share_counter__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(id);
    if (id == null) return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_share_loading__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
        style: {
            fontSize: "30px"
        }
    });
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(lib_share_customize__WEBPACK_IMPORTED_MODULE_10__/* .Customize */ .l, {
        value: customize,
        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(components_share_layout__WEBPACK_IMPORTED_MODULE_8__/* .Embed */ .c, {
            title: (0,lib_share_util__WEBPACK_IMPORTED_MODULE_11__/* .getTitle */ .YQ)({
                path,
                relativePath
            }),
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    style: {
                        backgroundColor: "white",
                        display: "inline-block",
                        padding: "0 5px",
                        margin: "5px",
                        width: "100%"
                    },
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_share_path_actions__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                        id: id,
                        path: path,
                        project_id: project_id,
                        relativePath: relativePath,
                        isDir: !!contents?.isdir,
                        exclude: new Set([
                            "embed"
                        ])
                    })
                }),
                contents != null && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_share_path_contents__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                    id: id,
                    relativePath: relativePath,
                    path: path,
                    ...contents
                }),
                error != null && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Alert, {
                    showIcon: true,
                    type: "error",
                    style: {
                        maxWidth: "700px",
                        margin: "30px auto"
                    },
                    message: "Error loading file",
                    description: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        children: [
                            'There was a problem loading "',
                            relativePath,
                            '" in',
                            " ",
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_2___default()), {
                                href: `/share/public_paths/${id}`,
                                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", {
                                    children: [
                                        path,
                                        "."
                                    ]
                                })
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}),
                            error
                        ]
                    })
                })
            ]
        })
    });
};
async function getServerSideProps(context) {
    const id = context.params.id[0];
    const relativePath = context.params.id.slice(1).join("/");
    try {
        const props = await (0,lib_share_get_public_path_info__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({
            id,
            relativePath,
            req: context.req
        });
        return await (0,lib_with_customize__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z)({
            context,
            props: {
                ...props,
                layout: "embed"
            }
        });
    } catch (_err) {
        console.log(_err);
        return {
            notFound: true
        };
    }
}

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 545725:
/***/ ((module) => {

module.exports = require("antd");

/***/ }),

/***/ 102574:
/***/ ((module) => {

module.exports = require("base-64");

/***/ }),

/***/ 770640:
/***/ ((module) => {

module.exports = require("cookies");

/***/ }),

/***/ 546517:
/***/ ((module) => {

module.exports = require("lodash");

/***/ }),

/***/ 65680:
/***/ ((module) => {

module.exports = require("lru-cache");

/***/ }),

/***/ 903280:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/app-router-context.js");

/***/ }),

/***/ 492796:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/head-manager-context.js");

/***/ }),

/***/ 294957:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/head.js");

/***/ }),

/***/ 703539:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");

/***/ }),

/***/ 734014:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");

/***/ }),

/***/ 450744:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/image-config-context.js");

/***/ }),

/***/ 435843:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/image-config.js");

/***/ }),

/***/ 278524:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/is-plain-object.js");

/***/ }),

/***/ 878020:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/mitt.js");

/***/ }),

/***/ 664406:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");

/***/ }),

/***/ 424964:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router-context.js");

/***/ }),

/***/ 493431:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");

/***/ }),

/***/ 611751:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");

/***/ }),

/***/ 746220:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");

/***/ }),

/***/ 110299:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");

/***/ }),

/***/ 623938:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/format-url.js");

/***/ }),

/***/ 329565:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");

/***/ }),

/***/ 735789:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");

/***/ }),

/***/ 901428:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");

/***/ }),

/***/ 528854:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");

/***/ }),

/***/ 491292:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");

/***/ }),

/***/ 734567:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");

/***/ }),

/***/ 980979:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/querystring.js");

/***/ }),

/***/ 393297:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");

/***/ }),

/***/ 836052:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");

/***/ }),

/***/ 584226:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");

/***/ }),

/***/ 95052:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");

/***/ }),

/***/ 359232:
/***/ ((module) => {

module.exports = require("next/dist/shared/lib/utils.js");

/***/ }),

/***/ 40968:
/***/ ((module) => {

module.exports = require("next/head");

/***/ }),

/***/ 371853:
/***/ ((module) => {

module.exports = require("next/router");

/***/ }),

/***/ 616689:
/***/ ((module) => {

module.exports = require("react");

/***/ }),

/***/ 566405:
/***/ ((module) => {

module.exports = require("react-dom");

/***/ }),

/***/ 271704:
/***/ ((module) => {

module.exports = require("react-google-recaptcha-v3");

/***/ }),

/***/ 920997:
/***/ ((module) => {

module.exports = require("react/jsx-runtime");

/***/ }),

/***/ 96544:
/***/ ((module) => {

module.exports = import("node-fetch");;

/***/ }),

/***/ 439491:
/***/ ((module) => {

module.exports = require("assert");

/***/ }),

/***/ 714300:
/***/ ((module) => {

module.exports = require("buffer");

/***/ }),

/***/ 706113:
/***/ ((module) => {

module.exports = require("crypto");

/***/ }),

/***/ 809523:
/***/ ((module) => {

module.exports = require("dns");

/***/ }),

/***/ 582361:
/***/ ((module) => {

module.exports = require("events");

/***/ }),

/***/ 657147:
/***/ ((module) => {

module.exports = require("fs");

/***/ }),

/***/ 241808:
/***/ ((module) => {

module.exports = require("net");

/***/ }),

/***/ 822037:
/***/ ((module) => {

module.exports = require("os");

/***/ }),

/***/ 371017:
/***/ ((module) => {

module.exports = require("path");

/***/ }),

/***/ 677282:
/***/ ((module) => {

module.exports = require("process");

/***/ }),

/***/ 285477:
/***/ ((module) => {

module.exports = require("punycode");

/***/ }),

/***/ 12781:
/***/ ((module) => {

module.exports = require("stream");

/***/ }),

/***/ 371576:
/***/ ((module) => {

module.exports = require("string_decoder");

/***/ }),

/***/ 924404:
/***/ ((module) => {

module.exports = require("tls");

/***/ }),

/***/ 76224:
/***/ ((module) => {

module.exports = require("tty");

/***/ }),

/***/ 257310:
/***/ ((module) => {

module.exports = require("url");

/***/ }),

/***/ 473837:
/***/ ((module) => {

module.exports = require("util");

/***/ })

};
;

// load runtime
var __webpack_require__ = require("../../../../webpack-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [549,6918,3429,2952,1746,1664,7545,3734,2208,5654,9925,3739,4854,9715,2448,9066,981,5997,5409,6087,722,3624,9924,5379,3009,5490,6952,5863,2881], () => (__webpack_exec__(292654)));
module.exports = __webpack_exports__;

})();