"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([["node_modules_jupyterlab_htmlviewer_lib_index_js-_f0bb1"],{

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

/***/ }),

/***/ "../node_modules/@jupyterlab/htmlviewer/lib/tokens.js":
/*!************************************************************!*\
  !*** ../node_modules/@jupyterlab/htmlviewer/lib/tokens.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 */   \"IHTMLViewerTracker\": () => (/* binding */ IHTMLViewerTracker)\n/* harmony export */ });\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/**\n * The HTML viewer tracker token.\n */\nconst IHTMLViewerTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/htmlviewer:IHTMLViewerTracker', `A widget tracker for rendered HTML documents.\n  Use this if you want to be able to iterate over and interact with HTML documents\n  viewed by the application.`);\n//# sourceMappingURL=tokens.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/htmlviewer/lib/tokens.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/htmlviewer/lib/widget.js":
/*!************************************************************!*\
  !*** ../node_modules/@jupyterlab/htmlviewer/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 */   \"HTMLViewer\": () => (/* binding */ HTMLViewer),\n/* harmony export */   \"HTMLViewerFactory\": () => (/* binding */ HTMLViewerFactory),\n/* harmony export */   \"ToolbarItems\": () => (/* binding */ ToolbarItems)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/docregistry */ \"webpack/sharing/consume/default/@jupyterlab/docregistry/@jupyterlab/docregistry\");\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__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 _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);\n/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n\n\n\n\n\n/**\n * The timeout to wait for change activity to have ceased before rendering.\n */\nconst RENDER_TIMEOUT = 1000;\n/**\n * The CSS class to add to the HTMLViewer Widget.\n */\nconst CSS_CLASS = 'jp-HTMLViewer';\n/**\n * A viewer widget for HTML documents.\n *\n * #### Notes\n * The iframed HTML document can pose a potential security risk,\n * since it can execute Javascript, and make same-origin requests\n * to the server, thereby executing arbitrary Javascript.\n *\n * Here, we sandbox the iframe so that it can't execute Javascript\n * or launch any popups. We allow one exception: 'allow-same-origin'\n * requests, so that local HTML documents can access CSS, images,\n * etc from the files system.\n */\nclass HTMLViewer extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.DocumentWidget {\n    /**\n     * Create a new widget for rendering HTML.\n     */\n    constructor(options) {\n        super({\n            ...options,\n            content: new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.IFrame({ sandbox: ['allow-same-origin'] })\n        });\n        this._renderPending = false;\n        this._parser = new DOMParser();\n        this._monitor = null;\n        this._objectUrl = '';\n        this._trustedChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_4__.Signal(this);\n        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        this.content.addClass(CSS_CLASS);\n        void this.context.ready.then(() => {\n            this.update();\n            // Throttle the rendering rate of the widget.\n            this._monitor = new _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.ActivityMonitor({\n                signal: this.context.model.contentChanged,\n                timeout: RENDER_TIMEOUT\n            });\n            this._monitor.activityStopped.connect(this.update, this);\n        });\n    }\n    /**\n     * Whether the HTML document is trusted. If trusted,\n     * it can execute Javascript in the iframe sandbox.\n     */\n    get trusted() {\n        return this.content.sandbox.indexOf('allow-scripts') !== -1;\n    }\n    set trusted(value) {\n        if (this.trusted === value) {\n            return;\n        }\n        if (value) {\n            this.content.sandbox = Private.trusted;\n        }\n        else {\n            this.content.sandbox = Private.untrusted;\n        }\n        // eslint-disable-next-line\n        this.content.url = this.content.url; // Force a refresh.\n        this._trustedChanged.emit(value);\n    }\n    /**\n     * Emitted when the trust state of the document changes.\n     */\n    get trustedChanged() {\n        return this._trustedChanged;\n    }\n    /**\n     * Dispose of resources held by the html viewer.\n     */\n    dispose() {\n        if (this._objectUrl) {\n            try {\n                URL.revokeObjectURL(this._objectUrl);\n            }\n            catch (error) {\n                /* no-op */\n            }\n        }\n        super.dispose();\n    }\n    /**\n     * Handle and update request.\n     */\n    onUpdateRequest() {\n        if (this._renderPending) {\n            return;\n        }\n        this._renderPending = true;\n        void this._renderModel().then(() => (this._renderPending = false));\n    }\n    /**\n     * Render HTML in IFrame into this widget's node.\n     */\n    async _renderModel() {\n        let data = this.context.model.toString();\n        data = await this._setBase(data);\n        // Set the new iframe url.\n        const blob = new Blob([data], { type: 'text/html' });\n        const oldUrl = this._objectUrl;\n        this._objectUrl = URL.createObjectURL(blob);\n        this.content.url = this._objectUrl;\n        // Release reference to any previous object url.\n        if (oldUrl) {\n            try {\n                URL.revokeObjectURL(oldUrl);\n            }\n            catch (error) {\n                /* no-op */\n            }\n        }\n        return;\n    }\n    /**\n     * Set a <base> element in the HTML string so that the iframe\n     * can correctly dereference relative links.\n     */\n    async _setBase(data) {\n        const doc = this._parser.parseFromString(data, 'text/html');\n        let base = doc.querySelector('base');\n        if (!base) {\n            base = doc.createElement('base');\n            doc.head.insertBefore(base, doc.head.firstChild);\n        }\n        const path = this.context.path;\n        const baseUrl = await this.context.urlResolver.getDownloadUrl(path);\n        // Set the base href, plus a fake name for the url of this\n        // document. The fake name doesn't really matter, as long\n        // as the document can dereference relative links to resources\n        // (e.g. CSS and scripts).\n        base.href = baseUrl;\n        base.target = '_self';\n        return doc.documentElement.innerHTML;\n    }\n}\n/**\n * A widget factory for HTMLViewers.\n */\nclass HTMLViewerFactory extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.ABCWidgetFactory {\n    /**\n     * Create a new widget given a context.\n     */\n    createNewWidget(context) {\n        return new HTMLViewer({ context });\n    }\n    /**\n     * Default factory for toolbar items to be added after the widget is created.\n     */\n    defaultToolbarFactory(widget) {\n        return [\n            // Make a refresh button for the toolbar.\n            {\n                name: 'refresh',\n                widget: ToolbarItems.createRefreshButton(widget, this.translator)\n            },\n            // Make a trust button for the toolbar.\n            {\n                name: 'trust',\n                widget: ToolbarItems.createTrustButton(widget, this.translator)\n            }\n        ];\n    }\n}\n/**\n * A namespace for toolbar items generator\n */\nvar ToolbarItems;\n(function (ToolbarItems) {\n    /**\n     * Create the refresh button\n     *\n     * @param widget HTML viewer widget\n     * @param translator Application translator object\n     * @returns Toolbar item button\n     */\n    function createRefreshButton(widget, translator) {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.refreshIcon,\n            onClick: async () => {\n                if (!widget.context.model.dirty) {\n                    await widget.context.revert();\n                    widget.update();\n                }\n            },\n            tooltip: trans.__('Rerender HTML Document')\n        });\n    }\n    ToolbarItems.createRefreshButton = createRefreshButton;\n    /**\n     * Create the trust button\n     *\n     * @param document HTML viewer widget\n     * @param translator Application translator object\n     * @returns Toolbar item button\n     */\n    function createTrustButton(document, translator) {\n        return _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ReactWidget.create(react__WEBPACK_IMPORTED_MODULE_5__.createElement(Private.TrustButtonComponent, { htmlDocument: document, translator: translator }));\n    }\n    ToolbarItems.createTrustButton = createTrustButton;\n})(ToolbarItems || (ToolbarItems = {}));\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Sandbox exceptions for untrusted HTML.\n     */\n    Private.untrusted = [];\n    /**\n     * Sandbox exceptions for trusted HTML.\n     */\n    Private.trusted = ['allow-scripts'];\n    /**\n     * React component for a trusted button.\n     *\n     * This wraps the ToolbarButtonComponent and watches for trust changes.\n     */\n    function TrustButtonComponent(props) {\n        const translator = props.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        return (react__WEBPACK_IMPORTED_MODULE_5__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.UseSignal, { signal: props.htmlDocument.trustedChanged, initialSender: props.htmlDocument }, () => (react__WEBPACK_IMPORTED_MODULE_5__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButtonComponent, { className: \"\", onClick: () => (props.htmlDocument.trusted = !props.htmlDocument.trusted), tooltip: trans.__(`Whether the HTML file is trusted.\nTrusting the file allows scripts to run in it,\nwhich may result in security risks.\nOnly enable for files you trust.`), label: props.htmlDocument.trusted\n                ? trans.__('Distrust HTML')\n                : trans.__('Trust HTML') }))));\n    }\n    Private.TrustButtonComponent = TrustButtonComponent;\n})(Private || (Private = {}));\n//# sourceMappingURL=widget.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/htmlviewer/lib/widget.js?");

/***/ })

}]);