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

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ \"webpack/sharing/consume/default/@jupyterlab/application/@jupyterlab/application\");\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/imageviewer */ \"webpack/sharing/consume/default/@jupyterlab/imageviewer/@jupyterlab/imageviewer\");\n/* harmony import */ var _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module imageviewer-extension\n */\n\n\n\n\n/**\n * The command IDs used by the image widget plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.resetImage = 'imageviewer:reset-image';\n    CommandIDs.zoomIn = 'imageviewer:zoom-in';\n    CommandIDs.zoomOut = 'imageviewer:zoom-out';\n    CommandIDs.flipHorizontal = 'imageviewer:flip-horizontal';\n    CommandIDs.flipVertical = 'imageviewer:flip-vertical';\n    CommandIDs.rotateClockwise = 'imageviewer:rotate-clockwise';\n    CommandIDs.rotateCounterclockwise = 'imageviewer:rotate-counterclockwise';\n    CommandIDs.invertColors = 'imageviewer:invert-colors';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * The list of file types for images.\n */\nconst FILE_TYPES = ['png', 'gif', 'jpeg', 'bmp', 'ico', 'tiff'];\n/**\n * The name of the factory that creates image widgets.\n */\nconst FACTORY = 'Image';\n/**\n * The name of the factory that creates image widgets.\n */\nconst TEXT_FACTORY = 'Image (Text)';\n/**\n * The list of file types for images with optional text modes.\n */\nconst TEXT_FILE_TYPES = ['svg', 'xbm'];\n/**\n * The test pattern for text file types in paths.\n */\nconst TEXT_FILE_REGEX = new RegExp(`[.](${TEXT_FILE_TYPES.join('|')})$`);\n/**\n * The image file handler extension.\n */\nconst plugin = {\n    activate,\n    description: 'Adds image viewer and provide its tracker.',\n    id: '@jupyterlab/imageviewer-extension:plugin',\n    provides: _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__.IImageTracker,\n    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],\n    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],\n    autoStart: true\n};\n/**\n * Export the plugin as default.\n */\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);\n/**\n * Activate the image widget extension.\n */\nfunction activate(app, translator, palette, restorer) {\n    const trans = translator.load('jupyterlab');\n    const namespace = 'image-widget';\n    function onWidgetCreated(sender, widget) {\n        var _a, _b;\n        // Notify the widget tracker if restore data needs to update.\n        widget.context.pathChanged.connect(() => {\n            void tracker.save(widget);\n        });\n        void tracker.add(widget);\n        const types = app.docRegistry.getFileTypesForPath(widget.context.path);\n        if (types.length > 0) {\n            widget.title.icon = types[0].icon;\n            widget.title.iconClass = (_a = types[0].iconClass) !== null && _a !== void 0 ? _a : '';\n            widget.title.iconLabel = (_b = types[0].iconLabel) !== null && _b !== void 0 ? _b : '';\n        }\n    }\n    const factory = new _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__.ImageViewerFactory({\n        name: FACTORY,\n        label: trans.__('Image'),\n        modelName: 'base64',\n        fileTypes: [...FILE_TYPES, ...TEXT_FILE_TYPES],\n        defaultFor: FILE_TYPES,\n        readOnly: true\n    });\n    const textFactory = new _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__.ImageViewerFactory({\n        name: TEXT_FACTORY,\n        label: trans.__('Image (Text)'),\n        modelName: 'text',\n        fileTypes: TEXT_FILE_TYPES,\n        defaultFor: TEXT_FILE_TYPES,\n        readOnly: true\n    });\n    [factory, textFactory].forEach(factory => {\n        app.docRegistry.addWidgetFactory(factory);\n        factory.widgetCreated.connect(onWidgetCreated);\n    });\n    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({\n        namespace\n    });\n    if (restorer) {\n        // Handle state restoration.\n        void restorer.restore(tracker, {\n            command: 'docmanager:open',\n            args: widget => ({\n                path: widget.context.path,\n                factory: TEXT_FILE_REGEX.test(widget.context.path)\n                    ? TEXT_FACTORY\n                    : FACTORY\n            }),\n            name: widget => widget.context.path\n        });\n    }\n    addCommands(app, tracker, translator);\n    if (palette) {\n        const category = trans.__('Image Viewer');\n        [\n            CommandIDs.zoomIn,\n            CommandIDs.zoomOut,\n            CommandIDs.resetImage,\n            CommandIDs.rotateClockwise,\n            CommandIDs.rotateCounterclockwise,\n            CommandIDs.flipHorizontal,\n            CommandIDs.flipVertical,\n            CommandIDs.invertColors\n        ].forEach(command => {\n            palette.addItem({ command, category });\n        });\n    }\n    return tracker;\n}\n/**\n * Add the commands for the image widget.\n */\nfunction addCommands(app, tracker, translator) {\n    var _a;\n    const trans = translator.load('jupyterlab');\n    const { commands, shell } = app;\n    /**\n     * Whether there is an active image viewer.\n     */\n    function isEnabled() {\n        return (tracker.currentWidget !== null &&\n            tracker.currentWidget === shell.currentWidget);\n    }\n    commands.addCommand(CommandIDs.zoomIn, {\n        execute: zoomIn,\n        label: trans.__('Zoom In'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.zoomOut, {\n        execute: zoomOut,\n        label: trans.__('Zoom Out'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.resetImage, {\n        execute: resetImage,\n        label: trans.__('Reset Image'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.rotateClockwise, {\n        execute: rotateClockwise,\n        label: trans.__('Rotate Clockwise'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.rotateCounterclockwise, {\n        execute: rotateCounterclockwise,\n        label: trans.__('Rotate Counterclockwise'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.flipHorizontal, {\n        execute: flipHorizontal,\n        label: trans.__('Flip image horizontally'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.flipVertical, {\n        execute: flipVertical,\n        label: trans.__('Flip image vertically'),\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.invertColors, {\n        execute: invertColors,\n        label: trans.__('Invert Colors'),\n        isEnabled\n    });\n    const notify = () => {\n        Object.values(CommandIDs).forEach(id => commands.notifyCommandChanged(id));\n    };\n    // All commands with isEnabled defined directly or in a semantic commands\n    tracker.currentChanged.connect(notify);\n    (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);\n    function zoomIn() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.scale = widget.scale > 1 ? widget.scale + 0.5 : widget.scale * 2;\n        }\n    }\n    function zoomOut() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.scale = widget.scale > 1 ? widget.scale - 0.5 : widget.scale / 2;\n        }\n    }\n    function resetImage() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.scale = 1;\n            widget.colorinversion = 0;\n            widget.resetRotationFlip();\n        }\n    }\n    function rotateClockwise() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.rotateClockwise();\n        }\n    }\n    function rotateCounterclockwise() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.rotateCounterclockwise();\n        }\n    }\n    function flipHorizontal() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.flipHorizontal();\n        }\n    }\n    function flipVertical() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.flipVertical();\n        }\n    }\n    function invertColors() {\n        var _a;\n        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;\n        if (widget) {\n            widget.colorinversion += 1;\n            widget.colorinversion %= 2;\n        }\n    }\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/imageviewer-extension/lib/index.js?");

/***/ })

}]);