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

/***/ "../node_modules/@lumino/application/dist/index.es6.js":
/*!*************************************************************!*\
  !*** ../node_modules/@lumino/application/dist/index.es6.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 */   \"Application\": () => (/* binding */ Application)\n/* harmony export */ });\n/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lumino/commands */ \"webpack/sharing/consume/default/@lumino/commands/@lumino/commands\");\n/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_commands__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n}\n\n/**\n * A class for creating pluggable applications.\n *\n * #### Notes\n * The `Application` class is useful when creating large, complex\n * UI applications with the ability to be safely extended by third\n * party code via plugins.\n */\nvar Application = /** @class */ (function () {\n    /**\n     * Construct a new application.\n     *\n     * @param options - The options for creating the application.\n     */\n    function Application(options) {\n        this._started = false;\n        this._pluginMap = Private.createPluginMap();\n        this._serviceMap = Private.createServiceMap();\n        this._delegate = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.PromiseDelegate();\n        // Create the application command registry.\n        var commands = new _lumino_commands__WEBPACK_IMPORTED_MODULE_0__.CommandRegistry();\n        // Create the application context menu.\n        var renderer = options.contextMenuRenderer;\n        var contextMenu = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.ContextMenu({ commands: commands, renderer: renderer });\n        // Initialize the application state.\n        this.commands = commands;\n        this.contextMenu = contextMenu;\n        this.shell = options.shell;\n    }\n    Object.defineProperty(Application.prototype, \"started\", {\n        /**\n         * A promise which resolves after the application has started.\n         *\n         * #### Notes\n         * This promise will resolve after the `start()` method is called,\n         * when all the bootstrapping and shell mounting work is complete.\n         */\n        get: function () {\n            return this._delegate.promise;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * Test whether a plugin is registered with the application.\n     *\n     * @param id - The id of the plugin of interest.\n     *\n     * @returns `true` if the plugin is registered, `false` otherwise.\n     */\n    Application.prototype.hasPlugin = function (id) {\n        return id in this._pluginMap;\n    };\n    /**\n     * List the IDs of the plugins registered with the application.\n     *\n     * @returns A new array of the registered plugin IDs.\n     */\n    Application.prototype.listPlugins = function () {\n        return Object.keys(this._pluginMap);\n    };\n    /**\n     * Register a plugin with the application.\n     *\n     * @param plugin - The plugin to register.\n     *\n     * #### Notes\n     * An error will be thrown if a plugin with the same id is already\n     * registered, or if the plugin has a circular dependency.\n     *\n     * If the plugin provides a service which has already been provided\n     * by another plugin, the new service will override the old service.\n     */\n    Application.prototype.registerPlugin = function (plugin) {\n        // Throw an error if the plugin id is already registered.\n        if (plugin.id in this._pluginMap) {\n            throw new Error(\"Plugin '\" + plugin.id + \"' is already registered.\");\n        }\n        // Create the normalized plugin data.\n        var data = Private.createPluginData(plugin);\n        // Ensure the plugin does not cause a cyclic dependency.\n        Private.ensureNoCycle(data, this._pluginMap, this._serviceMap);\n        // Add the service token to the service map.\n        if (data.provides) {\n            this._serviceMap.set(data.provides, data.id);\n        }\n        // Add the plugin to the plugin map.\n        this._pluginMap[data.id] = data;\n    };\n    /**\n     * Register multiple plugins with the application.\n     *\n     * @param plugins - The plugins to register.\n     *\n     * #### Notes\n     * This calls `registerPlugin()` for each of the given plugins.\n     */\n    Application.prototype.registerPlugins = function (plugins) {\n        for (var _i = 0, plugins_1 = plugins; _i < plugins_1.length; _i++) {\n            var plugin = plugins_1[_i];\n            this.registerPlugin(plugin);\n        }\n    };\n    /**\n     * Activate the plugin with the given id.\n     *\n     * @param id - The ID of the plugin of interest.\n     *\n     * @returns A promise which resolves when the plugin is activated\n     *   or rejects with an error if it cannot be activated.\n     */\n    Application.prototype.activatePlugin = function (id) {\n        var _this = this;\n        // Reject the promise if the plugin is not registered.\n        var data = this._pluginMap[id];\n        if (!data) {\n            return Promise.reject(new Error(\"Plugin '\" + id + \"' is not registered.\"));\n        }\n        // Resolve immediately if the plugin is already activated.\n        if (data.activated) {\n            return Promise.resolve(undefined);\n        }\n        // Return the pending resolver promise if it exists.\n        if (data.promise) {\n            return data.promise;\n        }\n        // Resolve the required services for the plugin.\n        var required = data.requires.map(function (t) { return _this.resolveRequiredService(t); });\n        // Resolve the optional services for the plugin.\n        var optional = data.optional.map(function (t) { return _this.resolveOptionalService(t); });\n        // Create the array of promises to resolve.\n        var promises = required.concat(optional);\n        // Setup the resolver promise for the plugin.\n        data.promise = Promise.all(promises).then(function (services) {\n            return data.activate.apply(undefined, __spreadArrays([_this], services));\n        }).then(function (service) {\n            data.service = service;\n            data.activated = true;\n            data.promise = null;\n        }).catch(function (error) {\n            data.promise = null;\n            throw error;\n        });\n        // Return the pending resolver promise.\n        return data.promise;\n    };\n    /**\n     * Resolve a required service of a given type.\n     *\n     * @param token - The token for the service type of interest.\n     *\n     * @returns A promise which resolves to an instance of the requested\n     *   service, or rejects with an error if it cannot be resolved.\n     *\n     * #### Notes\n     * Services are singletons. The same instance will be returned each\n     * time a given service token is resolved.\n     *\n     * If the plugin which provides the service has not been activated,\n     * resolving the service will automatically activate the plugin.\n     *\n     * User code will not typically call this method directly. Instead,\n     * the required services for the user's plugins will be resolved\n     * automatically when the plugin is activated.\n     */\n    Application.prototype.resolveRequiredService = function (token) {\n        // Reject the promise if there is no provider for the type.\n        var id = this._serviceMap.get(token);\n        if (!id) {\n            return Promise.reject(new Error(\"No provider for: \" + token.name + \".\"));\n        }\n        // Resolve immediately if the plugin is already activated.\n        var data = this._pluginMap[id];\n        if (data.activated) {\n            return Promise.resolve(data.service);\n        }\n        // Otherwise, activate the plugin and wait on the results.\n        return this.activatePlugin(id).then(function () { return data.service; });\n    };\n    /**\n     * Resolve an optional service of a given type.\n     *\n     * @param token - The token for the service type of interest.\n     *\n     * @returns A promise which resolves to an instance of the requested\n     *   service, or `null` if it cannot be resolved.\n     *\n     * #### Notes\n     * Services are singletons. The same instance will be returned each\n     * time a given service token is resolved.\n     *\n     * If the plugin which provides the service has not been activated,\n     * resolving the service will automatically activate the plugin.\n     *\n     * User code will not typically call this method directly. Instead,\n     * the optional services for the user's plugins will be resolved\n     * automatically when the plugin is activated.\n     */\n    Application.prototype.resolveOptionalService = function (token) {\n        // Resolve with `null` if there is no provider for the type.\n        var id = this._serviceMap.get(token);\n        if (!id) {\n            return Promise.resolve(null);\n        }\n        // Resolve immediately if the plugin is already activated.\n        var data = this._pluginMap[id];\n        if (data.activated) {\n            return Promise.resolve(data.service);\n        }\n        // Otherwise, activate the plugin and wait on the results.\n        return this.activatePlugin(id).then(function () {\n            return data.service;\n        }).catch(function (reason) {\n            console.error(reason);\n            return null;\n        });\n    };\n    /**\n     * Start the application.\n     *\n     * @param options - The options for starting the application.\n     *\n     * @returns A promise which resolves when all bootstrapping work\n     *   is complete and the shell is mounted to the DOM.\n     *\n     * #### Notes\n     * This should be called once by the application creator after all\n     * initial plugins have been registered.\n     *\n     * If a plugin fails to the load, the error will be logged and the\n     * other valid plugins will continue to be loaded.\n     *\n     * Bootstrapping the application consists of the following steps:\n     * 1. Activate the startup plugins\n     * 2. Wait for those plugins to activate\n     * 3. Attach the shell widget to the DOM\n     * 4. Add the application event listeners\n     */\n    Application.prototype.start = function (options) {\n        var _this = this;\n        if (options === void 0) { options = {}; }\n        // Return immediately if the application is already started.\n        if (this._started) {\n            return this._delegate.promise;\n        }\n        // Mark the application as started;\n        this._started = true;\n        // Parse the host id for attaching the shell.\n        var hostID = options.hostID || '';\n        // Collect the ids of the startup plugins.\n        var startups = Private.collectStartupPlugins(this._pluginMap, options);\n        // Generate the activation promises.\n        var promises = startups.map(function (id) {\n            return _this.activatePlugin(id).catch(function (error) {\n                console.error(\"Plugin '\" + id + \"' failed to activate.\");\n                console.error(error);\n            });\n        });\n        // Wait for the plugins to activate, then finalize startup.\n        Promise.all(promises).then(function () {\n            _this.attachShell(hostID);\n            _this.addEventListeners();\n            _this._delegate.resolve(undefined);\n        });\n        // Return the pending delegate promise.\n        return this._delegate.promise;\n    };\n    /**\n     * Handle the DOM events for the application.\n     *\n     * @param event - The DOM event sent to the application.\n     *\n     * #### Notes\n     * This method implements the DOM `EventListener` interface and is\n     * called in response to events registered for the application. It\n     * should not be called directly by user code.\n     */\n    Application.prototype.handleEvent = function (event) {\n        switch (event.type) {\n            case 'resize':\n                this.evtResize(event);\n                break;\n            case 'keydown':\n                this.evtKeydown(event);\n                break;\n            case 'contextmenu':\n                this.evtContextMenu(event);\n                break;\n        }\n    };\n    /**\n     * Attach the application shell to the DOM.\n     *\n     * @param id - The id of the host node for the shell, or `''`.\n     *\n     * #### Notes\n     * If the id is not provided, the document body will be the host.\n     *\n     * A subclass may reimplement this method as needed.\n     */\n    Application.prototype.attachShell = function (id) {\n        _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.Widget.attach(this.shell, (id && document.getElementById(id)) || document.body);\n    };\n    /**\n     * Add the application event listeners.\n     *\n     * #### Notes\n     * The default implementation of this method adds listeners for\n     * `'keydown'` and `'resize'` events.\n     *\n     * A subclass may reimplement this method as needed.\n     */\n    Application.prototype.addEventListeners = function () {\n        document.addEventListener('contextmenu', this);\n        document.addEventListener('keydown', this, true);\n        window.addEventListener('resize', this);\n    };\n    /**\n     * A method invoked on a document `'keydown'` event.\n     *\n     * #### Notes\n     * The default implementation of this method invokes the key down\n     * processing method of the application command registry.\n     *\n     * A subclass may reimplement this method as needed.\n     */\n    Application.prototype.evtKeydown = function (event) {\n        this.commands.processKeydownEvent(event);\n    };\n    /**\n     * A method invoked on a document `'contextmenu'` event.\n     *\n     * #### Notes\n     * The default implementation of this method opens the application\n     * `contextMenu` at the current mouse position.\n     *\n     * If the application context menu has no matching content *or* if\n     * the shift key is pressed, the default browser context menu will\n     * be opened instead.\n     *\n     * A subclass may reimplement this method as needed.\n     */\n    Application.prototype.evtContextMenu = function (event) {\n        if (event.shiftKey) {\n            return;\n        }\n        if (this.contextMenu.open(event)) {\n            event.preventDefault();\n            event.stopPropagation();\n        }\n    };\n    /**\n     * A method invoked on a window `'resize'` event.\n     *\n     * #### Notes\n     * The default implementation of this method updates the shell.\n     *\n     * A subclass may reimplement this method as needed.\n     */\n    Application.prototype.evtResize = function (event) {\n        this.shell.update();\n    };\n    return Application;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Create a new plugin map.\n     */\n    function createPluginMap() {\n        return Object.create(null);\n    }\n    Private.createPluginMap = createPluginMap;\n    /**\n     * Create a new service map.\n     */\n    function createServiceMap() {\n        return new Map();\n    }\n    Private.createServiceMap = createServiceMap;\n    /**\n     * Create a normalized plugin data object for the given plugin.\n     */\n    function createPluginData(plugin) {\n        return {\n            id: plugin.id,\n            service: null,\n            promise: null,\n            activated: false,\n            activate: plugin.activate,\n            provides: plugin.provides || null,\n            autoStart: plugin.autoStart || false,\n            requires: plugin.requires ? plugin.requires.slice() : [],\n            optional: plugin.optional ? plugin.optional.slice() : []\n        };\n    }\n    Private.createPluginData = createPluginData;\n    /**\n     * Ensure no cycle is present in the plugin resolution graph.\n     *\n     * If a cycle is detected, an error will be thrown.\n     */\n    function ensureNoCycle(data, pluginMap, serviceMap) {\n        var dependencies = data.requires.concat(data.optional);\n        // Bail early if there cannot be a cycle.\n        if (!data.provides || dependencies.length === 0) {\n            return;\n        }\n        // Setup a stack to trace service resolution.\n        var trace = [data.id];\n        // Throw an exception if a cycle is present.\n        if (dependencies.some(visit)) {\n            throw new Error(\"Cycle detected: \" + trace.join(' -> ') + \".\");\n        }\n        function visit(token) {\n            if (token === data.provides) {\n                return true;\n            }\n            var id = serviceMap.get(token);\n            if (!id) {\n                return false;\n            }\n            var other = pluginMap[id];\n            var otherDependencies = other.requires.concat(other.optional);\n            if (otherDependencies.length === 0) {\n                return false;\n            }\n            trace.push(id);\n            if (otherDependencies.some(visit)) {\n                return true;\n            }\n            trace.pop();\n            return false;\n        }\n    }\n    Private.ensureNoCycle = ensureNoCycle;\n    /**\n     * Collect the IDs of the plugins to activate on startup.\n     */\n    function collectStartupPlugins(pluginMap, options) {\n        // Create a map to hold the plugin IDs.\n        var resultMap = Object.create(null);\n        // Collect the auto-start plugins.\n        for (var id in pluginMap) {\n            if (pluginMap[id].autoStart) {\n                resultMap[id] = true;\n            }\n        }\n        // Add the startup plugins.\n        if (options.startPlugins) {\n            for (var _i = 0, _a = options.startPlugins; _i < _a.length; _i++) {\n                var id = _a[_i];\n                resultMap[id] = true;\n            }\n        }\n        // Remove the ignored plugins.\n        if (options.ignorePlugins) {\n            for (var _b = 0, _c = options.ignorePlugins; _b < _c.length; _b++) {\n                var id = _c[_b];\n                delete resultMap[id];\n            }\n        }\n        // Return the final startup plugins.\n        return Object.keys(resultMap);\n    }\n    Private.collectStartupPlugins = collectStartupPlugins;\n})(Private || (Private = {}));\n\n\n//# sourceMappingURL=index.es6.js.map\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@lumino/application/dist/index.es6.js?");

/***/ })

}]);