/*
 * 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_application-extension_lib_index_js"],{

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

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\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_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_property_inspector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/property-inspector */ \"webpack/sharing/consume/default/@jupyterlab/property-inspector/@jupyterlab/property-inspector\");\n/* harmony import */ var _jupyterlab_property_inspector__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_property_inspector__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/statedb */ \"webpack/sharing/consume/default/@jupyterlab/statedb/@jupyterlab/statedb\");\n/* harmony import */ var _jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__ = __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_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @lumino/disposable */ \"webpack/sharing/consume/default/@lumino/disposable/@lumino/disposable\");\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module application-extension\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The command IDs used by the application plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.activateNextTab = 'application:activate-next-tab';\n    CommandIDs.activatePreviousTab = 'application:activate-previous-tab';\n    CommandIDs.activateNextTabBar = 'application:activate-next-tab-bar';\n    CommandIDs.activatePreviousTabBar = 'application:activate-previous-tab-bar';\n    CommandIDs.close = 'application:close';\n    CommandIDs.closeOtherTabs = 'application:close-other-tabs';\n    CommandIDs.closeRightTabs = 'application:close-right-tabs';\n    CommandIDs.closeAll = 'application:close-all';\n    CommandIDs.setMode = 'application:set-mode';\n    CommandIDs.toggleMode = 'application:toggle-mode';\n    CommandIDs.toggleLeftArea = 'application:toggle-left-area';\n    CommandIDs.toggleRightArea = 'application:toggle-right-area';\n    CommandIDs.togglePresentationMode = 'application:toggle-presentation-mode';\n    CommandIDs.tree = 'router:tree';\n    CommandIDs.switchSidebar = 'sidebar:switch';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * A plugin to register the commands for the main application.\n */\nconst mainCommands = {\n    id: '@jupyterlab/application-extension:commands',\n    autoStart: true,\n    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],\n    activate: (app, translator, labShell, palette) => {\n        const { commands, shell } = app;\n        const trans = translator.load('jupyterlab');\n        const category = trans.__('Main Area');\n        // Add Command to override the JLab context menu.\n        commands.addCommand(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEndContextMenu.contextMenu, {\n            label: trans.__('Shift+Right Click for Browser Menu'),\n            isEnabled: () => false,\n            execute: () => void 0\n        });\n        // Returns the widget associated with the most recent contextmenu event.\n        const contextMenuWidget = () => {\n            const test = (node) => !!node.dataset.id;\n            const node = app.contextMenuHitTest(test);\n            if (!node) {\n                // Fall back to active widget if path cannot be obtained from event.\n                return shell.currentWidget;\n            }\n            const matches = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__.toArray)(shell.widgets('main')).filter(widget => widget.id === node.dataset.id);\n            if (matches.length < 1) {\n                return shell.currentWidget;\n            }\n            return matches[0];\n        };\n        // Closes an array of widgets.\n        const closeWidgets = (widgets) => {\n            widgets.forEach(widget => widget.close());\n        };\n        // Find the tab area for a widget within a specific dock area.\n        const findTab = (area, widget) => {\n            switch (area.type) {\n                case 'split-area': {\n                    const iterator = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__.iter)(area.children);\n                    let tab = null;\n                    let value;\n                    do {\n                        value = iterator.next();\n                        if (value) {\n                            tab = findTab(value, widget);\n                        }\n                    } while (!tab && value);\n                    return tab;\n                }\n                case 'tab-area': {\n                    const { id } = widget;\n                    return area.widgets.some(widget => widget.id === id) ? area : null;\n                }\n                default:\n                    return null;\n            }\n        };\n        // Find the tab area for a widget within the main dock area.\n        const tabAreaFor = (widget) => {\n            var _a;\n            const layout = labShell === null || labShell === void 0 ? void 0 : labShell.saveLayout();\n            const mainArea = layout === null || layout === void 0 ? void 0 : layout.mainArea;\n            if (!mainArea || _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getOption('mode') !== 'multiple-document') {\n                return null;\n            }\n            const area = (_a = mainArea.dock) === null || _a === void 0 ? void 0 : _a.main;\n            if (!area) {\n                return null;\n            }\n            return findTab(area, widget);\n        };\n        // Returns an array of all widgets to the right of a widget in a tab area.\n        const widgetsRightOf = (widget) => {\n            const { id } = widget;\n            const tabArea = tabAreaFor(widget);\n            const widgets = tabArea ? tabArea.widgets || [] : [];\n            const index = widgets.findIndex(widget => widget.id === id);\n            if (index < 0) {\n                return [];\n            }\n            return widgets.slice(index + 1);\n        };\n        commands.addCommand(CommandIDs.close, {\n            label: () => trans.__('Close Tab'),\n            isEnabled: () => {\n                const widget = contextMenuWidget();\n                return !!widget && widget.title.closable;\n            },\n            execute: () => {\n                const widget = contextMenuWidget();\n                if (widget) {\n                    widget.close();\n                }\n            }\n        });\n        commands.addCommand(CommandIDs.closeOtherTabs, {\n            label: () => trans.__('Close All Other Tabs'),\n            isEnabled: () => {\n                // Ensure there are at least two widgets.\n                const iterator = shell.widgets('main');\n                return !!iterator.next() && !!iterator.next();\n            },\n            execute: () => {\n                const widget = contextMenuWidget();\n                if (!widget) {\n                    return;\n                }\n                const { id } = widget;\n                const otherWidgets = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__.toArray)(shell.widgets('main')).filter(widget => widget.id !== id);\n                closeWidgets(otherWidgets);\n            }\n        });\n        commands.addCommand(CommandIDs.closeRightTabs, {\n            label: () => trans.__('Close Tabs to Right'),\n            isEnabled: () => !!contextMenuWidget() &&\n                widgetsRightOf(contextMenuWidget()).length > 0,\n            execute: () => {\n                const widget = contextMenuWidget();\n                if (!widget) {\n                    return;\n                }\n                closeWidgets(widgetsRightOf(widget));\n            }\n        });\n        if (labShell) {\n            commands.addCommand(CommandIDs.activateNextTab, {\n                label: trans.__('Activate Next Tab'),\n                execute: () => {\n                    labShell.activateNextTab();\n                }\n            });\n            commands.addCommand(CommandIDs.activatePreviousTab, {\n                label: trans.__('Activate Previous Tab'),\n                execute: () => {\n                    labShell.activatePreviousTab();\n                }\n            });\n            commands.addCommand(CommandIDs.activateNextTabBar, {\n                label: trans.__('Activate Next Tab Bar'),\n                execute: () => {\n                    labShell.activateNextTabBar();\n                }\n            });\n            commands.addCommand(CommandIDs.activatePreviousTabBar, {\n                label: trans.__('Activate Previous Tab Bar'),\n                execute: () => {\n                    labShell.activatePreviousTabBar();\n                }\n            });\n            commands.addCommand(CommandIDs.closeAll, {\n                label: trans.__('Close All Tabs'),\n                execute: () => {\n                    labShell.closeAll();\n                }\n            });\n            commands.addCommand(CommandIDs.toggleLeftArea, {\n                label: () => trans.__('Show Left Sidebar'),\n                execute: () => {\n                    if (labShell.leftCollapsed) {\n                        labShell.expandLeft();\n                    }\n                    else {\n                        labShell.collapseLeft();\n                        if (labShell.currentWidget) {\n                            labShell.activateById(labShell.currentWidget.id);\n                        }\n                    }\n                },\n                isToggled: () => !labShell.leftCollapsed,\n                isVisible: () => !labShell.isEmpty('left')\n            });\n            commands.addCommand(CommandIDs.toggleRightArea, {\n                label: () => trans.__('Show Right Sidebar'),\n                execute: () => {\n                    if (labShell.rightCollapsed) {\n                        labShell.expandRight();\n                    }\n                    else {\n                        labShell.collapseRight();\n                        if (labShell.currentWidget) {\n                            labShell.activateById(labShell.currentWidget.id);\n                        }\n                    }\n                },\n                isToggled: () => !labShell.rightCollapsed,\n                isVisible: () => !labShell.isEmpty('right')\n            });\n            commands.addCommand(CommandIDs.togglePresentationMode, {\n                label: () => trans.__('Presentation Mode'),\n                execute: () => {\n                    labShell.presentationMode = !labShell.presentationMode;\n                },\n                isToggled: () => labShell.presentationMode,\n                isVisible: () => true\n            });\n            commands.addCommand(CommandIDs.setMode, {\n                isVisible: args => {\n                    const mode = args['mode'];\n                    return mode === 'single-document' || mode === 'multiple-document';\n                },\n                execute: args => {\n                    const mode = args['mode'];\n                    if (mode === 'single-document' || mode === 'multiple-document') {\n                        labShell.mode = mode;\n                        return;\n                    }\n                    throw new Error(`Unsupported application shell mode: ${mode}`);\n                }\n            });\n            commands.addCommand(CommandIDs.toggleMode, {\n                label: trans.__('Simple Interface'),\n                isToggled: () => labShell.mode === 'single-document',\n                execute: () => {\n                    const args = labShell.mode === 'multiple-document'\n                        ? { mode: 'single-document' }\n                        : { mode: 'multiple-document' };\n                    return commands.execute(CommandIDs.setMode, args);\n                }\n            });\n        }\n        if (palette) {\n            [\n                CommandIDs.activateNextTab,\n                CommandIDs.activatePreviousTab,\n                CommandIDs.activateNextTabBar,\n                CommandIDs.activatePreviousTabBar,\n                CommandIDs.close,\n                CommandIDs.closeAll,\n                CommandIDs.closeOtherTabs,\n                CommandIDs.closeRightTabs,\n                CommandIDs.toggleLeftArea,\n                CommandIDs.toggleRightArea,\n                CommandIDs.togglePresentationMode,\n                CommandIDs.toggleMode\n            ].forEach(command => palette.addItem({ command, category }));\n        }\n    }\n};\n/**\n * The main extension.\n */\nconst main = {\n    id: '@jupyterlab/application-extension:main',\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IRouter, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IWindowResolver, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IConnectionLost],\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ITreePathUpdater,\n    activate: (app, router, resolver, translator, connectionLost) => {\n        const trans = translator.load('jupyterlab');\n        if (!(app instanceof _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab)) {\n            throw new Error(`${main.id} must be activated in JupyterLab.`);\n        }\n        // These two internal state variables are used to manage the two source\n        // of the tree part of the URL being updated: 1) path of the active document,\n        // 2) path of the default browser if the active main area widget isn't a document.\n        let _docTreePath = '';\n        let _defaultBrowserTreePath = '';\n        function updateTreePath(treePath) {\n            _defaultBrowserTreePath = treePath;\n            if (!_docTreePath) {\n                const path = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getUrl({ treePath });\n                router.navigate(path, { skipRouting: true });\n                // Persist the new tree path to PageConfig as it is used elsewhere at runtime.\n                _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.setOption('treePath', treePath);\n            }\n        }\n        // Requiring the window resolver guarantees that the application extension\n        // only loads if there is a viable window name. Otherwise, the application\n        // will short-circuit and ask the user to navigate away.\n        const workspace = resolver.name;\n        console.debug(`Starting application in workspace: \"${workspace}\"`);\n        // If there were errors registering plugins, tell the user.\n        if (app.registerPluginErrors.length !== 0) {\n            const body = (react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"pre\", null, app.registerPluginErrors.map(e => e.message).join('\\n')));\n            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showErrorMessage)(trans.__('Error Registering Plugins'), {\n                message: body\n            });\n        }\n        // If the application shell layout is modified,\n        // trigger a refresh of the commands.\n        app.shell.layoutModified.connect(() => {\n            app.commands.notifyCommandChanged();\n        });\n        // Watch the mode and update the page URL to /lab or /doc to reflect the\n        // change.\n        app.shell.modeChanged.connect((_, args) => {\n            const path = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getUrl({ mode: args });\n            router.navigate(path, { skipRouting: true });\n            // Persist this mode change to PageConfig as it is used elsewhere at runtime.\n            _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.setOption('mode', args);\n        });\n        // Watch the path of the current widget in the main area and update the page\n        // URL to reflect the change.\n        app.shell.currentPathChanged.connect((_, args) => {\n            const maybeTreePath = args.newValue;\n            const treePath = maybeTreePath || _defaultBrowserTreePath;\n            const path = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getUrl({ treePath: treePath });\n            router.navigate(path, { skipRouting: true });\n            // Persist the new tree path to PageConfig as it is used elsewhere at runtime.\n            _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.setOption('treePath', treePath);\n            _docTreePath = maybeTreePath;\n        });\n        // If the connection to the server is lost, handle it with the\n        // connection lost handler.\n        connectionLost = connectionLost || _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ConnectionLost;\n        app.serviceManager.connectionFailure.connect((manager, error) => connectionLost(manager, error, translator));\n        const builder = app.serviceManager.builder;\n        const build = () => {\n            return builder\n                .build()\n                .then(() => {\n                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Build Complete'),\n                    body: (react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"div\", null,\n                        trans.__('Build successfully completed, reload page?'),\n                        react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"br\", null),\n                        trans.__('You will lose any unsaved changes.'))),\n                    buttons: [\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({\n                            label: trans.__('Reload Without Saving'),\n                            actions: ['reload']\n                        }),\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: trans.__('Save and Reload') })\n                    ],\n                    hasClose: true\n                });\n            })\n                .then(({ button: { accept, actions } }) => {\n                if (accept) {\n                    void app.commands\n                        .execute('docmanager:save')\n                        .then(() => {\n                        router.reload();\n                    })\n                        .catch(err => {\n                        void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showErrorMessage)(trans.__('Save Failed'), {\n                            message: react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"pre\", null, err.message)\n                        });\n                    });\n                }\n                else if (actions.includes('reload')) {\n                    router.reload();\n                }\n            })\n                .catch(err => {\n                void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showErrorMessage)(trans.__('Build Failed'), {\n                    message: react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"pre\", null, err.message)\n                });\n            });\n        };\n        if (builder.isAvailable && builder.shouldCheck) {\n            void builder.getStatus().then(response => {\n                if (response.status === 'building') {\n                    return build();\n                }\n                if (response.status !== 'needed') {\n                    return;\n                }\n                const body = (react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"div\", null,\n                    trans.__('JupyterLab build is suggested:'),\n                    react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"br\", null),\n                    react__WEBPACK_IMPORTED_MODULE_12__.createElement(\"pre\", null, response.message)));\n                void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Build Recommended'),\n                    body,\n                    buttons: [\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: trans.__('Build') })\n                    ]\n                }).then(result => (result.button.accept ? build() : undefined));\n            });\n        }\n        return updateTreePath;\n    },\n    autoStart: true\n};\n/**\n * Plugin to build the context menu from the settings.\n */\nconst contextMenuPlugin = {\n    id: '@jupyterlab/application-extension:context-menu',\n    autoStart: true,\n    requires: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    activate: (app, settingRegistry, translator) => {\n        const trans = translator.load('jupyterlab');\n        function createMenu(options) {\n            const menu = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__.RankedMenu(Object.assign(Object.assign({}, options), { commands: app.commands }));\n            if (options.label) {\n                menu.title.label = trans.__(options.label);\n            }\n            return menu;\n        }\n        // Load the context menu lately so plugins are loaded.\n        app.started\n            .then(() => {\n            return Private.loadSettingsContextMenu(app.contextMenu, settingRegistry, createMenu, translator);\n        })\n            .catch(reason => {\n            console.error('Failed to load context menu items from settings registry.', reason);\n        });\n    }\n};\n/**\n * Check if the application is dirty before closing the browser tab.\n */\nconst dirty = {\n    id: '@jupyterlab/application-extension:dirty',\n    autoStart: true,\n    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    activate: (app, translator) => {\n        if (!(app instanceof _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab)) {\n            throw new Error(`${dirty.id} must be activated in JupyterLab.`);\n        }\n        const trans = translator.load('jupyterlab');\n        const message = trans.__('Are you sure you want to exit JupyterLab?\\n\\nAny unsaved changes will be lost.');\n        // The spec for the `beforeunload` event is implemented differently by\n        // the different browser vendors. Consequently, the `event.returnValue`\n        // attribute needs to set in addition to a return value being returned.\n        // For more information, see:\n        // https://developer.mozilla.org/en/docs/Web/Events/beforeunload\n        window.addEventListener('beforeunload', event => {\n            if (app.status.isDirty) {\n                return (event.returnValue = message);\n            }\n        });\n    }\n};\n/**\n * The default layout restorer provider.\n */\nconst layout = {\n    id: '@jupyterlab/application-extension:layout',\n    requires: [_jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_5__.IStateDB, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    activate: (app, state, labShell, settingRegistry, translator) => {\n        const first = app.started;\n        const registry = app.commands;\n        const restorer = new _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.LayoutRestorer({ connector: state, first, registry });\n        void restorer.fetch().then(saved => {\n            labShell.restoreLayout(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getOption('mode'), saved);\n            labShell.layoutModified.connect(() => {\n                void restorer.save(labShell.saveLayout());\n            });\n            Private.activateSidebarSwitcher(app, labShell, settingRegistry, translator, saved);\n        });\n        return restorer;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer\n};\n/**\n * The default URL router provider.\n */\nconst router = {\n    id: '@jupyterlab/application-extension:router',\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths],\n    activate: (app, paths) => {\n        const { commands } = app;\n        const base = paths.urls.base;\n        const router = new _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.Router({ base, commands });\n        void app.started.then(() => {\n            // Route the very first request on load.\n            void router.route();\n            // Route all pop state events.\n            window.addEventListener('popstate', () => {\n                void router.route();\n            });\n        });\n        return router;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IRouter\n};\n/**\n * The default tree route resolver plugin.\n */\nconst tree = {\n    id: '@jupyterlab/application-extension:tree-resolver',\n    autoStart: true,\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IRouter],\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.ITreeResolver,\n    activate: (app, router) => {\n        const { commands } = app;\n        const set = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_10__.DisposableSet();\n        const delegate = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.PromiseDelegate();\n        const treePattern = new RegExp('/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?');\n        set.add(commands.addCommand(CommandIDs.tree, {\n            execute: async (args) => {\n                var _a;\n                if (set.isDisposed) {\n                    return;\n                }\n                const query = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.queryStringToObject((_a = args.search) !== null && _a !== void 0 ? _a : '');\n                const browser = query['file-browser-path'] || '';\n                // Remove the file browser path from the query string.\n                delete query['file-browser-path'];\n                // Clean up artifacts immediately upon routing.\n                set.dispose();\n                delegate.resolve({ browser, file: _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getOption('treePath') });\n            }\n        }));\n        set.add(router.register({ command: CommandIDs.tree, pattern: treePattern }));\n        // If a route is handled by the router without the tree command being\n        // invoked, resolve to `null` and clean up artifacts.\n        const listener = () => {\n            if (set.isDisposed) {\n                return;\n            }\n            set.dispose();\n            delegate.resolve(null);\n        };\n        router.routed.connect(listener);\n        set.add(new _lumino_disposable__WEBPACK_IMPORTED_MODULE_10__.DisposableDelegate(() => {\n            router.routed.disconnect(listener);\n        }));\n        return { paths: delegate.promise };\n    }\n};\n/**\n * The default URL not found extension.\n */\nconst notfound = {\n    id: '@jupyterlab/application-extension:notfound',\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IRouter, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    activate: (_, paths, router, translator) => {\n        const trans = translator.load('jupyterlab');\n        const bad = paths.urls.notFound;\n        if (!bad) {\n            return;\n        }\n        const base = router.base;\n        const message = trans.__('The path: %1 was not found. JupyterLab redirected to: %2', bad, base);\n        // Change the URL back to the base application URL.\n        router.navigate('');\n        void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showErrorMessage)(trans.__('Path Not Found'), { message });\n    },\n    autoStart: true\n};\n/**\n * Change the favicon changing based on the busy status;\n */\nconst busy = {\n    id: '@jupyterlab/application-extension:faviconbusy',\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabStatus],\n    activate: async (_, status) => {\n        status.busySignal.connect((_, isBusy) => {\n            const favicon = document.querySelector(`link[rel=\"icon\"]${isBusy ? '.idle.favicon' : '.busy.favicon'}`);\n            if (!favicon) {\n                return;\n            }\n            const newFavicon = document.querySelector(`link${isBusy ? '.busy.favicon' : '.idle.favicon'}`);\n            if (!newFavicon) {\n                return;\n            }\n            // If we have the two icons with the special classes, then toggle them.\n            if (favicon !== newFavicon) {\n                favicon.rel = '';\n                newFavicon.rel = 'icon';\n                // Firefox doesn't seem to recognize just changing rel, so we also\n                // reinsert the link into the DOM.\n                newFavicon.parentNode.replaceChild(newFavicon, newFavicon);\n            }\n        });\n    },\n    autoStart: true\n};\n/**\n * The default JupyterLab application shell.\n */\nconst shell = {\n    id: '@jupyterlab/application-extension:shell',\n    activate: (app) => {\n        if (!(app.shell instanceof _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.LabShell)) {\n            throw new Error(`${shell.id} did not find a LabShell instance.`);\n        }\n        return app.shell;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell\n};\n/**\n * The default JupyterLab application status provider.\n */\nconst status = {\n    id: '@jupyterlab/application-extension:status',\n    activate: (app) => {\n        if (!(app instanceof _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab)) {\n            throw new Error(`${status.id} must be activated in JupyterLab.`);\n        }\n        return app.status;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabStatus\n};\n/**\n * The default JupyterLab application-specific information provider.\n *\n * #### Notes\n * This plugin should only be used by plugins that specifically need to access\n * JupyterLab application information, e.g., listing extensions that have been\n * loaded or deferred within JupyterLab.\n */\nconst info = {\n    id: '@jupyterlab/application-extension:info',\n    activate: (app) => {\n        if (!(app instanceof _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab)) {\n            throw new Error(`${info.id} must be activated in JupyterLab.`);\n        }\n        return app.info;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab.IInfo\n};\n/**\n * The default JupyterLab paths dictionary provider.\n */\nconst paths = {\n    id: '@jupyterlab/apputils-extension:paths',\n    activate: (app) => {\n        if (!(app instanceof _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab)) {\n            throw new Error(`${paths.id} must be activated in JupyterLab.`);\n        }\n        return app.paths;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths\n};\n/**\n * The default property inspector provider.\n */\nconst propertyInspector = {\n    id: '@jupyterlab/application-extension:property-inspector',\n    autoStart: true,\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],\n    provides: _jupyterlab_property_inspector__WEBPACK_IMPORTED_MODULE_3__.IPropertyInspectorProvider,\n    activate: (app, labshell, translator, restorer) => {\n        const trans = translator.load('jupyterlab');\n        const widget = new _jupyterlab_property_inspector__WEBPACK_IMPORTED_MODULE_3__.SideBarPropertyInspectorProvider(labshell, undefined, translator);\n        widget.title.icon = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__.buildIcon;\n        widget.title.caption = trans.__('Property Inspector');\n        widget.id = 'jp-property-inspector';\n        labshell.add(widget, 'right', { rank: 100 });\n        if (restorer) {\n            restorer.add(widget, 'jp-property-inspector');\n        }\n        return widget;\n    }\n};\nconst JupyterLogo = {\n    id: '@jupyterlab/application-extension:logo',\n    autoStart: true,\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell],\n    activate: (app, shell) => {\n        const logo = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_11__.Widget();\n        _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__.jupyterIcon.element({\n            container: logo.node,\n            elementPosition: 'center',\n            margin: '2px 2px 2px 8px',\n            height: 'auto',\n            width: '16px'\n        });\n        logo.id = 'jp-MainLogo';\n        shell.add(logo, 'top', { rank: 0 });\n    }\n};\n/**\n * Export the plugins as default.\n */\nconst plugins = [\n    contextMenuPlugin,\n    dirty,\n    main,\n    mainCommands,\n    layout,\n    router,\n    tree,\n    notfound,\n    busy,\n    shell,\n    status,\n    info,\n    paths,\n    propertyInspector,\n    JupyterLogo\n];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);\nvar Private;\n(function (Private) {\n    async function displayInformation(trans) {\n        const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n            title: trans.__('Information'),\n            body: trans.__('Context menu customization has changed. You will need to reload JupyterLab to see the changes.'),\n            buttons: [\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: trans.__('Reload') })\n            ]\n        });\n        if (result.button.accept) {\n            location.reload();\n        }\n    }\n    async function loadSettingsContextMenu(contextMenu, registry, menuFactory, translator) {\n        var _a;\n        const trans = translator.load('jupyterlab');\n        const pluginId = contextMenuPlugin.id;\n        let canonical;\n        let loaded = {};\n        /**\n         * Populate the plugin's schema defaults.\n         *\n         * We keep track of disabled entries in case the plugin is loaded\n         * after the menu initialization.\n         */\n        function populate(schema) {\n            var _a, _b;\n            loaded = {};\n            schema.properties.contextMenu.default = Object.keys(registry.plugins)\n                .map(plugin => {\n                var _a, _b;\n                const items = (_b = (_a = registry.plugins[plugin].schema['jupyter.lab.menus']) === null || _a === void 0 ? void 0 : _a.context) !== null && _b !== void 0 ? _b : [];\n                loaded[plugin] = items;\n                return items;\n            })\n                .concat([\n                (_b = (_a = schema['jupyter.lab.menus']) === null || _a === void 0 ? void 0 : _a.context) !== null && _b !== void 0 ? _b : [],\n                schema.properties.contextMenu.default\n            ])\n                .reduceRight((acc, val) => _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.SettingRegistry.reconcileItems(acc, val, true), []) // flatten one level\n                .sort((a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.rank) !== null && _b !== void 0 ? _b : Infinity); });\n        }\n        // Transform the plugin object to return different schema than the default.\n        registry.transform(pluginId, {\n            compose: plugin => {\n                var _a, _b, _c, _d;\n                // Only override the canonical schema the first time.\n                if (!canonical) {\n                    canonical = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepCopy(plugin.schema);\n                    populate(canonical);\n                }\n                const defaults = (_c = (_b = (_a = canonical.properties) === null || _a === void 0 ? void 0 : _a.contextMenu) === null || _b === void 0 ? void 0 : _b.default) !== null && _c !== void 0 ? _c : [];\n                const user = {\n                    contextMenu: (_d = plugin.data.user.contextMenu) !== null && _d !== void 0 ? _d : []\n                };\n                const composite = {\n                    contextMenu: _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.SettingRegistry.reconcileItems(defaults, user.contextMenu, false)\n                };\n                plugin.data = { composite, user };\n                return plugin;\n            },\n            fetch: plugin => {\n                // Only override the canonical schema the first time.\n                if (!canonical) {\n                    canonical = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepCopy(plugin.schema);\n                    populate(canonical);\n                }\n                return {\n                    data: plugin.data,\n                    id: plugin.id,\n                    raw: plugin.raw,\n                    schema: canonical,\n                    version: plugin.version\n                };\n            }\n        });\n        // Repopulate the canonical variable after the setting registry has\n        // preloaded all initial plugins.\n        canonical = null;\n        const settings = await registry.load(pluginId);\n        const contextItems = (_a = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepCopy(settings.composite.contextMenu)) !== null && _a !== void 0 ? _a : [];\n        // Create menu item for non-disabled element\n        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.SettingRegistry.filterDisabledItems(contextItems).forEach(item => {\n            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MenuFactory.addContextItem(item, contextMenu, menuFactory);\n        });\n        settings.changed.connect(() => {\n            var _a;\n            // As extension may change the context menu through API,\n            // prompt the user to reload if the menu has been updated.\n            const newItems = (_a = settings.composite.contextMenu) !== null && _a !== void 0 ? _a : [];\n            if (!_lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepEqual(contextItems, newItems)) {\n                void displayInformation(trans);\n            }\n        });\n        registry.pluginChanged.connect(async (sender, plugin) => {\n            var _a, _b, _c, _d;\n            if (plugin !== pluginId) {\n                // If the plugin changed its menu.\n                const oldItems = (_a = loaded[plugin]) !== null && _a !== void 0 ? _a : [];\n                const newItems = (_c = (_b = registry.plugins[plugin].schema['jupyter.lab.menus']) === null || _b === void 0 ? void 0 : _b.context) !== null && _c !== void 0 ? _c : [];\n                if (!_lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepEqual(oldItems, newItems)) {\n                    if (loaded[plugin]) {\n                        // The plugin has changed, request the user to reload the UI\n                        await displayInformation(trans);\n                    }\n                    else {\n                        // The plugin was not yet loaded when the menu was built => update the menu\n                        loaded[plugin] = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepCopy(newItems);\n                        // Merge potential disabled state\n                        const toAdd = (_d = _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.SettingRegistry.reconcileItems(newItems, contextItems, false, false)) !== null && _d !== void 0 ? _d : [];\n                        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.SettingRegistry.filterDisabledItems(toAdd).forEach(item => {\n                            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MenuFactory.addContextItem(item, contextMenu, menuFactory);\n                        });\n                    }\n                }\n            }\n        });\n    }\n    Private.loadSettingsContextMenu = loadSettingsContextMenu;\n    function activateSidebarSwitcher(app, labShell, settingRegistry, translator, initial) {\n        const setting = '@jupyterlab/application-extension:sidebar';\n        const trans = translator.load('jupyterlab');\n        let overrides = {};\n        const update = (_, layout) => {\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__.each)(labShell.widgets('left'), widget => {\n                var _a;\n                if (overrides[widget.id] && overrides[widget.id] === 'right') {\n                    labShell.add(widget, 'right');\n                    if (layout && ((_a = layout.rightArea) === null || _a === void 0 ? void 0 : _a.currentWidget) === widget) {\n                        labShell.activateById(widget.id);\n                    }\n                }\n            });\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__.each)(labShell.widgets('right'), widget => {\n                var _a;\n                if (overrides[widget.id] && overrides[widget.id] === 'left') {\n                    labShell.add(widget, 'left');\n                    if (layout && ((_a = layout.leftArea) === null || _a === void 0 ? void 0 : _a.currentWidget) === widget) {\n                        labShell.activateById(widget.id);\n                    }\n                }\n            });\n        };\n        // Fetch overrides from the settings system.\n        void Promise.all([settingRegistry.load(setting), app.restored]).then(([settings]) => {\n            overrides = (settings.get('overrides').composite ||\n                {});\n            settings.changed.connect(settings => {\n                overrides = (settings.get('overrides').composite ||\n                    {});\n                update(labShell);\n            });\n            labShell.layoutModified.connect(update);\n            update(labShell, initial);\n        });\n        // Add a command to switch a side panels's side\n        app.commands.addCommand(CommandIDs.switchSidebar, {\n            label: trans.__('Switch Sidebar Side'),\n            execute: () => {\n                // First, try to find the correct panel based on the application\n                // context menu click. Bail if we don't find a sidebar for the widget.\n                const contextNode = app.contextMenuHitTest(node => !!node.dataset.id);\n                if (!contextNode) {\n                    return;\n                }\n                const id = contextNode.dataset['id'];\n                const leftPanel = document.getElementById('jp-left-stack');\n                const node = document.getElementById(id);\n                let side;\n                if (leftPanel && node && leftPanel.contains(node)) {\n                    side = 'right';\n                }\n                else {\n                    side = 'left';\n                }\n                // Move the panel to the other side.\n                return settingRegistry.set(setting, 'overrides', Object.assign(Object.assign({}, overrides), { [id]: side }));\n            }\n        });\n    }\n    Private.activateSidebarSwitcher = activateSidebarSwitcher;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/application-extension/lib/index.js?");

/***/ })

}]);