UNPKG

gatsby-plugin-perf-budgets

Version:

**gatsby-plugin-perf-budgets** is an *experimental* plugin to make browsing bundles on a page basis easier. It is used in conjunction with `gatsby-plugin-webpack-bundle-analyser-v2`.

301 lines (245 loc) 672 kB
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./client/viewer.jsx"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./client/assets/icon-arrow-right.svg": /*!********************************************!*\ !*** ./client/assets/icon-arrow-right.svg ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNyIgaGVpZ2h0PSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNLjgyMiAxMi44MTFhLjQ0NS40NDUgMCAwIDEtLjMyMi4xMzMuNDU2LjQ1NiAwIDAgMS0uMzIyLS43NzhMNS44NDQgNi41LjE3OC44MzNBLjQ1Ni40NTYgMCAwIDEgLjgyMi4xOWw1Ljk5IDUuOTg5YS40NTYuNDU2IDAgMCAxIDAgLjY0NGwtNS45OSA1Ljk5eiIvPjwvc3ZnPg==\"\n\n//# sourceURL=webpack:///./client/assets/icon-arrow-right.svg?"); /***/ }), /***/ "./client/assets/icon-chunk.svg": /*!**************************************!*\ !*** ./client/assets/icon-chunk.svg ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwdjExLjI1YzAgLjQxNC4zMzYuNzUuNzUuNzVoMTAuNWEuNzUuNzUgMCAwIDAgLjc1LS43NVYwSDB6IiBmaWxsPSIjRkM2IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNMCAwcy4xNTYgMyAxLjEyNSAzaDkuNzVDMTEuODQ1IDMgMTIgMCAxMiAwSDB6IiBmaWxsPSIjQ0NBMzUyIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNi43NSAxLjVoLS4zNzVMNiAyLjVsLS4zNzUtMUg1LjI1TDUuODEzIDMgNS4yNSA0LjVoLjM3NUw2IDMuNWwuMzc1IDFoLjM3NUw2LjE4NyAzeiIgZmlsbD0iIzk5N0EzRCIvPjxjaXJjbGUgY3g9Ii43NSIgY3k9Ii43NSIgcj0iMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS4yNSAzLjc1KSIgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIi8+PGNpcmNsZSBjeD0iLjc1IiBjeT0iLjc1IiByPSIxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LjI1IC43NSkiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=\"\n\n//# sourceURL=webpack:///./client/assets/icon-chunk.svg?"); /***/ }), /***/ "./client/assets/icon-folder.svg": /*!***************************************!*\ !*** ./client/assets/icon-folder.svg ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTExLjcgMS4zMzNINS44NUw0LjU1IDBIMS4zQy41ODUgMCAwIC42IDAgMS4zMzNWNGgxM1YyLjY2N2MwLS43MzMtLjU4NS0xLjMzNC0xLjMtMS4zMzR6IiBmaWxsPSIjRkZBMDAwIi8+PHBhdGggZD0iTTExLjcgMUgxLjNDLjU4NSAxIDAgMS41NzkgMCAyLjI4NnY2LjQyOEMwIDkuNDIxLjU4NSAxMCAxLjMgMTBoMTAuNGMuNzE1IDAgMS4zLS41NzkgMS4zLTEuMjg2VjIuMjg2QzEzIDEuNTc5IDEyLjQxNSAxIDExLjcgMXoiIGZpbGw9IiNGRkNBMjgiLz48L2c+PC9zdmc+\"\n\n//# sourceURL=webpack:///./client/assets/icon-folder.svg?"); /***/ }), /***/ "./client/assets/icon-invisible.svg": /*!******************************************!*\ !*** ./client/assets/icon-invisible.svg ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjMyNy4wNjRMOC40MzMgMS45NTdhNi4wMjUgNi4wMjUgMCAwIDAtMS45NTItLjM0MkMyLjkxMiAxLjYxNS4wMTkgNS4xOTYuMDE5IDUuMTk2czEuMDk4IDEuMzU4IDIuNzc0IDIuNDAxTC45NiA5LjQzMWwuOTM2LjkzNkwxMS4yNjMgMWwtLjkzNi0uOTM2ek00LjA1IDYuMzRhMi42ODYgMi42ODYgMCAwIDEgMy41NzQtMy41NzRMNC4wNSA2LjM0em02LjQ0OC0zLjMzYTEyLjM0NCAxMi4zNDQgMCAwIDEgMi40NDQgMi4xODZzLTIuODkzIDMuNTgtNi40NjEgMy41OGMtLjUzIDAtMS4wNDQtLjA3OC0xLjUzNy0uMjEzbC43ODgtLjc4OEEyLjY4NCAyLjY4NCAwIDAgMCA5LjA2IDQuNDQ4bDEuNDM4LTEuNDM5eiIgZmlsbD0iIzIzMUYyMCIgZmlsbC1vcGFjaXR5PSIuNTk3Ii8+PC9zdmc+\"\n\n//# sourceURL=webpack:///./client/assets/icon-invisible.svg?"); /***/ }), /***/ "./client/assets/icon-module.svg": /*!***************************************!*\ !*** ./client/assets/icon-module.svg ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iMTMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNjI1IDBBMS42MyAxLjYzIDAgMCAwIDAgMS42MjV2OS43NUExLjYzIDEuNjMgMCAwIDAgMS42MjUgMTNoNy41ODNhMS42MyAxLjYzIDAgMCAwIDEuNjI1LTEuNjI1VjMuNTY3TDcuMjY2IDBIMS42MjV6bTAgMS4wODNINi41djMuMjVoMy4yNXY3LjA0MmEuNTM1LjUzNSAwIDAgMS0uNTQyLjU0MkgxLjYyNWEuNTM1LjUzNSAwIDAgMS0uNTQyLS41NDJ2LTkuNzVjMC0uMzA1LjIzNy0uNTQyLjU0Mi0uNTQyem01Ljk1OC43NjZMOC45ODQgMy4yNWgtMS40di0xLjR6TTMuMjUgNi41djEuMDgzaDQuMzMzVjYuNUgzLjI1em0wIDIuMTY3VjkuNzVINi41VjguNjY3SDMuMjV6IiBmaWxsLW9wYWNpdHk9Ii40MDMiLz48L3N2Zz4=\"\n\n//# sourceURL=webpack:///./client/assets/icon-module.svg?"); /***/ }), /***/ "./client/assets/icon-pin.svg": /*!************************************!*\ !*** ./client/assets/icon-pin.svg ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYuMDEyIDE3Ljk0OWwtMS40OTMtNi4zNzZhMTAuOTM1IDEwLjkzNSAwIDAgMCAyLjk4NS4wMDJMNi4wMTIgMTcuOTV6TTkuMjQ2IDEuODU3YzAgLjUyLS40MTUuOTg1LTEuMDcgMS4zMDhsLS4wMDEgMi42MTZjMS43MjUuNDEgMi45MjIgMS4yOTQgMi45MjIgMi4zMiAwIC40MTYtLjE5NS44MDktLjU0MiAxLjE1Ni0uNjQuNjM5LTEuNzk0IDEuMTI0LTMuMTg3IDEuMzE4LS4wMy4wMDUtLjA2Mi4wMDgtLjA5My4wMTJhOC45MTcgOC45MTcgMCAwIDEtLjcyNS4wNjVsLS4xMi4wMDdhMTAuMTU0IDEwLjE1NCAwIDAgMS0uODk1LS4wMDNjLS4wOTgtLjAwNS0uMTkzLS4wMTMtLjI4OC0uMDItLjA1My0uMDA0LS4xMDYtLjAwNy0uMTU4LS4wMTJhOS4yNDcgOS4yNDcgMCAwIDEtLjM3Mi0uMDQzbC0uMDQ1LS4wMDZDMi41MTQgMTAuMjc4LjkyNiA5LjI4NS45MjYgOC4xMDFjMC0uNDE1LjE5Ni0uODA3LjU0My0xLjE1NC41MTEtLjUxMiAxLjM1Mi0uOTI0IDIuMzgtMS4xNjhWMy4xNjVjLS42NTYtLjMyMy0xLjA3LS43ODktMS4wNy0xLjMwOUMyLjc3OC44ODIgNC4yMjUuMDkyIDYuMDExLjA5MnMzLjIzNC43OSAzLjIzNCAxLjc2NXoiLz48L3N2Zz4=\"\n\n//# sourceURL=webpack:///./client/assets/icon-pin.svg?"); /***/ }), /***/ "./client/components/App.css": /*!***********************************!*\ !*** ./client/components/App.css ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--5-1!../../node_modules/postcss-loader/src??ref--5-2!./App.css */ \"./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./client/components/App.css\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./client/components/App.css?"); /***/ }), /***/ "./client/components/App.jsx": /*!***********************************!*\ !*** ./client/components/App.jsx ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return PageList; });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var _ModulesTreemap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ModulesTreemap */ \"./client/components/ModulesTreemap.jsx\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store */ \"./client/store.js\");\n/* harmony import */ var mobx_preact__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-preact */ \"./node_modules/mobx-preact/lib/index.module.js\");\n/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! filesize */ \"./node_modules/filesize/lib/filesize.js\");\n/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(filesize__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _App_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./App.css */ \"./client/components/App.css\");\n/* harmony import */ var _App_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_App_css__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _SortableHeader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SortableHeader */ \"./client/components/SortableHeader.jsx\");\nvar _class, _temp;\n\n/** @jsx h */\n\n\n\n\n\n\n\n\nlet PageList = Object(mobx_preact__WEBPACK_IMPORTED_MODULE_3__[\"observer\"])(_class = (_temp = class PageList extends preact__WEBPACK_IMPORTED_MODULE_0__[\"Component\"] {\n constructor(...args) {\n super(...args);\n\n this.handleSort = id => {\n console.log({\n id,\n b: this.props.sort\n });\n\n if (this.props.sort.key === id) {\n const newType = this.props.sortTypes.find(s => {\n return s.key === id && s.order !== this.props.sort.order;\n }); // console.log({ newType });\n\n if (newType) {\n this.props.handleSelectedSortChange(newType);\n }\n } else {\n const newType = this.props.sortTypes.find(s => {\n return s.key === id;\n }); // console.log({ newType });\n\n if (newType) {\n this.props.handleSelectedSortChange(newType);\n }\n } // if (this.state.sidebarPinned) {\n // setTimeout(() => this.treemap.resize());\n // }\n\n };\n }\n\n render() {\n const activeSize = _store__WEBPACK_IMPORTED_MODULE_2__[\"store\"].selectedSize || _store__WEBPACK_IMPORTED_MODULE_2__[\"store\"].defaultSize;\n const filter = this.props.filter || \"\";\n\n const sortFn = this.props.sort && this.props.sort.compare || ((a, b) => a.pagePath.localeCompare(b.pagePath));\n\n const filteredPages = _store__WEBPACK_IMPORTED_MODULE_2__[\"store\"].pages.filter(page => {\n return page.pagePath.includes(filter) || page.componentChunkName.includes(filter);\n }).sort(sortFn);\n const allPagesL = _store__WEBPACK_IMPORTED_MODULE_2__[\"store\"].pages.length;\n const filteredPagesL = filteredPages.length;\n const showPagesL = Math.min(filteredPagesL, 50); // if (filter) {\n // const exactMatch = filteredPages.findIndex(page => page.path === filter);\n // }\n\n console.log({\n showPagesL\n });\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"div\", {\n className: _App_css__WEBPACK_IMPORTED_MODULE_5___default.a.container\n }, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"table\", {\n border: \"1\",\n style: {\n width: \"100%\"\n }\n }, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"thead\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"tr\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", {\n colSpan: 12\n }, \"Displayed: \", showPagesL, \" / Filtered: \", filteredPagesL, \" / Total:\", \" \", allPagesL)), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"tr\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rowSpan: 3,\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"template\"\n }, \"Template\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rowSpan: 3,\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"path\"\n }, \"Page\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rowSpan: 3,\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"numberOfRequests\"\n }, \"Number of requests\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", {\n colSpan: 9\n }, \"Size of requests\")), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"tr\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", {\n colSpan: 4\n }, \".js\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", {\n colSpan: 4\n }, \"data\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rowSpan: 2,\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"total\"\n }, \"Total\")), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"tr\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", null, \"App\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"jsPage\"\n }, \"Page\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"jsModule\"\n }, \"Modules\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"js\"\n }, \"Total\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", null, \"App\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"dataPage\"\n }, \"Page\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"th\", null, \"Static query\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_SortableHeader__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n sort: this.props.sort,\n onClick: this.handleSort,\n id: \"data\"\n }, \"Total\"))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"tbody\", null, filteredPages.slice(0, showPagesL).map(page => {\n const jsAppSize = page.assetSizes.app[activeSize];\n const jsPageSize = page.assetSizes.page[activeSize];\n const jsModuleSize = page.assetSizes.modules[activeSize];\n const appDataSize = page.assetSizes.appData[activeSize];\n const pageDataSize = page[activeSize];\n const sqDataSize = page.assetSizes.sqData[activeSize]; // console.log(page);\n\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"tr\", {\n key: page.path,\n style: {\n cursor: \"pointer\"\n },\n onClick: () => {\n _store__WEBPACK_IMPORTED_MODULE_2__[\"store\"].setPath(page.pagePath);\n },\n className: _App_css__WEBPACK_IMPORTED_MODULE_5___default.a.itemRow\n }, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, page.componentChunkName)), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, page.pagePath)), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, page.numberOfRequests)), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(jsAppSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(jsPageSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(jsModuleSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(jsAppSize + jsPageSize + jsModuleSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(appDataSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(pageDataSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(sqDataSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(appDataSize + pageDataSize + sqDataSize))), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"td\", null, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"code\", null, filesize__WEBPACK_IMPORTED_MODULE_4___default()(jsAppSize + jsPageSize + jsModuleSize + pageDataSize + appDataSize))));\n }))));\n }\n\n}, _temp)) || _class;\n\n // @observer\n// export default class App extends Component {\n// render() {\n// if (store.path) {\n// return <ModulesTreemap />;\n// return (\n// <div>\n// <button\n// onClick={() => {\n// store.setPath(``);\n// }}\n// >\n// Go to page list\n// </button>\n// <ModulesTreemap />;\n// </div>\n// );\n// } else {\n// return <PageList />;\n// }\n// }\n// }\n\n//# sourceURL=webpack:///./client/components/App.jsx?"); /***/ }), /***/ "./client/components/Button.css": /*!**************************************!*\ !*** ./client/components/Button.css ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--5-1!../../node_modules/postcss-loader/src??ref--5-2!./Button.css */ \"./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./client/components/Button.css\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./client/components/Button.css?"); /***/ }), /***/ "./client/components/Button.jsx": /*!**************************************!*\ !*** ./client/components/Button.jsx ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Button; });\n/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _Button_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Button.css */ \"./client/components/Button.css\");\n/* harmony import */ var _Button_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_Button_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lib_PureComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/PureComponent */ \"./client/lib/PureComponent.jsx\");\n\n\n/** @jsx h */\n\n\n\n\nclass Button extends _lib_PureComponent__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n constructor(...args) {\n super(...args);\n\n this.handleClick = event => {\n this.elem.blur();\n this.props.onClick(event);\n };\n\n this.saveRef = elem => this.elem = elem;\n }\n\n render({\n active,\n toggle,\n className,\n children,\n ...props\n }) {\n const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, {\n [_Button_css__WEBPACK_IMPORTED_MODULE_3___default.a.button]: true,\n [_Button_css__WEBPACK_IMPORTED_MODULE_3___default.a.active]: active,\n [_Button_css__WEBPACK_IMPORTED_MODULE_3___default.a.toggle]: toggle\n });\n return Object(preact__WEBPACK_IMPORTED_MODULE_1__[\"h\"])(\"button\", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, props, {\n ref: this.saveRef,\n type: \"button\",\n className: classes,\n disabled: this.disabled,\n onClick: this.handleClick\n }), children);\n }\n\n get disabled() {\n const {\n props\n } = this;\n return props.disabled || props.active && !props.toggle;\n }\n\n}\n\n//# sourceURL=webpack:///./client/components/Button.jsx?"); /***/ }), /***/ "./client/components/Checkbox.css": /*!****************************************!*\ !*** ./client/components/Checkbox.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--5-1!../../node_modules/postcss-loader/src??ref--5-2!./Checkbox.css */ \"./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./client/components/Checkbox.css\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./client/components/Checkbox.css?"); /***/ }), /***/ "./client/components/Checkbox.jsx": /*!****************************************!*\ !*** ./client/components/Checkbox.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Checkbox; });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Checkbox_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Checkbox.css */ \"./client/components/Checkbox.css\");\n/* harmony import */ var _Checkbox_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_Checkbox_css__WEBPACK_IMPORTED_MODULE_2__);\n/** @jsx h */\n\n\n\nclass Checkbox extends preact__WEBPACK_IMPORTED_MODULE_0__[\"Component\"] {\n constructor(...args) {\n super(...args);\n\n this.handleChange = () => {\n this.props.onChange(!this.props.checked);\n };\n }\n\n render() {\n const {\n checked,\n className,\n children\n } = this.props;\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"label\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_Checkbox_css__WEBPACK_IMPORTED_MODULE_2___default.a.label, className)\n }, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"input\", {\n className: _Checkbox_css__WEBPACK_IMPORTED_MODULE_2___default.a.checkbox,\n type: \"checkbox\",\n checked: checked,\n onChange: this.handleChange\n }), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"span\", {\n className: _Checkbox_css__WEBPACK_IMPORTED_MODULE_2___default.a.itemText\n }, children));\n }\n\n}\n\n//# sourceURL=webpack:///./client/components/Checkbox.jsx?"); /***/ }), /***/ "./client/components/CheckboxList.css": /*!********************************************!*\ !*** ./client/components/CheckboxList.css ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--5-1!../../node_modules/postcss-loader/src??ref--5-2!./CheckboxList.css */ \"./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./client/components/CheckboxList.css\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./client/components/CheckboxList.css?"); /***/ }), /***/ "./client/components/CheckboxList.jsx": /*!********************************************!*\ !*** ./client/components/CheckboxList.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CheckboxList; });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! filesize */ \"./node_modules/filesize/lib/filesize.js\");\n/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(filesize__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _CheckboxListItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CheckboxListItem */ \"./client/components/CheckboxListItem.jsx\");\n/* harmony import */ var _CheckboxList_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CheckboxList.css */ \"./client/components/CheckboxList.css\");\n/* harmony import */ var _CheckboxList_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_CheckboxList_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lib_PureComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/PureComponent */ \"./client/lib/PureComponent.jsx\");\n/** @jsx h */\n\n\n\n\n\nconst ALL_ITEM = Symbol(\"ALL_ITEM\"); // const groupMapping = {\n// \"page-data\": \"\"\n// };\n\nconst groupOrder = [{\n type: \"app-chunk\",\n label: \"Application level chunks (shared with all pages)\"\n}, {\n type: \"page-chunk\",\n label: \"Template level chunks (shared with all pages using this template)\"\n}, {\n type: \"module-chunk\",\n label: \"Page level chunks\"\n}, {\n type: \"app-data\",\n label: \"Application level data (shared with all pages)\"\n}, {\n type: \"page-data\",\n label: \"Page level data\"\n}, {\n type: \"other\",\n label: \"Not classified\"\n}];\n\nconst groupItems = items => {\n // if (group) {\n const groups = {\n \"page-data\": [],\n \"module-chunk\": [],\n \"app-chunk\": [],\n \"page-chunk\": [],\n \"app-data\": [],\n other: []\n };\n const sizes = {\n \"page-data\": {\n parsedSize: 0,\n gzipSize: 0\n },\n \"module-chunk\": {\n parsedSize: 0,\n gzipSize: 0\n },\n \"app-chunk\": {\n parsedSize: 0,\n gzipSize: 0\n },\n \"page-chunk\": {\n parsedSize: 0,\n gzipSize: 0\n },\n \"app-data\": {\n parsedSize: 0,\n gzipSize: 0\n },\n other: {\n parsedSize: 0,\n gzipSize: 0\n }\n }; // const groups = {\n // }\n\n items.forEach(item => {\n const arr = groups[item.type] || groups.other;\n const sizeObj = sizes[item.type] || sizes.other;\n sizeObj.gzipSize += item.gzipSize;\n sizeObj.parsedSize += item.parsedSize;\n arr.push(item);\n });\n const result = [];\n groupOrder.forEach(({\n type,\n label\n }) => {\n const groupItems = groups[type];\n\n if (groupItems.length) {\n result.push({\n label,\n ui: \"group\",\n ...sizes[type]\n });\n result.push(...groupItems);\n }\n });\n return result;\n};\n\nclass CheckboxList extends _lib_PureComponent__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n constructor(props) {\n super(props);\n\n this.handleToggleAllCheck = () => {\n const checkedItems = this.isAllChecked() ? [] : this.props.items;\n this.setState({\n checkedItems\n });\n this.informAboutChange(checkedItems);\n };\n\n this.handleItemCheck = item => {\n let checkedItems;\n\n if (this.isItemChecked(item)) {\n checkedItems = this.state.checkedItems.filter(checkedItem => checkedItem !== item);\n } else {\n checkedItems = [...this.state.checkedItems, item];\n }\n\n this.setState({\n checkedItems\n });\n this.informAboutChange(checkedItems);\n };\n\n this.state = {\n checkedItems: props.checkedItems || props.items,\n renderItems: props.group ? groupItems(props.items) : props.items\n };\n }\n\n componentWillReceiveProps(newProps) {\n if (newProps.items !== this.props.items) {\n if (this.isAllChecked()) {\n // Preserving `all checked` state\n this.setState({\n checkedItems: newProps.items,\n renderItems: newProps.group ? groupItems(newProps.items) : newProps.items\n });\n this.informAboutChange(newProps.items);\n } else if (this.state.checkedItems.length) {\n // Checking only items that are in the new `items` array\n const checkedItems = newProps.items.filter(item => this.state.checkedItems.find(checkedItem => checkedItem.label === item.label));\n this.setState({\n checkedItems,\n renderItems: newProps.group ? groupItems(newProps.items) : newProps.items\n });\n this.informAboutChange(checkedItems);\n }\n } else if (newProps.checkedItems !== this.props.checkedItems) {\n this.setState({\n checkedItems: newProps.checkedItems\n });\n }\n }\n\n render() {\n const {\n label,\n items,\n renderLabel,\n showAll\n } = this.props;\n const {\n renderItems\n } = this.state; // let renderItems = items\n\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"div\", {\n className: _CheckboxList_css__WEBPACK_IMPORTED_MODULE_3___default.a.container\n }, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"div\", {\n className: _CheckboxList_css__WEBPACK_IMPORTED_MODULE_3___default.a.label\n }, label, \":\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"div\", null, showAll !== false && Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_CheckboxListItem__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n item: ALL_ITEM,\n checked: this.isAllChecked(),\n onChange: this.handleToggleAllCheck\n }, renderLabel), renderItems.map(item => {\n if (item.ui === \"group\") {\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"div\", {\n style: {\n margin: \"10px 0\"\n }\n }, item.label, \" (\", Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"strong\", null, filesize__WEBPACK_IMPORTED_MODULE_1___default()(item[this.props.activeSize])), \")\");\n }\n\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_CheckboxListItem__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n key: item.label,\n item: item,\n checked: this.isItemChecked(item),\n onChange: this.handleItemCheck\n }, renderLabel);\n })));\n }\n\n isItemChecked(item) {\n return this.state.checkedItems.includes(item);\n }\n\n isAllChecked() {\n return this.props.items.length === this.state.checkedItems.length;\n }\n\n informAboutChange(checkedItems) {\n setTimeout(() => this.props.onChange(checkedItems));\n }\n\n}\nCheckboxList.ALL_ITEM = ALL_ITEM;\n\n//# sourceURL=webpack:///./client/components/CheckboxList.jsx?"); /***/ }), /***/ "./client/components/CheckboxListItem.jsx": /*!************************************************!*\ !*** ./client/components/CheckboxListItem.jsx ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CheckboxListItem; });\n/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Checkbox */ \"./client/components/Checkbox.jsx\");\n/* harmony import */ var _CheckboxList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CheckboxList */ \"./client/components/CheckboxList.jsx\");\n/* harmony import */ var _CheckboxList_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CheckboxList.css */ \"./client/components/CheckboxList.css\");\n/* harmony import */ var _CheckboxList_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_CheckboxList_css__WEBPACK_IMPORTED_MODULE_4__);\n\n\n/** @jsx h */\n\n\n\n\nclass CheckboxListItem extends preact__WEBPACK_IMPORTED_MODULE_1__[\"Component\"] {\n constructor(...args) {\n super(...args);\n\n this.handleChange = () => {\n this.props.onChange(this.props.item);\n };\n }\n\n render() {\n return Object(preact__WEBPACK_IMPORTED_MODULE_1__[\"h\"])(\"div\", {\n className: _CheckboxList_css__WEBPACK_IMPORTED_MODULE_4___default.a.item\n }, Object(preact__WEBPACK_IMPORTED_MODULE_1__[\"h\"])(_Checkbox__WEBPACK_IMPORTED_MODULE_2__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, this.props, {\n onChange: this.handleChange\n }), this.renderLabel()));\n }\n\n renderLabel() {\n const {\n children,\n item\n } = this.props;\n\n if (children && children.length) {\n return children[0](item);\n }\n\n return item === _CheckboxList__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ALL_ITEM ? 'All' : item.label;\n }\n\n}\n\n//# sourceURL=webpack:///./client/components/CheckboxListItem.jsx?"); /***/ }), /***/ "./client/components/ContextMenu.css": /*!*******************************************!*\ !*** ./client/components/ContextMenu.css ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--5-1!../../node_modules/postcss-loader/src??ref--5-2!./ContextMenu.css */ \"./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./client/components/ContextMenu.css\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./client/components/ContextMenu.css?"); /***/ }), /***/ "./client/components/ContextMenu.jsx": /*!*******************************************!*\ !*** ./client/components/ContextMenu.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ContextMenu; });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _ContextMenuItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextMenuItem */ \"./client/components/ContextMenuItem.jsx\");\n/* harmony import */ var _lib_PureComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/PureComponent */ \"./client/lib/PureComponent.jsx\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../store */ \"./client/store.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ \"./client/utils.js\");\n/* harmony import */ var _ContextMenu_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ContextMenu.css */ \"./client/components/ContextMenu.css\");\n/* harmony import */ var _ContextMenu_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_ContextMenu_css__WEBPACK_IMPORTED_MODULE_6__);\n/** @jsx h */\n\n\n\n\n\n\n\nclass ContextMenu extends _lib_PureComponent__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\n constructor(...args) {\n super(...args);\n\n this.handleClickHideChunk = () => {\n const {\n chunk: selectedChunk\n } = this.props;\n\n if (selectedChunk && selectedChunk.label) {\n const filteredChunks = _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].selectedChunks.filter(chunk => chunk.label !== selectedChunk.label);\n _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].selectedChunks = filteredChunks;\n }\n\n this.hide();\n };\n\n this.handleClickFilterToChunk = () => {\n const {\n chunk: selectedChunk\n } = this.props;\n\n if (selectedChunk && selectedChunk.label) {\n const filteredChunks = _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].allChunks.filter(chunk => chunk.label === selectedChunk.label);\n _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].selectedChunks = filteredChunks;\n }\n\n this.hide();\n };\n\n this.handleClickShowAllChunks = () => {\n _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].selectedChunks = _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].allChunks;\n this.hide();\n };\n\n this.handleDocumentMousedown = e => {\n const isSecondaryClick = e.ctrlKey || e.button === 2;\n\n if (!isSecondaryClick && Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"elementIsOutside\"])(e.target, this.node)) {\n e.preventDefault();\n e.stopPropagation();\n this.hide();\n }\n };\n\n this.saveNode = node => this.node = node;\n }\n\n componentDidMount() {\n this.boundingRect = this.node.getBoundingClientRect();\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.visible && !prevProps.visible) {\n document.addEventListener('mousedown', this.handleDocumentMousedown, true);\n } else if (prevProps.visible && !this.props.visible) {\n document.removeEventListener('mousedown', this.handleDocumentMousedown, true);\n }\n }\n\n render() {\n const {\n visible\n } = this.props;\n const containerClassName = classnames__WEBPACK_IMPORTED_MODULE_1___default()({\n [_ContextMenu_css__WEBPACK_IMPORTED_MODULE_6___default.a.container]: true,\n [_ContextMenu_css__WEBPACK_IMPORTED_MODULE_6___default.a.hidden]: !visible\n });\n const multipleChunksSelected = _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].selectedChunks.length > 1;\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"ul\", {\n ref: this.saveNode,\n className: containerClassName,\n style: this.getStyle()\n }, Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_ContextMenuItem__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n disabled: !multipleChunksSelected,\n onClick: this.handleClickHideChunk\n }, \"Hide chunk\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_ContextMenuItem__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n disabled: !multipleChunksSelected,\n onClick: this.handleClickFilterToChunk\n }, \"Hide all other chunks\"), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"hr\", null), Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(_ContextMenuItem__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n disabled: _store__WEBPACK_IMPORTED_MODULE_4__[\"store\"].allChunksSelected,\n onClick: this.handleClickShowAllChunks\n }, \"Show all chunks\"));\n }\n\n hide() {\n if (this.props.onHide) {\n this.props.onHide();\n }\n }\n\n getStyle() {\n const {\n boundingRect\n } = this; // Upon the first render of this component, we don't yet know\n // its dimensions, so can't position it yet\n\n if (!boundingRect) return;\n const {\n coords\n } = this.props;\n const pos = {\n left: coords.x,\n top: coords.y\n };\n\n if (pos.left + boundingRect.width > window.innerWidth) {\n // Shifting horizontally\n pos.left = window.innerWidth - boundingRect.width;\n }\n\n if (pos.top + boundingRect.height > window.innerHeight) {\n // Flipping vertically\n pos.top = coords.y - boundingRect.height;\n }\n\n return pos;\n }\n\n}\n\n//# sourceURL=webpack:///./client/components/ContextMenu.jsx?"); /***/ }), /***/ "./client/components/ContextMenuItem.css": /*!***********************************************!*\ !*** ./client/components/ContextMenuItem.css ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--5-1!../../node_modules/postcss-loader/src??ref--5-2!./ContextMenuItem.css */ \"./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./client/components/ContextMenuItem.css\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./client/components/ContextMenuItem.css?"); /***/ }), /***/ "./client/components/ContextMenuItem.jsx": /*!***********************************************!*\ !*** ./client/components/ContextMenuItem.jsx ***! \***********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ContextMenuItem; });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.mjs\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _ContextMenuItem_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextMenuItem.css */ \"./client/components/ContextMenuItem.css\");\n/* harmony import */ var _ContextMenuItem_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_ContextMenuItem_css__WEBPACK_IMPORTED_MODULE_2__);\n/** @jsx h */\n\n\n\n\nfunction noop() {\n return false;\n}\n\nfunction ContextMenuItem({\n children,\n disabled,\n onClick\n}) {\n const className = classnames__WEBPACK_IMPORTED_MODULE_1___default()({\n [_ContextMenuItem_css__WEBPACK_IMPORTED_MODULE_2___default.a.item]: true,\n [_ContextMenuItem_css__WEBPACK_IMPORTED_MODULE_2___default.a.disabled]: disabled\n });\n const handler = disabled ? noop : onClick;\n return Object(preact__WEBPACK_IMPORTED_MODULE_0__[\"h\"])(\"li\", {\n className: className,\n onClick: handler\n }, children);\n}\n\n//# sourceURL=web