"use strict";
/*
 * 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_fileeditor-extension_lib_index_js"],{

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   CommandIDs: () => (/* binding */ CommandIDs),\n/* harmony export */   Commands: () => (/* binding */ Commands),\n/* harmony export */   FACTORY: () => (/* binding */ FACTORY)\n/* harmony export */ });\n/* harmony import */ var _codemirror_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @codemirror/commands */ \"webpack/sharing/consume/default/@codemirror/commands/@codemirror/commands\");\n/* harmony import */ var _codemirror_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_codemirror_commands__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _codemirror_search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/search */ \"webpack/sharing/consume/default/@codemirror/search/@codemirror/search\");\n/* harmony import */ var _codemirror_search__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_codemirror_search__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/codeeditor */ \"webpack/sharing/consume/default/@jupyterlab/codeeditor/@jupyterlab/codeeditor\");\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__ = __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_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @lumino/disposable */ \"webpack/sharing/consume/default/@lumino/disposable/@lumino/disposable\");\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_8__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n\n\n\n\nconst autoClosingBracketsNotebook = 'notebook:toggle-autoclosing-brackets';\nconst autoClosingBracketsConsole = 'console:toggle-autoclosing-brackets';\n/**\n * The command IDs used by the fileeditor plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.createNew = 'fileeditor:create-new';\n    CommandIDs.createNewMarkdown = 'fileeditor:create-new-markdown-file';\n    CommandIDs.changeFontSize = 'fileeditor:change-font-size';\n    CommandIDs.lineNumbers = 'fileeditor:toggle-line-numbers';\n    CommandIDs.currentLineNumbers = 'fileeditor:toggle-current-line-numbers';\n    CommandIDs.lineWrap = 'fileeditor:toggle-line-wrap';\n    CommandIDs.currentLineWrap = 'fileeditor:toggle-current-line-wrap';\n    CommandIDs.changeTabs = 'fileeditor:change-tabs';\n    CommandIDs.matchBrackets = 'fileeditor:toggle-match-brackets';\n    CommandIDs.currentMatchBrackets = 'fileeditor:toggle-current-match-brackets';\n    CommandIDs.autoClosingBrackets = 'fileeditor:toggle-autoclosing-brackets';\n    CommandIDs.autoClosingBracketsUniversal = 'fileeditor:toggle-autoclosing-brackets-universal';\n    CommandIDs.createConsole = 'fileeditor:create-console';\n    CommandIDs.replaceSelection = 'fileeditor:replace-selection';\n    CommandIDs.restartConsole = 'fileeditor:restart-console';\n    CommandIDs.runCode = 'fileeditor:run-code';\n    CommandIDs.runAllCode = 'fileeditor:run-all';\n    CommandIDs.markdownPreview = 'fileeditor:markdown-preview';\n    CommandIDs.undo = 'fileeditor:undo';\n    CommandIDs.redo = 'fileeditor:redo';\n    CommandIDs.cut = 'fileeditor:cut';\n    CommandIDs.copy = 'fileeditor:copy';\n    CommandIDs.paste = 'fileeditor:paste';\n    CommandIDs.selectAll = 'fileeditor:select-all';\n    CommandIDs.invokeCompleter = 'completer:invoke-file';\n    CommandIDs.selectCompleter = 'completer:select-file';\n    CommandIDs.openCodeViewer = 'code-viewer:open';\n    CommandIDs.changeTheme = 'fileeditor:change-theme';\n    CommandIDs.changeLanguage = 'fileeditor:change-language';\n    CommandIDs.find = 'fileeditor:find';\n    CommandIDs.goToLine = 'fileeditor:go-to-line';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * The name of the factory that creates editor widgets.\n */\nconst FACTORY = 'Editor';\n/**\n * A utility class for adding commands and menu items,\n * for use by the File Editor extension or other Editor extensions.\n */\nvar Commands;\n(function (Commands) {\n    let config = {};\n    let scrollPastEnd = true;\n    /**\n     * Accessor function that returns the createConsole function for use by Create Console commands\n     */\n    function getCreateConsoleFunction(commands, languages) {\n        return async function createConsole(widget, args) {\n            var _a, _b, _c;\n            const options = args || {};\n            const console = await commands.execute('console:create', {\n                activate: options['activate'],\n                name: (_a = widget.context.contentsModel) === null || _a === void 0 ? void 0 : _a.name,\n                path: widget.context.path,\n                // Default value is an empty string -> using OR operator\n                preferredLanguage: widget.context.model.defaultKernelLanguage ||\n                    ((_c = (_b = languages.findByFileName(widget.context.path)) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : ''),\n                ref: widget.id,\n                insertMode: 'split-bottom'\n            });\n            widget.context.pathChanged.connect((sender, value) => {\n                var _a;\n                console.session.setPath(value);\n                console.session.setName((_a = widget.context.contentsModel) === null || _a === void 0 ? void 0 : _a.name);\n            });\n        };\n    }\n    /**\n     * Update the setting values.\n     */\n    function updateSettings(settings, commands) {\n        var _a;\n        config =\n            (_a = settings.get('editorConfig').composite) !== null && _a !== void 0 ? _a : {};\n        scrollPastEnd = settings.get('scrollPasteEnd').composite;\n        // Trigger a refresh of the rendered commands\n        commands.notifyCommandChanged(CommandIDs.lineNumbers);\n        commands.notifyCommandChanged(CommandIDs.currentLineNumbers);\n        commands.notifyCommandChanged(CommandIDs.lineWrap);\n        commands.notifyCommandChanged(CommandIDs.currentLineWrap);\n        commands.notifyCommandChanged(CommandIDs.changeTabs);\n        commands.notifyCommandChanged(CommandIDs.matchBrackets);\n        commands.notifyCommandChanged(CommandIDs.currentMatchBrackets);\n        commands.notifyCommandChanged(CommandIDs.autoClosingBrackets);\n        commands.notifyCommandChanged(CommandIDs.changeLanguage);\n    }\n    Commands.updateSettings = updateSettings;\n    /**\n     * Update the settings of the current tracker instances.\n     */\n    function updateTracker(tracker) {\n        tracker.forEach(widget => {\n            updateWidget(widget.content);\n        });\n    }\n    Commands.updateTracker = updateTracker;\n    /**\n     * Update the settings of a widget.\n     * Skip global settings for transient editor specific configs.\n     */\n    function updateWidget(widget) {\n        const editor = widget.editor;\n        editor.setOptions({ ...config, scrollPastEnd });\n    }\n    Commands.updateWidget = updateWidget;\n    /**\n     * Wrapper function for adding the default File Editor commands\n     */\n    function addCommands(commands, settingRegistry, trans, id, isEnabled, tracker, defaultBrowser, extensions, languages, consoleTracker, sessionDialogs, shell) {\n        var _a;\n        /**\n         * Add a command to change font size for File Editor\n         */\n        commands.addCommand(CommandIDs.changeFontSize, {\n            execute: args => {\n                var _a;\n                const delta = Number(args['delta']);\n                if (Number.isNaN(delta)) {\n                    console.error(`${CommandIDs.changeFontSize}: delta arg must be a number`);\n                    return;\n                }\n                const style = window.getComputedStyle(document.documentElement);\n                const cssSize = parseInt(style.getPropertyValue('--jp-code-font-size'), 10);\n                if (!config.customStyles) {\n                    config.customStyles = {};\n                }\n                const currentSize = ((_a = config['customStyles']['fontSize']) !== null && _a !== void 0 ? _a : extensions.baseConfiguration['customStyles']['fontSize']) ||\n                    cssSize;\n                config.customStyles.fontSize = currentSize + delta;\n                return settingRegistry\n                    .set(id, 'editorConfig', config)\n                    .catch((reason) => {\n                    console.error(`Failed to set ${id}: ${reason.message}`);\n                });\n            },\n            label: args => {\n                const delta = Number(args['delta']);\n                if (Number.isNaN(delta)) {\n                    console.error(`${CommandIDs.changeFontSize}: delta arg must be a number`);\n                }\n                if (delta > 0) {\n                    return args.isMenu\n                        ? trans.__('Increase Text Editor Font Size')\n                        : trans.__('Increase Font Size');\n                }\n                else {\n                    return args.isMenu\n                        ? trans.__('Decrease Text Editor Font Size')\n                        : trans.__('Decrease Font Size');\n                }\n            }\n        });\n        /**\n         * Add the Line Numbers command\n         */\n        commands.addCommand(CommandIDs.lineNumbers, {\n            execute: async () => {\n                var _a;\n                config.lineNumbers = !((_a = config.lineNumbers) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.lineNumbers);\n                try {\n                    return await settingRegistry.set(id, 'editorConfig', config);\n                }\n                catch (reason) {\n                    console.error(`Failed to set ${id}: ${reason.message}`);\n                }\n            },\n            isEnabled,\n            isToggled: () => { var _a; return (_a = config.lineNumbers) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.lineNumbers; },\n            label: trans.__('Show Line Numbers')\n        });\n        commands.addCommand(CommandIDs.currentLineNumbers, {\n            label: trans.__('Show Line Numbers'),\n            caption: trans.__('Show the line numbers for the current file.'),\n            execute: () => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                const lineNumbers = !widget.content.editor.getOption('lineNumbers');\n                widget.content.editor.setOption('lineNumbers', lineNumbers);\n            },\n            isEnabled,\n            isToggled: () => {\n                var _a;\n                const widget = tracker.currentWidget;\n                return ((_a = widget === null || widget === void 0 ? void 0 : widget.content.editor.getOption('lineNumbers')) !== null && _a !== void 0 ? _a : false);\n            }\n        });\n        /**\n         * Add the Word Wrap command\n         */\n        commands.addCommand(CommandIDs.lineWrap, {\n            execute: async (args) => {\n                var _a;\n                config.lineWrap = (_a = args['mode']) !== null && _a !== void 0 ? _a : false;\n                try {\n                    return await settingRegistry.set(id, 'editorConfig', config);\n                }\n                catch (reason) {\n                    console.error(`Failed to set ${id}: ${reason.message}`);\n                }\n            },\n            isEnabled,\n            isToggled: args => {\n                var _a, _b;\n                const lineWrap = (_a = args['mode']) !== null && _a !== void 0 ? _a : false;\n                return (lineWrap ===\n                    ((_b = config.lineWrap) !== null && _b !== void 0 ? _b : extensions.baseConfiguration.lineWrap));\n            },\n            label: trans.__('Word Wrap')\n        });\n        commands.addCommand(CommandIDs.currentLineWrap, {\n            label: trans.__('Wrap Words'),\n            caption: trans.__('Wrap words for the current file.'),\n            execute: () => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                const oldValue = widget.content.editor.getOption('lineWrap');\n                widget.content.editor.setOption('lineWrap', !oldValue);\n            },\n            isEnabled,\n            isToggled: () => {\n                var _a;\n                const widget = tracker.currentWidget;\n                return ((_a = widget === null || widget === void 0 ? void 0 : widget.content.editor.getOption('lineWrap')) !== null && _a !== void 0 ? _a : false);\n            }\n        });\n        /**\n         * Add command for changing tabs size or type in File Editor\n         */\n        commands.addCommand(CommandIDs.changeTabs, {\n            label: args => {\n                var _a;\n                if (args.size) {\n                    // Use a context to differentiate with string set as plural in 3.x\n                    return trans._p('v4', 'Spaces: %1', (_a = args.size) !== null && _a !== void 0 ? _a : '');\n                }\n                else {\n                    return trans.__('Indent with Tab');\n                }\n            },\n            execute: async (args) => {\n                var _a;\n                config.indentUnit =\n                    args['size'] !== undefined\n                        ? ((_a = args['size']) !== null && _a !== void 0 ? _a : '4').toString()\n                        : 'Tab';\n                try {\n                    return await settingRegistry.set(id, 'editorConfig', config);\n                }\n                catch (reason) {\n                    console.error(`Failed to set ${id}: ${reason.message}`);\n                }\n            },\n            isToggled: args => {\n                var _a;\n                const currentIndentUnit = (_a = config.indentUnit) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.indentUnit;\n                return args['size']\n                    ? args['size'] === currentIndentUnit\n                    : 'Tab' == currentIndentUnit;\n            }\n        });\n        /**\n         * Add the Match Brackets command\n         */\n        commands.addCommand(CommandIDs.matchBrackets, {\n            execute: async () => {\n                var _a;\n                config.matchBrackets = !((_a = config.matchBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.matchBrackets);\n                try {\n                    return await settingRegistry.set(id, 'editorConfig', config);\n                }\n                catch (reason) {\n                    console.error(`Failed to set ${id}: ${reason.message}`);\n                }\n            },\n            label: trans.__('Match Brackets'),\n            isEnabled,\n            isToggled: () => { var _a; return (_a = config.matchBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.matchBrackets; }\n        });\n        commands.addCommand(CommandIDs.currentMatchBrackets, {\n            label: trans.__('Match Brackets'),\n            caption: trans.__('Change match brackets for the current file.'),\n            execute: () => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                const matchBrackets = !widget.content.editor.getOption('matchBrackets');\n                widget.content.editor.setOption('matchBrackets', matchBrackets);\n            },\n            isEnabled,\n            isToggled: () => {\n                var _a;\n                const widget = tracker.currentWidget;\n                return ((_a = widget === null || widget === void 0 ? void 0 : widget.content.editor.getOption('matchBrackets')) !== null && _a !== void 0 ? _a : false);\n            }\n        });\n        /**\n         * Add the Auto Close Brackets for Text Editor command\n         */\n        commands.addCommand(CommandIDs.autoClosingBrackets, {\n            execute: async (args) => {\n                var _a, _b;\n                config.autoClosingBrackets = !!((_a = args['force']) !== null && _a !== void 0 ? _a : !((_b = config.autoClosingBrackets) !== null && _b !== void 0 ? _b : extensions.baseConfiguration.autoClosingBrackets));\n                try {\n                    return await settingRegistry.set(id, 'editorConfig', config);\n                }\n                catch (reason) {\n                    console.error(`Failed to set ${id}: ${reason.message}`);\n                }\n            },\n            label: trans.__('Auto Close Brackets in Text Editor'),\n            isToggled: () => {\n                var _a;\n                return (_a = config.autoClosingBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.autoClosingBrackets;\n            }\n        });\n        commands.addCommand(CommandIDs.autoClosingBracketsUniversal, {\n            execute: () => {\n                const anyToggled = commands.isToggled(CommandIDs.autoClosingBrackets) ||\n                    commands.isToggled(autoClosingBracketsNotebook) ||\n                    commands.isToggled(autoClosingBracketsConsole);\n                // if any auto closing brackets options is toggled, toggle both off\n                if (anyToggled) {\n                    void commands.execute(CommandIDs.autoClosingBrackets, {\n                        force: false\n                    });\n                    void commands.execute(autoClosingBracketsNotebook, { force: false });\n                    void commands.execute(autoClosingBracketsConsole, { force: false });\n                }\n                else {\n                    // both are off, turn them on\n                    void commands.execute(CommandIDs.autoClosingBrackets, {\n                        force: true\n                    });\n                    void commands.execute(autoClosingBracketsNotebook, { force: true });\n                    void commands.execute(autoClosingBracketsConsole, { force: true });\n                }\n            },\n            label: trans.__('Auto Close Brackets'),\n            isToggled: () => commands.isToggled(CommandIDs.autoClosingBrackets) ||\n                commands.isToggled(autoClosingBracketsNotebook) ||\n                commands.isToggled(autoClosingBracketsConsole)\n        });\n        /**\n         * Create a menu for the editor.\n         */\n        commands.addCommand(CommandIDs.changeTheme, {\n            label: args => {\n                var _a, _b, _c, _d;\n                return (_d = (_c = (_b = ((_a = args.displayName) !== null && _a !== void 0 ? _a : args.theme)) !== null && _b !== void 0 ? _b : config.theme) !== null && _c !== void 0 ? _c : extensions.baseConfiguration.theme) !== null && _d !== void 0 ? _d : trans.__('Editor Theme');\n            },\n            execute: async (args) => {\n                var _a;\n                config.theme = (_a = args['theme']) !== null && _a !== void 0 ? _a : config.theme;\n                try {\n                    return await settingRegistry.set(id, 'editorConfig', config);\n                }\n                catch (reason) {\n                    console.error(`Failed to set theme - ${reason.message}`);\n                }\n            },\n            isToggled: args => { var _a; return args['theme'] === ((_a = config.theme) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.theme); }\n        });\n        commands.addCommand(CommandIDs.find, {\n            label: trans.__('Find…'),\n            execute: () => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                const editor = widget.content.editor;\n                editor.execCommand(_codemirror_search__WEBPACK_IMPORTED_MODULE_1__.findNext);\n            },\n            isEnabled\n        });\n        commands.addCommand(CommandIDs.goToLine, {\n            label: trans.__('Go to Line…'),\n            execute: args => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                const editor = widget.content.editor;\n                const line = args['line'];\n                const column = args['column'];\n                if (line !== undefined || column !== undefined) {\n                    editor.setCursorPosition({\n                        line: (line !== null && line !== void 0 ? line : 1) - 1,\n                        column: (column !== null && column !== void 0 ? column : 1) - 1\n                    });\n                }\n                else {\n                    editor.execCommand(_codemirror_search__WEBPACK_IMPORTED_MODULE_1__.gotoLine);\n                }\n            },\n            isEnabled\n        });\n        commands.addCommand(CommandIDs.changeLanguage, {\n            label: args => {\n                var _a, _b;\n                return (_b = ((_a = args['displayName']) !== null && _a !== void 0 ? _a : args['name'])) !== null && _b !== void 0 ? _b : trans.__('Change editor language.');\n            },\n            execute: args => {\n                var _a;\n                const name = args['name'];\n                const widget = tracker.currentWidget;\n                if (name && widget) {\n                    const spec = languages.findByName(name);\n                    if (spec) {\n                        if (Array.isArray(spec.mime)) {\n                            widget.content.model.mimeType =\n                                (_a = spec.mime[0]) !== null && _a !== void 0 ? _a : _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_3__.IEditorMimeTypeService.defaultMimeType;\n                        }\n                        else {\n                            widget.content.model.mimeType = spec.mime;\n                        }\n                    }\n                }\n            },\n            isEnabled,\n            isToggled: args => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return false;\n                }\n                const mime = widget.content.model.mimeType;\n                const spec = languages.findByMIME(mime);\n                const name = spec && spec.name;\n                return args['name'] === name;\n            }\n        });\n        /**\n         * Add the replace selection for text editor command\n         */\n        commands.addCommand(CommandIDs.replaceSelection, {\n            execute: args => {\n                var _a, _b;\n                const text = args['text'] || '';\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                (_b = (_a = widget.content.editor).replaceSelection) === null || _b === void 0 ? void 0 : _b.call(_a, text);\n            },\n            isEnabled,\n            label: trans.__('Replace Selection in Editor')\n        });\n        /**\n         * Add the Create Console for Editor command\n         */\n        commands.addCommand(CommandIDs.createConsole, {\n            execute: args => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                return getCreateConsoleFunction(commands, languages)(widget, args);\n            },\n            isEnabled,\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.consoleIcon,\n            label: trans.__('Create Console for Editor')\n        });\n        /**\n         * Restart the Console Kernel linked to the current Editor\n         */\n        commands.addCommand(CommandIDs.restartConsole, {\n            execute: async () => {\n                var _a;\n                const current = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!current || consoleTracker === null) {\n                    return;\n                }\n                const widget = consoleTracker.find(widget => { var _a; return ((_a = widget.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) === current.context.path; });\n                if (widget) {\n                    return sessionDialogs.restart(widget.sessionContext);\n                }\n            },\n            label: trans.__('Restart Kernel'),\n            isEnabled: () => consoleTracker !== null && isEnabled()\n        });\n        /**\n         * Add the Run Code command\n         */\n        commands.addCommand(CommandIDs.runCode, {\n            execute: () => {\n                var _a, _b;\n                // Run the appropriate code, taking into account a ```fenced``` code block.\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                let code = '';\n                const editor = widget.editor;\n                const path = widget.context.path;\n                const extension = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.PathExt.extname(path);\n                const selection = editor.getSelection();\n                const { start, end } = selection;\n                let selected = start.column !== end.column || start.line !== end.line;\n                if (selected) {\n                    // Get the selected code from the editor.\n                    const start = editor.getOffsetAt(selection.start);\n                    const end = editor.getOffsetAt(selection.end);\n                    code = editor.model.sharedModel.getSource().substring(start, end);\n                }\n                else if (_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.MarkdownCodeBlocks.isMarkdown(extension)) {\n                    const text = editor.model.sharedModel.getSource();\n                    const blocks = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.MarkdownCodeBlocks.findMarkdownCodeBlocks(text);\n                    for (const block of blocks) {\n                        if (block.startLine <= start.line && start.line <= block.endLine) {\n                            code = block.code;\n                            selected = true;\n                            break;\n                        }\n                    }\n                }\n                if (!selected) {\n                    // no selection, submit whole line and advance\n                    code = editor.getLine(selection.start.line);\n                    const cursor = editor.getCursorPosition();\n                    const nextLine = editor.getLine(cursor.line + 1);\n                    if (cursor.line + 1 === editor.lineCount) {\n                        const text = editor.model.sharedModel.getSource();\n                        editor.model.sharedModel.setSource(text + '\\n');\n                    }\n                    editor.setCursorPosition({\n                        line: cursor.line + 1,\n                        column: (_b = nextLine === null || nextLine === void 0 ? void 0 : nextLine.length) !== null && _b !== void 0 ? _b : 0 // Place cursor at end of line if line has content else place at start of line\n                    });\n                }\n                const activate = false;\n                if (code) {\n                    return commands.execute('console:inject', { activate, code, path });\n                }\n                else {\n                    return Promise.resolve(void 0);\n                }\n            },\n            isEnabled,\n            label: trans.__('Run Selected Code')\n        });\n        /**\n         * Add the Run All Code command\n         */\n        commands.addCommand(CommandIDs.runAllCode, {\n            execute: () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                let code = '';\n                const editor = widget.editor;\n                const text = editor.model.sharedModel.getSource();\n                const path = widget.context.path;\n                const extension = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.PathExt.extname(path);\n                if (_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.MarkdownCodeBlocks.isMarkdown(extension)) {\n                    // For Markdown files, run only code blocks.\n                    const blocks = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.MarkdownCodeBlocks.findMarkdownCodeBlocks(text);\n                    for (const block of blocks) {\n                        code += block.code;\n                    }\n                }\n                else {\n                    code = text;\n                }\n                const activate = false;\n                if (code) {\n                    return commands.execute('console:inject', { activate, code, path });\n                }\n                else {\n                    return Promise.resolve(void 0);\n                }\n            },\n            isEnabled,\n            label: trans.__('Run All Code')\n        });\n        /**\n         * Add markdown preview command\n         */\n        commands.addCommand(CommandIDs.markdownPreview, {\n            execute: () => {\n                const widget = tracker.currentWidget;\n                if (!widget) {\n                    return;\n                }\n                const path = widget.context.path;\n                return commands.execute('markdownviewer:open', {\n                    path,\n                    options: {\n                        mode: 'split-right'\n                    }\n                });\n            },\n            isVisible: () => {\n                const widget = tracker.currentWidget;\n                return ((widget && _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_4__.PathExt.extname(widget.context.path) === '.md') || false);\n            },\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.markdownIcon,\n            label: trans.__('Show Markdown Preview')\n        });\n        /**\n         * Add the New File command\n         *\n         * Defaults to Text/.txt if file type data is not specified\n         */\n        commands.addCommand(CommandIDs.createNew, {\n            label: args => {\n                var _a, _b;\n                if (args.isPalette) {\n                    return (_a = args.paletteLabel) !== null && _a !== void 0 ? _a : trans.__('New Text File');\n                }\n                return (_b = args.launcherLabel) !== null && _b !== void 0 ? _b : trans.__('Text File');\n            },\n            caption: args => { var _a; return (_a = args.caption) !== null && _a !== void 0 ? _a : trans.__('Create a new text file'); },\n            icon: args => {\n                var _a;\n                return args.isPalette\n                    ? undefined\n                    : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.LabIcon.resolve({\n                        icon: (_a = args.iconName) !== null && _a !== void 0 ? _a : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.textEditorIcon\n                    });\n            },\n            execute: args => {\n                var _a;\n                const cwd = args.cwd || defaultBrowser.model.path;\n                return createNew(commands, cwd, (_a = args.fileExt) !== null && _a !== void 0 ? _a : 'txt');\n            }\n        });\n        /**\n         * Add the New Markdown File command\n         */\n        commands.addCommand(CommandIDs.createNewMarkdown, {\n            label: args => args['isPalette']\n                ? trans.__('New Markdown File')\n                : trans.__('Markdown File'),\n            caption: trans.__('Create a new markdown file'),\n            icon: args => (args['isPalette'] ? undefined : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.markdownIcon),\n            execute: args => {\n                const cwd = args['cwd'] || defaultBrowser.model.path;\n                return createNew(commands, cwd, 'md');\n            }\n        });\n        /**\n         * Add undo command\n         */\n        commands.addCommand(CommandIDs.undo, {\n            execute: () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                widget.editor.undo();\n            },\n            isEnabled: () => {\n                var _a;\n                if (!isEnabled()) {\n                    return false;\n                }\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return false;\n                }\n                return widget.editor.model.sharedModel.canUndo();\n            },\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.undoIcon.bindprops({ stylesheet: 'menuItem' }),\n            label: trans.__('Undo')\n        });\n        /**\n         * Add redo command\n         */\n        commands.addCommand(CommandIDs.redo, {\n            execute: () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                widget.editor.redo();\n            },\n            isEnabled: () => {\n                var _a;\n                if (!isEnabled()) {\n                    return false;\n                }\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return false;\n                }\n                return widget.editor.model.sharedModel.canRedo();\n            },\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.redoIcon.bindprops({ stylesheet: 'menuItem' }),\n            label: trans.__('Redo')\n        });\n        /**\n         * Add cut command\n         */\n        commands.addCommand(CommandIDs.cut, {\n            execute: () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                const editor = widget.editor;\n                const text = getTextSelection(editor);\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copyToSystem(text);\n                editor.replaceSelection && editor.replaceSelection('');\n            },\n            isEnabled: () => {\n                var _a;\n                if (!isEnabled()) {\n                    return false;\n                }\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return false;\n                }\n                // Enable command if there is a text selection in the editor\n                return isSelected(widget.editor);\n            },\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.cutIcon.bindprops({ stylesheet: 'menuItem' }),\n            label: trans.__('Cut')\n        });\n        /**\n         * Add copy command\n         */\n        commands.addCommand(CommandIDs.copy, {\n            execute: () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                const editor = widget.editor;\n                const text = getTextSelection(editor);\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copyToSystem(text);\n            },\n            isEnabled: () => {\n                var _a;\n                if (!isEnabled()) {\n                    return false;\n                }\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return false;\n                }\n                // Enable command if there is a text selection in the editor\n                return isSelected(widget.editor);\n            },\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.copyIcon.bindprops({ stylesheet: 'menuItem' }),\n            label: trans.__('Copy')\n        });\n        /**\n         * Add paste command\n         */\n        commands.addCommand(CommandIDs.paste, {\n            execute: async () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                const editor = widget.editor;\n                // Get data from clipboard\n                const clipboard = window.navigator.clipboard;\n                const clipboardData = await clipboard.readText();\n                if (clipboardData) {\n                    // Paste data to the editor\n                    editor.replaceSelection && editor.replaceSelection(clipboardData);\n                }\n            },\n            isEnabled: () => { var _a; return Boolean(isEnabled() && ((_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content)); },\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.pasteIcon.bindprops({ stylesheet: 'menuItem' }),\n            label: trans.__('Paste')\n        });\n        /**\n         * Add select all command\n         */\n        commands.addCommand(CommandIDs.selectAll, {\n            execute: () => {\n                var _a;\n                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n                if (!widget) {\n                    return;\n                }\n                const editor = widget.editor;\n                editor.execCommand(_codemirror_commands__WEBPACK_IMPORTED_MODULE_0__.selectAll);\n            },\n            isEnabled: () => { var _a; return Boolean(isEnabled() && ((_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content)); },\n            label: trans.__('Select All')\n        });\n        // All commands with isEnabled defined directly or in a semantic commands\n        const commandIds = [\n            CommandIDs.lineNumbers,\n            CommandIDs.currentLineNumbers,\n            CommandIDs.lineWrap,\n            CommandIDs.currentLineWrap,\n            CommandIDs.matchBrackets,\n            CommandIDs.currentMatchBrackets,\n            CommandIDs.find,\n            CommandIDs.goToLine,\n            CommandIDs.changeLanguage,\n            CommandIDs.replaceSelection,\n            CommandIDs.createConsole,\n            CommandIDs.restartConsole,\n            CommandIDs.runCode,\n            CommandIDs.runAllCode,\n            CommandIDs.undo,\n            CommandIDs.redo,\n            CommandIDs.cut,\n            CommandIDs.copy,\n            CommandIDs.paste,\n            CommandIDs.selectAll,\n            CommandIDs.createConsole\n        ];\n        const notify = () => {\n            commandIds.forEach(id => commands.notifyCommandChanged(id));\n        };\n        tracker.currentChanged.connect(notify);\n        (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);\n    }\n    Commands.addCommands = addCommands;\n    function addCompleterCommands(commands, editorTracker, manager, translator) {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__.nullTranslator).load('jupyterlab');\n        commands.addCommand(CommandIDs.invokeCompleter, {\n            label: trans.__('Display the completion helper.'),\n            execute: () => {\n                const id = editorTracker.currentWidget && editorTracker.currentWidget.id;\n                if (id) {\n                    return manager.invoke(id);\n                }\n            }\n        });\n        commands.addCommand(CommandIDs.selectCompleter, {\n            label: trans.__('Select the completion suggestion.'),\n            execute: () => {\n                const id = editorTracker.currentWidget && editorTracker.currentWidget.id;\n                if (id) {\n                    return manager.select(id);\n                }\n            }\n        });\n        commands.addKeyBinding({\n            command: CommandIDs.selectCompleter,\n            keys: ['Enter'],\n            selector: '.jp-FileEditor .jp-mod-completer-active'\n        });\n    }\n    Commands.addCompleterCommands = addCompleterCommands;\n    /**\n     * Helper function to check if there is a text selection in the editor\n     */\n    function isSelected(editor) {\n        const selectionObj = editor.getSelection();\n        const { start, end } = selectionObj;\n        const selected = start.column !== end.column || start.line !== end.line;\n        return selected;\n    }\n    /**\n     * Helper function to get text selection from the editor\n     */\n    function getTextSelection(editor) {\n        const selectionObj = editor.getSelection();\n        const start = editor.getOffsetAt(selectionObj.start);\n        const end = editor.getOffsetAt(selectionObj.end);\n        const text = editor.model.sharedModel.getSource().substring(start, end);\n        return text;\n    }\n    /**\n     * Function to create a new untitled text file, given the current working directory.\n     */\n    async function createNew(commands, cwd, ext = 'txt') {\n        const model = await commands.execute('docmanager:new-untitled', {\n            path: cwd,\n            type: 'file',\n            ext\n        });\n        if (model != undefined) {\n            const widget = (await commands.execute('docmanager:open', {\n                path: model.path,\n                factory: FACTORY\n            }));\n            widget.isUntitled = true;\n            return widget;\n        }\n    }\n    /**\n     * Wrapper function for adding the default launcher items for File Editor\n     */\n    function addLauncherItems(launcher, trans) {\n        addCreateNewToLauncher(launcher, trans);\n        addCreateNewMarkdownToLauncher(launcher, trans);\n    }\n    Commands.addLauncherItems = addLauncherItems;\n    /**\n     * Add Create New Text File to the Launcher\n     */\n    function addCreateNewToLauncher(launcher, trans) {\n        launcher.add({\n            command: CommandIDs.createNew,\n            category: trans.__('Other'),\n            rank: 1\n        });\n    }\n    Commands.addCreateNewToLauncher = addCreateNewToLauncher;\n    /**\n     * Add Create New Markdown to the Launcher\n     */\n    function addCreateNewMarkdownToLauncher(launcher, trans) {\n        launcher.add({\n            command: CommandIDs.createNewMarkdown,\n            category: trans.__('Other'),\n            rank: 2\n        });\n    }\n    Commands.addCreateNewMarkdownToLauncher = addCreateNewMarkdownToLauncher;\n    /**\n     * Add ___ File items to the Launcher for common file types associated with available kernels\n     * Returns a DisposableSet containing all added items\n     */\n    function addKernelLanguageLauncherItems(launcher, trans, availableKernelFileTypes) {\n        const disposables = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_8__.DisposableSet();\n        for (const ext of availableKernelFileTypes) {\n            disposables.add(launcher.add({\n                command: CommandIDs.createNew,\n                category: trans.__('Other'),\n                rank: 3,\n                args: ext\n            }));\n        }\n        return disposables;\n    }\n    Commands.addKernelLanguageLauncherItems = addKernelLanguageLauncherItems;\n    /**\n     * Wrapper function for adding the default items to the File Editor palette\n     */\n    function addPaletteItems(palette, trans) {\n        addChangeTabsCommandsToPalette(palette, trans);\n        addCreateNewCommandToPalette(palette, trans);\n        addCreateNewMarkdownCommandToPalette(palette, trans);\n        addChangeFontSizeCommandsToPalette(palette, trans);\n    }\n    Commands.addPaletteItems = addPaletteItems;\n    /**\n     * Add commands to change the tab indentation to the File Editor palette\n     */\n    function addChangeTabsCommandsToPalette(palette, trans) {\n        const paletteCategory = trans.__('Text Editor');\n        const args = {\n            size: 4\n        };\n        const command = CommandIDs.changeTabs;\n        palette.addItem({ command, args, category: paletteCategory });\n        for (const size of [1, 2, 4, 8]) {\n            const args = {\n                size\n            };\n            palette.addItem({ command, args, category: paletteCategory });\n        }\n    }\n    Commands.addChangeTabsCommandsToPalette = addChangeTabsCommandsToPalette;\n    /**\n     * Add a Create New File command to the File Editor palette\n     */\n    function addCreateNewCommandToPalette(palette, trans) {\n        const paletteCategory = trans.__('Text Editor');\n        palette.addItem({\n            command: CommandIDs.createNew,\n            args: { isPalette: true },\n            category: paletteCategory\n        });\n    }\n    Commands.addCreateNewCommandToPalette = addCreateNewCommandToPalette;\n    /**\n     * Add a Create New Markdown command to the File Editor palette\n     */\n    function addCreateNewMarkdownCommandToPalette(palette, trans) {\n        const paletteCategory = trans.__('Text Editor');\n        palette.addItem({\n            command: CommandIDs.createNewMarkdown,\n            args: { isPalette: true },\n            category: paletteCategory\n        });\n    }\n    Commands.addCreateNewMarkdownCommandToPalette = addCreateNewMarkdownCommandToPalette;\n    /**\n     * Add commands to change the font size to the File Editor palette\n     */\n    function addChangeFontSizeCommandsToPalette(palette, trans) {\n        const paletteCategory = trans.__('Text Editor');\n        const command = CommandIDs.changeFontSize;\n        let args = { delta: 1 };\n        palette.addItem({ command, args, category: paletteCategory });\n        args = { delta: -1 };\n        palette.addItem({ command, args, category: paletteCategory });\n    }\n    Commands.addChangeFontSizeCommandsToPalette = addChangeFontSizeCommandsToPalette;\n    /**\n     * Add New ___ File commands to the File Editor palette for common file types associated with available kernels\n     * Returns a DisposableSet containing all added items\n     */\n    function addKernelLanguagePaletteItems(palette, trans, availableKernelFileTypes) {\n        const disposables = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_8__.DisposableSet();\n        const paletteCategory = trans.__('Text Editor');\n        for (const ext of availableKernelFileTypes) {\n            disposables.add(palette.addItem({\n                command: CommandIDs.createNew,\n                args: { ...ext, isPalette: true },\n                category: paletteCategory\n            }));\n        }\n        return disposables;\n    }\n    Commands.addKernelLanguagePaletteItems = addKernelLanguagePaletteItems;\n    /**\n     * Wrapper function for adding the default menu items for File Editor\n     */\n    function addMenuItems(menu, tracker, consoleTracker, isEnabled) {\n        // Add undo/redo hooks to the edit menu.\n        menu.editMenu.undoers.redo.add({\n            id: CommandIDs.redo,\n            isEnabled\n        });\n        menu.editMenu.undoers.undo.add({\n            id: CommandIDs.undo,\n            isEnabled\n        });\n        // Add editor view options.\n        menu.viewMenu.editorViewers.toggleLineNumbers.add({\n            id: CommandIDs.currentLineNumbers,\n            isEnabled\n        });\n        menu.viewMenu.editorViewers.toggleMatchBrackets.add({\n            id: CommandIDs.currentMatchBrackets,\n            isEnabled\n        });\n        menu.viewMenu.editorViewers.toggleWordWrap.add({\n            id: CommandIDs.currentLineWrap,\n            isEnabled\n        });\n        // Add a console creator the the file menu.\n        menu.fileMenu.consoleCreators.add({\n            id: CommandIDs.createConsole,\n            isEnabled\n        });\n        // Add a code runner to the run menu.\n        if (consoleTracker) {\n            addCodeRunnersToRunMenu(menu, consoleTracker, isEnabled);\n        }\n    }\n    Commands.addMenuItems = addMenuItems;\n    /**\n     * Add Create New ___ File commands to the File menu for common file types associated with available kernels\n     * Returns a DisposableSet containing all added items\n     */\n    function addKernelLanguageMenuItems(menu, availableKernelFileTypes) {\n        const disposables = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_8__.DisposableSet();\n        for (const ext of availableKernelFileTypes) {\n            disposables.add(menu.fileMenu.newMenu.addItem({\n                command: CommandIDs.createNew,\n                args: ext,\n                rank: 31\n            }));\n        }\n        return disposables;\n    }\n    Commands.addKernelLanguageMenuItems = addKernelLanguageMenuItems;\n    /**\n     * Add a File Editor code runner to the Run menu\n     */\n    function addCodeRunnersToRunMenu(menu, consoleTracker, isEnabled) {\n        const isEnabled_ = (current) => isEnabled() &&\n            current.context &&\n            !!consoleTracker.find(widget => { var _a; return ((_a = widget.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) === current.context.path; });\n        menu.runMenu.codeRunners.restart.add({\n            id: CommandIDs.restartConsole,\n            isEnabled: isEnabled_\n        });\n        menu.runMenu.codeRunners.run.add({\n            id: CommandIDs.runCode,\n            isEnabled: isEnabled_\n        });\n        menu.runMenu.codeRunners.runAll.add({\n            id: CommandIDs.runAllCode,\n            isEnabled: isEnabled_\n        });\n    }\n    Commands.addCodeRunnersToRunMenu = addCodeRunnersToRunMenu;\n    function addOpenCodeViewerCommand(app, editorServices, tracker, trans) {\n        const openCodeViewer = async (args) => {\n            var _a;\n            const func = editorServices.factoryService.newDocumentEditor;\n            const factory = options => {\n                return func(options);\n            };\n            // Derive mimetype from extension\n            let mimetype = args.mimeType;\n            if (!mimetype && args.extension) {\n                mimetype = editorServices.mimeTypeService.getMimeTypeByFilePath(`temp.${args.extension.replace(/\\\\.$/, '')}`);\n            }\n            const widget = _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_3__.CodeViewerWidget.createCodeViewer({\n                factory,\n                content: args.content,\n                mimeType: mimetype\n            });\n            widget.title.label = args.label || trans.__('Code Viewer');\n            widget.title.caption = widget.title.label;\n            // Get the fileType based on the mimetype to determine the icon\n            const fileType = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__.find)(app.docRegistry.fileTypes(), fileType => mimetype ? fileType.mimeTypes.includes(mimetype) : false);\n            widget.title.icon = (_a = fileType === null || fileType === void 0 ? void 0 : fileType.icon) !== null && _a !== void 0 ? _a : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.textEditorIcon;\n            if (args.widgetId) {\n                widget.id = args.widgetId;\n            }\n            const main = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.MainAreaWidget({ content: widget });\n            await tracker.add(main);\n            app.shell.add(main, 'main');\n            return widget;\n        };\n        app.commands.addCommand(CommandIDs.openCodeViewer, {\n            label: trans.__('Open Code Viewer'),\n            execute: (args) => {\n                return openCodeViewer(args);\n            }\n        });\n    }\n    Commands.addOpenCodeViewerCommand = addOpenCodeViewerCommand;\n})(Commands || (Commands = {}));\n//# sourceMappingURL=commands.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/fileeditor-extension/lib/commands.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   Commands: () => (/* reexport safe */ _commands__WEBPACK_IMPORTED_MODULE_18__.Commands),\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   tabSpaceStatus: () => (/* binding */ tabSpaceStatus)\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_codeeditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/codeeditor */ \"webpack/sharing/consume/default/@jupyterlab/codeeditor/@jupyterlab/codeeditor\");\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/codemirror */ \"webpack/sharing/consume/default/@jupyterlab/codemirror/@jupyterlab/codemirror\");\n/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/completer */ \"webpack/sharing/consume/default/@jupyterlab/completer/@jupyterlab/completer\");\n/* harmony import */ var _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_completer__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/console */ \"webpack/sharing/consume/default/@jupyterlab/console/@jupyterlab/console\");\n/* harmony import */ var _jupyterlab_console__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_console__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/documentsearch */ \"webpack/sharing/consume/default/@jupyterlab/documentsearch/@jupyterlab/documentsearch\");\n/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @jupyterlab/filebrowser */ \"webpack/sharing/consume/default/@jupyterlab/filebrowser/@jupyterlab/filebrowser\");\n/* harmony import */ var _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @jupyterlab/fileeditor */ \"webpack/sharing/consume/default/@jupyterlab/fileeditor/@jupyterlab/fileeditor\");\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @jupyterlab/launcher */ \"webpack/sharing/consume/default/@jupyterlab/launcher/@jupyterlab/launcher\");\n/* harmony import */ var _jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @jupyterlab/lsp */ \"webpack/sharing/consume/default/@jupyterlab/lsp/@jupyterlab/lsp\");\n/* harmony import */ var _jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @jupyterlab/mainmenu */ \"webpack/sharing/consume/default/@jupyterlab/mainmenu/@jupyterlab/mainmenu\");\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @jupyterlab/statusbar */ \"webpack/sharing/consume/default/@jupyterlab/statusbar/@jupyterlab/statusbar\");\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @jupyterlab/toc */ \"webpack/sharing/consume/default/@jupyterlab/toc/@jupyterlab/toc\");\n/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_toc__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_16__ = __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_16___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./commands */ \"../node_modules/@jupyterlab/fileeditor-extension/lib/commands.js\");\n/* harmony import */ var _syntaxstatus__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./syntaxstatus */ \"../node_modules/@jupyterlab/fileeditor-extension/lib/syntaxstatus.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module fileeditor-extension\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The editor tracker extension.\n */\nconst plugin = {\n    activate,\n    id: '@jupyterlab/fileeditor-extension:plugin',\n    description: 'Provides the file editor widget tracker.',\n    requires: [\n        _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorWidgetFactory,\n        _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_2__.IEditorServices,\n        _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3__.IEditorExtensionRegistry,\n        _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3__.IEditorLanguageRegistry,\n        _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3__.IEditorThemeRegistry,\n        _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_7__.IDefaultFileBrowser,\n        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_12__.ISettingRegistry\n    ],\n    optional: [\n        _jupyterlab_console__WEBPACK_IMPORTED_MODULE_5__.IConsoleTracker,\n        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette,\n        _jupyterlab_launcher__WEBPACK_IMPORTED_MODULE_9__.ILauncher,\n        _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_11__.IMainMenu,\n        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer,\n        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ISessionContextDialogs,\n        _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_14__.ITableOfContentsRegistry,\n        _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__.ITranslator,\n        _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_16__.IFormRendererRegistry\n    ],\n    provides: _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorTracker,\n    autoStart: true\n};\n/**\n * The widget factory extension.\n */\nconst widgetFactory = {\n    id: '@jupyterlab/fileeditor-extension:widget-factory',\n    description: 'Provides the factory for creating file editors.',\n    autoStart: true,\n    requires: [_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_2__.IEditorServices, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_12__.ISettingRegistry],\n    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IToolbarWidgetRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__.ITranslator],\n    provides: _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorWidgetFactory,\n    activate: (app, editorServices, settingRegistry, toolbarRegistry, translator_) => {\n        const id = plugin.id;\n        const translator = translator_ !== null && translator_ !== void 0 ? translator_ : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        let toolbarFactory;\n        if (toolbarRegistry) {\n            toolbarFactory = (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.createToolbarFactory)(toolbarRegistry, settingRegistry, _commands__WEBPACK_IMPORTED_MODULE_18__.FACTORY, id, translator);\n        }\n        const factory = new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.FileEditorFactory({\n            editorServices,\n            factoryOptions: {\n                name: _commands__WEBPACK_IMPORTED_MODULE_18__.FACTORY,\n                label: trans.__('Editor'),\n                fileTypes: ['markdown', '*'], // Explicitly add the markdown fileType so\n                defaultFor: ['markdown', '*'], // it outranks the defaultRendered viewer.\n                toolbarFactory,\n                translator\n            }\n        });\n        app.docRegistry.addWidgetFactory(factory);\n        return factory;\n    }\n};\n/**\n * A plugin that provides a status item allowing the user to\n * switch tabs vs spaces and tab widths for text editors.\n */\nconst tabSpaceStatus = {\n    id: '@jupyterlab/fileeditor-extension:tab-space-status',\n    description: 'Adds a file editor indentation status widget.',\n    autoStart: true,\n    requires: [\n        _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorTracker,\n        _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_3__.IEditorExtensionRegistry,\n        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_12__.ISettingRegistry,\n        _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__.ITranslator\n    ],\n    optional: [_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_13__.IStatusBar],\n    activate: (app, editorTracker, extensions, settingRegistry, translator, statusBar) => {\n        const trans = translator.load('jupyterlab');\n        if (!statusBar) {\n            // Automatically disable if statusbar missing\n            return;\n        }\n        // Create a menu for switching tabs vs spaces.\n        const menu = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_16__.MenuSvg({ commands: app.commands });\n        const command = 'fileeditor:change-tabs';\n        const { shell } = app;\n        const args = {\n            name: trans.__('Indent with Tab')\n        };\n        menu.addItem({ command, args });\n        for (const size of ['1', '2', '4', '8']) {\n            const args = {\n                size,\n                // Use a context to differentiate with string set as plural in 3.x\n                name: trans._p('v4', 'Spaces: %1', size)\n            };\n            menu.addItem({ command, args });\n        }\n        // Create the status item.\n        const item = new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.TabSpaceStatus({ menu, translator });\n        // Keep a reference to the code editor config from the settings system.\n        const updateIndentUnit = (settings) => {\n            var _a, _b, _c;\n            item.model.indentUnit =\n                (_c = (_b = (_a = settings.get('editorConfig').composite) === null || _a === void 0 ? void 0 : _a.indentUnit) !== null && _b !== void 0 ? _b : extensions.baseConfiguration.indentUnit) !== null && _c !== void 0 ? _c : null;\n        };\n        void Promise.all([\n            settingRegistry.load('@jupyterlab/fileeditor-extension:plugin'),\n            app.restored\n        ]).then(([settings]) => {\n            updateIndentUnit(settings);\n            settings.changed.connect(updateIndentUnit);\n        });\n        // Add the status item.\n        statusBar.registerStatusItem('@jupyterlab/fileeditor-extension:tab-space-status', {\n            item,\n            align: 'right',\n            rank: 1,\n            isActive: () => {\n                return (!!shell.currentWidget && editorTracker.has(shell.currentWidget));\n            }\n        });\n    }\n};\n/**\n * Cursor position.\n */\nconst lineColStatus = {\n    id: '@jupyterlab/fileeditor-extension:cursor-position',\n    description: 'Adds a file editor cursor position status widget.',\n    activate: (app, tracker, positionModel) => {\n        positionModel.addEditorProvider((widget) => Promise.resolve(widget && tracker.has(widget)\n            ? widget.content.editor\n            : null));\n    },\n    requires: [_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorTracker, _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_2__.IPositionModel],\n    autoStart: true\n};\nconst completerPlugin = {\n    id: '@jupyterlab/fileeditor-extension:completer',\n    description: 'Adds the completer capability to the file editor.',\n    requires: [_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorTracker],\n    optional: [_jupyterlab_completer__WEBPACK_IMPORTED_MODULE_4__.ICompletionProviderManager, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__.ITranslator, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ISanitizer],\n    activate: activateFileEditorCompleterService,\n    autoStart: true\n};\n/**\n * A plugin to search file editors\n */\nconst searchProvider = {\n    id: '@jupyterlab/fileeditor-extension:search',\n    description: 'Adds search capability to the file editor.',\n    requires: [_jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_6__.ISearchProviderRegistry],\n    autoStart: true,\n    activate: (app, registry) => {\n        registry.add('jp-fileeditorSearchProvider', _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.FileEditorSearchProvider);\n    }\n};\nconst languageServerPlugin = {\n    id: '@jupyterlab/fileeditor-extension:language-server',\n    description: 'Adds Language Server capability to the file editor.',\n    requires: [\n        _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.IEditorTracker,\n        _jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10__.ILSPDocumentConnectionManager,\n        _jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10__.ILSPFeatureManager,\n        _jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10__.ILSPCodeExtractorsManager,\n        _jupyterlab_lsp__WEBPACK_IMPORTED_MODULE_10__.IWidgetLSPAdapterTracker\n    ],\n    activate: activateFileEditorLanguageServer,\n    autoStart: true\n};\n/**\n * Export the plugins as default.\n */\nconst plugins = [\n    widgetFactory,\n    plugin,\n    lineColStatus,\n    completerPlugin,\n    languageServerPlugin,\n    searchProvider,\n    _syntaxstatus__WEBPACK_IMPORTED_MODULE_19__.editorSyntaxStatus,\n    tabSpaceStatus\n];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);\n/**\n * Activate the editor tracker plugin.\n */\nfunction activate(app, factory, editorServices, extensions, languages, themes, fileBrowser, settingRegistry, consoleTracker, palette, launcher, menu, restorer, sessionDialogs_, tocRegistry, translator_, formRegistry) {\n    const id = plugin.id;\n    const translator = translator_ !== null && translator_ !== void 0 ? translator_ : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_15__.nullTranslator;\n    const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.SessionContextDialogs({ translator });\n    const trans = translator.load('jupyterlab');\n    const namespace = 'editor';\n    const { commands, restored, shell } = app;\n    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({\n        namespace\n    });\n    const isEnabled = () => tracker.currentWidget !== null &&\n        tracker.currentWidget === shell.currentWidget;\n    const commonLanguageFileTypeData = new Map([\n        [\n            'python',\n            [\n                {\n                    fileExt: 'py',\n                    iconName: 'ui-components:python',\n                    launcherLabel: trans.__('Python File'),\n                    paletteLabel: trans.__('New Python File'),\n                    caption: trans.__('Create a new Python file')\n                }\n            ]\n        ],\n        [\n            'julia',\n            [\n                {\n                    fileExt: 'jl',\n                    iconName: 'ui-components:julia',\n                    launcherLabel: trans.__('Julia File'),\n                    paletteLabel: trans.__('New Julia File'),\n                    caption: trans.__('Create a new Julia file')\n                }\n            ]\n        ],\n        [\n            'R',\n            [\n                {\n                    fileExt: 'r',\n                    iconName: 'ui-components:r-kernel',\n                    launcherLabel: trans.__('R File'),\n                    paletteLabel: trans.__('New R File'),\n                    caption: trans.__('Create a new R file')\n                }\n            ]\n        ]\n    ]);\n    // Use available kernels to determine which common file types should have 'Create New' options in the Launcher, File Editor palette, and File menu\n    const getAvailableKernelFileTypes = async () => {\n        var _a, _b;\n        const specsManager = app.serviceManager.kernelspecs;\n        await specsManager.ready;\n        let fileTypes = new Set();\n        const specs = (_b = (_a = specsManager.specs) === null || _a === void 0 ? void 0 : _a.kernelspecs) !== null && _b !== void 0 ? _b : {};\n        Object.keys(specs).forEach(spec => {\n            const specModel = specs[spec];\n            if (specModel) {\n                const exts = commonLanguageFileTypeData.get(specModel.language);\n                exts === null || exts === void 0 ? void 0 : exts.forEach(ext => fileTypes.add(ext));\n            }\n        });\n        return fileTypes;\n    };\n    let launcherDisposables = null;\n    let paletteDisposables = null;\n    let menuDisposables = null;\n    const updateKernelFileTypeComponents = (fileTypes) => {\n        // Dispose of previous entries if they exist\n        if (launcherDisposables) {\n            launcherDisposables.dispose();\n            launcherDisposables = null;\n        }\n        if (paletteDisposables) {\n            paletteDisposables.dispose();\n            paletteDisposables = null;\n        }\n        if (menuDisposables) {\n            menuDisposables.dispose();\n            menuDisposables = null;\n        }\n        if (launcher) {\n            launcherDisposables = _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addKernelLanguageLauncherItems(launcher, trans, fileTypes);\n        }\n        if (palette) {\n            paletteDisposables = _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addKernelLanguagePaletteItems(palette, trans, fileTypes);\n        }\n        if (menu) {\n            menuDisposables = _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addKernelLanguageMenuItems(menu, fileTypes);\n        }\n    };\n    // Update if new specs are added later\n    const specsManager = app.serviceManager.kernelspecs;\n    specsManager.specsChanged.connect(async () => {\n        try {\n            const updatedFileTypes = await getAvailableKernelFileTypes();\n            updateKernelFileTypeComponents(updatedFileTypes);\n        }\n        catch (error) {\n            console.error('Error updating kernel file types:', error);\n        }\n    });\n    // Handle state restoration.\n    if (restorer) {\n        void restorer.restore(tracker, {\n            command: 'docmanager:open',\n            args: widget => ({ path: widget.context.path, factory: _commands__WEBPACK_IMPORTED_MODULE_18__.FACTORY }),\n            name: widget => widget.context.path\n        });\n    }\n    // Add a console creator to the File menu\n    // Fetch the initial state of the settings.\n    Promise.all([settingRegistry.load(id), restored])\n        .then(([settings]) => {\n        var _a, _b, _c;\n        // As the menu are defined in the settings we must ensure they are loaded\n        // before updating dynamically the submenu\n        if (menu) {\n            const languageMenu = (_a = menu.viewMenu.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-view-codemirror-language';\n            })) === null || _a === void 0 ? void 0 : _a.submenu;\n            if (languageMenu) {\n                languages\n                    .getLanguages()\n                    .sort((a, b) => {\n                    const aName = a.name;\n                    const bName = b.name;\n                    return aName.localeCompare(bName);\n                })\n                    .forEach(spec => {\n                    // Avoid mode name with a curse word.\n                    if (spec.name.toLowerCase().indexOf('brainf') === 0) {\n                        return;\n                    }\n                    languageMenu.addItem({\n                        command: _commands__WEBPACK_IMPORTED_MODULE_18__.CommandIDs.changeLanguage,\n                        args: { ...spec } // TODO: Casting to `any` until lumino typings are fixed\n                    });\n                });\n            }\n            const themeMenu = (_b = menu.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-codemirror-theme';\n            })) === null || _b === void 0 ? void 0 : _b.submenu;\n            if (themeMenu) {\n                for (const theme of themes.themes) {\n                    themeMenu.addItem({\n                        command: _commands__WEBPACK_IMPORTED_MODULE_18__.CommandIDs.changeTheme,\n                        args: {\n                            theme: theme.name,\n                            displayName: (_c = theme.displayName) !== null && _c !== void 0 ? _c : theme.name\n                        }\n                    });\n                }\n            }\n            // Add go to line capabilities to the edit menu.\n            menu.editMenu.goToLiners.add({\n                id: _commands__WEBPACK_IMPORTED_MODULE_18__.CommandIDs.goToLine,\n                isEnabled: (w) => tracker.currentWidget !== null && tracker.has(w)\n            });\n        }\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateSettings(settings, commands);\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateTracker(tracker);\n        settings.changed.connect(() => {\n            _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateSettings(settings, commands);\n            _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateTracker(tracker);\n        });\n    })\n        .catch((reason) => {\n        console.error(reason.message);\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateTracker(tracker);\n    });\n    if (formRegistry) {\n        const CMRenderer = formRegistry.getRenderer('@jupyterlab/codemirror-extension:plugin.defaultConfig');\n        if (CMRenderer) {\n            formRegistry.addRenderer('@jupyterlab/fileeditor-extension:plugin.editorConfig', CMRenderer);\n        }\n    }\n    factory.widgetCreated.connect((sender, widget) => {\n        // Notify the widget tracker if restore data needs to update.\n        widget.context.pathChanged.connect(() => {\n            void tracker.save(widget);\n        });\n        void tracker.add(widget);\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateWidget(widget.content);\n    });\n    // Handle the settings of new widgets.\n    tracker.widgetAdded.connect((sender, widget) => {\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.updateWidget(widget.content);\n    });\n    _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addCommands(app.commands, settingRegistry, trans, id, isEnabled, tracker, fileBrowser, extensions, languages, consoleTracker, sessionDialogs, app.shell);\n    const codeViewerTracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({\n        namespace: 'codeviewer'\n    });\n    // Handle state restoration for code viewers\n    if (restorer) {\n        void restorer.restore(codeViewerTracker, {\n            command: _commands__WEBPACK_IMPORTED_MODULE_18__.CommandIDs.openCodeViewer,\n            args: widget => ({\n                content: widget.content.content,\n                label: widget.content.title.label,\n                mimeType: widget.content.mimeType,\n                widgetId: widget.content.id\n            }),\n            name: widget => widget.content.id\n        });\n    }\n    _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addOpenCodeViewerCommand(app, editorServices, codeViewerTracker, trans);\n    // Add a launcher item if the launcher is available.\n    if (launcher) {\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addLauncherItems(launcher, trans);\n    }\n    if (palette) {\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addPaletteItems(palette, trans);\n    }\n    if (menu) {\n        _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addMenuItems(menu, tracker, consoleTracker, isEnabled);\n    }\n    getAvailableKernelFileTypes()\n        .then(updateKernelFileTypeComponents)\n        .catch((reason) => {\n        console.error(reason.message);\n    });\n    if (tocRegistry) {\n        tocRegistry.add(new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.LaTeXTableOfContentsFactory(tracker));\n        tocRegistry.add(new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.MarkdownTableOfContentsFactory(tracker));\n        tocRegistry.add(new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.PythonTableOfContentsFactory(tracker));\n    }\n    return tracker;\n}\n/**\n * Activate the completer service for file editor.\n */\nfunction activateFileEditorCompleterService(app, editorTracker, manager, translator, appSanitizer) {\n    if (!manager) {\n        return;\n    }\n    _commands__WEBPACK_IMPORTED_MODULE_18__.Commands.addCompleterCommands(app.commands, editorTracker, manager, translator);\n    const sessionManager = app.serviceManager.sessions;\n    const sanitizer = appSanitizer !== null && appSanitizer !== void 0 ? appSanitizer : new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Sanitizer();\n    const _activeSessions = new Map();\n    const updateCompleter = async (_, widget) => {\n        const completerContext = {\n            editor: widget.content.editor,\n            widget\n        };\n        await manager.updateCompleter(completerContext);\n        const onRunningChanged = (_, models) => {\n            const oldSession = _activeSessions.get(widget.id);\n            // Search for a matching path.\n            const model = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_17__.find)(models, m => m.path === widget.context.path);\n            if (model) {\n                // If there is a matching path, but it is the same\n                // session as we previously had, do nothing.\n                if (oldSession && oldSession.id === model.id) {\n                    return;\n                }\n                // Otherwise, dispose of the old session and reset to\n                // a new CompletionConnector.\n                if (oldSession) {\n                    _activeSessions.delete(widget.id);\n                    oldSession.dispose();\n                }\n                const session = sessionManager.connectTo({ model });\n                const newCompleterContext = {\n                    editor: widget.content.editor,\n                    widget,\n                    session,\n                    sanitizer\n                };\n                manager.updateCompleter(newCompleterContext).catch(console.error);\n                _activeSessions.set(widget.id, session);\n            }\n            else {\n                // If we didn't find a match, make sure\n                // the connector is the contextConnector and\n                // dispose of any previous connection.\n                if (oldSession) {\n                    _activeSessions.delete(widget.id);\n                    oldSession.dispose();\n                }\n            }\n        };\n        onRunningChanged(sessionManager, Array.from(sessionManager.running()));\n        sessionManager.runningChanged.connect(onRunningChanged);\n        widget.disposed.connect(() => {\n            sessionManager.runningChanged.disconnect(onRunningChanged);\n            const session = _activeSessions.get(widget.id);\n            if (session) {\n                _activeSessions.delete(widget.id);\n                session.dispose();\n            }\n        });\n    };\n    editorTracker.widgetAdded.connect(updateCompleter);\n    manager.activeProvidersChanged.connect(() => {\n        editorTracker.forEach(editorWidget => {\n            updateCompleter(editorTracker, editorWidget).catch(console.error);\n        });\n    });\n}\nfunction activateFileEditorLanguageServer(app, editors, connectionManager, featureManager, extractorManager, adapterTracker) {\n    editors.widgetAdded.connect(async (_, editor) => {\n        const adapter = new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_8__.FileEditorAdapter(editor, {\n            connectionManager,\n            featureManager,\n            foreignCodeExtractorsManager: extractorManager,\n            docRegistry: app.docRegistry\n        });\n        adapterTracker.add(adapter);\n    });\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/fileeditor-extension/lib/index.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   editorSyntaxStatus: () => (/* binding */ editorSyntaxStatus)\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_codemirror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/codemirror */ \"webpack/sharing/consume/default/@jupyterlab/codemirror/@jupyterlab/codemirror\");\n/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/fileeditor */ \"webpack/sharing/consume/default/@jupyterlab/fileeditor/@jupyterlab/fileeditor\");\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/statusbar */ \"webpack/sharing/consume/default/@jupyterlab/statusbar/@jupyterlab/statusbar\");\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n\n\n\n\n/**\n * The JupyterLab plugin for the EditorSyntax status item.\n */\nconst editorSyntaxStatus = {\n    id: '@jupyterlab/fileeditor-extension:editor-syntax-status',\n    description: 'Adds a file editor syntax status widget.',\n    autoStart: true,\n    requires: [_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__.IEditorTracker, _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1__.IEditorLanguageRegistry, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],\n    optional: [_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_3__.IStatusBar],\n    activate: (app, tracker, languages, labShell, translator, statusBar) => {\n        if (!statusBar) {\n            // Automatically disable if statusbar missing\n            return;\n        }\n        const item = new _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__.EditorSyntaxStatus({\n            commands: app.commands,\n            languages,\n            translator\n        });\n        labShell.currentChanged.connect(() => {\n            const current = labShell.currentWidget;\n            if (current && tracker.has(current) && item.model) {\n                item.model.editor = current.content.editor;\n            }\n        });\n        statusBar.registerStatusItem(editorSyntaxStatus.id, {\n            item,\n            align: 'left',\n            rank: 0,\n            isActive: () => !!labShell.currentWidget &&\n                !!tracker.currentWidget &&\n                labShell.currentWidget === tracker.currentWidget\n        });\n    }\n};\n//# sourceMappingURL=syntaxstatus.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/fileeditor-extension/lib/syntaxstatus.js?");

/***/ })

}]);