(() => {
var exports = {};
exports.id = 7099;
exports.ids = [7099,1225,1644,5293,1348,672,3533];
exports.modules = {

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

"use strict";
module.exports = require("cookies");

/***/ }),

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

"use strict";
module.exports = require("assert");

/***/ }),

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

"use strict";
module.exports = require("buffer");

/***/ }),

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

"use strict";
module.exports = require("child_process");

/***/ }),

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

"use strict";
module.exports = require("cluster");

/***/ }),

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

"use strict";
module.exports = require("constants");

/***/ }),

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

"use strict";
module.exports = require("crypto");

/***/ }),

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

"use strict";
module.exports = require("dns");

/***/ }),

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

"use strict";
module.exports = require("events");

/***/ }),

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

"use strict";
module.exports = require("fs");

/***/ }),

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

"use strict";
module.exports = require("http");

/***/ }),

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

"use strict";
module.exports = require("https");

/***/ }),

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

"use strict";
module.exports = require("net");

/***/ }),

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

"use strict";
module.exports = require("os");

/***/ }),

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

"use strict";
module.exports = require("path");

/***/ }),

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

"use strict";
module.exports = require("perf_hooks");

/***/ }),

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

"use strict";
module.exports = require("process");

/***/ }),

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

"use strict";
module.exports = require("readline");

/***/ }),

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

"use strict";
module.exports = require("stream");

/***/ }),

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

"use strict";
module.exports = require("string_decoder");

/***/ }),

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

"use strict";
module.exports = require("tls");

/***/ }),

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

"use strict";
module.exports = require("tty");

/***/ }),

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

"use strict";
module.exports = require("url");

/***/ }),

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

"use strict";
module.exports = require("util");

/***/ }),

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

"use strict";
module.exports = require("v8");

/***/ }),

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

"use strict";
module.exports = require("zlib");

/***/ }),

/***/ 426006:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ getParams)
/* harmony export */ });
function getParams(req, params) {
    const x = {};
    if ((req === null || req === void 0 ? void 0 : req.method) == "POST") {
        for (const param of params){
            var ref;
            x[param] = (ref = req.body) === null || ref === void 0 ? void 0 : ref[param];
        }
    } else {
        for (const param of params){
            var ref1;
            x[param] = (ref1 = req.query) === null || ref1 === void 0 ? void 0 : ref1[param];
        }
    }
    return x;
};


/***/ }),

/***/ 537479:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ handle)
/* harmony export */ });
/* harmony import */ var lib_account_get_account__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(677793);
/* harmony import */ var _projects_get_one__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79614);
/* harmony import */ var _cocalc_server_projects_control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145970);
/* harmony import */ var _cocalc_server_projects_control__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_projects_control__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _projects_call__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(316269);
/* harmony import */ var lib_api_get_params__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(426006);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(854006);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _cocalc_server_settings_customize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(223832);
/* harmony import */ var _cocalc_server_settings_customize__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_settings_customize__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(126804);
/* harmony import */ var _cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_6__);
/*
Turn latex file contents into a pdf.

You can call this either via GET or POST, but of course POST makes way more sense.
The parameters are:

- project_id: *optional* project in which to run latex.  If not given, your most recent project is used, or if you have no projects, one is created.
- content: *optional* textual content of the .tex file you want to latex.  If not given, path must refer to an actual file already in the project.
- path: required path to a .tex file.  If the file doesn't exist, it is created with the given content.  Also, if the directory containing path
  doesn't exist, it is created.
- command: *optional* latex build command.  This will be run from the directory containing path and should produce the output pdf file.
  If not given, we use latexmk.
- timeout: if given, this is a timeout on how long the latex build command can run before it is killed.
- ttl: how long the resulting PDF url is valid (default: 1 hour)


When you call this API the project is started if it isn't already running.  Then the path .tex file
is created, if content is specified.  Next the command is run which should hopefully produce a pdf file.
Finally, the pdf file is read into our database (as a blob), and the API call returns an object with
this shape:

{error?: '... message if something goes badly wrong ...',
compile: {
   stdout: string
   stderr: string
   exit_code: number
},
url: URL where you can view the generated PDF file
pdf: information about reading the PDF from disk, e.g., an
error if the PDF doesn't exist.

Finally, if the path starts with /tmp, e.g., /tmp/foo/bar.tex, then we do always do "rm /tmp/foo/bar.*"
to clean up temp file.  We do NOT do this unless the path starts with /tmp.


TODO/WARNING: For some reason on kucalc (so cocalc.com), if the project isn't running you'll
get an error while it is starting.  If you retry in a few seconds then it works.  On cocalc-docker
and dev mode it all seems to work fine in terms of starting the project, then using.
*/ 







async function handle(req, res) {
    const account_id = await (0,lib_account_get_account__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(req);
    const params = (0,lib_api_get_params__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(req, [
        "project_id",
        "content",
        "path",
        "command",
        "timeout",
        "ttl",
        "leave", 
    ]);
    try {
        if (!account_id) {
            throw Error("must be authenticated");
        }
        if (!params.path || !params.path.endsWith(".tex")) {
            throw Error("path must be specified and end in .tex");
        }
        const { head: dir , tail: filename  } = (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_4__.path_split)(params.path);
        let project_id;
        if (params.project_id != null) {
            project_id = params.project_id;
            if (!await _cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_6___default()({
                project_id,
                account_id
            })) {
                throw Error("must be signed in as a collaborator on the project");
            }
        } else {
            // don't need to check collaborator in this case:
            project_id = (await (0,_projects_get_one__WEBPACK_IMPORTED_MODULE_1__.getOneProject)(account_id)).project_id;
        }
        let result = undefined;
        try {
            // ensure the project is running.
            const project = (0,_cocalc_server_projects_control__WEBPACK_IMPORTED_MODULE_2__.getProject)(project_id);
            await project.start();
            if (params.content != null) {
                // write content to the project as the file path
                await (0,_projects_call__WEBPACK_IMPORTED_MODULE_3__.callProject)({
                    account_id,
                    project_id,
                    mesg: {
                        event: "write_text_file_to_project",
                        path: params.path,
                        content: params.content
                    }
                });
            }
            const compile = await (0,_projects_call__WEBPACK_IMPORTED_MODULE_3__.callProject)({
                account_id,
                project_id,
                mesg: {
                    event: "project_exec",
                    timeout: params.timeout,
                    path: dir,
                    command: params.command ?? `latexmk -pdf -f -g -bibtex -deps -interaction=nonstopmode ${filename}`
                }
            });
            // check for errors in compie before trying to read pdf. here...
            const ttlSeconds = params.ttl ?? 3600;
            const pdf = await (0,_projects_call__WEBPACK_IMPORTED_MODULE_3__.callProject)({
                account_id,
                project_id,
                mesg: {
                    event: "read_file_from_project",
                    path: pdfFile(params.path),
                    ttlSeconds
                }
            });
            const { siteURL  } = await _cocalc_server_settings_customize__WEBPACK_IMPORTED_MODULE_5___default()();
            const url = pdf.data_uuid ? siteURL + `/blobs/${pdfFile(params.path)}?uuid=${pdf.data_uuid}` : undefined;
            result = {
                compile,
                url,
                pdf
            };
        } finally{
            if (params.path.startsWith("/tmp")) {
                await (0,_projects_call__WEBPACK_IMPORTED_MODULE_3__.callProject)({
                    account_id,
                    project_id,
                    mesg: {
                        event: "project_exec",
                        path: "/tmp",
                        bash: true,
                        command: `rm ${rmGlob(params.path)}`
                    }
                });
            }
        }
        res.json(result);
    } catch (err) {
        res.json({
            error: err.message
        });
    }
};
function pdfFile(path) {
    return path.slice(0, path.length - 4) + ".pdf";
}
function rmGlob(path) {
    return path.slice(0, path.length - 4) + ".*";
}


/***/ }),

/***/ 316269:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "callProject": () => (/* binding */ callProject),
/* harmony export */   "default": () => (/* binding */ handle)
/* harmony export */ });
/* harmony import */ var _cocalc_server_projects_connection_call__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(113011);
/* harmony import */ var _cocalc_server_projects_connection_call__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_projects_connection_call__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lib_api_get_params__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(426006);
/* harmony import */ var lib_account_get_account__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(677793);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(854006);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(126804);
/* harmony import */ var _cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_3__);
/*
API endpoint that makes it possible to send a message to a project
that the user is a collaborator on and get back a response.

See cocalc/src/packages/server/projects/connection/call.ts
for a list of messages.
*/ 




async function handle(req, res) {
    const account_id = await (0,lib_account_get_account__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(req);
    try {
        const { project_id , mesg  } = (0,lib_api_get_params__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(req, [
            "project_id",
            "mesg"
        ]);
        res.json(await callProject({
            account_id,
            project_id,
            mesg
        }));
    } catch (err) {
        res.json({
            error: err.message
        });
    }
};
// also used by the latex api call
async function callProject({ account_id , project_id , mesg ,  }) {
    if (!(0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_2__.isValidUUID)(account_id)) {
        throw Error("user must be authenticated");
    }
    if (!(0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_2__.isValidUUID)(project_id)) {
        throw Error("must specify project_id");
    }
    if (!await _cocalc_server_projects_is_collaborator__WEBPACK_IMPORTED_MODULE_3___default()({
        account_id,
        project_id
    })) {
        throw Error("authenticated user must be a collaborator on the project");
    }
    return await _cocalc_server_projects_connection_call__WEBPACK_IMPORTED_MODULE_0___default()({
        project_id,
        mesg
    });
}


/***/ }),

/***/ 79614:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ handle),
/* harmony export */   "getOneProject": () => (/* binding */ getOneProject)
/* harmony export */ });
/* harmony import */ var lib_account_get_account__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(677793);
/* harmony import */ var _cocalc_server_projects_create__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(713428);
/* harmony import */ var _cocalc_server_projects_create__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_projects_create__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _cocalc_server_projects_get__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(483533);
/* harmony import */ var _cocalc_server_projects_get__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_cocalc_server_projects_get__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(854006);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_3__);
/* Get projects that belongs to the authenticated user.
   If the user has no projects, creates one.
   If they have projects, returns the most recently active one.
*/ 



async function handle(req, res) {
    const account_id = await (0,lib_account_get_account__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(req);
    try {
        res.json(await getOneProject(account_id));
    } catch (err) {
        res.json({
            error: err.message
        });
    }
};
// This is also used by the latex api endpoint.
async function getOneProject(account_id) {
    if (!(0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_3__.isValidUUID)(account_id)) {
        throw Error("user must be authenticated");
    }
    const projects = await _cocalc_server_projects_get__WEBPACK_IMPORTED_MODULE_2___default()({
        account_id,
        limit: 1
    });
    if (projects.length >= 1) {
        return projects[0];
    }
    const title = "Untitled Project";
    return {
        project_id: await _cocalc_server_projects_create__WEBPACK_IMPORTED_MODULE_1___default()({
            account_id,
            title
        }),
        title
    };
}


/***/ }),

/***/ 113011:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/*
Use the project hub socket API to communicate with the project.

The supported messages are implemented here in the project:

   cocalc/src/packages/project/servers/hub/handle-message.ts

and messages must be defined as in

   cocalc/src/packages/util/message.js

and they include:

- ping: for testing; returns a pong
- heartbeat: used for maintaining the connection
- named_server_port: finding out the port used by jupyter, jupyterlab, etc.
- project_exec: run shell command
- read_file_from_project: reads file and stores it as a blob in the database. blob expires in 24 hours.
- write_file_to_project: write abitrary file to disk in project (goes via a blob)
- write_text_file_to_project: write a text file, whose contents is in the message, to the project.
- print_to_pdf: tells sage worksheet to print
- send_signal: send a signal to a process
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var handle_message_1 = __webpack_require__(386441);
var connect_1 = __importDefault(__webpack_require__(673317));
//import getLogger from "@cocalc/backend/logger";
//const logger = getLogger("project-connection:call");
function call(_a) {
    var project_id = _a.project_id, mesg = _a.mesg;
    return __awaiter(this, void 0, void 0, function () {
        var socket;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, (0, connect_1.default)(project_id)];
                case 1:
                    socket = _b.sent();
                    return [4 /*yield*/, (0, handle_message_1.callProjectMessage)({ mesg: mesg, socket: socket })];
                case 2: return [2 /*return*/, _b.sent()];
            }
        });
    });
}
exports["default"] = call;
//# sourceMappingURL=call.js.map

/***/ }),

/***/ 713428:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var pool_1 = __importDefault(__webpack_require__(541808));
var misc_1 = __webpack_require__(854006);
var uuid_1 = __webpack_require__(282185);
var compute_images_1 = __webpack_require__(533888);
function createProject(_a) {
    var account_id = _a.account_id, title = _a.title, description = _a.description, image = _a.image, license = _a.license;
    return __awaiter(this, void 0, void 0, function () {
        var project_id, pool, users, site_license, x;
        var _b;
        return __generator(this, function (_c) {
            switch (_c.label) {
                case 0:
                    if (!(0, misc_1.is_valid_uuid_string)(account_id)) {
                        throw Error("account_id must be a valid uuid");
                    }
                    project_id = (0, uuid_1.v4)();
                    pool = (0, pool_1.default)();
                    users = (_b = {}, _b[account_id] = { group: "owner" }, _b);
                    if (license) {
                        site_license = {};
                        for (x in license.split(",")) {
                            site_license[x] = {};
                        }
                    }
                    else {
                        site_license = undefined;
                    }
                    return [4 /*yield*/, pool.query("INSERT INTO projects (project_id, title, description, users, site_license, compute_image, created, last_edited) VALUES($1, $2, $3, $4, $5, $6, NOW(), NOW())", [
                            project_id,
                            title,
                            description,
                            JSON.stringify(users),
                            site_license != null ? JSON.stringify(site_license) : undefined,
                            image !== null && image !== void 0 ? image : compute_images_1.DEFAULT_COMPUTE_IMAGE,
                        ])];
                case 1:
                    _c.sent();
                    return [2 /*return*/, project_id];
            }
        });
    });
}
exports["default"] = createProject;
//# sourceMappingURL=create.js.map

/***/ }),

/***/ 483533:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/* get up to limit projects that have the given user as a collaborator,
   ordered by how recently they were modified.

   DELETED and HIDDEN projects are skipped.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var pool_1 = __importDefault(__webpack_require__(541808));
var misc_1 = __webpack_require__(854006);
// I may add more fields and more options later...
function getProjects(_a) {
    var account_id = _a.account_id, _b = _a.limit, limit = _b === void 0 ? 50 : _b;
    return __awaiter(this, void 0, void 0, function () {
        var pool, rows;
        return __generator(this, function (_c) {
            switch (_c.label) {
                case 0:
                    if (!(0, misc_1.is_valid_uuid_string)(account_id)) {
                        throw Error("account_id must be a UUIDv4");
                    }
                    if (limit <= 0) {
                        return [2 /*return*/, []];
                    }
                    pool = (0, pool_1.default)();
                    return [4 /*yield*/, pool.query("SELECT project_id, title, description FROM projects WHERE DELETED IS NOT true AND users ? $1 AND (users#>>'{".concat(account_id, ",hide}')::BOOLEAN IS NOT TRUE ORDER BY last_edited DESC LIMIT $2"), [account_id, limit])];
                case 1:
                    rows = (_c.sent()).rows;
                    return [2 /*return*/, rows];
            }
        });
    });
}
exports["default"] = getProjects;
//# sourceMappingURL=get.js.map

/***/ }),

/***/ 126804:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var pool_1 = __importDefault(__webpack_require__(541808));
var misc_1 = __webpack_require__(854006);
function isCollaborator(_a) {
    var _b;
    var account_id = _a.account_id, project_id = _a.project_id;
    return __awaiter(this, void 0, void 0, function () {
        var pool, rows, group;
        return __generator(this, function (_c) {
            switch (_c.label) {
                case 0:
                    if (!(0, misc_1.is_valid_uuid_string)(account_id) || !(0, misc_1.is_valid_uuid_string)(project_id)) {
                        throw Error("invalid input");
                    }
                    pool = (0, pool_1.default)("long");
                    return [4 /*yield*/, pool.query("SELECT users#>'{".concat(account_id, ",group}' AS group FROM projects WHERE project_id=$1"), [project_id])];
                case 1:
                    rows = (_c.sent()).rows;
                    group = (_b = rows[0]) === null || _b === void 0 ? void 0 : _b.group;
                    return [2 /*return*/, group == "owner" || group == "collaborator"];
            }
        });
    });
}
exports["default"] = isCollaborator;
//# sourceMappingURL=is-collaborator.js.map

/***/ }),

/***/ 223832:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var server_settings_1 = __webpack_require__(526177);
var site_url_1 = __importDefault(__webpack_require__(661348));
var site_defaults_1 = __webpack_require__(889188);
var fallback = function (a, b) {
    return typeof a == "string" && a.length > 0 ? a : "".concat(b);
};
/*
Create a Javascript object that describes properties of the server.
This is used on the next.js server landing pages and the share server
to customize their look and behavior.

This function is cached via the parameters in ./server-settings, i.e.,
for a few seconds.
*/
var cachedSettings = undefined;
var cachedCustomize = undefined;
function getCustomize() {
    return __awaiter(this, void 0, void 0, function () {
        var settings;
        var _a;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, (0, server_settings_1.getServerSettings)()];
                case 1:
                    settings = _b.sent();
                    if (settings === cachedSettings && cachedCustomize != null) {
                        return [2 /*return*/, cachedCustomize];
                    }
                    cachedSettings = settings;
                    _a = {
                        siteName: fallback(settings.site_name, "On Premises CoCalc"),
                        siteDescription: fallback(settings.site_description, "Collaborative Calculation using Python, Sage, R, Julia, and more."),
                        organizationName: settings.organization_name,
                        organizationEmail: settings.organization_email,
                        organizationURL: settings.organization_url,
                        termsOfServiceURL: settings.terms_of_service_url,
                        helpEmail: settings.help_email,
                        contactEmail: fallback(settings.organization_email, settings.help_email),
                        isCommercial: settings.commercial,
                        kucalc: settings.kucalc,
                        sshGateway: settings.ssh_gateway,
                        anonymousSignup: settings.anonymous_signup,
                        emailSignup: settings.email_signup,
                        accountCreationInstructions: settings.account_creation_email_instructions,
                        logoSquareURL: settings.logo_square,
                        logoRectangularURL: settings.logo_rectangular,
                        splashImage: settings.splash_image,
                        shareServer: !!settings.share_server,
                        // additionally restrict showing landing pages only in cocalc.com-mode
                        landingPages: !!settings.landing_pages && settings.kucalc === site_defaults_1.KUCALC_COCALC_COM,
                        googleAnalytics: settings.google_analytics,
                        indexInfo: settings.index_info_html,
                        imprint: settings.imprint,
                        policies: settings.policies,
                        // Is important for invite emails, password reset, etc. (e.g., so we can construct a url to our site).
                        // This *can* start with http:// to explicitly use http instead of https, and can end
                        // in something like :3594 to indicate a port.
                        dns: settings.dns
                    };
                    return [4 /*yield*/, (0, site_url_1.default)(settings.dns)];
                case 2:
                    cachedCustomize = (
                    // siteURL is derived from settings.dns and the basePath -- it combines the dns, https://
                    // and the basePath.  It never ends in a slash.  This is used in practice for
                    // things like invite emails, password reset, etc.
                    _a.siteURL = _b.sent(),
                        _a.zendesk = settings.zendesk_token &&
                            settings.zendesk_username &&
                            settings.zendesk_uri,
                        // obviously only the public key here!
                        _a.stripePublishableKey = settings.stripe_publishable_key,
                        // obviously only the public key here too!
                        _a.reCaptchaKey = settings.re_captcha_v3_publishable_key,
                        _a);
                    return [2 /*return*/, cachedCustomize];
            }
        });
    });
}
exports["default"] = getCustomize;
//# sourceMappingURL=customize.js.map

/***/ }),

/***/ 661348:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var server_settings_1 = __webpack_require__(526177);
var base_path_1 = __importDefault(__webpack_require__(8312));
// Returns url of this site in terms of the base path (determined
// by an env variable when server starts) and the "Domain name"
// setting of site settings.  This URL does NOT end in a /
function siteURL(dns) {
    var _a;
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    if (!!dns) return [3 /*break*/, 2];
                    return [4 /*yield*/, (0, server_settings_1.getServerSettings)()];
                case 1:
                    dns = (_a = (_b.sent()).dns) === null || _a === void 0 ? void 0 : _a.toLowerCase();
                    _b.label = 2;
                case 2:
                    if (!dns) {
                        dns = "localhost";
                    }
                    if (!dns.startsWith("http")) {
                        dns = "https://" + dns;
                    }
                    return [2 /*return*/, "".concat(dns).concat(base_path_1.default == "/" ? "" : base_path_1.default)];
            }
        });
    });
}
exports["default"] = siteURL;
//# sourceMappingURL=site-url.js.map

/***/ }),

/***/ 630900:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var crypto = __webpack_require__(706113);

var rn = function(max) {
  var rnBytes = crypto.randomBytes(2);
  var randomNum = rnBytes.readUInt8(0) * 256 + rnBytes.readUInt8(1);
  return randomNum % max;
}

var digits = '0123456789'
var base62 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'
var base30 = '0123456789ABCDFHKLMNPQRSTUVWXYZ'  // 1-9, A-Z exclude(E, G, I, J, O) for human read

exports.generate = function(len, chars) {
  len = len || 16;
  chars = chars || base62;
  var key = '';
  var charsLen = chars.length;
  for (var i=0; i<len; i++) {
    key += chars[rn(charsLen)];
  }
  return key;
};

exports.generateDigits = function(len) {
  len = len || 16;
  return exports.generate(len, digits)
};

exports.generateBase30 = function(len) {
  len = len || 16;
  return exports.generate(len, base30)
}


/***/ }),

/***/ 533888:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.is_valid = exports.get_compute_images = exports.COMPUTE_IMAGES = exports.GROUPS = exports.FALLBACK_COMPUTE_IMAGE = exports.DEFAULT_COMPUTE_IMAGE = void 0;
// this is tied to the back-end setup of cocalc.com
var misc_1 = __webpack_require__(854006);
var schema = __importStar(__webpack_require__(98416));
exports.DEFAULT_COMPUTE_IMAGE = schema.DEFAULT_COMPUTE_IMAGE;
exports.FALLBACK_COMPUTE_IMAGE = schema.FALLBACK_COMPUTE_IMAGE;
// this defines their ordering
exports.GROUPS = [
    "Main",
    "Ubuntu 20.04",
    "Ubuntu 18.04",
    "Ubuntu 16.04",
];
exports.COMPUTE_IMAGES = {
    // "default" or "undefined" is what was used for "ubuntu1804" until summer 2020
    // nowdays, DEFAULT_COMPUTE_IMAGE is "ubuntu2004"
    default: {
        order: 1,
        title: "Ubuntu 18.04 (Deprecated)",
        short: "Ubuntu 18.04 (Deprecated)",
        descr: "Ubuntu 18.04 reached end of life in August 2020",
        group: "Main",
        hidden: true,
    },
    ubuntu1804: {
        // a synonym of "default", but with a specific functionality!
        // we use it as a marker: if a "default" project (before the 20.04 upgrade) is set to stay at 18.04, this image is selected.
        order: 1,
        title: "Ubuntu 18.04 (EndOfLife)",
        short: "Ubuntu 18.04 (EndOfLife)",
        descr: "Ubuntu 18.04 reached end of life in August 2020",
        group: "Main",
    },
    ubuntu2004: {
        order: 0,
        title: "Ubuntu 20.04 (Default)",
        short: "Ubuntu 20.04 (Default)",
        descr: "Regular updates, well tested",
        group: "Main",
    },
    "ubuntu2004-previous": {
        title: "Ubuntu 20.04 (Previous)",
        short: "Previous",
        descr: "Slightly behind 20.04 (Default)",
        group: "Ubuntu 20.04",
    },
    "ubuntu2004-dev": {
        title: "Ubuntu 20.04 (Experimental)",
        short: "Experimental",
        descr: "Cutting-edge software updates (could be broken)",
        group: "Ubuntu 20.04",
    },
    "ubuntu2004-2020-10-28": {
        title: "Ubuntu 20.04 (2020-10-28)",
        short: "2020-10-28",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2020-10-28 and no longer updated",
    },
    "ubuntu2004-2020-12-09": {
        title: "Ubuntu 20.04 (2020-12-09)",
        short: "2020-12-09",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2020-12-09 and no longer updated",
    },
    "ubuntu2004-2021-02-01": {
        title: "Ubuntu 20.04 (2021-02-01)",
        short: "2021-02-01",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2021-02-01 and no longer updated",
    },
    "ubuntu2004-2021-05-31": {
        title: "Ubuntu 20.04 (2021-05-31)",
        short: "2021-05-31",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2021-05-31 and no longer updated",
    },
    "ubuntu2004-2021-08-13": {
        title: "Ubuntu 20.04 (2021-08-13)",
        short: "2021-08-13",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2021-08-13 and no longer updated",
    },
    "ubuntu2004-2021-10-10": {
        title: "Ubuntu 20.04 (2021-10-10)",
        short: "2021-10-10",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2021-10-10 and no longer updated",
    },
    "ubuntu2004-2022-04-19": {
        title: "Ubuntu 20.04 (2022-04-19)",
        short: "2022-04-19",
        group: "Ubuntu 20.04",
        descr: "Frozen on 2022-04-19 and no longer updated",
    },
    previous: {
        order: -2,
        title: "Ubuntu 18.04 (Previous)",
        short: "Previous",
        descr: "Ubuntu 18.04 Reached end of life in August 2020",
        group: "Ubuntu 18.04",
        hidden: true,
    },
    exp: {
        order: -1,
        title: "Ubuntu 18.04 (Experimental)",
        short: "Experimental",
        descr: "Reached end of life in August 2020",
        group: "Ubuntu 18.04",
        hidden: true,
    },
    "stable-2018-08-27": {
        title: "Ubuntu 18.04 @ 2018-08-27",
        short: "2018-08-27",
        descr: "Frozen on 2018-08-27 and no longer updated",
        group: "Ubuntu 18.04",
    },
    "stable-2019-01-12": {
        title: "Ubuntu 18.04 @ 2019-01-12",
        short: "2019-01-12",
        descr: "Frozen on 2019-01-12 and no longer updated",
        group: "Ubuntu 18.04",
    },
    "stable-2019-07-15": {
        title: "Ubuntu 18.04 @ 2019-07-15",
        short: "2019-07-15",
        descr: "Frozen on 2019-07-15 and no longer updated",
        group: "Ubuntu 18.04",
    },
    "stable-2019-10-25_ro": {
        title: "Ubuntu 18.04 @ 2019-10-25",
        short: "2019-10-25",
        descr: "Frozen on 2019-10-25 and no longer updated",
        group: "Ubuntu 18.04",
    },
    "stable-2019-12-15_ro": {
        title: "Ubuntu 18.04 @ 2019-12-15",
        short: "2019-12-15",
        descr: "Frozen on 2019-12-15 and no longer updated",
        group: "Ubuntu 18.04",
    },
    "stable-2020-01-26_ro": {
        title: "Ubuntu 18.04 @ 2020-01-26",
        short: "2020-01-26",
        descr: "Frozen on 2020-01-26 and no longer updated",
        group: "Ubuntu 18.04",
    },
    "stable-2020-07-31": {
        title: "Ubuntu 18.04 @ 2020-07-31",
        short: "2020-07-31",
        descr: "Frozen on 2020-07-31 and no longer updated",
        group: "Ubuntu 18.04",
    },
    old: {
        order: 10,
        title: "Old Ubuntu 16.04",
        short: "Old software image",
        descr: "In use until Summer 2018. No longer maintained!",
        group: "Ubuntu 16.04",
    },
};
function get_compute_images(opts) {
    opts = (0, misc_1.defaults)(opts, { cb: misc_1.required });
    opts.cb(undefined, exports.COMPUTE_IMAGES);
}
exports.get_compute_images = get_compute_images;
var is_valid = function (name) { return exports.COMPUTE_IMAGES[name] != null; };
exports.is_valid = is_valid;
//# sourceMappingURL=compute-images.js.map

/***/ })

};
;

// load runtime
var __webpack_require__ = require("../../../webpack-api-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,1970,2921,2185,2014,6652,1050,6942,1034,5791,2739,6257,9715,2448,1808,9738,8312,540,7793,8416,4181,3009,7554,5016,6177,3086,5970], () => (__webpack_exec__(537479)));
module.exports = __webpack_exports__;

})();