"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_outputarea_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/outputarea/lib/index.js":
/*!***********************************************************!*\
  !*** ../node_modules/@jupyterlab/outputarea/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 */   OutputArea: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_1__.OutputArea),\n/* harmony export */   OutputAreaModel: () => (/* reexport safe */ _model__WEBPACK_IMPORTED_MODULE_0__.OutputAreaModel),\n/* harmony export */   OutputPrompt: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_1__.OutputPrompt),\n/* harmony export */   SimplifiedOutputArea: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_1__.SimplifiedOutputArea),\n/* harmony export */   Stdin: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_1__.Stdin)\n/* harmony export */ });\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model */ \"../node_modules/@jupyterlab/outputarea/lib/model.js\");\n/* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widget */ \"../node_modules/@jupyterlab/outputarea/lib/widget.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module outputarea\n */\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/outputarea/lib/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/outputarea/lib/model.js":
/*!***********************************************************!*\
  !*** ../node_modules/@jupyterlab/outputarea/lib/model.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 */   OutputAreaModel: () => (/* binding */ OutputAreaModel)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/nbformat */ \"webpack/sharing/consume/default/@jupyterlab/nbformat/@jupyterlab/nbformat\");\n/* harmony import */ var _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/observables */ \"webpack/sharing/consume/default/@jupyterlab/observables/@jupyterlab/observables\");\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/rendermime */ \"webpack/sharing/consume/default/@jupyterlab/rendermime/@jupyterlab/rendermime\");\n/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_5__);\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 default implementation of the IOutputAreaModel.\n */\nclass OutputAreaModel {\n    /**\n     * Construct a new observable outputs instance.\n     */\n    constructor(options = {}) {\n        /**\n         * A flag that is set when we want to clear the output area\n         * *after* the next addition to it.\n         */\n        this.clearNext = false;\n        this._lastStream = '';\n        this._trusted = false;\n        this._isDisposed = false;\n        this._stateChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);\n        this._changed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);\n        this._trusted = !!options.trusted;\n        this.contentFactory =\n            options.contentFactory || OutputAreaModel.defaultContentFactory;\n        this.list = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__.ObservableList();\n        if (options.values) {\n            for (const value of options.values) {\n                const index = this._add(value) - 1;\n                const item = this.list.get(index);\n                item.changed.connect(this._onGenericChange, this);\n            }\n        }\n        this.list.changed.connect(this._onListChanged, this);\n    }\n    /**\n     * A signal emitted when an item changes.\n     */\n    get stateChanged() {\n        return this._stateChanged;\n    }\n    /**\n     * A signal emitted when the list of items changes.\n     */\n    get changed() {\n        return this._changed;\n    }\n    /**\n     * Get the length of the items in the model.\n     */\n    get length() {\n        return this.list ? this.list.length : 0;\n    }\n    /**\n     * Get whether the model is trusted.\n     */\n    get trusted() {\n        return this._trusted;\n    }\n    /**\n     * Set whether the model is trusted.\n     *\n     * #### Notes\n     * Changing the value will cause all of the models to re-set.\n     */\n    set trusted(value) {\n        if (value === this._trusted) {\n            return;\n        }\n        const trusted = (this._trusted = value);\n        for (let i = 0; i < this.list.length; i++) {\n            const oldItem = this.list.get(i);\n            const value = oldItem.toJSON();\n            const item = this._createItem({ value, trusted });\n            this.list.set(i, item);\n            oldItem.dispose();\n        }\n    }\n    /**\n     * Test whether the model is disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources used by the model.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        this.list.dispose();\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal.clearData(this);\n    }\n    /**\n     * Get an item at the specified index.\n     */\n    get(index) {\n        return this.list.get(index);\n    }\n    /**\n     * Set the value at the specified index.\n     */\n    set(index, value) {\n        value = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.deepCopy(value);\n        // Normalize stream data.\n        Private.normalize(value);\n        const item = this._createItem({ value, trusted: this._trusted });\n        this.list.set(index, item);\n    }\n    /**\n     * Add an output, which may be combined with previous output.\n     *\n     * @returns The total number of outputs.\n     *\n     * #### Notes\n     * The output bundle is copied.\n     * Contiguous stream outputs of the same `name` are combined.\n     */\n    add(output) {\n        // If we received a delayed clear message, then clear now.\n        if (this.clearNext) {\n            this.clear();\n            this.clearNext = false;\n        }\n        return this._add(output);\n    }\n    /**\n     * Clear all of the output.\n     *\n     * @param wait Delay clearing the output until the next message is added.\n     */\n    clear(wait = false) {\n        this._lastStream = '';\n        if (wait) {\n            this.clearNext = true;\n            return;\n        }\n        for (const item of this.list) {\n            item.dispose();\n        }\n        this.list.clear();\n    }\n    /**\n     * Deserialize the model from JSON.\n     *\n     * #### Notes\n     * This will clear any existing data.\n     */\n    fromJSON(values) {\n        this.clear();\n        for (const value of values) {\n            this._add(value);\n        }\n    }\n    /**\n     * Serialize the model to JSON.\n     */\n    toJSON() {\n        return Array.from((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.map)(this.list, (output) => output.toJSON()));\n    }\n    /**\n     * Add a copy of the item to the list.\n     *\n     * @returns The list length\n     */\n    _add(value) {\n        const trusted = this._trusted;\n        value = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.deepCopy(value);\n        // Normalize the value.\n        Private.normalize(value);\n        // Consolidate outputs if they are stream outputs of the same kind.\n        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isStream(value) &&\n            this._lastStream &&\n            value.name === this._lastName &&\n            this.shouldCombine({\n                value,\n                lastModel: this.list.get(this.length - 1)\n            })) {\n            // In order to get a list change event, we add the previous\n            // text to the current item and replace the previous item.\n            // This also replaces the metadata of the last item.\n            this._lastStream += value.text;\n            this._lastStream = Private.removeOverwrittenChars(this._lastStream);\n            value.text = this._lastStream;\n            const item = this._createItem({ value, trusted });\n            const index = this.length - 1;\n            const prev = this.list.get(index);\n            this.list.set(index, item);\n            prev.dispose();\n            return this.length;\n        }\n        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isStream(value)) {\n            value.text = Private.removeOverwrittenChars(value.text);\n        }\n        // Create the new item.\n        const item = this._createItem({ value, trusted });\n        // Update the stream information.\n        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isStream(value)) {\n            this._lastStream = value.text;\n            this._lastName = value.name;\n        }\n        else {\n            this._lastStream = '';\n        }\n        // Add the item to our list and return the new length.\n        return this.list.push(item);\n    }\n    /**\n     * Whether a new value should be consolidated with the previous output.\n     *\n     * This will only be called if the minimal criteria of both being stream\n     * messages of the same type.\n     */\n    shouldCombine(options) {\n        return true;\n    }\n    /**\n     * Create an output item and hook up its signals.\n     */\n    _createItem(options) {\n        const factory = this.contentFactory;\n        const item = factory.createOutputModel(options);\n        return item;\n    }\n    /**\n     * Handle a change to the list.\n     */\n    _onListChanged(sender, args) {\n        switch (args.type) {\n            case 'add':\n                args.newValues.forEach(item => {\n                    item.changed.connect(this._onGenericChange, this);\n                });\n                break;\n            case 'remove':\n                args.oldValues.forEach(item => {\n                    item.changed.disconnect(this._onGenericChange, this);\n                });\n                break;\n            case 'set':\n                args.newValues.forEach(item => {\n                    item.changed.connect(this._onGenericChange, this);\n                });\n                args.oldValues.forEach(item => {\n                    item.changed.disconnect(this._onGenericChange, this);\n                });\n                break;\n        }\n        this._changed.emit(args);\n    }\n    /**\n     * Handle a change to an item.\n     */\n    _onGenericChange(itemModel) {\n        let idx;\n        let item = null;\n        for (idx = 0; idx < this.list.length; idx++) {\n            item = this.list.get(idx);\n            if (item === itemModel) {\n                break;\n            }\n        }\n        if (item != null) {\n            this._stateChanged.emit(idx);\n            this._changed.emit({\n                type: 'set',\n                newIndex: idx,\n                oldIndex: idx,\n                oldValues: [item],\n                newValues: [item]\n            });\n        }\n    }\n}\n/**\n * The namespace for OutputAreaModel class statics.\n */\n(function (OutputAreaModel) {\n    /**\n     * The default implementation of a `IModelOutputFactory`.\n     */\n    class ContentFactory {\n        /**\n         * Create an output model.\n         */\n        createOutputModel(options) {\n            return new _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__.OutputModel(options);\n        }\n    }\n    OutputAreaModel.ContentFactory = ContentFactory;\n    /**\n     * The default output model factory.\n     */\n    OutputAreaModel.defaultContentFactory = new ContentFactory();\n})(OutputAreaModel || (OutputAreaModel = {}));\n/**\n * A namespace for module-private functionality.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Normalize an output.\n     */\n    function normalize(value) {\n        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isStream(value)) {\n            if (Array.isArray(value.text)) {\n                value.text = value.text.join('\\n');\n            }\n        }\n    }\n    Private.normalize = normalize;\n    /**\n     * Remove characters that are overridden by backspace characters.\n     */\n    function fixBackspace(txt) {\n        let tmp = txt;\n        do {\n            txt = tmp;\n            // Cancel out anything-but-newline followed by backspace\n            tmp = txt.replace(/[^\\n]\\x08/gm, ''); // eslint-disable-line no-control-regex\n        } while (tmp.length < txt.length);\n        return txt;\n    }\n    /**\n     * Remove chunks that should be overridden by the effect of\n     * carriage return characters.\n     */\n    function fixCarriageReturn(txt) {\n        txt = txt.replace(/\\r+\\n/gm, '\\n'); // \\r followed by \\n --> newline\n        while (txt.search(/\\r[^$]/g) > -1) {\n            const base = txt.match(/^(.*)\\r+/m)[1];\n            let insert = txt.match(/\\r+(.*)$/m)[1];\n            insert = insert + base.slice(insert.length, base.length);\n            txt = txt.replace(/\\r+.*$/m, '\\r').replace(/^.*\\r/m, insert);\n        }\n        return txt;\n    }\n    /*\n     * Remove characters overridden by backspaces and carriage returns\n     */\n    function removeOverwrittenChars(text) {\n        return fixCarriageReturn(fixBackspace(text));\n    }\n    Private.removeOverwrittenChars = removeOverwrittenChars;\n})(Private || (Private = {}));\n//# sourceMappingURL=model.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/outputarea/lib/model.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/outputarea/lib/widget.js":
/*!************************************************************!*\
  !*** ../node_modules/@jupyterlab/outputarea/lib/widget.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 */   OutputArea: () => (/* binding */ OutputArea),\n/* harmony export */   OutputPrompt: () => (/* binding */ OutputPrompt),\n/* harmony export */   SimplifiedOutputArea: () => (/* binding */ SimplifiedOutputArea),\n/* harmony export */   Stdin: () => (/* binding */ Stdin)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/services */ \"webpack/sharing/consume/default/@jupyterlab/services/@jupyterlab/services\");\n/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/properties */ \"webpack/sharing/consume/default/@lumino/properties/@lumino/properties\");\n/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_properties__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_6__);\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 * The class name added to an output area widget.\n */\nconst OUTPUT_AREA_CLASS = 'jp-OutputArea';\n/**\n * The class name added to the direction children of OutputArea\n */\nconst OUTPUT_AREA_ITEM_CLASS = 'jp-OutputArea-child';\n/**\n * The class name added to actual outputs\n */\nconst OUTPUT_AREA_OUTPUT_CLASS = 'jp-OutputArea-output';\n/**\n * The class name added to prompt children of OutputArea.\n */\nconst OUTPUT_AREA_PROMPT_CLASS = 'jp-OutputArea-prompt';\nconst OUTPUT_AREA_STDIN_HIDING_CLASS = 'jp-OutputArea-stdin-hiding';\n/**\n * The class name added to OutputPrompt.\n */\nconst OUTPUT_PROMPT_CLASS = 'jp-OutputPrompt';\n/**\n * The class name added to an execution result.\n */\nconst EXECUTE_CLASS = 'jp-OutputArea-executeResult';\n/**\n * The class name added stdin items of OutputArea\n */\nconst OUTPUT_AREA_STDIN_ITEM_CLASS = 'jp-OutputArea-stdin-item';\n/**\n * The class name added to stdin widgets.\n */\nconst STDIN_CLASS = 'jp-Stdin';\n/**\n * The class name added to stdin data prompt nodes.\n */\nconst STDIN_PROMPT_CLASS = 'jp-Stdin-prompt';\n/**\n * The class name added to stdin data input nodes.\n */\nconst STDIN_INPUT_CLASS = 'jp-Stdin-input';\n/**\n * The overlay that can be clicked to switch between output scrolling modes.\n */\nconst OUTPUT_PROMPT_OVERLAY = 'jp-OutputArea-promptOverlay';\n/** ****************************************************************************\n * OutputArea\n ******************************************************************************/\n/**\n * An output area widget.\n *\n * #### Notes\n * The widget model must be set separately and can be changed\n * at any time.  Consumers of the widget must account for a\n * `null` model, and may want to listen to the `modelChanged`\n * signal.\n */\nclass OutputArea extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Widget {\n    /**\n     * Construct an output area widget.\n     */\n    constructor(options) {\n        var _a, _b, _c, _d;\n        super();\n        /**\n         * A public signal used to indicate the number of displayed outputs has changed.\n         *\n         * #### Notes\n         * This is useful for parents who want to apply styling based on the number\n         * of outputs. Emits the current number of outputs.\n         */\n        this.outputLengthChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);\n        /**\n         * Handle an iopub message.\n         */\n        this._onIOPub = (msg) => {\n            const model = this.model;\n            const msgType = msg.header.msg_type;\n            let output;\n            const transient = (msg.content.transient || {});\n            const displayId = transient['display_id'];\n            let targets;\n            switch (msgType) {\n                case 'execute_result':\n                case 'display_data':\n                case 'stream':\n                case 'error':\n                    output = { ...msg.content, output_type: msgType };\n                    model.add(output);\n                    break;\n                case 'clear_output': {\n                    const wait = msg.content.wait;\n                    model.clear(wait);\n                    break;\n                }\n                case 'update_display_data':\n                    output = { ...msg.content, output_type: 'display_data' };\n                    targets = this._displayIdMap.get(displayId);\n                    if (targets) {\n                        for (const index of targets) {\n                            model.set(index, output);\n                        }\n                    }\n                    break;\n                case 'status': {\n                    const executionState = msg.content\n                        .execution_state;\n                    if (executionState === 'idle') {\n                        // If status is idle, the kernel is no longer blocked by the input\n                        this._pendingInput = false;\n                    }\n                    break;\n                }\n                default:\n                    break;\n            }\n            if (displayId && msgType === 'display_data') {\n                targets = this._displayIdMap.get(displayId) || [];\n                targets.push(model.length - 1);\n                this._displayIdMap.set(displayId, targets);\n            }\n        };\n        /**\n         * Handle an execute reply message.\n         */\n        this._onExecuteReply = (msg) => {\n            // API responses that contain a pager are special cased and their type\n            // is overridden from 'execute_reply' to 'display_data' in order to\n            // render output.\n            const model = this.model;\n            const content = msg.content;\n            if (content.status !== 'ok') {\n                return;\n            }\n            const payload = content && content.payload;\n            if (!payload || !payload.length) {\n                return;\n            }\n            const pages = payload.filter((i) => i.source === 'page');\n            if (!pages.length) {\n                return;\n            }\n            const page = JSON.parse(JSON.stringify(pages[0]));\n            const output = {\n                output_type: 'display_data',\n                data: page.data,\n                metadata: {}\n            };\n            model.add(output);\n        };\n        this._displayIdMap = new Map();\n        this._minHeightTimeout = null;\n        this._inputRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);\n        this._toggleScrolling = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);\n        this._initialize = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);\n        this._outputTracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.WidgetTracker({\n            namespace: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__.UUID.uuid4()\n        });\n        this._inputHistoryScope = 'global';\n        this._pendingInput = false;\n        super.layout = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.PanelLayout();\n        this.addClass(OUTPUT_AREA_CLASS);\n        this.contentFactory =\n            (_a = options.contentFactory) !== null && _a !== void 0 ? _a : OutputArea.defaultContentFactory;\n        this.rendermime = options.rendermime;\n        this._maxNumberOutputs = (_b = options.maxNumberOutputs) !== null && _b !== void 0 ? _b : Infinity;\n        this._translator = (_c = options.translator) !== null && _c !== void 0 ? _c : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        this._inputHistoryScope = (_d = options.inputHistoryScope) !== null && _d !== void 0 ? _d : 'global';\n        const model = (this.model = options.model);\n        for (let i = 0; i < Math.min(model.length, this._maxNumberOutputs + 1); i++) {\n            const output = model.get(i);\n            this._insertOutput(i, output);\n        }\n        model.changed.connect(this.onModelChanged, this);\n        model.stateChanged.connect(this.onStateChanged, this);\n        if (options.promptOverlay) {\n            this._addPromptOverlay();\n        }\n    }\n    /**\n     * Narrow the type of OutputArea's layout prop\n     */\n    get layout() {\n        return super.layout;\n    }\n    /**\n     * A read-only sequence of the children widgets in the output area.\n     */\n    get widgets() {\n        return this.layout.widgets;\n    }\n    /**\n     * The kernel future associated with the output area.\n     */\n    get future() {\n        return this._future;\n    }\n    set future(value) {\n        // Bail if the model is disposed.\n        if (this.model.isDisposed) {\n            throw Error('Model is disposed');\n        }\n        if (this._future === value) {\n            return;\n        }\n        if (this._future) {\n            this._future.dispose();\n        }\n        this._future = value;\n        value.done\n            .finally(() => {\n            this._pendingInput = false;\n        })\n            .catch(() => {\n            // No-op, required because `finally` re-raises any rejections,\n            // even if caught on the `done` promise level before.\n        });\n        this.model.clear();\n        // Make sure there were no input widgets.\n        if (this.widgets.length) {\n            this._clear();\n            this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));\n        }\n        // Handle published messages.\n        value.onIOPub = this._onIOPub;\n        // Handle the execute reply.\n        value.onReply = this._onExecuteReply;\n        // Handle stdin.\n        value.onStdin = msg => {\n            if (_jupyterlab_services__WEBPACK_IMPORTED_MODULE_1__.KernelMessage.isInputRequestMsg(msg)) {\n                this.onInputRequest(msg, value);\n            }\n        };\n    }\n    /**\n     * Signal emitted when an output area is requesting an input. The signal\n     * carries the input widget that this class creates in response to the input\n     * request.\n     */\n    get inputRequested() {\n        return this._inputRequested;\n    }\n    /**\n     * A flag indicating if the output area has pending input.\n     */\n    get pendingInput() {\n        return this._pendingInput;\n    }\n    /**\n     * The maximum number of output items to display on top and bottom of cell output.\n     *\n     * ### Notes\n     * It is set to Infinity if no trim is applied.\n     */\n    get maxNumberOutputs() {\n        return this._maxNumberOutputs;\n    }\n    set maxNumberOutputs(limit) {\n        if (limit <= 0) {\n            console.warn(`OutputArea.maxNumberOutputs must be strictly positive.`);\n            return;\n        }\n        const lastShown = this._maxNumberOutputs;\n        this._maxNumberOutputs = limit;\n        if (lastShown < limit) {\n            this._showTrimmedOutputs(lastShown);\n        }\n    }\n    /**\n     * Dispose of the resources used by the output area.\n     */\n    dispose() {\n        if (this._future) {\n            this._future.dispose();\n            this._future = null;\n        }\n        this._displayIdMap.clear();\n        this._outputTracker.dispose();\n        super.dispose();\n    }\n    /**\n     * Follow changes on the model state.\n     */\n    onModelChanged(sender, args) {\n        switch (args.type) {\n            case 'add':\n                this._insertOutput(args.newIndex, args.newValues[0]);\n                break;\n            case 'remove':\n                if (this.widgets.length) {\n                    // all items removed from model\n                    if (this.model.length === 0) {\n                        this._clear();\n                    }\n                    else {\n                        // range of items removed from model\n                        // remove widgets corresponding to removed model items\n                        const startIndex = args.oldIndex;\n                        for (let i = 0; i < args.oldValues.length && startIndex < this.widgets.length; ++i) {\n                            const widget = this.widgets[startIndex];\n                            widget.parent = null;\n                            widget.dispose();\n                        }\n                        // apply item offset to target model item indices in _displayIdMap\n                        this._moveDisplayIdIndices(startIndex, args.oldValues.length);\n                        // prevent jitter caused by immediate height change\n                        this._preventHeightChangeJitter();\n                    }\n                }\n                break;\n            case 'set':\n                this._setOutput(args.newIndex, args.newValues[0]);\n                break;\n            default:\n                break;\n        }\n        this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));\n    }\n    /**\n     * Emitted when user requests toggling of the output scrolling mode.\n     */\n    get toggleScrolling() {\n        return this._toggleScrolling;\n    }\n    get initialize() {\n        return this._initialize;\n    }\n    /**\n     * Add overlay allowing to toggle scrolling.\n     */\n    _addPromptOverlay() {\n        const overlay = document.createElement('div');\n        overlay.className = OUTPUT_PROMPT_OVERLAY;\n        overlay.addEventListener('click', () => {\n            this._toggleScrolling.emit();\n        });\n        this.node.appendChild(overlay);\n        requestAnimationFrame(() => {\n            this._initialize.emit();\n        });\n    }\n    /**\n     * Update indices in _displayIdMap in response to element remove from model items\n     *\n     * @param startIndex - The index of first element removed\n     *\n     * @param count - The number of elements removed from model items\n     *\n     */\n    _moveDisplayIdIndices(startIndex, count) {\n        this._displayIdMap.forEach((indices) => {\n            const rangeEnd = startIndex + count;\n            const numIndices = indices.length;\n            // reverse loop in order to prevent removing element affecting the index\n            for (let i = numIndices - 1; i >= 0; --i) {\n                const index = indices[i];\n                // remove model item indices in removed range\n                if (index >= startIndex && index < rangeEnd) {\n                    indices.splice(i, 1);\n                }\n                else if (index >= rangeEnd) {\n                    // move model item indices that were larger than range end\n                    indices[i] -= count;\n                }\n            }\n        });\n    }\n    /**\n     * Follow changes on the output model state.\n     */\n    onStateChanged(sender, change) {\n        const outputLength = Math.min(this.model.length, this._maxNumberOutputs);\n        if (change) {\n            if (change >= this._maxNumberOutputs) {\n                // Bail early\n                return;\n            }\n            this._setOutput(change, this.model.get(change));\n        }\n        else {\n            for (let i = 0; i < outputLength; i++) {\n                this._setOutput(i, this.model.get(i));\n            }\n        }\n        this.outputLengthChanged.emit(outputLength);\n    }\n    /**\n     * Clear the widget outputs.\n     */\n    _clear() {\n        // Bail if there is no work to do.\n        if (!this.widgets.length) {\n            return;\n        }\n        // Remove all of our widgets.\n        const length = this.widgets.length;\n        for (let i = 0; i < length; i++) {\n            const widget = this.widgets[0];\n            widget.parent = null;\n            widget.dispose();\n        }\n        // Clear the display id map.\n        this._displayIdMap.clear();\n        // prevent jitter caused by immediate height change\n        this._preventHeightChangeJitter();\n    }\n    _preventHeightChangeJitter() {\n        // When an output area is cleared and then quickly replaced with new\n        // content (as happens with @interact in widgets, for example), the\n        // quickly changing height can make the page jitter.\n        // We introduce a small delay in the minimum height\n        // to prevent this jitter.\n        const rect = this.node.getBoundingClientRect();\n        this.node.style.minHeight = `${rect.height}px`;\n        if (this._minHeightTimeout) {\n            window.clearTimeout(this._minHeightTimeout);\n        }\n        this._minHeightTimeout = window.setTimeout(() => {\n            if (this.isDisposed) {\n                return;\n            }\n            this.node.style.minHeight = '';\n        }, 50);\n    }\n    /**\n     * Handle an input request from a kernel.\n     */\n    onInputRequest(msg, future) {\n        // Add an output widget to the end.\n        const factory = this.contentFactory;\n        const stdinPrompt = msg.content.prompt;\n        const password = msg.content.password;\n        const panel = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Panel();\n        panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n        panel.addClass(OUTPUT_AREA_STDIN_ITEM_CLASS);\n        const prompt = factory.createOutputPrompt();\n        prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n        panel.addWidget(prompt);\n        // Indicate that input is pending\n        this._pendingInput = true;\n        const input = factory.createStdin({\n            parent_header: msg.header,\n            prompt: stdinPrompt,\n            password,\n            future,\n            translator: this._translator,\n            inputHistoryScope: this._inputHistoryScope\n        });\n        input.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n        panel.addWidget(input);\n        // Increase number of outputs to display the result up to the input request.\n        if (this.model.length >= this.maxNumberOutputs) {\n            this.maxNumberOutputs = this.model.length;\n        }\n        this._inputRequested.emit(input);\n        // Get the input node to ensure focus after updating the model upon user reply.\n        const inputNode = input.node.getElementsByTagName('input')[0];\n        /**\n         * Wait for the stdin to complete, add it to the model (so it persists)\n         * and remove the stdin widget.\n         */\n        void input.value.then(value => {\n            // Increase number of outputs to display the result of stdin if needed.\n            if (this.model.length >= this.maxNumberOutputs) {\n                this.maxNumberOutputs = this.model.length + 1;\n            }\n            panel.addClass(OUTPUT_AREA_STDIN_HIDING_CLASS);\n            // Use stdin as the stream so it does not get combined with stdout.\n            // Note: because it modifies DOM it may (will) shift focus away from the input node.\n            this.model.add({\n                output_type: 'stream',\n                name: 'stdin',\n                text: value + '\\n'\n            });\n            // Refocus the input node after it lost focus due to update of the model.\n            inputNode.focus();\n            // Indicate that input is no longer pending\n            this._pendingInput = false;\n            // Keep the input in view for a little while; this (along refocusing)\n            // ensures that we can avoid the cell editor stealing the focus, and\n            // leading to user inadvertently modifying editor content when executing\n            // consecutive commands in short succession.\n            window.setTimeout(() => {\n                // Tack currently focused element to ensure that it remains on it\n                // after disposal of the panel with the old input\n                // (which modifies DOM and can lead to focus jump).\n                const focusedElement = document.activeElement;\n                // Dispose the old panel with no longer needed input box.\n                panel.dispose();\n                // Refocus the element that was focused before.\n                if (focusedElement && focusedElement instanceof HTMLElement) {\n                    focusedElement.focus();\n                }\n            }, 500);\n        });\n        // Note: the `input.value` promise must be listened to before we attach the panel\n        this.layout.addWidget(panel);\n    }\n    /**\n     * Update an output in the layout in place.\n     */\n    _setOutput(index, model) {\n        if (index >= this._maxNumberOutputs) {\n            return;\n        }\n        const panel = this.layout.widgets[index];\n        const renderer = (panel.widgets\n            ? panel.widgets.filter(it => 'renderModel' in it).pop()\n            : panel);\n        // Check whether it is safe to reuse renderer:\n        // - Preferred mime type has not changed\n        // - Isolation has not changed\n        const mimeType = this.rendermime.preferredMimeType(model.data, model.trusted ? 'any' : 'ensure');\n        if (Private.currentPreferredMimetype.get(renderer) === mimeType &&\n            OutputArea.isIsolated(mimeType, model.metadata) ===\n                renderer instanceof Private.IsolatedRenderer) {\n            void renderer.renderModel(model);\n        }\n        else {\n            this.layout.widgets[index].dispose();\n            this._insertOutput(index, model);\n        }\n    }\n    /**\n     * Render and insert a single output into the layout.\n     *\n     * @param index - The index of the output to be inserted.\n     * @param model - The model of the output to be inserted.\n     */\n    _insertOutput(index, model) {\n        if (index > this._maxNumberOutputs) {\n            return;\n        }\n        const layout = this.layout;\n        if (index === this._maxNumberOutputs) {\n            const warning = new Private.TrimmedOutputs(this._maxNumberOutputs, () => {\n                const lastShown = this._maxNumberOutputs;\n                this._maxNumberOutputs = Infinity;\n                this._showTrimmedOutputs(lastShown);\n            });\n            layout.insertWidget(index, this._wrappedOutput(warning));\n        }\n        else {\n            let output = this.createOutputItem(model);\n            if (output) {\n                output.toggleClass(EXECUTE_CLASS, model.executionCount !== null);\n            }\n            else {\n                output = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Widget();\n            }\n            if (!this._outputTracker.has(output)) {\n                void this._outputTracker.add(output);\n            }\n            layout.insertWidget(index, output);\n        }\n    }\n    /**\n     * A widget tracker for individual output widgets in the output area.\n     */\n    get outputTracker() {\n        return this._outputTracker;\n    }\n    /**\n     * Dispose information message and show output models from the given\n     * index to maxNumberOutputs\n     *\n     * @param lastShown Starting model index to insert.\n     */\n    _showTrimmedOutputs(lastShown) {\n        // Dispose information widget\n        this.widgets[lastShown].dispose();\n        for (let idx = lastShown; idx < this.model.length; idx++) {\n            this._insertOutput(idx, this.model.get(idx));\n        }\n        this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));\n    }\n    /**\n     * Create an output item with a prompt and actual output\n     *\n     * @returns a rendered widget, or null if we cannot render\n     * #### Notes\n     */\n    createOutputItem(model) {\n        const output = this.createRenderedMimetype(model);\n        if (!output) {\n            return null;\n        }\n        return this._wrappedOutput(output, model.executionCount);\n    }\n    /**\n     * Render a mimetype\n     */\n    createRenderedMimetype(model) {\n        const mimeType = this.rendermime.preferredMimeType(model.data, model.trusted ? 'any' : 'ensure');\n        if (!mimeType) {\n            return null;\n        }\n        let output = this.rendermime.createRenderer(mimeType);\n        const isolated = OutputArea.isIsolated(mimeType, model.metadata);\n        if (isolated === true) {\n            output = new Private.IsolatedRenderer(output);\n        }\n        Private.currentPreferredMimetype.set(output, mimeType);\n        output.renderModel(model).catch(error => {\n            // Manually append error message to output\n            const pre = document.createElement('pre');\n            const trans = this._translator.load('jupyterlab');\n            pre.textContent = trans.__('Javascript Error: %1', error.message);\n            output.node.appendChild(pre);\n            // Remove mime-type-specific CSS classes\n            output.node.className = 'lm-Widget jp-RenderedText';\n            output.node.setAttribute('data-mime-type', 'application/vnd.jupyter.stderr');\n        });\n        return output;\n    }\n    /**\n     * Wrap a output widget within a output panel\n     *\n     * @param output Output widget to wrap\n     * @param executionCount Execution count\n     * @returns The output panel\n     */\n    _wrappedOutput(output, executionCount = null) {\n        const panel = new Private.OutputPanel();\n        panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n        const prompt = this.contentFactory.createOutputPrompt();\n        prompt.executionCount = executionCount;\n        prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n        panel.addWidget(prompt);\n        output.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n        panel.addWidget(output);\n        return panel;\n    }\n}\nclass SimplifiedOutputArea extends OutputArea {\n    /**\n     * Handle an input request from a kernel by doing nothing.\n     */\n    onInputRequest(msg, future) {\n        return;\n    }\n    /**\n     * Create an output item without a prompt, just the output widgets\n     */\n    createOutputItem(model) {\n        const output = this.createRenderedMimetype(model);\n        if (!output) {\n            return null;\n        }\n        const panel = new Private.OutputPanel();\n        panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n        output.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n        panel.addWidget(output);\n        return panel;\n    }\n}\n/**\n * A namespace for OutputArea statics.\n */\n(function (OutputArea) {\n    /**\n     * Execute code on an output area.\n     */\n    async function execute(code, output, sessionContext, metadata) {\n        var _a;\n        // Override the default for `stop_on_error`.\n        let stopOnError = true;\n        if (metadata &&\n            Array.isArray(metadata.tags) &&\n            metadata.tags.indexOf('raises-exception') !== -1) {\n            stopOnError = false;\n        }\n        const content = {\n            code,\n            stop_on_error: stopOnError\n        };\n        const kernel = (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;\n        if (!kernel) {\n            throw new Error('Session has no kernel.');\n        }\n        const future = kernel.requestExecute(content, false, metadata);\n        output.future = future;\n        return future.done;\n    }\n    OutputArea.execute = execute;\n    function isIsolated(mimeType, metadata) {\n        const mimeMd = metadata[mimeType];\n        // mime-specific higher priority\n        if (mimeMd && mimeMd['isolated'] !== undefined) {\n            return !!mimeMd['isolated'];\n        }\n        else {\n            // fallback on global\n            return !!metadata['isolated'];\n        }\n    }\n    OutputArea.isIsolated = isIsolated;\n    /**\n     * The default implementation of `IContentFactory`.\n     */\n    class ContentFactory {\n        /**\n         * Create the output prompt for the widget.\n         */\n        createOutputPrompt() {\n            return new OutputPrompt();\n        }\n        /**\n         * Create an stdin widget.\n         */\n        createStdin(options) {\n            return new Stdin(options);\n        }\n    }\n    OutputArea.ContentFactory = ContentFactory;\n    /**\n     * The default `ContentFactory` instance.\n     */\n    OutputArea.defaultContentFactory = new ContentFactory();\n})(OutputArea || (OutputArea = {}));\n/**\n * The default output prompt implementation\n */\nclass OutputPrompt extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Widget {\n    /*\n     * Create an output prompt widget.\n     */\n    constructor() {\n        super();\n        this._executionCount = null;\n        this.addClass(OUTPUT_PROMPT_CLASS);\n    }\n    /**\n     * The execution count for the prompt.\n     */\n    get executionCount() {\n        return this._executionCount;\n    }\n    set executionCount(value) {\n        this._executionCount = value;\n        if (value === null) {\n            this.node.textContent = '';\n        }\n        else {\n            this.node.textContent = `[${value}]:`;\n        }\n    }\n}\n/**\n * The default stdin widget.\n */\nclass Stdin extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Widget {\n    static _historyIx(key, ix) {\n        const history = Stdin._history.get(key);\n        if (!history) {\n            return undefined;\n        }\n        const len = history.length;\n        // wrap nonpositive ix to nonnegative ix\n        if (ix <= 0) {\n            return len + ix;\n        }\n    }\n    static _historyAt(key, ix) {\n        const history = Stdin._history.get(key);\n        if (!history) {\n            return undefined;\n        }\n        const len = history.length;\n        const ixpos = Stdin._historyIx(key, ix);\n        if (ixpos !== undefined && ixpos < len) {\n            return history[ixpos];\n        }\n        // return undefined if ix is out of bounds\n    }\n    static _historyPush(key, line) {\n        const history = Stdin._history.get(key);\n        history.push(line);\n        if (history.length > 1000) {\n            // truncate line history if it's too long\n            history.shift();\n        }\n    }\n    static _historySearch(key, pat, ix, reverse = true) {\n        const history = Stdin._history.get(key);\n        const len = history.length;\n        const ixpos = Stdin._historyIx(key, ix);\n        const substrFound = (x) => x.search(pat) !== -1;\n        if (ixpos === undefined) {\n            return;\n        }\n        if (reverse) {\n            if (ixpos === 0) {\n                // reverse search fails if already at start of history\n                return;\n            }\n            const ixFound = history.slice(0, ixpos).findLastIndex(substrFound);\n            if (ixFound !== -1) {\n                // wrap ix to negative\n                return ixFound - len;\n            }\n        }\n        else {\n            if (ixpos >= len - 1) {\n                // forward search fails if already at end of history\n                return;\n            }\n            const ixFound = history.slice(ixpos + 1).findIndex(substrFound);\n            if (ixFound !== -1) {\n                // wrap ix to negative and adjust for slice\n                return ixFound - len + ixpos + 1;\n            }\n        }\n    }\n    /**\n     * Construct a new input widget.\n     */\n    constructor(options) {\n        var _a;\n        super({\n            node: Private.createInputWidgetNode(options.prompt, options.password)\n        });\n        this._promise = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__.PromiseDelegate();\n        this._resolved = false;\n        this.addClass(STDIN_CLASS);\n        this._future = options.future;\n        this._historyIndex = 0;\n        this._historyKey =\n            options.inputHistoryScope === 'session'\n                ? options.parent_header.session\n                : '';\n        this._historyPat = '';\n        this._parentHeader = options.parent_header;\n        this._password = options.password;\n        this._trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator).load('jupyterlab');\n        this._value = options.prompt + ' ';\n        this._input = this.node.getElementsByTagName('input')[0];\n        // make users aware of the line history feature\n        if (!this._password) {\n            this._input.placeholder = this._trans.__('↑↓ for history. Search history with c-↑/c-↓');\n        }\n        else {\n            this._input.placeholder = '';\n        }\n        // initialize line history\n        if (!Stdin._history.has(this._historyKey)) {\n            Stdin._history.set(this._historyKey, []);\n        }\n    }\n    /**\n     * The value of the widget.\n     */\n    get value() {\n        return this._promise.promise.then(() => this._value);\n    }\n    /**\n     * Handle the DOM events for the widget.\n     *\n     * @param event - The DOM event sent to the widget.\n     *\n     * #### Notes\n     * This method implements the DOM `EventListener` interface and is\n     * called in response to events on the dock panel's node. It should\n     * not be called directly by user code.\n     */\n    handleEvent(event) {\n        if (this._resolved) {\n            // Do not handle any more key events if the promise was resolved.\n            event.preventDefault();\n            return;\n        }\n        const input = this._input;\n        if (event.type === 'keydown') {\n            if (event.key === 'Enter') {\n                this.resetSearch();\n                this._future.sendInputReply({\n                    status: 'ok',\n                    value: input.value\n                }, this._parentHeader);\n                if (this._password) {\n                    this._value += '········';\n                }\n                else {\n                    this._value += input.value;\n                    Stdin._historyPush(this._historyKey, input.value);\n                }\n                this._resolved = true;\n                this._promise.resolve(void 0);\n            }\n            else if (event.key === 'Escape') {\n                // currently this gets clobbered by the documentsearch:end command at the notebook level\n                this.resetSearch();\n                input.blur();\n            }\n            else if (event.ctrlKey &&\n                (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {\n                // if _historyPat is blank, use input as search pattern. Otherwise, reuse the current search pattern\n                if (this._historyPat === '') {\n                    this._historyPat = input.value;\n                }\n                const reverse = event.key === 'ArrowUp';\n                const searchHistoryIx = Stdin._historySearch(this._historyKey, this._historyPat, this._historyIndex, reverse);\n                if (searchHistoryIx !== undefined) {\n                    const historyLine = Stdin._historyAt(this._historyKey, searchHistoryIx);\n                    if (historyLine !== undefined) {\n                        if (this._historyIndex === 0) {\n                            this._valueCache = input.value;\n                        }\n                        this._setInputValue(historyLine);\n                        this._historyIndex = searchHistoryIx;\n                        // The default action for ArrowUp is moving to first character\n                        // but we want to keep the cursor at the end.\n                        event.preventDefault();\n                    }\n                }\n            }\n            else if (event.key === 'ArrowUp') {\n                this.resetSearch();\n                const historyLine = Stdin._historyAt(this._historyKey, this._historyIndex - 1);\n                if (historyLine) {\n                    if (this._historyIndex === 0) {\n                        this._valueCache = input.value;\n                    }\n                    this._setInputValue(historyLine);\n                    --this._historyIndex;\n                    // The default action for ArrowUp is moving to first character\n                    // but we want to keep the cursor at the end.\n                    event.preventDefault();\n                }\n            }\n            else if (event.key === 'ArrowDown') {\n                this.resetSearch();\n                if (this._historyIndex === 0) {\n                    // do nothing\n                }\n                else if (this._historyIndex === -1) {\n                    this._setInputValue(this._valueCache);\n                    ++this._historyIndex;\n                }\n                else {\n                    const historyLine = Stdin._historyAt(this._historyKey, this._historyIndex + 1);\n                    if (historyLine) {\n                        this._setInputValue(historyLine);\n                        ++this._historyIndex;\n                    }\n                }\n            }\n        }\n    }\n    resetSearch() {\n        this._historyPat = '';\n    }\n    /**\n     * Handle `after-attach` messages sent to the widget.\n     */\n    onAfterAttach(msg) {\n        this._input.addEventListener('keydown', this);\n        this._input.focus();\n    }\n    /**\n     * Handle `before-detach` messages sent to the widget.\n     */\n    onBeforeDetach(msg) {\n        this._input.removeEventListener('keydown', this);\n    }\n    _setInputValue(value) {\n        this._input.value = value;\n        // Set cursor at the end; this is usually not necessary when input is\n        // focused but having the explicit placement ensures consistency.\n        this._input.setSelectionRange(value.length, value.length);\n    }\n}\nStdin._history = new Map();\n/** ****************************************************************************\n * Private namespace\n ******************************************************************************/\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Create the node for an InputWidget.\n     */\n    function createInputWidgetNode(prompt, password) {\n        const node = document.createElement('div');\n        const promptNode = document.createElement('pre');\n        promptNode.className = STDIN_PROMPT_CLASS;\n        promptNode.textContent = prompt;\n        const input = document.createElement('input');\n        input.className = STDIN_INPUT_CLASS;\n        if (password) {\n            input.type = 'password';\n        }\n        node.appendChild(promptNode);\n        promptNode.appendChild(input);\n        return node;\n    }\n    Private.createInputWidgetNode = createInputWidgetNode;\n    /**\n     * A renderer for IFrame data.\n     */\n    class IsolatedRenderer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Widget {\n        /**\n         * Create an isolated renderer.\n         */\n        constructor(wrapped) {\n            super({ node: document.createElement('iframe') });\n            this.addClass('jp-mod-isolated');\n            this._wrapped = wrapped;\n            // Once the iframe is loaded, the subarea is dynamically inserted\n            const iframe = this.node;\n            iframe.frameBorder = '0';\n            iframe.scrolling = 'auto';\n            iframe.addEventListener('load', () => {\n                // Workaround needed by Firefox, to properly render svg inside\n                // iframes, see https://stackoverflow.com/questions/10177190/\n                // svg-dynamically-added-to-iframe-does-not-render-correctly\n                iframe.contentDocument.open();\n                // Insert the subarea into the iframe\n                // We must directly write the html. At this point, subarea doesn't\n                // contain any user content.\n                iframe.contentDocument.write(this._wrapped.node.innerHTML);\n                iframe.contentDocument.close();\n                const body = iframe.contentDocument.body;\n                // Adjust the iframe height automatically\n                iframe.style.height = `${body.scrollHeight}px`;\n                iframe.heightChangeObserver = new ResizeObserver(() => {\n                    iframe.style.height = `${body.scrollHeight}px`;\n                });\n                iframe.heightChangeObserver.observe(body);\n            });\n        }\n        /**\n         * Render a mime model.\n         *\n         * @param model - The mime model to render.\n         *\n         * @returns A promise which resolves when rendering is complete.\n         *\n         * #### Notes\n         * This method may be called multiple times during the lifetime\n         * of the widget to update it if and when new data is available.\n         */\n        renderModel(model) {\n            return this._wrapped.renderModel(model);\n        }\n    }\n    Private.IsolatedRenderer = IsolatedRenderer;\n    Private.currentPreferredMimetype = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({\n        name: 'preferredMimetype',\n        create: owner => ''\n    });\n    /**\n     * A `Panel` that's focused by a `contextmenu` event.\n     */\n    class OutputPanel extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Panel {\n        /**\n         * Construct a new `OutputPanel` widget.\n         */\n        constructor(options) {\n            super(options);\n        }\n        /**\n         * A callback that focuses on the widget.\n         */\n        _onContext(_) {\n            this.node.focus();\n        }\n        /**\n         * Handle `after-attach` messages sent to the widget.\n         */\n        onAfterAttach(msg) {\n            super.onAfterAttach(msg);\n            this.node.addEventListener('contextmenu', this._onContext.bind(this));\n        }\n        /**\n         * Handle `before-detach` messages sent to the widget.\n         */\n        onBeforeDetach(msg) {\n            super.onAfterDetach(msg);\n            this.node.removeEventListener('contextmenu', this._onContext.bind(this));\n        }\n    }\n    Private.OutputPanel = OutputPanel;\n    /**\n     * Trimmed outputs information widget.\n     */\n    class TrimmedOutputs extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_6__.Widget {\n        /**\n         * Widget constructor\n         *\n         * ### Notes\n         * The widget will be disposed on click after calling the callback.\n         *\n         * @param maxNumberOutputs Maximal number of outputs to display\n         * @param _onClick Callback on click event on the widget\n         */\n        constructor(maxNumberOutputs, onClick) {\n            const node = document.createElement('div');\n            const title = `The first ${maxNumberOutputs} are displayed`;\n            const msg = 'Show more outputs';\n            node.insertAdjacentHTML('afterbegin', `<a title=${title}>\n          <pre>${msg}</pre>\n        </a>`);\n            super({\n                node\n            });\n            this._onClick = onClick;\n            this.addClass('jp-TrimmedOutputs');\n            this.addClass('jp-RenderedHTMLCommon');\n        }\n        /**\n         * Handle the DOM events for widget.\n         *\n         * @param event - The DOM event sent to the widget.\n         *\n         * #### Notes\n         * This method implements the DOM `EventListener` interface and is\n         * called in response to events on the widget's DOM node. It should\n         * not be called directly by user code.\n         */\n        handleEvent(event) {\n            if (event.type === 'click') {\n                this._onClick(event);\n            }\n        }\n        /**\n         * Handle `after-attach` messages for the widget.\n         */\n        onAfterAttach(msg) {\n            super.onAfterAttach(msg);\n            this.node.addEventListener('click', this);\n        }\n        /**\n         * A message handler invoked on a `'before-detach'`\n         * message\n         */\n        onBeforeDetach(msg) {\n            super.onBeforeDetach(msg);\n            this.node.removeEventListener('click', this);\n        }\n    }\n    Private.TrimmedOutputs = TrimmedOutputs;\n})(Private || (Private = {}));\n//# sourceMappingURL=widget.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/outputarea/lib/widget.js?");

/***/ })

}]);