/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([["vendors-node_modules_jupyterlab_terminal-extension_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/terminal-extension/lib/index.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/terminal-extension/lib/index.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   \"addCommands\": () => (/* binding */ addCommands)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ \"webpack/sharing/consume/default/@jupyterlab/application/@jupyterlab/application\");\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/launcher */ \"webpack/sharing/consume/default/@jupyterlab/launcher/@jupyterlab/launcher\");\n/* harmony import */ var _jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/mainmenu */ \"webpack/sharing/consume/default/@jupyterlab/mainmenu/@jupyterlab/mainmenu\");\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_running__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/running */ \"webpack/sharing/consume/default/@jupyterlab/running/@jupyterlab/running\");\n/* harmony import */ var _jupyterlab_running__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_running__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_terminal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/terminal */ \"webpack/sharing/consume/default/@jupyterlab/terminal/@jupyterlab/terminal\");\n/* harmony import */ var _jupyterlab_terminal__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_terminal__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @jupyterlab/ui-components */ \"webpack/sharing/consume/default/@jupyterlab/ui-components/@jupyterlab/ui-components\");\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_9__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module terminal-extension\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * The command IDs used by the terminal plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.createNew = 'terminal:create-new';\n    CommandIDs.open = 'terminal:open';\n    CommandIDs.refresh = 'terminal:refresh';\n    CommandIDs.increaseFont = 'terminal:increase-font';\n    CommandIDs.decreaseFont = 'terminal:decrease-font';\n    CommandIDs.setTheme = 'terminal:set-theme';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * The default terminal extension.\n */\nconst plugin = {\n    activate,\n    id: '@jupyterlab/terminal-extension:plugin',\n    provides: _jupyterlab_terminal__WEBPACK_IMPORTED_MODULE_6__.ITerminalTracker,\n    requires: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__.ITranslator],\n    optional: [\n        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette,\n        _jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_2__.ILauncher,\n        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer,\n        _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__.IMainMenu,\n        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IThemeManager,\n        _jupyterlab_running__WEBPACK_IMPORTED_MODULE_4__.IRunningSessionManagers\n    ],\n    autoStart: true\n};\n/**\n * Export the plugin as default.\n */\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);\n/**\n * Activate the terminal plugin.\n */\nfunction activate(app, settingRegistry, translator, palette, launcher, restorer, mainMenu, themeManager, runningSessionManagers) {\n    const trans = translator.load('jupyterlab');\n    const { serviceManager } = app;\n    const category = trans.__('Terminal');\n    const namespace = 'terminal';\n    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({\n        namespace\n    });\n    // Bail if there are no terminals available.\n    if (!serviceManager.terminals.isAvailable()) {\n        console.warn('Disabling terminals plugin because they are not available on the server');\n        const terminalThemeMenu = mainMenu === null || mainMenu === void 0 ? void 0 : mainMenu.settingsMenu.items.find(item => {\n            var _a;\n            return item.type === 'submenu' &&\n                ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-settings-terminaltheme';\n        });\n        if (terminalThemeMenu) {\n            mainMenu === null || mainMenu === void 0 ? void 0 : mainMenu.settingsMenu.removeItem(terminalThemeMenu);\n        }\n        return tracker;\n    }\n    // Handle state restoration.\n    if (restorer) {\n        void restorer.restore(tracker, {\n            command: CommandIDs.createNew,\n            args: widget => ({ name: widget.content.session.name }),\n            name: widget => widget.content.session.name\n        });\n    }\n    // The cached terminal options from the setting editor.\n    const options = {};\n    /**\n     * Update the cached option values.\n     */\n    function updateOptions(settings) {\n        // Update the cached options by doing a shallow copy of key/values.\n        // This is needed because options is passed and used in addcommand-palette and needs\n        // to reflect the current cached values.\n        Object.keys(settings.composite).forEach((key) => {\n            options[key] = settings.composite[key];\n        });\n    }\n    /**\n     * Update terminal\n     */\n    function updateTerminal(widget) {\n        const terminal = widget.content;\n        if (!terminal) {\n            return;\n        }\n        Object.keys(options).forEach((key) => {\n            terminal.setOption(key, options[key]);\n        });\n    }\n    /**\n     * Update the settings of the current tracker instances.\n     */\n    function updateTracker() {\n        tracker.forEach(widget => updateTerminal(widget));\n    }\n    // Fetch the initial state of the settings.\n    settingRegistry\n        .load(plugin.id)\n        .then(settings => {\n        updateOptions(settings);\n        updateTracker();\n        settings.changed.connect(() => {\n            updateOptions(settings);\n            updateTracker();\n        });\n    })\n        .catch(Private.showErrorMessage);\n    // Subscribe to changes in theme. This is needed as the theme\n    // is computed dynamically based on the string value and DOM\n    // properties.\n    themeManager === null || themeManager === void 0 ? void 0 : themeManager.themeChanged.connect((sender, args) => {\n        tracker.forEach(widget => {\n            const terminal = widget.content;\n            if (terminal.getOption('theme') === 'inherit') {\n                terminal.setOption('theme', 'inherit');\n            }\n        });\n    });\n    addCommands(app, tracker, settingRegistry, translator, options);\n    if (mainMenu) {\n        // Add terminal close-and-shutdown to the file menu.\n        mainMenu.fileMenu.closeAndCleaners.add({\n            tracker,\n            closeAndCleanupLabel: (n) => trans.__('Shutdown Terminal'),\n            closeAndCleanup: (current) => {\n                // The widget is automatically disposed upon session shutdown.\n                return current.content.session.shutdown();\n            }\n        });\n    }\n    if (palette) {\n        // Add command palette items.\n        [\n            CommandIDs.createNew,\n            CommandIDs.refresh,\n            CommandIDs.increaseFont,\n            CommandIDs.decreaseFont\n        ].forEach(command => {\n            palette.addItem({ command, category, args: { isPalette: true } });\n        });\n        palette.addItem({\n            command: CommandIDs.setTheme,\n            category,\n            args: {\n                theme: 'inherit',\n                displayName: trans.__('Inherit'),\n                isPalette: true\n            }\n        });\n        palette.addItem({\n            command: CommandIDs.setTheme,\n            category,\n            args: { theme: 'light', displayName: trans.__('Light'), isPalette: true }\n        });\n        palette.addItem({\n            command: CommandIDs.setTheme,\n            category,\n            args: { theme: 'dark', displayName: trans.__('Dark'), isPalette: true }\n        });\n    }\n    // Add a launcher item if the launcher is available.\n    if (launcher) {\n        launcher.add({\n            command: CommandIDs.createNew,\n            category: trans.__('Other'),\n            rank: 0\n        });\n    }\n    // Add a sessions manager if the running extension is available\n    if (runningSessionManagers) {\n        addRunningSessionManager(runningSessionManagers, app, translator);\n    }\n    return tracker;\n}\n/**\n * Add the running terminal manager to the running panel.\n */\nfunction addRunningSessionManager(managers, app, translator) {\n    const trans = translator.load('jupyterlab');\n    const manager = app.serviceManager.terminals;\n    managers.add({\n        name: trans.__('Terminals'),\n        running: () => (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_9__.toArray)(manager.running()).map(model => new RunningTerminal(model)),\n        shutdownAll: () => manager.shutdownAll(),\n        refreshRunning: () => manager.refreshRunning(),\n        runningChanged: manager.runningChanged,\n        shutdownLabel: trans.__('Shut Down'),\n        shutdownAllLabel: trans.__('Shut Down All'),\n        shutdownAllConfirmationText: trans.__('Are you sure you want to permanently shut down all running terminals?')\n    });\n    class RunningTerminal {\n        constructor(model) {\n            this._model = model;\n        }\n        open() {\n            void app.commands.execute('terminal:open', { name: this._model.name });\n        }\n        icon() {\n            return _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_8__.terminalIcon;\n        }\n        label() {\n            return `terminals/${this._model.name}`;\n        }\n        shutdown() {\n            return manager.shutdown(this._model.name);\n        }\n    }\n}\n/**\n * Add the commands for the terminal.\n */\nfunction addCommands(app, tracker, settingRegistry, translator, options) {\n    const trans = translator.load('jupyterlab');\n    const { commands, serviceManager } = app;\n    // Add terminal commands.\n    commands.addCommand(CommandIDs.createNew, {\n        label: args => args['isPalette'] ? trans.__('New Terminal') : trans.__('Terminal'),\n        caption: trans.__('Start a new terminal session'),\n        icon: args => (args['isPalette'] ? undefined : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_8__.terminalIcon),\n        execute: async (args) => {\n            // wait for the widget to lazy load\n            let Terminal;\n            try {\n                Terminal = (await Private.ensureWidget()).Terminal;\n            }\n            catch (err) {\n                Private.showErrorMessage(err);\n                return;\n            }\n            const name = args['name'];\n            const session = await (name\n                ? serviceManager.terminals.connectTo({ model: { name } })\n                : serviceManager.terminals.startNew());\n            const term = new Terminal(session, options, translator);\n            term.title.icon = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_8__.terminalIcon;\n            term.title.label = '...';\n            const main = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget({ content: term });\n            app.shell.add(main);\n            void tracker.add(main);\n            app.shell.activateById(main.id);\n            return main;\n        }\n    });\n    commands.addCommand(CommandIDs.open, {\n        execute: args => {\n            const name = args['name'];\n            // Check for a running terminal with the given name.\n            const widget = tracker.find(value => {\n                const content = value.content;\n                return content.session.name === name || false;\n            });\n            if (widget) {\n                app.shell.activateById(widget.id);\n            }\n            else {\n                // Otherwise, create a new terminal with a given name.\n                return commands.execute(CommandIDs.createNew, { name });\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.refresh, {\n        label: trans.__('Refresh Terminal'),\n        caption: trans.__('Refresh the current terminal session'),\n        execute: async () => {\n            const current = tracker.currentWidget;\n            if (!current) {\n                return;\n            }\n            app.shell.activateById(current.id);\n            try {\n                await current.content.refresh();\n                if (current) {\n                    current.content.activate();\n                }\n            }\n            catch (err) {\n                Private.showErrorMessage(err);\n            }\n        },\n        isEnabled: () => tracker.currentWidget !== null\n    });\n    commands.addCommand(CommandIDs.increaseFont, {\n        label: trans.__('Increase Terminal Font Size'),\n        execute: async () => {\n            const { fontSize } = options;\n            if (fontSize && fontSize < 72) {\n                try {\n                    await settingRegistry.set(plugin.id, 'fontSize', fontSize + 1);\n                }\n                catch (err) {\n                    Private.showErrorMessage(err);\n                }\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.decreaseFont, {\n        label: trans.__('Decrease Terminal Font Size'),\n        execute: async () => {\n            const { fontSize } = options;\n            if (fontSize && fontSize > 9) {\n                try {\n                    await settingRegistry.set(plugin.id, 'fontSize', fontSize - 1);\n                }\n                catch (err) {\n                    Private.showErrorMessage(err);\n                }\n            }\n        }\n    });\n    const themeDisplayedName = {\n        inherit: trans.__('Inherit'),\n        light: trans.__('Light'),\n        dark: trans.__('Dark')\n    };\n    commands.addCommand(CommandIDs.setTheme, {\n        label: args => {\n            const theme = args['theme'];\n            const displayName = theme in themeDisplayedName\n                ? themeDisplayedName[theme]\n                : trans.__(theme[0].toUpperCase() + theme.slice(1));\n            return args['isPalette']\n                ? trans.__('Use Terminal Theme: %1', displayName)\n                : displayName;\n        },\n        caption: trans.__('Set the terminal theme'),\n        isToggled: args => {\n            const { theme } = options;\n            return args['theme'] === theme;\n        },\n        execute: async (args) => {\n            const theme = args['theme'];\n            try {\n                await settingRegistry.set(plugin.id, 'theme', theme);\n                commands.notifyCommandChanged(CommandIDs.setTheme);\n            }\n            catch (err) {\n                console.log(err);\n                Private.showErrorMessage(err);\n            }\n        }\n    });\n}\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Lazy-load the widget (and xterm library and addons)\n     */\n    function ensureWidget() {\n        if (Private.widgetReady) {\n            return Private.widgetReady;\n        }\n        Private.widgetReady = Promise.all(/*! import() */[__webpack_require__.e(\"vendors-node_modules_jupyterlab_terminal_lib_widget_js\"), __webpack_require__.e(\"webpack_sharing_consume_default_lumino_coreutils_lumino_coreutils\"), __webpack_require__.e(\"webpack_sharing_consume_default_lumino_widgets_lumino_widgets\"), __webpack_require__.e(\"webpack_sharing_consume_default_lumino_messaging_lumino_messaging\"), __webpack_require__.e(\"webpack_sharing_consume_default_lumino_domutils_lumino_domutils\")]).then(__webpack_require__.bind(__webpack_require__, /*! @jupyterlab/terminal/lib/widget */ \"../node_modules/@jupyterlab/terminal/lib/widget.js\"));\n        return Private.widgetReady;\n    }\n    Private.ensureWidget = ensureWidget;\n    /**\n     *  Utility function for consistent error reporting\n     */\n    function showErrorMessage(error) {\n        console.error(`Failed to configure ${plugin.id}: ${error.message}`);\n    }\n    Private.showErrorMessage = showErrorMessage;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/terminal-extension/lib/index.js?");

/***/ })

}]);