@k8slens/extensions 5.3.1-git.02056a6090.0 → 5.3.1-git.0be1ab4ce0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/common/catalog-entities/kubernetes-cluster.d.ts +1 -2
- package/dist/src/common/catalog-entities/web-link.d.ts +0 -2
- package/dist/src/common/hotbar-store.d.ts +16 -11
- package/dist/src/common/hotbar-store.injectable.d.ts +4 -0
- package/dist/src/common/hotbar-types.d.ts +5 -2
- package/dist/src/common/ipc/index.d.ts +1 -0
- package/dist/src/common/k8s-api/endpoints/crd.api.d.ts +29 -28
- package/dist/src/common/vars.d.ts +1 -0
- package/dist/src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api.d.ts +25 -0
- package/dist/src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api.d.ts +24 -0
- package/dist/src/extensions/{registries/command-registry.d.ts → as-legacy-globals-for-extension-api/as-legacy-global-singleton-for-extension-api.d.ts} +8 -16
- package/dist/src/{renderer/components/command-palette/command-overlay.d.ts → extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api.d.ts} +3 -8
- package/dist/src/extensions/extension-api.js +91 -174
- package/dist/src/extensions/lens-renderer-extension.d.ts +2 -1
- package/dist/src/extensions/registries/base-registry.d.ts +1 -1
- package/dist/src/extensions/registries/entity-setting-registry.d.ts +1 -1
- package/dist/src/extensions/registries/index.d.ts +0 -1
- package/dist/src/extensions/renderer-api/components.d.ts +1 -1
- package/dist/src/main/routes/port-forward-route.d.ts +0 -1
- package/dist/src/renderer/api/__tests__/catalog-entity-registry.test.d.ts +1 -1
- package/dist/src/renderer/api/catalog-entity-registry.d.ts +4 -0
- package/dist/src/renderer/api/catalog-entity.d.ts +1 -5
- package/dist/src/{main/catalog-sources → renderer/api}/helpers/general-active-sync.d.ts +0 -0
- package/dist/src/renderer/components/+custom-resources/custom-resources.injectable.d.ts +23 -0
- package/dist/src/renderer/components/+network-port-forwards/port-forward-menu.d.ts +2 -0
- package/dist/src/renderer/components/+network-services/service-port-component.d.ts +1 -0
- package/dist/src/renderer/components/+workloads-pods/pod-container-port.d.ts +1 -0
- package/dist/src/renderer/components/activate-entity-command/activate-entity-command.d.ts +1 -9
- package/dist/src/renderer/components/catalog-entities/weblink-add-command.d.ts +1 -11
- package/dist/src/renderer/components/cluster-manager/active-hotbar-name.d.ts +2 -1
- package/dist/src/renderer/components/command-palette/command-container.d.ts +1 -7
- package/dist/src/renderer/components/command-palette/command-dialog.d.ts +1 -13
- package/dist/src/renderer/components/command-palette/command-overlay.injectable.d.ts +31 -0
- package/dist/src/renderer/components/command-palette/index.d.ts +1 -1
- package/dist/src/renderer/components/command-palette/registered-commands/internal-commands.injectable.d.ts +25 -0
- package/dist/src/renderer/components/command-palette/registered-commands/registered-commands.injectable.d.ts +25 -0
- package/dist/src/renderer/components/dock/terminal.d.ts +1 -1
- package/dist/src/renderer/components/hotbar/hotbar-add-command.d.ts +1 -6
- package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +1 -1
- package/dist/src/renderer/components/hotbar/hotbar-remove-command.d.ts +1 -9
- package/dist/src/renderer/components/hotbar/hotbar-rename-command.d.ts +1 -14
- package/dist/src/renderer/components/hotbar/hotbar-selector.d.ts +3 -3
- package/dist/src/renderer/components/hotbar/hotbar-switch-command.d.ts +1 -12
- package/dist/src/renderer/components/input/input.d.ts +1 -0
- package/dist/src/renderer/components/{+404/not-found.d.ts → input/validators/unique-hotbar-name.injectable.d.ts} +4 -4
- package/dist/src/renderer/components/kube-object-menu/dependencies/hide-details.injectable.d.ts +1 -1
- package/dist/src/renderer/components/menu/menu-actions.d.ts +1 -1
- package/dist/src/renderer/components/monaco-editor/monaco-editor.d.ts +1 -1
- package/dist/src/renderer/components/switch/switcher.d.ts +1 -1
- package/dist/src/renderer/{components/getDi.d.ts → getDi.d.ts} +1 -1
- package/dist/src/renderer/{components/+404/index.d.ts → getDiForUnitTesting.d.ts} +2 -1
- package/dist/src/renderer/initializers/catalog.d.ts +6 -1
- package/dist/src/renderer/initializers/index.d.ts +0 -1
- package/dist/src/renderer/navigation/helpers.d.ts +1 -1
- package/dist/src/renderer/port-forward/port-forward-dialog.d.ts +1 -1
- package/dist/src/renderer/port-forward/port-forward-item.d.ts +4 -4
- package/dist/src/renderer/port-forward/port-forward-notify.d.ts +1 -0
- package/dist/src/renderer/port-forward/port-forward.store.d.ts +56 -6
- package/dist/src/renderer/theme.store.d.ts +0 -1
- package/dist/src/renderer/window/event-listener.injectable.d.ts +25 -0
- package/package.json +1 -1
- package/dist/src/renderer/components/getDiForUnitTesting.d.ts +0 -22
- package/dist/src/renderer/components/hotbar/hotbar-display-label.d.ts +0 -22
- package/dist/src/renderer/initializers/command-registry.d.ts +0 -21
|
@@ -13562,18 +13562,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
13562
13562
|
|
|
13563
13563
|
/***/ }),
|
|
13564
13564
|
|
|
13565
|
-
/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js?!./src/renderer/components/command-palette/command-container.scss":
|
|
13566
|
-
/*!*********************************************************************************************************************************************************************************************************!*\
|
|
13567
|
-
!*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./src/renderer/components/command-palette/command-container.scss ***!
|
|
13568
|
-
\*********************************************************************************************************************************************************************************************************/
|
|
13569
|
-
/*! exports provided: default */
|
|
13570
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
13571
|
-
|
|
13572
|
-
"use strict";
|
|
13573
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.i, \"/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n/**\\n * Copyright (c) 2021 OpenLens Authors\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\\n * this software and associated documentation files (the \\\"Software\\\"), to deal in\\n * the Software without restriction, including without limitation the rights to\\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\\n * the Software, and to permit persons to whom the Software is furnished to do so,\\n * subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n#command-container {\\n position: absolute;\\n top: 20px;\\n left: 0;\\n right: 0;\\n margin-left: auto;\\n margin-right: auto;\\n background-color: var(--layoutBackground);\\n border-radius: 8px;\\n box-shadow: rgba(0, 0, 0, 0.5) 0px 16px 70px;\\n max-width: 640px;\\n color: var(--settingsColor);\\n transition: all 0.3s;\\n}\\n#command-container .Input label {\\n caret-color: var(--blue);\\n color: var(--settingsColor);\\n background: transparent;\\n border: 0;\\n font-size: 18px;\\n padding: 15px 19px;\\n border-bottom: 1px solid var(--borderFaintColor);\\n}\\n#command-container .Input label:focus {\\n box-shadow: none;\\n}\\n#command-container .hint {\\n padding: 8px;\\n display: block;\\n}\\n#command-container .errors {\\n padding: 8px;\\n}\\n#command-container .Select__menu {\\n position: relative;\\n}\\n#command-container .Select__control {\\n padding: var(--padding);\\n box-shadow: none;\\n border-bottom: 1px solid var(--borderFaintColor);\\n caret-color: var(--blue);\\n font-size: 18px;\\n}\\n#command-container .Select__control:focus {\\n box-shadow: none;\\n}\\n#command-container .Select__menu {\\n box-shadow: none;\\n background: transparent;\\n margin: 0;\\n}\\n#command-container .Select__menu-list {\\n padding: 0;\\n}\\n#command-container .Select__option {\\n background-color: transparent;\\n padding: 10px 18px;\\n}\\n#command-container .Select__option:hover {\\n background-color: var(--menuSelectedOptionBgc);\\n border-left: 4px solid var(--blue);\\n padding-left: 14px;\\n}\\n#command-container .Select__option.Select__option--is-focused {\\n background-color: var(--menuSelectedOptionBgc);\\n border-left: 4px solid var(--blue);\\n padding-left: 14px;\\n}\\n#command-container .Select__menu-notice--no-options {\\n padding: 12px;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack:///./src/renderer/components/command-palette/command-container.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ref--7-3");
|
|
13574
|
-
|
|
13575
|
-
/***/ }),
|
|
13576
|
-
|
|
13577
13565
|
/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js?!./src/renderer/components/confirm-dialog/confirm-dialog.scss":
|
|
13578
13566
|
/*!*****************************************************************************************************************************************************************************************************!*\
|
|
13579
13567
|
!*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./src/renderer/components/confirm-dialog/confirm-dialog.scss ***!
|
|
@@ -14180,7 +14168,7 @@ eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation
|
|
|
14180
14168
|
/*! no static exports found */
|
|
14181
14169
|
/***/ (function(module, exports, __webpack_require__) {
|
|
14182
14170
|
|
|
14183
|
-
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\
|
|
14171
|
+
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/common.js?");
|
|
14184
14172
|
|
|
14185
14173
|
/***/ }),
|
|
14186
14174
|
|
|
@@ -15540,7 +15528,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst
|
|
|
15540
15528
|
/***/ (function(module, exports, __webpack_require__) {
|
|
15541
15529
|
|
|
15542
15530
|
"use strict";
|
|
15543
|
-
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CancelError = exports.ParseError = void 0;\nconst core_1 = __webpack_require__(/*! ../core */ \"./node_modules/got/dist/source/core/index.js\");\n/**\nAn error to be thrown when server response code is 2xx, and parsing body fails.\nIncludes a `response` property.\n*/\nclass ParseError extends core_1.RequestError {\n constructor(error, response) {\n const { options } = response.request;\n super(`${error.message} in \"${options.url.toString()}\"`, error, response.request);\n this.name = 'ParseError';\n }\n}\nexports.ParseError = ParseError;\n/**\nAn error to be thrown when the request is aborted with `.cancel()`.\n*/\nclass CancelError extends core_1.RequestError {\n constructor(request) {\n super('Promise was canceled', {}, request);\n this.name = 'CancelError';\n }\n get isCanceled() {\n return true;\n }\n}\nexports.CancelError = CancelError;\n__exportStar(__webpack_require__(/*! ../core */ \"./node_modules/got/dist/source/core/index.js\"), exports);\n\n\n//# sourceURL=webpack:///./node_modules/got/dist/source/as-promise/types.js?");
|
|
15531
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CancelError = exports.ParseError = void 0;\nconst core_1 = __webpack_require__(/*! ../core */ \"./node_modules/got/dist/source/core/index.js\");\n/**\nAn error to be thrown when server response code is 2xx, and parsing body fails.\nIncludes a `response` property.\n*/\nclass ParseError extends core_1.RequestError {\n constructor(error, response) {\n const { options } = response.request;\n super(`${error.message} in \"${options.url.toString()}\"`, error, response.request);\n this.name = 'ParseError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_BODY_PARSE_FAILURE' : this.code;\n }\n}\nexports.ParseError = ParseError;\n/**\nAn error to be thrown when the request is aborted with `.cancel()`.\n*/\nclass CancelError extends core_1.RequestError {\n constructor(request) {\n super('Promise was canceled', {}, request);\n this.name = 'CancelError';\n this.code = 'ERR_CANCELED';\n }\n get isCanceled() {\n return true;\n }\n}\nexports.CancelError = CancelError;\n__exportStar(__webpack_require__(/*! ../core */ \"./node_modules/got/dist/source/core/index.js\"), exports);\n\n\n//# sourceURL=webpack:///./node_modules/got/dist/source/as-promise/types.js?");
|
|
15544
15532
|
|
|
15545
15533
|
/***/ }),
|
|
15546
15534
|
|
|
@@ -15564,7 +15552,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
|
|
|
15564
15552
|
/***/ (function(module, exports, __webpack_require__) {
|
|
15565
15553
|
|
|
15566
15554
|
"use strict";
|
|
15567
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnsupportedProtocolError = exports.ReadError = exports.TimeoutError = exports.UploadError = exports.CacheError = exports.HTTPError = exports.MaxRedirectsError = exports.RequestError = exports.setNonEnumerableProperties = exports.knownHookEvents = exports.withoutBody = exports.kIsNormalizedAlready = void 0;\nconst util_1 = __webpack_require__(/*! util */ \"util\");\nconst stream_1 = __webpack_require__(/*! stream */ \"stream\");\nconst fs_1 = __webpack_require__(/*! fs */ \"fs\");\nconst url_1 = __webpack_require__(/*! url */ \"url\");\nconst http = __webpack_require__(/*! http */ \"http\");\nconst http_1 = __webpack_require__(/*! http */ \"http\");\nconst https = __webpack_require__(/*! https */ \"https\");\nconst http_timer_1 = __webpack_require__(/*! @szmarczak/http-timer */ \"./node_modules/@szmarczak/http-timer/dist/source/index.js\");\nconst cacheable_lookup_1 = __webpack_require__(/*! cacheable-lookup */ \"./node_modules/cacheable-lookup/source/index.js\");\nconst CacheableRequest = __webpack_require__(/*! cacheable-request */ \"./node_modules/cacheable-request/src/index.js\");\nconst decompressResponse = __webpack_require__(/*! decompress-response */ \"./node_modules/decompress-response/index.js\");\n// @ts-expect-error Missing types\nconst http2wrapper = __webpack_require__(/*! http2-wrapper */ \"./node_modules/http2-wrapper/source/index.js\");\nconst lowercaseKeys = __webpack_require__(/*! lowercase-keys */ \"./node_modules/lowercase-keys/index.js\");\nconst is_1 = __webpack_require__(/*! @sindresorhus/is */ \"./node_modules/@sindresorhus/is/dist/index.js\");\nconst get_body_size_1 = __webpack_require__(/*! ./utils/get-body-size */ \"./node_modules/got/dist/source/core/utils/get-body-size.js\");\nconst is_form_data_1 = __webpack_require__(/*! ./utils/is-form-data */ \"./node_modules/got/dist/source/core/utils/is-form-data.js\");\nconst proxy_events_1 = __webpack_require__(/*! ./utils/proxy-events */ \"./node_modules/got/dist/source/core/utils/proxy-events.js\");\nconst timed_out_1 = __webpack_require__(/*! ./utils/timed-out */ \"./node_modules/got/dist/source/core/utils/timed-out.js\");\nconst url_to_options_1 = __webpack_require__(/*! ./utils/url-to-options */ \"./node_modules/got/dist/source/core/utils/url-to-options.js\");\nconst options_to_url_1 = __webpack_require__(/*! ./utils/options-to-url */ \"./node_modules/got/dist/source/core/utils/options-to-url.js\");\nconst weakable_map_1 = __webpack_require__(/*! ./utils/weakable-map */ \"./node_modules/got/dist/source/core/utils/weakable-map.js\");\nconst get_buffer_1 = __webpack_require__(/*! ./utils/get-buffer */ \"./node_modules/got/dist/source/core/utils/get-buffer.js\");\nconst dns_ip_version_1 = __webpack_require__(/*! ./utils/dns-ip-version */ \"./node_modules/got/dist/source/core/utils/dns-ip-version.js\");\nconst is_response_ok_1 = __webpack_require__(/*! ./utils/is-response-ok */ \"./node_modules/got/dist/source/core/utils/is-response-ok.js\");\nconst deprecation_warning_1 = __webpack_require__(/*! ../utils/deprecation-warning */ \"./node_modules/got/dist/source/utils/deprecation-warning.js\");\nconst normalize_arguments_1 = __webpack_require__(/*! ../as-promise/normalize-arguments */ \"./node_modules/got/dist/source/as-promise/normalize-arguments.js\");\nconst calculate_retry_delay_1 = __webpack_require__(/*! ./calculate-retry-delay */ \"./node_modules/got/dist/source/core/calculate-retry-delay.js\");\nlet globalDnsCache;\nconst kRequest = Symbol('request');\nconst kResponse = Symbol('response');\nconst kResponseSize = Symbol('responseSize');\nconst kDownloadedSize = Symbol('downloadedSize');\nconst kBodySize = Symbol('bodySize');\nconst kUploadedSize = Symbol('uploadedSize');\nconst kServerResponsesPiped = Symbol('serverResponsesPiped');\nconst kUnproxyEvents = Symbol('unproxyEvents');\nconst kIsFromCache = Symbol('isFromCache');\nconst kCancelTimeouts = Symbol('cancelTimeouts');\nconst kStartedReading = Symbol('startedReading');\nconst kStopReading = Symbol('stopReading');\nconst kTriggerRead = Symbol('triggerRead');\nconst kBody = Symbol('body');\nconst kJobs = Symbol('jobs');\nconst kOriginalResponse = Symbol('originalResponse');\nconst kRetryTimeout = Symbol('retryTimeout');\nexports.kIsNormalizedAlready = Symbol('isNormalizedAlready');\nconst supportsBrotli = is_1.default.string(process.versions.brotli);\nexports.withoutBody = new Set(['GET', 'HEAD']);\nexports.knownHookEvents = [\n 'init',\n 'beforeRequest',\n 'beforeRedirect',\n 'beforeError',\n 'beforeRetry',\n // Promise-Only\n 'afterResponse'\n];\nfunction validateSearchParameters(searchParameters) {\n // eslint-disable-next-line guard-for-in\n for (const key in searchParameters) {\n const value = searchParameters[key];\n if (!is_1.default.string(value) && !is_1.default.number(value) && !is_1.default.boolean(value) && !is_1.default.null_(value) && !is_1.default.undefined(value)) {\n throw new TypeError(`The \\`searchParams\\` value '${String(value)}' must be a string, number, boolean or null`);\n }\n }\n}\nfunction isClientRequest(clientRequest) {\n return is_1.default.object(clientRequest) && !('statusCode' in clientRequest);\n}\nconst cacheableStore = new weakable_map_1.default();\nconst waitForOpenFile = async (file) => new Promise((resolve, reject) => {\n const onError = (error) => {\n reject(error);\n };\n // Node.js 12 has incomplete types\n if (!file.pending) {\n resolve();\n }\n file.once('error', onError);\n file.once('ready', () => {\n file.off('error', onError);\n resolve();\n });\n});\nconst redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]);\nconst nonEnumerableProperties = [\n 'context',\n 'body',\n 'json',\n 'form'\n];\nexports.setNonEnumerableProperties = (sources, to) => {\n // Non enumerable properties shall not be merged\n const properties = {};\n for (const source of sources) {\n if (!source) {\n continue;\n }\n for (const name of nonEnumerableProperties) {\n if (!(name in source)) {\n continue;\n }\n properties[name] = {\n writable: true,\n configurable: true,\n enumerable: false,\n // @ts-expect-error TS doesn't see the check above\n value: source[name]\n };\n }\n }\n Object.defineProperties(to, properties);\n};\n/**\nAn error to be thrown when a request fails.\nContains a `code` property with error class code, like `ECONNREFUSED`.\n*/\nclass RequestError extends Error {\n constructor(message, error, self) {\n var _a;\n super(message);\n Error.captureStackTrace(this, this.constructor);\n this.name = 'RequestError';\n this.code = error.code;\n if (self instanceof Request) {\n Object.defineProperty(this, 'request', {\n enumerable: false,\n value: self\n });\n Object.defineProperty(this, 'response', {\n enumerable: false,\n value: self[kResponse]\n });\n Object.defineProperty(this, 'options', {\n // This fails because of TS 3.7.2 useDefineForClassFields\n // Ref: https://github.com/microsoft/TypeScript/issues/34972\n enumerable: false,\n value: self.options\n });\n }\n else {\n Object.defineProperty(this, 'options', {\n // This fails because of TS 3.7.2 useDefineForClassFields\n // Ref: https://github.com/microsoft/TypeScript/issues/34972\n enumerable: false,\n value: self\n });\n }\n this.timings = (_a = this.request) === null || _a === void 0 ? void 0 : _a.timings;\n // Recover the original stacktrace\n if (is_1.default.string(error.stack) && is_1.default.string(this.stack)) {\n const indexOfMessage = this.stack.indexOf(this.message) + this.message.length;\n const thisStackTrace = this.stack.slice(indexOfMessage).split('\\n').reverse();\n const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message) + error.message.length).split('\\n').reverse();\n // Remove duplicated traces\n while (errorStackTrace.length !== 0 && errorStackTrace[0] === thisStackTrace[0]) {\n thisStackTrace.shift();\n }\n this.stack = `${this.stack.slice(0, indexOfMessage)}${thisStackTrace.reverse().join('\\n')}${errorStackTrace.reverse().join('\\n')}`;\n }\n }\n}\nexports.RequestError = RequestError;\n/**\nAn error to be thrown when the server redirects you more than ten times.\nIncludes a `response` property.\n*/\nclass MaxRedirectsError extends RequestError {\n constructor(request) {\n super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request);\n this.name = 'MaxRedirectsError';\n }\n}\nexports.MaxRedirectsError = MaxRedirectsError;\n/**\nAn error to be thrown when the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304.\nIncludes a `response` property.\n*/\nclass HTTPError extends RequestError {\n constructor(response) {\n super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request);\n this.name = 'HTTPError';\n }\n}\nexports.HTTPError = HTTPError;\n/**\nAn error to be thrown when a cache method fails.\nFor example, if the database goes down or there's a filesystem error.\n*/\nclass CacheError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'CacheError';\n }\n}\nexports.CacheError = CacheError;\n/**\nAn error to be thrown when the request body is a stream and an error occurs while reading from that stream.\n*/\nclass UploadError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'UploadError';\n }\n}\nexports.UploadError = UploadError;\n/**\nAn error to be thrown when the request is aborted due to a timeout.\nIncludes an `event` and `timings` property.\n*/\nclass TimeoutError extends RequestError {\n constructor(error, timings, request) {\n super(error.message, error, request);\n this.name = 'TimeoutError';\n this.event = error.event;\n this.timings = timings;\n }\n}\nexports.TimeoutError = TimeoutError;\n/**\nAn error to be thrown when reading from response stream fails.\n*/\nclass ReadError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'ReadError';\n }\n}\nexports.ReadError = ReadError;\n/**\nAn error to be thrown when given an unsupported protocol.\n*/\nclass UnsupportedProtocolError extends RequestError {\n constructor(options) {\n super(`Unsupported protocol \"${options.url.protocol}\"`, {}, options);\n this.name = 'UnsupportedProtocolError';\n }\n}\nexports.UnsupportedProtocolError = UnsupportedProtocolError;\nconst proxiedRequestEvents = [\n 'socket',\n 'connect',\n 'continue',\n 'information',\n 'upgrade',\n 'timeout'\n];\nclass Request extends stream_1.Duplex {\n constructor(url, options = {}, defaults) {\n super({\n // This must be false, to enable throwing after destroy\n // It is used for retry logic in Promise API\n autoDestroy: false,\n // It needs to be zero because we're just proxying the data to another stream\n highWaterMark: 0\n });\n this[kDownloadedSize] = 0;\n this[kUploadedSize] = 0;\n this.requestInitialized = false;\n this[kServerResponsesPiped] = new Set();\n this.redirects = [];\n this[kStopReading] = false;\n this[kTriggerRead] = false;\n this[kJobs] = [];\n this.retryCount = 0;\n // TODO: Remove this when targeting Node.js >= 12\n this._progressCallbacks = [];\n const unlockWrite = () => this._unlockWrite();\n const lockWrite = () => this._lockWrite();\n this.on('pipe', (source) => {\n source.prependListener('data', unlockWrite);\n source.on('data', lockWrite);\n source.prependListener('end', unlockWrite);\n source.on('end', lockWrite);\n });\n this.on('unpipe', (source) => {\n source.off('data', unlockWrite);\n source.off('data', lockWrite);\n source.off('end', unlockWrite);\n source.off('end', lockWrite);\n });\n this.on('pipe', source => {\n if (source instanceof http_1.IncomingMessage) {\n this.options.headers = {\n ...source.headers,\n ...this.options.headers\n };\n }\n });\n const { json, body, form } = options;\n if (json || body || form) {\n this._lockWrite();\n }\n if (exports.kIsNormalizedAlready in options) {\n this.options = options;\n }\n else {\n try {\n // @ts-expect-error Common TypeScript bug saying that `this.constructor` is not accessible\n this.options = this.constructor.normalizeArguments(url, options, defaults);\n }\n catch (error) {\n // TODO: Move this to `_destroy()`\n if (is_1.default.nodeStream(options.body)) {\n options.body.destroy();\n }\n this.destroy(error);\n return;\n }\n }\n (async () => {\n var _a;\n try {\n if (this.options.body instanceof fs_1.ReadStream) {\n await waitForOpenFile(this.options.body);\n }\n const { url: normalizedURL } = this.options;\n if (!normalizedURL) {\n throw new TypeError('Missing `url` property');\n }\n this.requestUrl = normalizedURL.toString();\n decodeURI(this.requestUrl);\n await this._finalizeBody();\n await this._makeRequest();\n if (this.destroyed) {\n (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroy();\n return;\n }\n // Queued writes etc.\n for (const job of this[kJobs]) {\n job();\n }\n // Prevent memory leak\n this[kJobs].length = 0;\n this.requestInitialized = true;\n }\n catch (error) {\n if (error instanceof RequestError) {\n this._beforeError(error);\n return;\n }\n // This is a workaround for https://github.com/nodejs/node/issues/33335\n if (!this.destroyed) {\n this.destroy(error);\n }\n }\n })();\n }\n static normalizeArguments(url, options, defaults) {\n var _a, _b, _c, _d, _e;\n const rawOptions = options;\n if (is_1.default.object(url) && !is_1.default.urlInstance(url)) {\n options = { ...defaults, ...url, ...options };\n }\n else {\n if (url && options && options.url !== undefined) {\n throw new TypeError('The `url` option is mutually exclusive with the `input` argument');\n }\n options = { ...defaults, ...options };\n if (url !== undefined) {\n options.url = url;\n }\n if (is_1.default.urlInstance(options.url)) {\n options.url = new url_1.URL(options.url.toString());\n }\n }\n // TODO: Deprecate URL options in Got 12.\n // Support extend-specific options\n if (options.cache === false) {\n options.cache = undefined;\n }\n if (options.dnsCache === false) {\n options.dnsCache = undefined;\n }\n // Nice type assertions\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.method);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.headers);\n is_1.assert.any([is_1.default.string, is_1.default.urlInstance, is_1.default.undefined], options.prefixUrl);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cookieJar);\n is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.searchParams);\n is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.cache);\n is_1.assert.any([is_1.default.object, is_1.default.number, is_1.default.undefined], options.timeout);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.context);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.hooks);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.decompress);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.ignoreInvalidCookies);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.followRedirect);\n is_1.assert.any([is_1.default.number, is_1.default.undefined], options.maxRedirects);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.throwHttpErrors);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.http2);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.allowGetBody);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.localAddress);\n is_1.assert.any([dns_ip_version_1.isDnsLookupIpVersion, is_1.default.undefined], options.dnsLookupIpVersion);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.https);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.rejectUnauthorized);\n if (options.https) {\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.https.rejectUnauthorized);\n is_1.assert.any([is_1.default.function_, is_1.default.undefined], options.https.checkServerIdentity);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificateAuthority);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.key);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificate);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.https.passphrase);\n is_1.assert.any([is_1.default.string, is_1.default.buffer, is_1.default.array, is_1.default.undefined], options.https.pfx);\n }\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cacheOptions);\n // `options.method`\n if (is_1.default.string(options.method)) {\n options.method = options.method.toUpperCase();\n }\n else {\n options.method = 'GET';\n }\n // `options.headers`\n if (options.headers === (defaults === null || defaults === void 0 ? void 0 : defaults.headers)) {\n options.headers = { ...options.headers };\n }\n else {\n options.headers = lowercaseKeys({ ...(defaults === null || defaults === void 0 ? void 0 : defaults.headers), ...options.headers });\n }\n // Disallow legacy `url.Url`\n if ('slashes' in options) {\n throw new TypeError('The legacy `url.Url` has been deprecated. Use `URL` instead.');\n }\n // `options.auth`\n if ('auth' in options) {\n throw new TypeError('Parameter `auth` is deprecated. Use `username` / `password` instead.');\n }\n // `options.searchParams`\n if ('searchParams' in options) {\n if (options.searchParams && options.searchParams !== (defaults === null || defaults === void 0 ? void 0 : defaults.searchParams)) {\n let searchParameters;\n if (is_1.default.string(options.searchParams) || (options.searchParams instanceof url_1.URLSearchParams)) {\n searchParameters = new url_1.URLSearchParams(options.searchParams);\n }\n else {\n validateSearchParameters(options.searchParams);\n searchParameters = new url_1.URLSearchParams();\n // eslint-disable-next-line guard-for-in\n for (const key in options.searchParams) {\n const value = options.searchParams[key];\n if (value === null) {\n searchParameters.append(key, '');\n }\n else if (value !== undefined) {\n searchParameters.append(key, value);\n }\n }\n }\n // `normalizeArguments()` is also used to merge options\n (_a = defaults === null || defaults === void 0 ? void 0 : defaults.searchParams) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {\n // Only use default if one isn't already defined\n if (!searchParameters.has(key)) {\n searchParameters.append(key, value);\n }\n });\n options.searchParams = searchParameters;\n }\n }\n // `options.username` & `options.password`\n options.username = (_b = options.username) !== null && _b !== void 0 ? _b : '';\n options.password = (_c = options.password) !== null && _c !== void 0 ? _c : '';\n // `options.prefixUrl` & `options.url`\n if (is_1.default.undefined(options.prefixUrl)) {\n options.prefixUrl = (_d = defaults === null || defaults === void 0 ? void 0 : defaults.prefixUrl) !== null && _d !== void 0 ? _d : '';\n }\n else {\n options.prefixUrl = options.prefixUrl.toString();\n if (options.prefixUrl !== '' && !options.prefixUrl.endsWith('/')) {\n options.prefixUrl += '/';\n }\n }\n if (is_1.default.string(options.url)) {\n if (options.url.startsWith('/')) {\n throw new Error('`input` must not start with a slash when using `prefixUrl`');\n }\n options.url = options_to_url_1.default(options.prefixUrl + options.url, options);\n }\n else if ((is_1.default.undefined(options.url) && options.prefixUrl !== '') || options.protocol) {\n options.url = options_to_url_1.default(options.prefixUrl, options);\n }\n if (options.url) {\n if ('port' in options) {\n delete options.port;\n }\n // Make it possible to change `options.prefixUrl`\n let { prefixUrl } = options;\n Object.defineProperty(options, 'prefixUrl', {\n set: (value) => {\n const url = options.url;\n if (!url.href.startsWith(value)) {\n throw new Error(`Cannot change \\`prefixUrl\\` from ${prefixUrl} to ${value}: ${url.href}`);\n }\n options.url = new url_1.URL(value + url.href.slice(prefixUrl.length));\n prefixUrl = value;\n },\n get: () => prefixUrl\n });\n // Support UNIX sockets\n let { protocol } = options.url;\n if (protocol === 'unix:') {\n protocol = 'http:';\n options.url = new url_1.URL(`http://unix${options.url.pathname}${options.url.search}`);\n }\n // Set search params\n if (options.searchParams) {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n options.url.search = options.searchParams.toString();\n }\n // Protocol check\n if (protocol !== 'http:' && protocol !== 'https:') {\n throw new UnsupportedProtocolError(options);\n }\n // Update `username`\n if (options.username === '') {\n options.username = options.url.username;\n }\n else {\n options.url.username = options.username;\n }\n // Update `password`\n if (options.password === '') {\n options.password = options.url.password;\n }\n else {\n options.url.password = options.password;\n }\n }\n // `options.cookieJar`\n const { cookieJar } = options;\n if (cookieJar) {\n let { setCookie, getCookieString } = cookieJar;\n is_1.assert.function_(setCookie);\n is_1.assert.function_(getCookieString);\n /* istanbul ignore next: Horrible `tough-cookie` v3 check */\n if (setCookie.length === 4 && getCookieString.length === 0) {\n setCookie = util_1.promisify(setCookie.bind(options.cookieJar));\n getCookieString = util_1.promisify(getCookieString.bind(options.cookieJar));\n options.cookieJar = {\n setCookie,\n getCookieString: getCookieString\n };\n }\n }\n // `options.cache`\n const { cache } = options;\n if (cache) {\n if (!cacheableStore.has(cache)) {\n cacheableStore.set(cache, new CacheableRequest(((requestOptions, handler) => {\n const result = requestOptions[kRequest](requestOptions, handler);\n // TODO: remove this when `cacheable-request` supports async request functions.\n if (is_1.default.promise(result)) {\n // @ts-expect-error\n // We only need to implement the error handler in order to support HTTP2 caching.\n // The result will be a promise anyway.\n result.once = (event, handler) => {\n if (event === 'error') {\n result.catch(handler);\n }\n else if (event === 'abort') {\n // The empty catch is needed here in case when\n // it rejects before it's `await`ed in `_makeRequest`.\n (async () => {\n try {\n const request = (await result);\n request.once('abort', handler);\n }\n catch (_a) { }\n })();\n }\n else {\n /* istanbul ignore next: safety check */\n throw new Error(`Unknown HTTP2 promise event: ${event}`);\n }\n return result;\n };\n }\n return result;\n }), cache));\n }\n }\n // `options.cacheOptions`\n options.cacheOptions = { ...options.cacheOptions };\n // `options.dnsCache`\n if (options.dnsCache === true) {\n if (!globalDnsCache) {\n globalDnsCache = new cacheable_lookup_1.default();\n }\n options.dnsCache = globalDnsCache;\n }\n else if (!is_1.default.undefined(options.dnsCache) && !options.dnsCache.lookup) {\n throw new TypeError(`Parameter \\`dnsCache\\` must be a CacheableLookup instance or a boolean, got ${is_1.default(options.dnsCache)}`);\n }\n // `options.timeout`\n if (is_1.default.number(options.timeout)) {\n options.timeout = { request: options.timeout };\n }\n else if (defaults && options.timeout !== defaults.timeout) {\n options.timeout = {\n ...defaults.timeout,\n ...options.timeout\n };\n }\n else {\n options.timeout = { ...options.timeout };\n }\n // `options.context`\n if (!options.context) {\n options.context = {};\n }\n // `options.hooks`\n const areHooksDefault = options.hooks === (defaults === null || defaults === void 0 ? void 0 : defaults.hooks);\n options.hooks = { ...options.hooks };\n for (const event of exports.knownHookEvents) {\n if (event in options.hooks) {\n if (is_1.default.array(options.hooks[event])) {\n // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044\n options.hooks[event] = [...options.hooks[event]];\n }\n else {\n throw new TypeError(`Parameter \\`${event}\\` must be an Array, got ${is_1.default(options.hooks[event])}`);\n }\n }\n else {\n options.hooks[event] = [];\n }\n }\n if (defaults && !areHooksDefault) {\n for (const event of exports.knownHookEvents) {\n const defaultHooks = defaults.hooks[event];\n if (defaultHooks.length > 0) {\n // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044\n options.hooks[event] = [\n ...defaults.hooks[event],\n ...options.hooks[event]\n ];\n }\n }\n }\n // DNS options\n if ('family' in options) {\n deprecation_warning_1.default('\"options.family\" was never documented, please use \"options.dnsLookupIpVersion\"');\n }\n // HTTPS options\n if (defaults === null || defaults === void 0 ? void 0 : defaults.https) {\n options.https = { ...defaults.https, ...options.https };\n }\n if ('rejectUnauthorized' in options) {\n deprecation_warning_1.default('\"options.rejectUnauthorized\" is now deprecated, please use \"options.https.rejectUnauthorized\"');\n }\n if ('checkServerIdentity' in options) {\n deprecation_warning_1.default('\"options.checkServerIdentity\" was never documented, please use \"options.https.checkServerIdentity\"');\n }\n if ('ca' in options) {\n deprecation_warning_1.default('\"options.ca\" was never documented, please use \"options.https.certificateAuthority\"');\n }\n if ('key' in options) {\n deprecation_warning_1.default('\"options.key\" was never documented, please use \"options.https.key\"');\n }\n if ('cert' in options) {\n deprecation_warning_1.default('\"options.cert\" was never documented, please use \"options.https.certificate\"');\n }\n if ('passphrase' in options) {\n deprecation_warning_1.default('\"options.passphrase\" was never documented, please use \"options.https.passphrase\"');\n }\n if ('pfx' in options) {\n deprecation_warning_1.default('\"options.pfx\" was never documented, please use \"options.https.pfx\"');\n }\n // Other options\n if ('followRedirects' in options) {\n throw new TypeError('The `followRedirects` option does not exist. Use `followRedirect` instead.');\n }\n if (options.agent) {\n for (const key in options.agent) {\n if (key !== 'http' && key !== 'https' && key !== 'http2') {\n throw new TypeError(`Expected the \\`options.agent\\` properties to be \\`http\\`, \\`https\\` or \\`http2\\`, got \\`${key}\\``);\n }\n }\n }\n options.maxRedirects = (_e = options.maxRedirects) !== null && _e !== void 0 ? _e : 0;\n // Set non-enumerable properties\n exports.setNonEnumerableProperties([defaults, rawOptions], options);\n return normalize_arguments_1.default(options, defaults);\n }\n _lockWrite() {\n const onLockedWrite = () => {\n throw new TypeError('The payload has been already provided');\n };\n this.write = onLockedWrite;\n this.end = onLockedWrite;\n }\n _unlockWrite() {\n this.write = super.write;\n this.end = super.end;\n }\n async _finalizeBody() {\n const { options } = this;\n const { headers } = options;\n const isForm = !is_1.default.undefined(options.form);\n const isJSON = !is_1.default.undefined(options.json);\n const isBody = !is_1.default.undefined(options.body);\n const hasPayload = isForm || isJSON || isBody;\n const cannotHaveBody = exports.withoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody);\n this._cannotHaveBody = cannotHaveBody;\n if (hasPayload) {\n if (cannotHaveBody) {\n throw new TypeError(`The \\`${options.method}\\` method cannot be used with a body`);\n }\n if ([isBody, isForm, isJSON].filter(isTrue => isTrue).length > 1) {\n throw new TypeError('The `body`, `json` and `form` options are mutually exclusive');\n }\n if (isBody &&\n !(options.body instanceof stream_1.Readable) &&\n !is_1.default.string(options.body) &&\n !is_1.default.buffer(options.body) &&\n !is_form_data_1.default(options.body)) {\n throw new TypeError('The `body` option must be a stream.Readable, string or Buffer');\n }\n if (isForm && !is_1.default.object(options.form)) {\n throw new TypeError('The `form` option must be an Object');\n }\n {\n // Serialize body\n const noContentType = !is_1.default.string(headers['content-type']);\n if (isBody) {\n // Special case for https://github.com/form-data/form-data\n if (is_form_data_1.default(options.body) && noContentType) {\n headers['content-type'] = `multipart/form-data; boundary=${options.body.getBoundary()}`;\n }\n this[kBody] = options.body;\n }\n else if (isForm) {\n if (noContentType) {\n headers['content-type'] = 'application/x-www-form-urlencoded';\n }\n this[kBody] = (new url_1.URLSearchParams(options.form)).toString();\n }\n else {\n if (noContentType) {\n headers['content-type'] = 'application/json';\n }\n this[kBody] = options.stringifyJson(options.json);\n }\n const uploadBodySize = await get_body_size_1.default(this[kBody], options.headers);\n // See https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body. For example, a Content-Length header\n // field is normally sent in a POST request even when the value is 0\n // (indicating an empty payload body). A user agent SHOULD NOT send a\n // Content-Length header field when the request message does not contain\n // a payload body and the method semantics do not anticipate such a\n // body.\n if (is_1.default.undefined(headers['content-length']) && is_1.default.undefined(headers['transfer-encoding'])) {\n if (!cannotHaveBody && !is_1.default.undefined(uploadBodySize)) {\n headers['content-length'] = String(uploadBodySize);\n }\n }\n }\n }\n else if (cannotHaveBody) {\n this._lockWrite();\n }\n else {\n this._unlockWrite();\n }\n this[kBodySize] = Number(headers['content-length']) || undefined;\n }\n async _onResponseBase(response) {\n const { options } = this;\n const { url } = options;\n this[kOriginalResponse] = response;\n if (options.decompress) {\n response = decompressResponse(response);\n }\n const statusCode = response.statusCode;\n const typedResponse = response;\n typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : http.STATUS_CODES[statusCode];\n typedResponse.url = options.url.toString();\n typedResponse.requestUrl = this.requestUrl;\n typedResponse.redirectUrls = this.redirects;\n typedResponse.request = this;\n typedResponse.isFromCache = response.fromCache || false;\n typedResponse.ip = this.ip;\n typedResponse.retryCount = this.retryCount;\n this[kIsFromCache] = typedResponse.isFromCache;\n this[kResponseSize] = Number(response.headers['content-length']) || undefined;\n this[kResponse] = response;\n response.once('end', () => {\n this[kResponseSize] = this[kDownloadedSize];\n this.emit('downloadProgress', this.downloadProgress);\n });\n response.once('error', (error) => {\n // Force clean-up, because some packages don't do this.\n // TODO: Fix decompress-response\n response.destroy();\n this._beforeError(new ReadError(error, this));\n });\n response.once('aborted', () => {\n this._beforeError(new ReadError({\n name: 'Error',\n message: 'The server aborted pending request',\n code: 'ECONNRESET'\n }, this));\n });\n this.emit('downloadProgress', this.downloadProgress);\n const rawCookies = response.headers['set-cookie'];\n if (is_1.default.object(options.cookieJar) && rawCookies) {\n let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString()));\n if (options.ignoreInvalidCookies) {\n promises = promises.map(async (p) => p.catch(() => { }));\n }\n try {\n await Promise.all(promises);\n }\n catch (error) {\n this._beforeError(error);\n return;\n }\n }\n if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) {\n // We're being redirected, we don't care about the response.\n // It'd be best to abort the request, but we can't because\n // we would have to sacrifice the TCP connection. We don't want that.\n response.resume();\n if (this[kRequest]) {\n this[kCancelTimeouts]();\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this[kRequest];\n this[kUnproxyEvents]();\n }\n const shouldBeGet = statusCode === 303 && options.method !== 'GET' && options.method !== 'HEAD';\n if (shouldBeGet || !options.methodRewriting) {\n // Server responded with \"see other\", indicating that the resource exists at another location,\n // and the client should request it from that location via GET or HEAD.\n options.method = 'GET';\n if ('body' in options) {\n delete options.body;\n }\n if ('json' in options) {\n delete options.json;\n }\n if ('form' in options) {\n delete options.form;\n }\n this[kBody] = undefined;\n delete options.headers['content-length'];\n }\n if (this.redirects.length >= options.maxRedirects) {\n this._beforeError(new MaxRedirectsError(this));\n return;\n }\n try {\n // Do not remove. See https://github.com/sindresorhus/got/pull/214\n const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();\n // Handles invalid URLs. See https://github.com/sindresorhus/got/issues/604\n const redirectUrl = new url_1.URL(redirectBuffer, url);\n const redirectString = redirectUrl.toString();\n decodeURI(redirectString);\n // Redirecting to a different site, clear sensitive data.\n if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {\n if ('host' in options.headers) {\n delete options.headers.host;\n }\n if ('cookie' in options.headers) {\n delete options.headers.cookie;\n }\n if ('authorization' in options.headers) {\n delete options.headers.authorization;\n }\n if (options.username || options.password) {\n options.username = '';\n options.password = '';\n }\n }\n else {\n redirectUrl.username = options.username;\n redirectUrl.password = options.password;\n }\n this.redirects.push(redirectString);\n options.url = redirectUrl;\n for (const hook of options.hooks.beforeRedirect) {\n // eslint-disable-next-line no-await-in-loop\n await hook(options, typedResponse);\n }\n this.emit('redirect', typedResponse, options);\n await this._makeRequest();\n }\n catch (error) {\n this._beforeError(error);\n return;\n }\n return;\n }\n if (options.isStream && options.throwHttpErrors && !is_response_ok_1.isResponseOk(typedResponse)) {\n this._beforeError(new HTTPError(typedResponse));\n return;\n }\n response.on('readable', () => {\n if (this[kTriggerRead]) {\n this._read();\n }\n });\n this.on('resume', () => {\n response.resume();\n });\n this.on('pause', () => {\n response.pause();\n });\n response.once('end', () => {\n this.push(null);\n });\n this.emit('response', response);\n for (const destination of this[kServerResponsesPiped]) {\n if (destination.headersSent) {\n continue;\n }\n // eslint-disable-next-line guard-for-in\n for (const key in response.headers) {\n const isAllowed = options.decompress ? key !== 'content-encoding' : true;\n const value = response.headers[key];\n if (isAllowed) {\n destination.setHeader(key, value);\n }\n }\n destination.statusCode = statusCode;\n }\n }\n async _onResponse(response) {\n try {\n await this._onResponseBase(response);\n }\n catch (error) {\n /* istanbul ignore next: better safe than sorry */\n this._beforeError(error);\n }\n }\n _onRequest(request) {\n const { options } = this;\n const { timeout, url } = options;\n http_timer_1.default(request);\n this[kCancelTimeouts] = timed_out_1.default(request, timeout, url);\n const responseEventName = options.cache ? 'cacheableResponse' : 'response';\n request.once(responseEventName, (response) => {\n void this._onResponse(response);\n });\n request.once('error', (error) => {\n var _a;\n // Force clean-up, because some packages (e.g. nock) don't do this.\n request.destroy();\n // Node.js <= 12.18.2 mistakenly emits the response `end` first.\n (_a = request.res) === null || _a === void 0 ? void 0 : _a.removeAllListeners('end');\n error = error instanceof timed_out_1.TimeoutError ? new TimeoutError(error, this.timings, this) : new RequestError(error.message, error, this);\n this._beforeError(error);\n });\n this[kUnproxyEvents] = proxy_events_1.default(request, this, proxiedRequestEvents);\n this[kRequest] = request;\n this.emit('uploadProgress', this.uploadProgress);\n // Send body\n const body = this[kBody];\n const currentRequest = this.redirects.length === 0 ? this : request;\n if (is_1.default.nodeStream(body)) {\n body.pipe(currentRequest);\n body.once('error', (error) => {\n this._beforeError(new UploadError(error, this));\n });\n }\n else {\n this._unlockWrite();\n if (!is_1.default.undefined(body)) {\n this._writeRequest(body, undefined, () => { });\n currentRequest.end();\n this._lockWrite();\n }\n else if (this._cannotHaveBody || this._noPipe) {\n currentRequest.end();\n this._lockWrite();\n }\n }\n this.emit('request', request);\n }\n async _createCacheableRequest(url, options) {\n return new Promise((resolve, reject) => {\n // TODO: Remove `utils/url-to-options.ts` when `cacheable-request` is fixed\n Object.assign(options, url_to_options_1.default(url));\n // `http-cache-semantics` checks this\n // TODO: Fix this ignore.\n // @ts-expect-error\n delete options.url;\n let request;\n // This is ugly\n const cacheRequest = cacheableStore.get(options.cache)(options, async (response) => {\n // TODO: Fix `cacheable-response`\n response._readableState.autoDestroy = false;\n if (request) {\n (await request).emit('cacheableResponse', response);\n }\n resolve(response);\n });\n // Restore options\n options.url = url;\n cacheRequest.once('error', reject);\n cacheRequest.once('request', async (requestOrPromise) => {\n request = requestOrPromise;\n resolve(request);\n });\n });\n }\n async _makeRequest() {\n var _a, _b, _c, _d, _e;\n const { options } = this;\n const { headers } = options;\n for (const key in headers) {\n if (is_1.default.undefined(headers[key])) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete headers[key];\n }\n else if (is_1.default.null_(headers[key])) {\n throw new TypeError(`Use \\`undefined\\` instead of \\`null\\` to delete the \\`${key}\\` header`);\n }\n }\n if (options.decompress && is_1.default.undefined(headers['accept-encoding'])) {\n headers['accept-encoding'] = supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate';\n }\n // Set cookies\n if (options.cookieJar) {\n const cookieString = await options.cookieJar.getCookieString(options.url.toString());\n if (is_1.default.nonEmptyString(cookieString)) {\n options.headers.cookie = cookieString;\n }\n }\n for (const hook of options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(options);\n if (!is_1.default.undefined(result)) {\n // @ts-expect-error Skip the type mismatch to support abstract responses\n options.request = () => result;\n break;\n }\n }\n if (options.body && this[kBody] !== options.body) {\n this[kBody] = options.body;\n }\n const { agent, request, timeout, url } = options;\n if (options.dnsCache && !('lookup' in options)) {\n options.lookup = options.dnsCache.lookup;\n }\n // UNIX sockets\n if (url.hostname === 'unix') {\n const matches = /(?<socketPath>.+?):(?<path>.+)/.exec(`${url.pathname}${url.search}`);\n if (matches === null || matches === void 0 ? void 0 : matches.groups) {\n const { socketPath, path } = matches.groups;\n Object.assign(options, {\n socketPath,\n path,\n host: ''\n });\n }\n }\n const isHttps = url.protocol === 'https:';\n // Fallback function\n let fallbackFn;\n if (options.http2) {\n fallbackFn = http2wrapper.auto;\n }\n else {\n fallbackFn = isHttps ? https.request : http.request;\n }\n const realFn = (_a = options.request) !== null && _a !== void 0 ? _a : fallbackFn;\n // Cache support\n const fn = options.cache ? this._createCacheableRequest : realFn;\n // Pass an agent directly when HTTP2 is disabled\n if (agent && !options.http2) {\n options.agent = agent[isHttps ? 'https' : 'http'];\n }\n // Prepare plain HTTP request options\n options[kRequest] = realFn;\n delete options.request;\n // TODO: Fix this ignore.\n // @ts-expect-error\n delete options.timeout;\n const requestOptions = options;\n requestOptions.shared = (_b = options.cacheOptions) === null || _b === void 0 ? void 0 : _b.shared;\n requestOptions.cacheHeuristic = (_c = options.cacheOptions) === null || _c === void 0 ? void 0 : _c.cacheHeuristic;\n requestOptions.immutableMinTimeToLive = (_d = options.cacheOptions) === null || _d === void 0 ? void 0 : _d.immutableMinTimeToLive;\n requestOptions.ignoreCargoCult = (_e = options.cacheOptions) === null || _e === void 0 ? void 0 : _e.ignoreCargoCult;\n // If `dnsLookupIpVersion` is not present do not override `family`\n if (options.dnsLookupIpVersion !== undefined) {\n try {\n requestOptions.family = dns_ip_version_1.dnsLookupIpVersionToFamily(options.dnsLookupIpVersion);\n }\n catch (_f) {\n throw new Error('Invalid `dnsLookupIpVersion` option value');\n }\n }\n // HTTPS options remapping\n if (options.https) {\n if ('rejectUnauthorized' in options.https) {\n requestOptions.rejectUnauthorized = options.https.rejectUnauthorized;\n }\n if (options.https.checkServerIdentity) {\n requestOptions.checkServerIdentity = options.https.checkServerIdentity;\n }\n if (options.https.certificateAuthority) {\n requestOptions.ca = options.https.certificateAuthority;\n }\n if (options.https.certificate) {\n requestOptions.cert = options.https.certificate;\n }\n if (options.https.key) {\n requestOptions.key = options.https.key;\n }\n if (options.https.passphrase) {\n requestOptions.passphrase = options.https.passphrase;\n }\n if (options.https.pfx) {\n requestOptions.pfx = options.https.pfx;\n }\n }\n try {\n let requestOrResponse = await fn(url, requestOptions);\n if (is_1.default.undefined(requestOrResponse)) {\n requestOrResponse = fallbackFn(url, requestOptions);\n }\n // Restore options\n options.request = request;\n options.timeout = timeout;\n options.agent = agent;\n // HTTPS options restore\n if (options.https) {\n if ('rejectUnauthorized' in options.https) {\n delete requestOptions.rejectUnauthorized;\n }\n if (options.https.checkServerIdentity) {\n // @ts-expect-error - This one will be removed when we remove the alias.\n delete requestOptions.checkServerIdentity;\n }\n if (options.https.certificateAuthority) {\n delete requestOptions.ca;\n }\n if (options.https.certificate) {\n delete requestOptions.cert;\n }\n if (options.https.key) {\n delete requestOptions.key;\n }\n if (options.https.passphrase) {\n delete requestOptions.passphrase;\n }\n if (options.https.pfx) {\n delete requestOptions.pfx;\n }\n }\n if (isClientRequest(requestOrResponse)) {\n this._onRequest(requestOrResponse);\n // Emit the response after the stream has been ended\n }\n else if (this.writable) {\n this.once('finish', () => {\n void this._onResponse(requestOrResponse);\n });\n this._unlockWrite();\n this.end();\n this._lockWrite();\n }\n else {\n void this._onResponse(requestOrResponse);\n }\n }\n catch (error) {\n if (error instanceof CacheableRequest.CacheError) {\n throw new CacheError(error, this);\n }\n throw new RequestError(error.message, error, this);\n }\n }\n async _error(error) {\n try {\n for (const hook of this.options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n }\n catch (error_) {\n error = new RequestError(error_.message, error_, this);\n }\n this.destroy(error);\n }\n _beforeError(error) {\n if (this[kStopReading]) {\n return;\n }\n const { options } = this;\n const retryCount = this.retryCount + 1;\n this[kStopReading] = true;\n if (!(error instanceof RequestError)) {\n error = new RequestError(error.message, error, this);\n }\n const typedError = error;\n const { response } = typedError;\n void (async () => {\n if (response && !response.body) {\n response.setEncoding(this._readableState.encoding);\n try {\n response.rawBody = await get_buffer_1.default(response);\n response.body = response.rawBody.toString();\n }\n catch (_a) { }\n }\n if (this.listenerCount('retry') !== 0) {\n let backoff;\n try {\n let retryAfter;\n if (response && 'retry-after' in response.headers) {\n retryAfter = Number(response.headers['retry-after']);\n if (Number.isNaN(retryAfter)) {\n retryAfter = Date.parse(response.headers['retry-after']) - Date.now();\n if (retryAfter <= 0) {\n retryAfter = 1;\n }\n }\n else {\n retryAfter *= 1000;\n }\n }\n backoff = await options.retry.calculateDelay({\n attemptCount: retryCount,\n retryOptions: options.retry,\n error: typedError,\n retryAfter,\n computedValue: calculate_retry_delay_1.default({\n attemptCount: retryCount,\n retryOptions: options.retry,\n error: typedError,\n retryAfter,\n computedValue: 0\n })\n });\n }\n catch (error_) {\n void this._error(new RequestError(error_.message, error_, this));\n return;\n }\n if (backoff) {\n const retry = async () => {\n try {\n for (const hook of this.options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n await hook(this.options, typedError, retryCount);\n }\n }\n catch (error_) {\n void this._error(new RequestError(error_.message, error, this));\n return;\n }\n // Something forced us to abort the retry\n if (this.destroyed) {\n return;\n }\n this.destroy();\n this.emit('retry', retryCount, error);\n };\n this[kRetryTimeout] = setTimeout(retry, backoff);\n return;\n }\n }\n void this._error(typedError);\n })();\n }\n _read() {\n this[kTriggerRead] = true;\n const response = this[kResponse];\n if (response && !this[kStopReading]) {\n // We cannot put this in the `if` above\n // because `.read()` also triggers the `end` event\n if (response.readableLength) {\n this[kTriggerRead] = false;\n }\n let data;\n while ((data = response.read()) !== null) {\n this[kDownloadedSize] += data.length;\n this[kStartedReading] = true;\n const progress = this.downloadProgress;\n if (progress.percent < 1) {\n this.emit('downloadProgress', progress);\n }\n this.push(data);\n }\n }\n }\n // Node.js 12 has incorrect types, so the encoding must be a string\n _write(chunk, encoding, callback) {\n const write = () => {\n this._writeRequest(chunk, encoding, callback);\n };\n if (this.requestInitialized) {\n write();\n }\n else {\n this[kJobs].push(write);\n }\n }\n _writeRequest(chunk, encoding, callback) {\n if (this[kRequest].destroyed) {\n // Probably the `ClientRequest` instance will throw\n return;\n }\n this._progressCallbacks.push(() => {\n this[kUploadedSize] += Buffer.byteLength(chunk, encoding);\n const progress = this.uploadProgress;\n if (progress.percent < 1) {\n this.emit('uploadProgress', progress);\n }\n });\n // TODO: What happens if it's from cache? Then this[kRequest] won't be defined.\n this[kRequest].write(chunk, encoding, (error) => {\n if (!error && this._progressCallbacks.length > 0) {\n this._progressCallbacks.shift()();\n }\n callback(error);\n });\n }\n _final(callback) {\n const endRequest = () => {\n // FIX: Node.js 10 calls the write callback AFTER the end callback!\n while (this._progressCallbacks.length !== 0) {\n this._progressCallbacks.shift()();\n }\n // We need to check if `this[kRequest]` is present,\n // because it isn't when we use cache.\n if (!(kRequest in this)) {\n callback();\n return;\n }\n if (this[kRequest].destroyed) {\n callback();\n return;\n }\n this[kRequest].end((error) => {\n if (!error) {\n this[kBodySize] = this[kUploadedSize];\n this.emit('uploadProgress', this.uploadProgress);\n this[kRequest].emit('upload-complete');\n }\n callback(error);\n });\n };\n if (this.requestInitialized) {\n endRequest();\n }\n else {\n this[kJobs].push(endRequest);\n }\n }\n _destroy(error, callback) {\n var _a;\n this[kStopReading] = true;\n // Prevent further retries\n clearTimeout(this[kRetryTimeout]);\n if (kRequest in this) {\n this[kCancelTimeouts]();\n // TODO: Remove the next `if` when these get fixed:\n // - https://github.com/nodejs/node/issues/32851\n if (!((_a = this[kResponse]) === null || _a === void 0 ? void 0 : _a.complete)) {\n this[kRequest].destroy();\n }\n }\n if (error !== null && !is_1.default.undefined(error) && !(error instanceof RequestError)) {\n error = new RequestError(error.message, error, this);\n }\n callback(error);\n }\n get _isAboutToError() {\n return this[kStopReading];\n }\n /**\n The remote IP address.\n */\n get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }\n /**\n Indicates whether the request has been aborted or not.\n */\n get aborted() {\n var _a, _b, _c;\n return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete);\n }\n get socket() {\n var _a, _b;\n return (_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.socket) !== null && _b !== void 0 ? _b : undefined;\n }\n /**\n Progress event for downloading (receiving a response).\n */\n get downloadProgress() {\n let percent;\n if (this[kResponseSize]) {\n percent = this[kDownloadedSize] / this[kResponseSize];\n }\n else if (this[kResponseSize] === this[kDownloadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kDownloadedSize],\n total: this[kResponseSize]\n };\n }\n /**\n Progress event for uploading (sending a request).\n */\n get uploadProgress() {\n let percent;\n if (this[kBodySize]) {\n percent = this[kUploadedSize] / this[kBodySize];\n }\n else if (this[kBodySize] === this[kUploadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kUploadedSize],\n total: this[kBodySize]\n };\n }\n /**\n The object contains the following properties:\n\n - `start` - Time when the request started.\n - `socket` - Time when a socket was assigned to the request.\n - `lookup` - Time when the DNS lookup finished.\n - `connect` - Time when the socket successfully connected.\n - `secureConnect` - Time when the socket securely connected.\n - `upload` - Time when the request finished uploading.\n - `response` - Time when the request fired `response` event.\n - `end` - Time when the response fired `end` event.\n - `error` - Time when the request fired `error` event.\n - `abort` - Time when the request fired `abort` event.\n - `phases`\n - `wait` - `timings.socket - timings.start`\n - `dns` - `timings.lookup - timings.socket`\n - `tcp` - `timings.connect - timings.lookup`\n - `tls` - `timings.secureConnect - timings.connect`\n - `request` - `timings.upload - (timings.secureConnect || timings.connect)`\n - `firstByte` - `timings.response - timings.upload`\n - `download` - `timings.end - timings.response`\n - `total` - `(timings.end || timings.error || timings.abort) - timings.start`\n\n If something has not been measured yet, it will be `undefined`.\n\n __Note__: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.\n */\n get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }\n /**\n Whether the response was retrieved from the cache.\n */\n get isFromCache() {\n return this[kIsFromCache];\n }\n pipe(destination, options) {\n if (this[kStartedReading]) {\n throw new Error('Failed to pipe. The response has been emitted already.');\n }\n if (destination instanceof http_1.ServerResponse) {\n this[kServerResponsesPiped].add(destination);\n }\n return super.pipe(destination, options);\n }\n unpipe(destination) {\n if (destination instanceof http_1.ServerResponse) {\n this[kServerResponsesPiped].delete(destination);\n }\n super.unpipe(destination);\n return this;\n }\n}\nexports.default = Request;\n\n\n//# sourceURL=webpack:///./node_modules/got/dist/source/core/index.js?");
|
|
15555
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnsupportedProtocolError = exports.ReadError = exports.TimeoutError = exports.UploadError = exports.CacheError = exports.HTTPError = exports.MaxRedirectsError = exports.RequestError = exports.setNonEnumerableProperties = exports.knownHookEvents = exports.withoutBody = exports.kIsNormalizedAlready = void 0;\nconst util_1 = __webpack_require__(/*! util */ \"util\");\nconst stream_1 = __webpack_require__(/*! stream */ \"stream\");\nconst fs_1 = __webpack_require__(/*! fs */ \"fs\");\nconst url_1 = __webpack_require__(/*! url */ \"url\");\nconst http = __webpack_require__(/*! http */ \"http\");\nconst http_1 = __webpack_require__(/*! http */ \"http\");\nconst https = __webpack_require__(/*! https */ \"https\");\nconst http_timer_1 = __webpack_require__(/*! @szmarczak/http-timer */ \"./node_modules/@szmarczak/http-timer/dist/source/index.js\");\nconst cacheable_lookup_1 = __webpack_require__(/*! cacheable-lookup */ \"./node_modules/cacheable-lookup/source/index.js\");\nconst CacheableRequest = __webpack_require__(/*! cacheable-request */ \"./node_modules/cacheable-request/src/index.js\");\nconst decompressResponse = __webpack_require__(/*! decompress-response */ \"./node_modules/decompress-response/index.js\");\n// @ts-expect-error Missing types\nconst http2wrapper = __webpack_require__(/*! http2-wrapper */ \"./node_modules/http2-wrapper/source/index.js\");\nconst lowercaseKeys = __webpack_require__(/*! lowercase-keys */ \"./node_modules/lowercase-keys/index.js\");\nconst is_1 = __webpack_require__(/*! @sindresorhus/is */ \"./node_modules/@sindresorhus/is/dist/index.js\");\nconst get_body_size_1 = __webpack_require__(/*! ./utils/get-body-size */ \"./node_modules/got/dist/source/core/utils/get-body-size.js\");\nconst is_form_data_1 = __webpack_require__(/*! ./utils/is-form-data */ \"./node_modules/got/dist/source/core/utils/is-form-data.js\");\nconst proxy_events_1 = __webpack_require__(/*! ./utils/proxy-events */ \"./node_modules/got/dist/source/core/utils/proxy-events.js\");\nconst timed_out_1 = __webpack_require__(/*! ./utils/timed-out */ \"./node_modules/got/dist/source/core/utils/timed-out.js\");\nconst url_to_options_1 = __webpack_require__(/*! ./utils/url-to-options */ \"./node_modules/got/dist/source/core/utils/url-to-options.js\");\nconst options_to_url_1 = __webpack_require__(/*! ./utils/options-to-url */ \"./node_modules/got/dist/source/core/utils/options-to-url.js\");\nconst weakable_map_1 = __webpack_require__(/*! ./utils/weakable-map */ \"./node_modules/got/dist/source/core/utils/weakable-map.js\");\nconst get_buffer_1 = __webpack_require__(/*! ./utils/get-buffer */ \"./node_modules/got/dist/source/core/utils/get-buffer.js\");\nconst dns_ip_version_1 = __webpack_require__(/*! ./utils/dns-ip-version */ \"./node_modules/got/dist/source/core/utils/dns-ip-version.js\");\nconst is_response_ok_1 = __webpack_require__(/*! ./utils/is-response-ok */ \"./node_modules/got/dist/source/core/utils/is-response-ok.js\");\nconst deprecation_warning_1 = __webpack_require__(/*! ../utils/deprecation-warning */ \"./node_modules/got/dist/source/utils/deprecation-warning.js\");\nconst normalize_arguments_1 = __webpack_require__(/*! ../as-promise/normalize-arguments */ \"./node_modules/got/dist/source/as-promise/normalize-arguments.js\");\nconst calculate_retry_delay_1 = __webpack_require__(/*! ./calculate-retry-delay */ \"./node_modules/got/dist/source/core/calculate-retry-delay.js\");\nlet globalDnsCache;\nconst kRequest = Symbol('request');\nconst kResponse = Symbol('response');\nconst kResponseSize = Symbol('responseSize');\nconst kDownloadedSize = Symbol('downloadedSize');\nconst kBodySize = Symbol('bodySize');\nconst kUploadedSize = Symbol('uploadedSize');\nconst kServerResponsesPiped = Symbol('serverResponsesPiped');\nconst kUnproxyEvents = Symbol('unproxyEvents');\nconst kIsFromCache = Symbol('isFromCache');\nconst kCancelTimeouts = Symbol('cancelTimeouts');\nconst kStartedReading = Symbol('startedReading');\nconst kStopReading = Symbol('stopReading');\nconst kTriggerRead = Symbol('triggerRead');\nconst kBody = Symbol('body');\nconst kJobs = Symbol('jobs');\nconst kOriginalResponse = Symbol('originalResponse');\nconst kRetryTimeout = Symbol('retryTimeout');\nexports.kIsNormalizedAlready = Symbol('isNormalizedAlready');\nconst supportsBrotli = is_1.default.string(process.versions.brotli);\nexports.withoutBody = new Set(['GET', 'HEAD']);\nexports.knownHookEvents = [\n 'init',\n 'beforeRequest',\n 'beforeRedirect',\n 'beforeError',\n 'beforeRetry',\n // Promise-Only\n 'afterResponse'\n];\nfunction validateSearchParameters(searchParameters) {\n // eslint-disable-next-line guard-for-in\n for (const key in searchParameters) {\n const value = searchParameters[key];\n if (!is_1.default.string(value) && !is_1.default.number(value) && !is_1.default.boolean(value) && !is_1.default.null_(value) && !is_1.default.undefined(value)) {\n throw new TypeError(`The \\`searchParams\\` value '${String(value)}' must be a string, number, boolean or null`);\n }\n }\n}\nfunction isClientRequest(clientRequest) {\n return is_1.default.object(clientRequest) && !('statusCode' in clientRequest);\n}\nconst cacheableStore = new weakable_map_1.default();\nconst waitForOpenFile = async (file) => new Promise((resolve, reject) => {\n const onError = (error) => {\n reject(error);\n };\n // Node.js 12 has incomplete types\n if (!file.pending) {\n resolve();\n }\n file.once('error', onError);\n file.once('ready', () => {\n file.off('error', onError);\n resolve();\n });\n});\nconst redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]);\nconst nonEnumerableProperties = [\n 'context',\n 'body',\n 'json',\n 'form'\n];\nexports.setNonEnumerableProperties = (sources, to) => {\n // Non enumerable properties shall not be merged\n const properties = {};\n for (const source of sources) {\n if (!source) {\n continue;\n }\n for (const name of nonEnumerableProperties) {\n if (!(name in source)) {\n continue;\n }\n properties[name] = {\n writable: true,\n configurable: true,\n enumerable: false,\n // @ts-expect-error TS doesn't see the check above\n value: source[name]\n };\n }\n }\n Object.defineProperties(to, properties);\n};\n/**\nAn error to be thrown when a request fails.\nContains a `code` property with error class code, like `ECONNREFUSED`.\n*/\nclass RequestError extends Error {\n constructor(message, error, self) {\n var _a, _b;\n super(message);\n Error.captureStackTrace(this, this.constructor);\n this.name = 'RequestError';\n this.code = (_a = error.code) !== null && _a !== void 0 ? _a : 'ERR_GOT_REQUEST_ERROR';\n if (self instanceof Request) {\n Object.defineProperty(this, 'request', {\n enumerable: false,\n value: self\n });\n Object.defineProperty(this, 'response', {\n enumerable: false,\n value: self[kResponse]\n });\n Object.defineProperty(this, 'options', {\n // This fails because of TS 3.7.2 useDefineForClassFields\n // Ref: https://github.com/microsoft/TypeScript/issues/34972\n enumerable: false,\n value: self.options\n });\n }\n else {\n Object.defineProperty(this, 'options', {\n // This fails because of TS 3.7.2 useDefineForClassFields\n // Ref: https://github.com/microsoft/TypeScript/issues/34972\n enumerable: false,\n value: self\n });\n }\n this.timings = (_b = this.request) === null || _b === void 0 ? void 0 : _b.timings;\n // Recover the original stacktrace\n if (is_1.default.string(error.stack) && is_1.default.string(this.stack)) {\n const indexOfMessage = this.stack.indexOf(this.message) + this.message.length;\n const thisStackTrace = this.stack.slice(indexOfMessage).split('\\n').reverse();\n const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message) + error.message.length).split('\\n').reverse();\n // Remove duplicated traces\n while (errorStackTrace.length !== 0 && errorStackTrace[0] === thisStackTrace[0]) {\n thisStackTrace.shift();\n }\n this.stack = `${this.stack.slice(0, indexOfMessage)}${thisStackTrace.reverse().join('\\n')}${errorStackTrace.reverse().join('\\n')}`;\n }\n }\n}\nexports.RequestError = RequestError;\n/**\nAn error to be thrown when the server redirects you more than ten times.\nIncludes a `response` property.\n*/\nclass MaxRedirectsError extends RequestError {\n constructor(request) {\n super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request);\n this.name = 'MaxRedirectsError';\n this.code = 'ERR_TOO_MANY_REDIRECTS';\n }\n}\nexports.MaxRedirectsError = MaxRedirectsError;\n/**\nAn error to be thrown when the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304.\nIncludes a `response` property.\n*/\nclass HTTPError extends RequestError {\n constructor(response) {\n super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request);\n this.name = 'HTTPError';\n this.code = 'ERR_NON_2XX_3XX_RESPONSE';\n }\n}\nexports.HTTPError = HTTPError;\n/**\nAn error to be thrown when a cache method fails.\nFor example, if the database goes down or there's a filesystem error.\n*/\nclass CacheError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'CacheError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_CACHE_ACCESS' : this.code;\n }\n}\nexports.CacheError = CacheError;\n/**\nAn error to be thrown when the request body is a stream and an error occurs while reading from that stream.\n*/\nclass UploadError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'UploadError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_UPLOAD' : this.code;\n }\n}\nexports.UploadError = UploadError;\n/**\nAn error to be thrown when the request is aborted due to a timeout.\nIncludes an `event` and `timings` property.\n*/\nclass TimeoutError extends RequestError {\n constructor(error, timings, request) {\n super(error.message, error, request);\n this.name = 'TimeoutError';\n this.event = error.event;\n this.timings = timings;\n }\n}\nexports.TimeoutError = TimeoutError;\n/**\nAn error to be thrown when reading from response stream fails.\n*/\nclass ReadError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'ReadError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_READING_RESPONSE_STREAM' : this.code;\n }\n}\nexports.ReadError = ReadError;\n/**\nAn error to be thrown when given an unsupported protocol.\n*/\nclass UnsupportedProtocolError extends RequestError {\n constructor(options) {\n super(`Unsupported protocol \"${options.url.protocol}\"`, {}, options);\n this.name = 'UnsupportedProtocolError';\n this.code = 'ERR_UNSUPPORTED_PROTOCOL';\n }\n}\nexports.UnsupportedProtocolError = UnsupportedProtocolError;\nconst proxiedRequestEvents = [\n 'socket',\n 'connect',\n 'continue',\n 'information',\n 'upgrade',\n 'timeout'\n];\nclass Request extends stream_1.Duplex {\n constructor(url, options = {}, defaults) {\n super({\n // This must be false, to enable throwing after destroy\n // It is used for retry logic in Promise API\n autoDestroy: false,\n // It needs to be zero because we're just proxying the data to another stream\n highWaterMark: 0\n });\n this[kDownloadedSize] = 0;\n this[kUploadedSize] = 0;\n this.requestInitialized = false;\n this[kServerResponsesPiped] = new Set();\n this.redirects = [];\n this[kStopReading] = false;\n this[kTriggerRead] = false;\n this[kJobs] = [];\n this.retryCount = 0;\n // TODO: Remove this when targeting Node.js >= 12\n this._progressCallbacks = [];\n const unlockWrite = () => this._unlockWrite();\n const lockWrite = () => this._lockWrite();\n this.on('pipe', (source) => {\n source.prependListener('data', unlockWrite);\n source.on('data', lockWrite);\n source.prependListener('end', unlockWrite);\n source.on('end', lockWrite);\n });\n this.on('unpipe', (source) => {\n source.off('data', unlockWrite);\n source.off('data', lockWrite);\n source.off('end', unlockWrite);\n source.off('end', lockWrite);\n });\n this.on('pipe', source => {\n if (source instanceof http_1.IncomingMessage) {\n this.options.headers = {\n ...source.headers,\n ...this.options.headers\n };\n }\n });\n const { json, body, form } = options;\n if (json || body || form) {\n this._lockWrite();\n }\n if (exports.kIsNormalizedAlready in options) {\n this.options = options;\n }\n else {\n try {\n // @ts-expect-error Common TypeScript bug saying that `this.constructor` is not accessible\n this.options = this.constructor.normalizeArguments(url, options, defaults);\n }\n catch (error) {\n // TODO: Move this to `_destroy()`\n if (is_1.default.nodeStream(options.body)) {\n options.body.destroy();\n }\n this.destroy(error);\n return;\n }\n }\n (async () => {\n var _a;\n try {\n if (this.options.body instanceof fs_1.ReadStream) {\n await waitForOpenFile(this.options.body);\n }\n const { url: normalizedURL } = this.options;\n if (!normalizedURL) {\n throw new TypeError('Missing `url` property');\n }\n this.requestUrl = normalizedURL.toString();\n decodeURI(this.requestUrl);\n await this._finalizeBody();\n await this._makeRequest();\n if (this.destroyed) {\n (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroy();\n return;\n }\n // Queued writes etc.\n for (const job of this[kJobs]) {\n job();\n }\n // Prevent memory leak\n this[kJobs].length = 0;\n this.requestInitialized = true;\n }\n catch (error) {\n if (error instanceof RequestError) {\n this._beforeError(error);\n return;\n }\n // This is a workaround for https://github.com/nodejs/node/issues/33335\n if (!this.destroyed) {\n this.destroy(error);\n }\n }\n })();\n }\n static normalizeArguments(url, options, defaults) {\n var _a, _b, _c, _d, _e;\n const rawOptions = options;\n if (is_1.default.object(url) && !is_1.default.urlInstance(url)) {\n options = { ...defaults, ...url, ...options };\n }\n else {\n if (url && options && options.url !== undefined) {\n throw new TypeError('The `url` option is mutually exclusive with the `input` argument');\n }\n options = { ...defaults, ...options };\n if (url !== undefined) {\n options.url = url;\n }\n if (is_1.default.urlInstance(options.url)) {\n options.url = new url_1.URL(options.url.toString());\n }\n }\n // TODO: Deprecate URL options in Got 12.\n // Support extend-specific options\n if (options.cache === false) {\n options.cache = undefined;\n }\n if (options.dnsCache === false) {\n options.dnsCache = undefined;\n }\n // Nice type assertions\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.method);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.headers);\n is_1.assert.any([is_1.default.string, is_1.default.urlInstance, is_1.default.undefined], options.prefixUrl);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cookieJar);\n is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.searchParams);\n is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.cache);\n is_1.assert.any([is_1.default.object, is_1.default.number, is_1.default.undefined], options.timeout);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.context);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.hooks);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.decompress);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.ignoreInvalidCookies);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.followRedirect);\n is_1.assert.any([is_1.default.number, is_1.default.undefined], options.maxRedirects);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.throwHttpErrors);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.http2);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.allowGetBody);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.localAddress);\n is_1.assert.any([dns_ip_version_1.isDnsLookupIpVersion, is_1.default.undefined], options.dnsLookupIpVersion);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.https);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.rejectUnauthorized);\n if (options.https) {\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.https.rejectUnauthorized);\n is_1.assert.any([is_1.default.function_, is_1.default.undefined], options.https.checkServerIdentity);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificateAuthority);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.key);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificate);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.https.passphrase);\n is_1.assert.any([is_1.default.string, is_1.default.buffer, is_1.default.array, is_1.default.undefined], options.https.pfx);\n }\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cacheOptions);\n // `options.method`\n if (is_1.default.string(options.method)) {\n options.method = options.method.toUpperCase();\n }\n else {\n options.method = 'GET';\n }\n // `options.headers`\n if (options.headers === (defaults === null || defaults === void 0 ? void 0 : defaults.headers)) {\n options.headers = { ...options.headers };\n }\n else {\n options.headers = lowercaseKeys({ ...(defaults === null || defaults === void 0 ? void 0 : defaults.headers), ...options.headers });\n }\n // Disallow legacy `url.Url`\n if ('slashes' in options) {\n throw new TypeError('The legacy `url.Url` has been deprecated. Use `URL` instead.');\n }\n // `options.auth`\n if ('auth' in options) {\n throw new TypeError('Parameter `auth` is deprecated. Use `username` / `password` instead.');\n }\n // `options.searchParams`\n if ('searchParams' in options) {\n if (options.searchParams && options.searchParams !== (defaults === null || defaults === void 0 ? void 0 : defaults.searchParams)) {\n let searchParameters;\n if (is_1.default.string(options.searchParams) || (options.searchParams instanceof url_1.URLSearchParams)) {\n searchParameters = new url_1.URLSearchParams(options.searchParams);\n }\n else {\n validateSearchParameters(options.searchParams);\n searchParameters = new url_1.URLSearchParams();\n // eslint-disable-next-line guard-for-in\n for (const key in options.searchParams) {\n const value = options.searchParams[key];\n if (value === null) {\n searchParameters.append(key, '');\n }\n else if (value !== undefined) {\n searchParameters.append(key, value);\n }\n }\n }\n // `normalizeArguments()` is also used to merge options\n (_a = defaults === null || defaults === void 0 ? void 0 : defaults.searchParams) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {\n // Only use default if one isn't already defined\n if (!searchParameters.has(key)) {\n searchParameters.append(key, value);\n }\n });\n options.searchParams = searchParameters;\n }\n }\n // `options.username` & `options.password`\n options.username = (_b = options.username) !== null && _b !== void 0 ? _b : '';\n options.password = (_c = options.password) !== null && _c !== void 0 ? _c : '';\n // `options.prefixUrl` & `options.url`\n if (is_1.default.undefined(options.prefixUrl)) {\n options.prefixUrl = (_d = defaults === null || defaults === void 0 ? void 0 : defaults.prefixUrl) !== null && _d !== void 0 ? _d : '';\n }\n else {\n options.prefixUrl = options.prefixUrl.toString();\n if (options.prefixUrl !== '' && !options.prefixUrl.endsWith('/')) {\n options.prefixUrl += '/';\n }\n }\n if (is_1.default.string(options.url)) {\n if (options.url.startsWith('/')) {\n throw new Error('`input` must not start with a slash when using `prefixUrl`');\n }\n options.url = options_to_url_1.default(options.prefixUrl + options.url, options);\n }\n else if ((is_1.default.undefined(options.url) && options.prefixUrl !== '') || options.protocol) {\n options.url = options_to_url_1.default(options.prefixUrl, options);\n }\n if (options.url) {\n if ('port' in options) {\n delete options.port;\n }\n // Make it possible to change `options.prefixUrl`\n let { prefixUrl } = options;\n Object.defineProperty(options, 'prefixUrl', {\n set: (value) => {\n const url = options.url;\n if (!url.href.startsWith(value)) {\n throw new Error(`Cannot change \\`prefixUrl\\` from ${prefixUrl} to ${value}: ${url.href}`);\n }\n options.url = new url_1.URL(value + url.href.slice(prefixUrl.length));\n prefixUrl = value;\n },\n get: () => prefixUrl\n });\n // Support UNIX sockets\n let { protocol } = options.url;\n if (protocol === 'unix:') {\n protocol = 'http:';\n options.url = new url_1.URL(`http://unix${options.url.pathname}${options.url.search}`);\n }\n // Set search params\n if (options.searchParams) {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n options.url.search = options.searchParams.toString();\n }\n // Protocol check\n if (protocol !== 'http:' && protocol !== 'https:') {\n throw new UnsupportedProtocolError(options);\n }\n // Update `username`\n if (options.username === '') {\n options.username = options.url.username;\n }\n else {\n options.url.username = options.username;\n }\n // Update `password`\n if (options.password === '') {\n options.password = options.url.password;\n }\n else {\n options.url.password = options.password;\n }\n }\n // `options.cookieJar`\n const { cookieJar } = options;\n if (cookieJar) {\n let { setCookie, getCookieString } = cookieJar;\n is_1.assert.function_(setCookie);\n is_1.assert.function_(getCookieString);\n /* istanbul ignore next: Horrible `tough-cookie` v3 check */\n if (setCookie.length === 4 && getCookieString.length === 0) {\n setCookie = util_1.promisify(setCookie.bind(options.cookieJar));\n getCookieString = util_1.promisify(getCookieString.bind(options.cookieJar));\n options.cookieJar = {\n setCookie,\n getCookieString: getCookieString\n };\n }\n }\n // `options.cache`\n const { cache } = options;\n if (cache) {\n if (!cacheableStore.has(cache)) {\n cacheableStore.set(cache, new CacheableRequest(((requestOptions, handler) => {\n const result = requestOptions[kRequest](requestOptions, handler);\n // TODO: remove this when `cacheable-request` supports async request functions.\n if (is_1.default.promise(result)) {\n // @ts-expect-error\n // We only need to implement the error handler in order to support HTTP2 caching.\n // The result will be a promise anyway.\n result.once = (event, handler) => {\n if (event === 'error') {\n result.catch(handler);\n }\n else if (event === 'abort') {\n // The empty catch is needed here in case when\n // it rejects before it's `await`ed in `_makeRequest`.\n (async () => {\n try {\n const request = (await result);\n request.once('abort', handler);\n }\n catch (_a) { }\n })();\n }\n else {\n /* istanbul ignore next: safety check */\n throw new Error(`Unknown HTTP2 promise event: ${event}`);\n }\n return result;\n };\n }\n return result;\n }), cache));\n }\n }\n // `options.cacheOptions`\n options.cacheOptions = { ...options.cacheOptions };\n // `options.dnsCache`\n if (options.dnsCache === true) {\n if (!globalDnsCache) {\n globalDnsCache = new cacheable_lookup_1.default();\n }\n options.dnsCache = globalDnsCache;\n }\n else if (!is_1.default.undefined(options.dnsCache) && !options.dnsCache.lookup) {\n throw new TypeError(`Parameter \\`dnsCache\\` must be a CacheableLookup instance or a boolean, got ${is_1.default(options.dnsCache)}`);\n }\n // `options.timeout`\n if (is_1.default.number(options.timeout)) {\n options.timeout = { request: options.timeout };\n }\n else if (defaults && options.timeout !== defaults.timeout) {\n options.timeout = {\n ...defaults.timeout,\n ...options.timeout\n };\n }\n else {\n options.timeout = { ...options.timeout };\n }\n // `options.context`\n if (!options.context) {\n options.context = {};\n }\n // `options.hooks`\n const areHooksDefault = options.hooks === (defaults === null || defaults === void 0 ? void 0 : defaults.hooks);\n options.hooks = { ...options.hooks };\n for (const event of exports.knownHookEvents) {\n if (event in options.hooks) {\n if (is_1.default.array(options.hooks[event])) {\n // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044\n options.hooks[event] = [...options.hooks[event]];\n }\n else {\n throw new TypeError(`Parameter \\`${event}\\` must be an Array, got ${is_1.default(options.hooks[event])}`);\n }\n }\n else {\n options.hooks[event] = [];\n }\n }\n if (defaults && !areHooksDefault) {\n for (const event of exports.knownHookEvents) {\n const defaultHooks = defaults.hooks[event];\n if (defaultHooks.length > 0) {\n // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044\n options.hooks[event] = [\n ...defaults.hooks[event],\n ...options.hooks[event]\n ];\n }\n }\n }\n // DNS options\n if ('family' in options) {\n deprecation_warning_1.default('\"options.family\" was never documented, please use \"options.dnsLookupIpVersion\"');\n }\n // HTTPS options\n if (defaults === null || defaults === void 0 ? void 0 : defaults.https) {\n options.https = { ...defaults.https, ...options.https };\n }\n if ('rejectUnauthorized' in options) {\n deprecation_warning_1.default('\"options.rejectUnauthorized\" is now deprecated, please use \"options.https.rejectUnauthorized\"');\n }\n if ('checkServerIdentity' in options) {\n deprecation_warning_1.default('\"options.checkServerIdentity\" was never documented, please use \"options.https.checkServerIdentity\"');\n }\n if ('ca' in options) {\n deprecation_warning_1.default('\"options.ca\" was never documented, please use \"options.https.certificateAuthority\"');\n }\n if ('key' in options) {\n deprecation_warning_1.default('\"options.key\" was never documented, please use \"options.https.key\"');\n }\n if ('cert' in options) {\n deprecation_warning_1.default('\"options.cert\" was never documented, please use \"options.https.certificate\"');\n }\n if ('passphrase' in options) {\n deprecation_warning_1.default('\"options.passphrase\" was never documented, please use \"options.https.passphrase\"');\n }\n if ('pfx' in options) {\n deprecation_warning_1.default('\"options.pfx\" was never documented, please use \"options.https.pfx\"');\n }\n // Other options\n if ('followRedirects' in options) {\n throw new TypeError('The `followRedirects` option does not exist. Use `followRedirect` instead.');\n }\n if (options.agent) {\n for (const key in options.agent) {\n if (key !== 'http' && key !== 'https' && key !== 'http2') {\n throw new TypeError(`Expected the \\`options.agent\\` properties to be \\`http\\`, \\`https\\` or \\`http2\\`, got \\`${key}\\``);\n }\n }\n }\n options.maxRedirects = (_e = options.maxRedirects) !== null && _e !== void 0 ? _e : 0;\n // Set non-enumerable properties\n exports.setNonEnumerableProperties([defaults, rawOptions], options);\n return normalize_arguments_1.default(options, defaults);\n }\n _lockWrite() {\n const onLockedWrite = () => {\n throw new TypeError('The payload has been already provided');\n };\n this.write = onLockedWrite;\n this.end = onLockedWrite;\n }\n _unlockWrite() {\n this.write = super.write;\n this.end = super.end;\n }\n async _finalizeBody() {\n const { options } = this;\n const { headers } = options;\n const isForm = !is_1.default.undefined(options.form);\n const isJSON = !is_1.default.undefined(options.json);\n const isBody = !is_1.default.undefined(options.body);\n const hasPayload = isForm || isJSON || isBody;\n const cannotHaveBody = exports.withoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody);\n this._cannotHaveBody = cannotHaveBody;\n if (hasPayload) {\n if (cannotHaveBody) {\n throw new TypeError(`The \\`${options.method}\\` method cannot be used with a body`);\n }\n if ([isBody, isForm, isJSON].filter(isTrue => isTrue).length > 1) {\n throw new TypeError('The `body`, `json` and `form` options are mutually exclusive');\n }\n if (isBody &&\n !(options.body instanceof stream_1.Readable) &&\n !is_1.default.string(options.body) &&\n !is_1.default.buffer(options.body) &&\n !is_form_data_1.default(options.body)) {\n throw new TypeError('The `body` option must be a stream.Readable, string or Buffer');\n }\n if (isForm && !is_1.default.object(options.form)) {\n throw new TypeError('The `form` option must be an Object');\n }\n {\n // Serialize body\n const noContentType = !is_1.default.string(headers['content-type']);\n if (isBody) {\n // Special case for https://github.com/form-data/form-data\n if (is_form_data_1.default(options.body) && noContentType) {\n headers['content-type'] = `multipart/form-data; boundary=${options.body.getBoundary()}`;\n }\n this[kBody] = options.body;\n }\n else if (isForm) {\n if (noContentType) {\n headers['content-type'] = 'application/x-www-form-urlencoded';\n }\n this[kBody] = (new url_1.URLSearchParams(options.form)).toString();\n }\n else {\n if (noContentType) {\n headers['content-type'] = 'application/json';\n }\n this[kBody] = options.stringifyJson(options.json);\n }\n const uploadBodySize = await get_body_size_1.default(this[kBody], options.headers);\n // See https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body. For example, a Content-Length header\n // field is normally sent in a POST request even when the value is 0\n // (indicating an empty payload body). A user agent SHOULD NOT send a\n // Content-Length header field when the request message does not contain\n // a payload body and the method semantics do not anticipate such a\n // body.\n if (is_1.default.undefined(headers['content-length']) && is_1.default.undefined(headers['transfer-encoding'])) {\n if (!cannotHaveBody && !is_1.default.undefined(uploadBodySize)) {\n headers['content-length'] = String(uploadBodySize);\n }\n }\n }\n }\n else if (cannotHaveBody) {\n this._lockWrite();\n }\n else {\n this._unlockWrite();\n }\n this[kBodySize] = Number(headers['content-length']) || undefined;\n }\n async _onResponseBase(response) {\n const { options } = this;\n const { url } = options;\n this[kOriginalResponse] = response;\n if (options.decompress) {\n response = decompressResponse(response);\n }\n const statusCode = response.statusCode;\n const typedResponse = response;\n typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : http.STATUS_CODES[statusCode];\n typedResponse.url = options.url.toString();\n typedResponse.requestUrl = this.requestUrl;\n typedResponse.redirectUrls = this.redirects;\n typedResponse.request = this;\n typedResponse.isFromCache = response.fromCache || false;\n typedResponse.ip = this.ip;\n typedResponse.retryCount = this.retryCount;\n this[kIsFromCache] = typedResponse.isFromCache;\n this[kResponseSize] = Number(response.headers['content-length']) || undefined;\n this[kResponse] = response;\n response.once('end', () => {\n this[kResponseSize] = this[kDownloadedSize];\n this.emit('downloadProgress', this.downloadProgress);\n });\n response.once('error', (error) => {\n // Force clean-up, because some packages don't do this.\n // TODO: Fix decompress-response\n response.destroy();\n this._beforeError(new ReadError(error, this));\n });\n response.once('aborted', () => {\n this._beforeError(new ReadError({\n name: 'Error',\n message: 'The server aborted pending request',\n code: 'ECONNRESET'\n }, this));\n });\n this.emit('downloadProgress', this.downloadProgress);\n const rawCookies = response.headers['set-cookie'];\n if (is_1.default.object(options.cookieJar) && rawCookies) {\n let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString()));\n if (options.ignoreInvalidCookies) {\n promises = promises.map(async (p) => p.catch(() => { }));\n }\n try {\n await Promise.all(promises);\n }\n catch (error) {\n this._beforeError(error);\n return;\n }\n }\n if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) {\n // We're being redirected, we don't care about the response.\n // It'd be best to abort the request, but we can't because\n // we would have to sacrifice the TCP connection. We don't want that.\n response.resume();\n if (this[kRequest]) {\n this[kCancelTimeouts]();\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this[kRequest];\n this[kUnproxyEvents]();\n }\n const shouldBeGet = statusCode === 303 && options.method !== 'GET' && options.method !== 'HEAD';\n if (shouldBeGet || !options.methodRewriting) {\n // Server responded with \"see other\", indicating that the resource exists at another location,\n // and the client should request it from that location via GET or HEAD.\n options.method = 'GET';\n if ('body' in options) {\n delete options.body;\n }\n if ('json' in options) {\n delete options.json;\n }\n if ('form' in options) {\n delete options.form;\n }\n this[kBody] = undefined;\n delete options.headers['content-length'];\n }\n if (this.redirects.length >= options.maxRedirects) {\n this._beforeError(new MaxRedirectsError(this));\n return;\n }\n try {\n // Do not remove. See https://github.com/sindresorhus/got/pull/214\n const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();\n // Handles invalid URLs. See https://github.com/sindresorhus/got/issues/604\n const redirectUrl = new url_1.URL(redirectBuffer, url);\n const redirectString = redirectUrl.toString();\n decodeURI(redirectString);\n // Redirecting to a different site, clear sensitive data.\n if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {\n if ('host' in options.headers) {\n delete options.headers.host;\n }\n if ('cookie' in options.headers) {\n delete options.headers.cookie;\n }\n if ('authorization' in options.headers) {\n delete options.headers.authorization;\n }\n if (options.username || options.password) {\n options.username = '';\n options.password = '';\n }\n }\n else {\n redirectUrl.username = options.username;\n redirectUrl.password = options.password;\n }\n this.redirects.push(redirectString);\n options.url = redirectUrl;\n for (const hook of options.hooks.beforeRedirect) {\n // eslint-disable-next-line no-await-in-loop\n await hook(options, typedResponse);\n }\n this.emit('redirect', typedResponse, options);\n await this._makeRequest();\n }\n catch (error) {\n this._beforeError(error);\n return;\n }\n return;\n }\n if (options.isStream && options.throwHttpErrors && !is_response_ok_1.isResponseOk(typedResponse)) {\n this._beforeError(new HTTPError(typedResponse));\n return;\n }\n response.on('readable', () => {\n if (this[kTriggerRead]) {\n this._read();\n }\n });\n this.on('resume', () => {\n response.resume();\n });\n this.on('pause', () => {\n response.pause();\n });\n response.once('end', () => {\n this.push(null);\n });\n this.emit('response', response);\n for (const destination of this[kServerResponsesPiped]) {\n if (destination.headersSent) {\n continue;\n }\n // eslint-disable-next-line guard-for-in\n for (const key in response.headers) {\n const isAllowed = options.decompress ? key !== 'content-encoding' : true;\n const value = response.headers[key];\n if (isAllowed) {\n destination.setHeader(key, value);\n }\n }\n destination.statusCode = statusCode;\n }\n }\n async _onResponse(response) {\n try {\n await this._onResponseBase(response);\n }\n catch (error) {\n /* istanbul ignore next: better safe than sorry */\n this._beforeError(error);\n }\n }\n _onRequest(request) {\n const { options } = this;\n const { timeout, url } = options;\n http_timer_1.default(request);\n this[kCancelTimeouts] = timed_out_1.default(request, timeout, url);\n const responseEventName = options.cache ? 'cacheableResponse' : 'response';\n request.once(responseEventName, (response) => {\n void this._onResponse(response);\n });\n request.once('error', (error) => {\n var _a;\n // Force clean-up, because some packages (e.g. nock) don't do this.\n request.destroy();\n // Node.js <= 12.18.2 mistakenly emits the response `end` first.\n (_a = request.res) === null || _a === void 0 ? void 0 : _a.removeAllListeners('end');\n error = error instanceof timed_out_1.TimeoutError ? new TimeoutError(error, this.timings, this) : new RequestError(error.message, error, this);\n this._beforeError(error);\n });\n this[kUnproxyEvents] = proxy_events_1.default(request, this, proxiedRequestEvents);\n this[kRequest] = request;\n this.emit('uploadProgress', this.uploadProgress);\n // Send body\n const body = this[kBody];\n const currentRequest = this.redirects.length === 0 ? this : request;\n if (is_1.default.nodeStream(body)) {\n body.pipe(currentRequest);\n body.once('error', (error) => {\n this._beforeError(new UploadError(error, this));\n });\n }\n else {\n this._unlockWrite();\n if (!is_1.default.undefined(body)) {\n this._writeRequest(body, undefined, () => { });\n currentRequest.end();\n this._lockWrite();\n }\n else if (this._cannotHaveBody || this._noPipe) {\n currentRequest.end();\n this._lockWrite();\n }\n }\n this.emit('request', request);\n }\n async _createCacheableRequest(url, options) {\n return new Promise((resolve, reject) => {\n // TODO: Remove `utils/url-to-options.ts` when `cacheable-request` is fixed\n Object.assign(options, url_to_options_1.default(url));\n // `http-cache-semantics` checks this\n // TODO: Fix this ignore.\n // @ts-expect-error\n delete options.url;\n let request;\n // This is ugly\n const cacheRequest = cacheableStore.get(options.cache)(options, async (response) => {\n // TODO: Fix `cacheable-response`\n response._readableState.autoDestroy = false;\n if (request) {\n (await request).emit('cacheableResponse', response);\n }\n resolve(response);\n });\n // Restore options\n options.url = url;\n cacheRequest.once('error', reject);\n cacheRequest.once('request', async (requestOrPromise) => {\n request = requestOrPromise;\n resolve(request);\n });\n });\n }\n async _makeRequest() {\n var _a, _b, _c, _d, _e;\n const { options } = this;\n const { headers } = options;\n for (const key in headers) {\n if (is_1.default.undefined(headers[key])) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete headers[key];\n }\n else if (is_1.default.null_(headers[key])) {\n throw new TypeError(`Use \\`undefined\\` instead of \\`null\\` to delete the \\`${key}\\` header`);\n }\n }\n if (options.decompress && is_1.default.undefined(headers['accept-encoding'])) {\n headers['accept-encoding'] = supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate';\n }\n // Set cookies\n if (options.cookieJar) {\n const cookieString = await options.cookieJar.getCookieString(options.url.toString());\n if (is_1.default.nonEmptyString(cookieString)) {\n options.headers.cookie = cookieString;\n }\n }\n for (const hook of options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(options);\n if (!is_1.default.undefined(result)) {\n // @ts-expect-error Skip the type mismatch to support abstract responses\n options.request = () => result;\n break;\n }\n }\n if (options.body && this[kBody] !== options.body) {\n this[kBody] = options.body;\n }\n const { agent, request, timeout, url } = options;\n if (options.dnsCache && !('lookup' in options)) {\n options.lookup = options.dnsCache.lookup;\n }\n // UNIX sockets\n if (url.hostname === 'unix') {\n const matches = /(?<socketPath>.+?):(?<path>.+)/.exec(`${url.pathname}${url.search}`);\n if (matches === null || matches === void 0 ? void 0 : matches.groups) {\n const { socketPath, path } = matches.groups;\n Object.assign(options, {\n socketPath,\n path,\n host: ''\n });\n }\n }\n const isHttps = url.protocol === 'https:';\n // Fallback function\n let fallbackFn;\n if (options.http2) {\n fallbackFn = http2wrapper.auto;\n }\n else {\n fallbackFn = isHttps ? https.request : http.request;\n }\n const realFn = (_a = options.request) !== null && _a !== void 0 ? _a : fallbackFn;\n // Cache support\n const fn = options.cache ? this._createCacheableRequest : realFn;\n // Pass an agent directly when HTTP2 is disabled\n if (agent && !options.http2) {\n options.agent = agent[isHttps ? 'https' : 'http'];\n }\n // Prepare plain HTTP request options\n options[kRequest] = realFn;\n delete options.request;\n // TODO: Fix this ignore.\n // @ts-expect-error\n delete options.timeout;\n const requestOptions = options;\n requestOptions.shared = (_b = options.cacheOptions) === null || _b === void 0 ? void 0 : _b.shared;\n requestOptions.cacheHeuristic = (_c = options.cacheOptions) === null || _c === void 0 ? void 0 : _c.cacheHeuristic;\n requestOptions.immutableMinTimeToLive = (_d = options.cacheOptions) === null || _d === void 0 ? void 0 : _d.immutableMinTimeToLive;\n requestOptions.ignoreCargoCult = (_e = options.cacheOptions) === null || _e === void 0 ? void 0 : _e.ignoreCargoCult;\n // If `dnsLookupIpVersion` is not present do not override `family`\n if (options.dnsLookupIpVersion !== undefined) {\n try {\n requestOptions.family = dns_ip_version_1.dnsLookupIpVersionToFamily(options.dnsLookupIpVersion);\n }\n catch (_f) {\n throw new Error('Invalid `dnsLookupIpVersion` option value');\n }\n }\n // HTTPS options remapping\n if (options.https) {\n if ('rejectUnauthorized' in options.https) {\n requestOptions.rejectUnauthorized = options.https.rejectUnauthorized;\n }\n if (options.https.checkServerIdentity) {\n requestOptions.checkServerIdentity = options.https.checkServerIdentity;\n }\n if (options.https.certificateAuthority) {\n requestOptions.ca = options.https.certificateAuthority;\n }\n if (options.https.certificate) {\n requestOptions.cert = options.https.certificate;\n }\n if (options.https.key) {\n requestOptions.key = options.https.key;\n }\n if (options.https.passphrase) {\n requestOptions.passphrase = options.https.passphrase;\n }\n if (options.https.pfx) {\n requestOptions.pfx = options.https.pfx;\n }\n }\n try {\n let requestOrResponse = await fn(url, requestOptions);\n if (is_1.default.undefined(requestOrResponse)) {\n requestOrResponse = fallbackFn(url, requestOptions);\n }\n // Restore options\n options.request = request;\n options.timeout = timeout;\n options.agent = agent;\n // HTTPS options restore\n if (options.https) {\n if ('rejectUnauthorized' in options.https) {\n delete requestOptions.rejectUnauthorized;\n }\n if (options.https.checkServerIdentity) {\n // @ts-expect-error - This one will be removed when we remove the alias.\n delete requestOptions.checkServerIdentity;\n }\n if (options.https.certificateAuthority) {\n delete requestOptions.ca;\n }\n if (options.https.certificate) {\n delete requestOptions.cert;\n }\n if (options.https.key) {\n delete requestOptions.key;\n }\n if (options.https.passphrase) {\n delete requestOptions.passphrase;\n }\n if (options.https.pfx) {\n delete requestOptions.pfx;\n }\n }\n if (isClientRequest(requestOrResponse)) {\n this._onRequest(requestOrResponse);\n // Emit the response after the stream has been ended\n }\n else if (this.writable) {\n this.once('finish', () => {\n void this._onResponse(requestOrResponse);\n });\n this._unlockWrite();\n this.end();\n this._lockWrite();\n }\n else {\n void this._onResponse(requestOrResponse);\n }\n }\n catch (error) {\n if (error instanceof CacheableRequest.CacheError) {\n throw new CacheError(error, this);\n }\n throw new RequestError(error.message, error, this);\n }\n }\n async _error(error) {\n try {\n for (const hook of this.options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n }\n catch (error_) {\n error = new RequestError(error_.message, error_, this);\n }\n this.destroy(error);\n }\n _beforeError(error) {\n if (this[kStopReading]) {\n return;\n }\n const { options } = this;\n const retryCount = this.retryCount + 1;\n this[kStopReading] = true;\n if (!(error instanceof RequestError)) {\n error = new RequestError(error.message, error, this);\n }\n const typedError = error;\n const { response } = typedError;\n void (async () => {\n if (response && !response.body) {\n response.setEncoding(this._readableState.encoding);\n try {\n response.rawBody = await get_buffer_1.default(response);\n response.body = response.rawBody.toString();\n }\n catch (_a) { }\n }\n if (this.listenerCount('retry') !== 0) {\n let backoff;\n try {\n let retryAfter;\n if (response && 'retry-after' in response.headers) {\n retryAfter = Number(response.headers['retry-after']);\n if (Number.isNaN(retryAfter)) {\n retryAfter = Date.parse(response.headers['retry-after']) - Date.now();\n if (retryAfter <= 0) {\n retryAfter = 1;\n }\n }\n else {\n retryAfter *= 1000;\n }\n }\n backoff = await options.retry.calculateDelay({\n attemptCount: retryCount,\n retryOptions: options.retry,\n error: typedError,\n retryAfter,\n computedValue: calculate_retry_delay_1.default({\n attemptCount: retryCount,\n retryOptions: options.retry,\n error: typedError,\n retryAfter,\n computedValue: 0\n })\n });\n }\n catch (error_) {\n void this._error(new RequestError(error_.message, error_, this));\n return;\n }\n if (backoff) {\n const retry = async () => {\n try {\n for (const hook of this.options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n await hook(this.options, typedError, retryCount);\n }\n }\n catch (error_) {\n void this._error(new RequestError(error_.message, error, this));\n return;\n }\n // Something forced us to abort the retry\n if (this.destroyed) {\n return;\n }\n this.destroy();\n this.emit('retry', retryCount, error);\n };\n this[kRetryTimeout] = setTimeout(retry, backoff);\n return;\n }\n }\n void this._error(typedError);\n })();\n }\n _read() {\n this[kTriggerRead] = true;\n const response = this[kResponse];\n if (response && !this[kStopReading]) {\n // We cannot put this in the `if` above\n // because `.read()` also triggers the `end` event\n if (response.readableLength) {\n this[kTriggerRead] = false;\n }\n let data;\n while ((data = response.read()) !== null) {\n this[kDownloadedSize] += data.length;\n this[kStartedReading] = true;\n const progress = this.downloadProgress;\n if (progress.percent < 1) {\n this.emit('downloadProgress', progress);\n }\n this.push(data);\n }\n }\n }\n // Node.js 12 has incorrect types, so the encoding must be a string\n _write(chunk, encoding, callback) {\n const write = () => {\n this._writeRequest(chunk, encoding, callback);\n };\n if (this.requestInitialized) {\n write();\n }\n else {\n this[kJobs].push(write);\n }\n }\n _writeRequest(chunk, encoding, callback) {\n if (this[kRequest].destroyed) {\n // Probably the `ClientRequest` instance will throw\n return;\n }\n this._progressCallbacks.push(() => {\n this[kUploadedSize] += Buffer.byteLength(chunk, encoding);\n const progress = this.uploadProgress;\n if (progress.percent < 1) {\n this.emit('uploadProgress', progress);\n }\n });\n // TODO: What happens if it's from cache? Then this[kRequest] won't be defined.\n this[kRequest].write(chunk, encoding, (error) => {\n if (!error && this._progressCallbacks.length > 0) {\n this._progressCallbacks.shift()();\n }\n callback(error);\n });\n }\n _final(callback) {\n const endRequest = () => {\n // FIX: Node.js 10 calls the write callback AFTER the end callback!\n while (this._progressCallbacks.length !== 0) {\n this._progressCallbacks.shift()();\n }\n // We need to check if `this[kRequest]` is present,\n // because it isn't when we use cache.\n if (!(kRequest in this)) {\n callback();\n return;\n }\n if (this[kRequest].destroyed) {\n callback();\n return;\n }\n this[kRequest].end((error) => {\n if (!error) {\n this[kBodySize] = this[kUploadedSize];\n this.emit('uploadProgress', this.uploadProgress);\n this[kRequest].emit('upload-complete');\n }\n callback(error);\n });\n };\n if (this.requestInitialized) {\n endRequest();\n }\n else {\n this[kJobs].push(endRequest);\n }\n }\n _destroy(error, callback) {\n var _a;\n this[kStopReading] = true;\n // Prevent further retries\n clearTimeout(this[kRetryTimeout]);\n if (kRequest in this) {\n this[kCancelTimeouts]();\n // TODO: Remove the next `if` when these get fixed:\n // - https://github.com/nodejs/node/issues/32851\n if (!((_a = this[kResponse]) === null || _a === void 0 ? void 0 : _a.complete)) {\n this[kRequest].destroy();\n }\n }\n if (error !== null && !is_1.default.undefined(error) && !(error instanceof RequestError)) {\n error = new RequestError(error.message, error, this);\n }\n callback(error);\n }\n get _isAboutToError() {\n return this[kStopReading];\n }\n /**\n The remote IP address.\n */\n get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }\n /**\n Indicates whether the request has been aborted or not.\n */\n get aborted() {\n var _a, _b, _c;\n return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete);\n }\n get socket() {\n var _a, _b;\n return (_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.socket) !== null && _b !== void 0 ? _b : undefined;\n }\n /**\n Progress event for downloading (receiving a response).\n */\n get downloadProgress() {\n let percent;\n if (this[kResponseSize]) {\n percent = this[kDownloadedSize] / this[kResponseSize];\n }\n else if (this[kResponseSize] === this[kDownloadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kDownloadedSize],\n total: this[kResponseSize]\n };\n }\n /**\n Progress event for uploading (sending a request).\n */\n get uploadProgress() {\n let percent;\n if (this[kBodySize]) {\n percent = this[kUploadedSize] / this[kBodySize];\n }\n else if (this[kBodySize] === this[kUploadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kUploadedSize],\n total: this[kBodySize]\n };\n }\n /**\n The object contains the following properties:\n\n - `start` - Time when the request started.\n - `socket` - Time when a socket was assigned to the request.\n - `lookup` - Time when the DNS lookup finished.\n - `connect` - Time when the socket successfully connected.\n - `secureConnect` - Time when the socket securely connected.\n - `upload` - Time when the request finished uploading.\n - `response` - Time when the request fired `response` event.\n - `end` - Time when the response fired `end` event.\n - `error` - Time when the request fired `error` event.\n - `abort` - Time when the request fired `abort` event.\n - `phases`\n - `wait` - `timings.socket - timings.start`\n - `dns` - `timings.lookup - timings.socket`\n - `tcp` - `timings.connect - timings.lookup`\n - `tls` - `timings.secureConnect - timings.connect`\n - `request` - `timings.upload - (timings.secureConnect || timings.connect)`\n - `firstByte` - `timings.response - timings.upload`\n - `download` - `timings.end - timings.response`\n - `total` - `(timings.end || timings.error || timings.abort) - timings.start`\n\n If something has not been measured yet, it will be `undefined`.\n\n __Note__: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.\n */\n get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }\n /**\n Whether the response was retrieved from the cache.\n */\n get isFromCache() {\n return this[kIsFromCache];\n }\n pipe(destination, options) {\n if (this[kStartedReading]) {\n throw new Error('Failed to pipe. The response has been emitted already.');\n }\n if (destination instanceof http_1.ServerResponse) {\n this[kServerResponsesPiped].add(destination);\n }\n return super.pipe(destination, options);\n }\n unpipe(destination) {\n if (destination instanceof http_1.ServerResponse) {\n this[kServerResponsesPiped].delete(destination);\n }\n super.unpipe(destination);\n return this;\n }\n}\nexports.default = Request;\n\n\n//# sourceURL=webpack:///./node_modules/got/dist/source/core/index.js?");
|
|
15568
15556
|
|
|
15569
15557
|
/***/ }),
|
|
15570
15558
|
|
|
@@ -31238,7 +31226,7 @@ eval("\n\n// ref: https://github.com/tc39/proposal-global\nvar getGlobal = funct
|
|
|
31238
31226
|
/***/ (function(module, exports, __webpack_require__) {
|
|
31239
31227
|
|
|
31240
31228
|
"use strict";
|
|
31241
|
-
eval("\n
|
|
31229
|
+
eval("\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\nconst DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';\nconst DATA_URL_DEFAULT_CHARSET = 'us-ascii';\n\nconst testParameter = (name, filters) => {\n\treturn filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);\n};\n\nconst normalizeDataURL = (urlString, {stripHash}) => {\n\tconst match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(urlString);\n\n\tif (!match) {\n\t\tthrow new Error(`Invalid URL: ${urlString}`);\n\t}\n\n\tlet {type, data, hash} = match.groups;\n\tconst mediaType = type.split(';');\n\thash = stripHash ? '' : hash;\n\n\tlet isBase64 = false;\n\tif (mediaType[mediaType.length - 1] === 'base64') {\n\t\tmediaType.pop();\n\t\tisBase64 = true;\n\t}\n\n\t// Lowercase MIME type\n\tconst mimeType = (mediaType.shift() || '').toLowerCase();\n\tconst attributes = mediaType\n\t\t.map(attribute => {\n\t\t\tlet [key, value = ''] = attribute.split('=').map(string => string.trim());\n\n\t\t\t// Lowercase `charset`\n\t\t\tif (key === 'charset') {\n\t\t\t\tvalue = value.toLowerCase();\n\n\t\t\t\tif (value === DATA_URL_DEFAULT_CHARSET) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn `${key}${value ? `=${value}` : ''}`;\n\t\t})\n\t\t.filter(Boolean);\n\n\tconst normalizedMediaType = [\n\t\t...attributes\n\t];\n\n\tif (isBase64) {\n\t\tnormalizedMediaType.push('base64');\n\t}\n\n\tif (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {\n\t\tnormalizedMediaType.unshift(mimeType);\n\t}\n\n\treturn `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`;\n};\n\nconst normalizeUrl = (urlString, options) => {\n\toptions = {\n\t\tdefaultProtocol: 'http:',\n\t\tnormalizeProtocol: true,\n\t\tforceHttp: false,\n\t\tforceHttps: false,\n\t\tstripAuthentication: true,\n\t\tstripHash: false,\n\t\tstripTextFragment: true,\n\t\tstripWWW: true,\n\t\tremoveQueryParameters: [/^utm_\\w+/i],\n\t\tremoveTrailingSlash: true,\n\t\tremoveSingleSlash: true,\n\t\tremoveDirectoryIndex: false,\n\t\tsortQueryParameters: true,\n\t\t...options\n\t};\n\n\turlString = urlString.trim();\n\n\t// Data URL\n\tif (/^data:/i.test(urlString)) {\n\t\treturn normalizeDataURL(urlString, options);\n\t}\n\n\tif (/^view-source:/i.test(urlString)) {\n\t\tthrow new Error('`view-source:` is not supported as it is a non-standard protocol');\n\t}\n\n\tconst hasRelativeProtocol = urlString.startsWith('//');\n\tconst isRelativeUrl = !hasRelativeProtocol && /^\\.*\\//.test(urlString);\n\n\t// Prepend protocol\n\tif (!isRelativeUrl) {\n\t\turlString = urlString.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//, options.defaultProtocol);\n\t}\n\n\tconst urlObj = new URL(urlString);\n\n\tif (options.forceHttp && options.forceHttps) {\n\t\tthrow new Error('The `forceHttp` and `forceHttps` options cannot be used together');\n\t}\n\n\tif (options.forceHttp && urlObj.protocol === 'https:') {\n\t\turlObj.protocol = 'http:';\n\t}\n\n\tif (options.forceHttps && urlObj.protocol === 'http:') {\n\t\turlObj.protocol = 'https:';\n\t}\n\n\t// Remove auth\n\tif (options.stripAuthentication) {\n\t\turlObj.username = '';\n\t\turlObj.password = '';\n\t}\n\n\t// Remove hash\n\tif (options.stripHash) {\n\t\turlObj.hash = '';\n\t} else if (options.stripTextFragment) {\n\t\turlObj.hash = urlObj.hash.replace(/#?:~:text.*?$/i, '');\n\t}\n\n\t// Remove duplicate slashes if not preceded by a protocol\n\tif (urlObj.pathname) {\n\t\turlObj.pathname = urlObj.pathname.replace(/(?<!\\b(?:[a-z][a-z\\d+\\-.]{1,50}:))\\/{2,}/g, '/');\n\t}\n\n\t// Decode URI octets\n\tif (urlObj.pathname) {\n\t\ttry {\n\t\t\turlObj.pathname = decodeURI(urlObj.pathname);\n\t\t} catch (_) {}\n\t}\n\n\t// Remove directory index\n\tif (options.removeDirectoryIndex === true) {\n\t\toptions.removeDirectoryIndex = [/^index\\.[a-z]+$/];\n\t}\n\n\tif (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {\n\t\tlet pathComponents = urlObj.pathname.split('/');\n\t\tconst lastComponent = pathComponents[pathComponents.length - 1];\n\n\t\tif (testParameter(lastComponent, options.removeDirectoryIndex)) {\n\t\t\tpathComponents = pathComponents.slice(0, pathComponents.length - 1);\n\t\t\turlObj.pathname = pathComponents.slice(1).join('/') + '/';\n\t\t}\n\t}\n\n\tif (urlObj.hostname) {\n\t\t// Remove trailing dot\n\t\turlObj.hostname = urlObj.hostname.replace(/\\.$/, '');\n\n\t\t// Remove `www.`\n\t\tif (options.stripWWW && /^www\\.(?!www\\.)(?:[a-z\\-\\d]{1,63})\\.(?:[a-z.\\-\\d]{2,63})$/.test(urlObj.hostname)) {\n\t\t\t// Each label should be max 63 at length (min: 1).\n\t\t\t// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names\n\t\t\t// Each TLD should be up to 63 characters long (min: 2).\n\t\t\t// It is technically possible to have a single character TLD, but none currently exist.\n\t\t\turlObj.hostname = urlObj.hostname.replace(/^www\\./, '');\n\t\t}\n\t}\n\n\t// Remove query unwanted parameters\n\tif (Array.isArray(options.removeQueryParameters)) {\n\t\tfor (const key of [...urlObj.searchParams.keys()]) {\n\t\t\tif (testParameter(key, options.removeQueryParameters)) {\n\t\t\t\turlObj.searchParams.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.removeQueryParameters === true) {\n\t\turlObj.search = '';\n\t}\n\n\t// Sort query parameters\n\tif (options.sortQueryParameters) {\n\t\turlObj.searchParams.sort();\n\t}\n\n\tif (options.removeTrailingSlash) {\n\t\turlObj.pathname = urlObj.pathname.replace(/\\/$/, '');\n\t}\n\n\tconst oldUrlString = urlString;\n\n\t// Take advantage of many of the Node `url` normalizations\n\turlString = urlObj.toString();\n\n\tif (!options.removeSingleSlash && urlObj.pathname === '/' && !oldUrlString.endsWith('/') && urlObj.hash === '') {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Remove ending `/` unless removeSingleSlash is false\n\tif ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '' && options.removeSingleSlash) {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Restore relative protocol, if applicable\n\tif (hasRelativeProtocol && !options.normalizeProtocol) {\n\t\turlString = urlString.replace(/^http:\\/\\//, '//');\n\t}\n\n\t// Remove http/https\n\tif (options.stripProtocol) {\n\t\turlString = urlString.replace(/^(?:https?:)?\\/\\//, '');\n\t}\n\n\treturn urlString;\n};\n\nmodule.exports = normalizeUrl;\n\n\n//# sourceURL=webpack:///./node_modules/normalize-url/index.js?");
|
|
31242
31230
|
|
|
31243
31231
|
/***/ }),
|
|
31244
31232
|
|
|
@@ -35352,29 +35340,7 @@ eval("const fs = __webpack_require__(/*! fs */ \"fs\")\n\nconst version = proces
|
|
|
35352
35340
|
/***/ (function(module, exports, __webpack_require__) {
|
|
35353
35341
|
|
|
35354
35342
|
"use strict";
|
|
35355
|
-
eval("/**\n * @fileOverview\n * A simple promises-based check to see if a TCP port is already in use.\n */\n\n\n// define the exports first to avoid cyclic dependencies.\nexports.check = check;\nexports.waitUntilFreeOnHost = waitUntilFreeOnHost;\nexports.waitUntilFree = waitUntilFree;\nexports.waitUntilUsedOnHost = waitUntilUsedOnHost;\nexports.waitUntilUsed = waitUntilUsed;\nexports.waitForStatus = waitForStatus;\n\nvar is = __webpack_require__(/*! is2 */ \"./node_modules/is2/index.js\");\nvar net = __webpack_require__(/*! net */ \"net\");\nvar util = __webpack_require__(/*! util */ \"util\");\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/tcp-port-used/node_modules/debug/src/browser.js\")('tcp-port-used');\n\n// Global Values\nvar TIMEOUT = 2000;\nvar RETRYTIME = 250;\n\nfunction getDeferred() {\n var resolve, reject, promise = new Promise(function(res, rej) {\n resolve = res;\n reject = rej;\n });\n\n return {\n resolve: resolve,\n reject: reject,\n promise: promise\n };\n}\n\n/**\n * Creates an options object from all the possible arguments\n * @private\n * @param {Number} port a valid TCP port number\n * @param {String} host The DNS name or IP address.\n * @param {Boolean} status The desired in use status to wait for: false === not in use, true === in use\n * @param {Number} retryTimeMs the retry interval in milliseconds - defaultis is 200ms\n * @param {Number} timeOutMs the amount of time to wait until port is free default is 1000ms\n * @return {Object} An options object with all the above parameters as properties.\n */\nfunction makeOptionsObj(port, host, inUse, retryTimeMs, timeOutMs) {\n var opts = {};\n opts.port = port;\n opts.host = host;\n opts.inUse = inUse;\n opts.retryTimeMs = retryTimeMs;\n opts.timeOutMs = timeOutMs;\n return opts;\n}\n\n/**\n * Checks if a TCP port is in use by creating the socket and binding it to the\n * target port. Once bound, successfully, it's assume the port is availble.\n * After the socket is closed or in error, the promise is resolved.\n * Note: you have to be super user to correctly test system ports (0-1023).\n * @param {Number|Object} port The port you are curious to see if available. If an object, must have the parameters as properties.\n * @param {String} [host] May be a DNS name or IP address. Default '127.0.0.1'\n * @return {Object} A deferred Q promise.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.check(22, '127.0.0.1')\n * .then(function(inUse) {\n * debug('Port 22 usage: '+inUse);\n * }, function(err) {\n * console.error('Error on check: '+util.inspect(err));\n * });\n */\nfunction check(port, host) {\n\n var deferred = getDeferred();\n var inUse = true;\n var client;\n\n var opts;\n if (!is.obj(port)) {\n opts = makeOptionsObj(port, host);\n } else {\n opts = port;\n }\n\n if (!is.port(opts.port)) {\n debug('Error invalid port: '+util.inspect(opts.port));\n deferred.reject(new Error('invalid port: '+util.inspect(opts.port)));\n return deferred.promise;\n }\n\n if (is.nullOrUndefined(opts.host)) {\n debug('set host address to default 127.0.0.1');\n opts.host = '127.0.0.1';\n }\n\n function cleanUp() {\n if (client) {\n client.removeAllListeners('connect');\n client.removeAllListeners('error');\n client.end();\n client.destroy();\n client.unref();\n }\n //debug('listeners removed from client socket');\n }\n\n function onConnectCb() {\n //debug('check - promise resolved - in use');\n deferred.resolve(inUse);\n cleanUp();\n }\n\n function onErrorCb(err) {\n if (err.code !== 'ECONNREFUSED') {\n //debug('check - promise rejected, error: '+err.message);\n deferred.reject(err);\n } else {\n //debug('ECONNREFUSED');\n inUse = false;\n //debug('check - promise resolved - not in use');\n deferred.resolve(inUse);\n }\n cleanUp();\n }\n\n client = new net.Socket();\n client.once('connect', onConnectCb);\n client.once('error', onErrorCb);\n client.connect({port: opts.port, host: opts.host}, function() {});\n\n return deferred.promise;\n}\n\n/**\n * Creates a deferred promise and fulfills it only when the socket's usage\n * equals status in terms of 'in use' (false === not in use, true === in use).\n * Will retry on an interval specified in retryTimeMs. Note: you have to be\n * super user to correctly test system ports (0-1023).\n * @param {Number|Object} port a valid TCP port number, if an object, has all the parameters described as properties.\n * @param {String} host The DNS name or IP address.\n * @param {Boolean} status The desired in use status to wait for false === not in use, true === in use\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 200ms\n * @param {Number} [timeOutMs] the amount of time to wait until port is free default is 1000ms\n * @return {Object} A deferred promise from the Q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitForStatus(44204, 'some.host.com', true, 500, 4000)\n * .then(function() {\n * console.log('Port 44204 is now in use.');\n * }, function(err) {\n * console.log('Error: ', error.message);\n * });\n */\nfunction waitForStatus(port, host, inUse, retryTimeMs, timeOutMs) {\n\n var deferred = getDeferred();\n var timeoutId;\n var timedout = false;\n var retryId;\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n } else {\n opts = makeOptionsObj(port, host, inUse, retryTimeMs, timeOutMs);\n }\n\n //debug('opts:'+util.inspect(opts);\n\n if (!is.bool(opts.inUse)) {\n deferred.reject(new Error('inUse must be a boolean'));\n return deferred.promise;\n }\n\n if (!is.positiveInt(opts.retryTimeMs)) {\n opts.retryTimeMs = RETRYTIME;\n debug('set retryTime to default '+RETRYTIME+'ms');\n }\n\n if (!is.positiveInt(opts.timeOutMs)) {\n opts.timeOutMs = TIMEOUT;\n debug('set timeOutMs to default '+TIMEOUT+'ms');\n }\n\n function cleanUp() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (retryId) {\n clearTimeout(retryId);\n }\n }\n\n function timeoutFunc() {\n timedout = true;\n cleanUp();\n deferred.reject(new Error('timeout'));\n }\n timeoutId = setTimeout(timeoutFunc, opts.timeOutMs);\n\n function doCheck() {\n check(opts.port, opts.host)\n .then(function(inUse) {\n if (timedout) {\n return;\n }\n //debug('doCheck inUse: '+inUse);\n //debug('doCheck opts.inUse: '+opts.inUse);\n if (inUse === opts.inUse) {\n deferred.resolve();\n cleanUp();\n return;\n } else {\n retryId = setTimeout(function() { doCheck(); }, opts.retryTimeMs);\n return;\n }\n }, function(err) {\n if (timedout) {\n return;\n }\n deferred.reject(err);\n cleanUp();\n });\n }\n\n doCheck();\n return deferred.promise;\n}\n\n/**\n * Creates a deferred promise and fulfills it only when the socket is free.\n * Will retry on an interval specified in retryTimeMs.\n * Note: you have to be super user to correctly test system ports (0-1023).\n * @param {Number} port a valid TCP port number\n * @param {String} [host] The hostname or IP address of where the socket is.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 100ms.\n * @param {Number} [timeOutMs] the amount of time to wait until port is free. Default 300ms.\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilFreeOnHost(44203, 'some.host.com', 500, 4000)\n * .then(function() {\n * console.log('Port 44203 is now free.');\n * }, function(err) {\n * console.loh('Error: ', error.message);\n * });\n */\nfunction waitUntilFreeOnHost(port, host, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.inUse = false;\n } else {\n opts = makeOptionsObj(port, host, false, retryTimeMs, timeOutMs);\n }\n\n return waitForStatus(opts);\n}\n\n/**\n * For compatibility with previous version of the module, that did not provide\n * arguements for hostnames. The host is set to the localhost '127.0.0.1'.\n * @param {Number|Object} port a valid TCP port number. If an object, must contain all the parameters as properties.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 100ms.\n * @param {Number} [timeOutMs] the amount of time to wait until port is free. Default 300ms.\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilFree(44203, 500, 4000)\n * .then(function() {\n * console.log('Port 44203 is now free.');\n * }, function(err) {\n * console.loh('Error: ', error.message);\n * });\n */\nfunction waitUntilFree(port, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.host = '127.0.0.1';\n opts.inUse = false;\n } else {\n opts = makeOptionsObj(port, '127.0.0.1', false, retryTimeMs, timeOutMs);\n }\n\n return waitForStatus(opts);\n}\n\n/**\n * Creates a deferred promise and fulfills it only when the socket is used.\n * Will retry on an interval specified in retryTimeMs.\n * Note: you have to be super user to correctly test system ports (0-1023).\n * @param {Number|Object} port a valid TCP port number. If an object, must contain all the parameters as properties.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 500ms\n * @param {Number} [timeOutMs] the amount of time to wait until port is free\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilUsedOnHost(44204, 'some.host.com', 500, 4000)\n * .then(function() {\n * console.log('Port 44204 is now in use.');\n * }, function(err) {\n * console.log('Error: ', error.message);\n * });\n */\nfunction waitUntilUsedOnHost(port, host, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.inUse = true;\n } else {\n opts = makeOptionsObj(port, host, true, retryTimeMs, timeOutMs);\n }\n\n return waitForStatus(opts);\n}\n\n/**\n * For compatibility to previous version of module which did not have support\n * for host addresses. This function works only for localhost.\n * @param {Number} port a valid TCP port number. If an Object, must contain all the parameters as properties.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 500ms\n * @param {Number} [timeOutMs] the amount of time to wait until port is free\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilUsed(44204, 500, 4000)\n * .then(function() {\n * console.log('Port 44204 is now in use.');\n * }, function(err) {\n * console.log('Error: ', error.message);\n * });\n */\nfunction waitUntilUsed(port, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.host = '127.0.0.1';\n opts.inUse = true;\n } else {\n opts = makeOptionsObj(port, '127.0.0.1', true, retryTimeMs, timeOutMs);\n }\n\n return waitUntilUsedOnHost(opts);\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/tcp-port-used/index.js?");
|
|
35356
|
-
|
|
35357
|
-
/***/ }),
|
|
35358
|
-
|
|
35359
|
-
/***/ "./node_modules/tcp-port-used/node_modules/debug/src/browser.js":
|
|
35360
|
-
/*!**********************************************************************!*\
|
|
35361
|
-
!*** ./node_modules/tcp-port-used/node_modules/debug/src/browser.js ***!
|
|
35362
|
-
\**********************************************************************/
|
|
35363
|
-
/*! no static exports found */
|
|
35364
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
35365
|
-
|
|
35366
|
-
eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/tcp-port-used/node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/tcp-port-used/node_modules/debug/src/browser.js?");
|
|
35367
|
-
|
|
35368
|
-
/***/ }),
|
|
35369
|
-
|
|
35370
|
-
/***/ "./node_modules/tcp-port-used/node_modules/debug/src/common.js":
|
|
35371
|
-
/*!*********************************************************************!*\
|
|
35372
|
-
!*** ./node_modules/tcp-port-used/node_modules/debug/src/common.js ***!
|
|
35373
|
-
\*********************************************************************/
|
|
35374
|
-
/*! no static exports found */
|
|
35375
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
35376
|
-
|
|
35377
|
-
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n\n\n//# sourceURL=webpack:///./node_modules/tcp-port-used/node_modules/debug/src/common.js?");
|
|
35343
|
+
eval("/**\n * @fileOverview\n * A simple promises-based check to see if a TCP port is already in use.\n */\n\n\n// define the exports first to avoid cyclic dependencies.\nexports.check = check;\nexports.waitUntilFreeOnHost = waitUntilFreeOnHost;\nexports.waitUntilFree = waitUntilFree;\nexports.waitUntilUsedOnHost = waitUntilUsedOnHost;\nexports.waitUntilUsed = waitUntilUsed;\nexports.waitForStatus = waitForStatus;\n\nvar is = __webpack_require__(/*! is2 */ \"./node_modules/is2/index.js\");\nvar net = __webpack_require__(/*! net */ \"net\");\nvar util = __webpack_require__(/*! util */ \"util\");\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('tcp-port-used');\n\n// Global Values\nvar TIMEOUT = 2000;\nvar RETRYTIME = 250;\n\nfunction getDeferred() {\n var resolve, reject, promise = new Promise(function(res, rej) {\n resolve = res;\n reject = rej;\n });\n\n return {\n resolve: resolve,\n reject: reject,\n promise: promise\n };\n}\n\n/**\n * Creates an options object from all the possible arguments\n * @private\n * @param {Number} port a valid TCP port number\n * @param {String} host The DNS name or IP address.\n * @param {Boolean} status The desired in use status to wait for: false === not in use, true === in use\n * @param {Number} retryTimeMs the retry interval in milliseconds - defaultis is 200ms\n * @param {Number} timeOutMs the amount of time to wait until port is free default is 1000ms\n * @return {Object} An options object with all the above parameters as properties.\n */\nfunction makeOptionsObj(port, host, inUse, retryTimeMs, timeOutMs) {\n var opts = {};\n opts.port = port;\n opts.host = host;\n opts.inUse = inUse;\n opts.retryTimeMs = retryTimeMs;\n opts.timeOutMs = timeOutMs;\n return opts;\n}\n\n/**\n * Checks if a TCP port is in use by creating the socket and binding it to the\n * target port. Once bound, successfully, it's assume the port is availble.\n * After the socket is closed or in error, the promise is resolved.\n * Note: you have to be super user to correctly test system ports (0-1023).\n * @param {Number|Object} port The port you are curious to see if available. If an object, must have the parameters as properties.\n * @param {String} [host] May be a DNS name or IP address. Default '127.0.0.1'\n * @return {Object} A deferred Q promise.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.check(22, '127.0.0.1')\n * .then(function(inUse) {\n * debug('Port 22 usage: '+inUse);\n * }, function(err) {\n * console.error('Error on check: '+util.inspect(err));\n * });\n */\nfunction check(port, host) {\n\n var deferred = getDeferred();\n var inUse = true;\n var client;\n\n var opts;\n if (!is.obj(port)) {\n opts = makeOptionsObj(port, host);\n } else {\n opts = port;\n }\n\n if (!is.port(opts.port)) {\n debug('Error invalid port: '+util.inspect(opts.port));\n deferred.reject(new Error('invalid port: '+util.inspect(opts.port)));\n return deferred.promise;\n }\n\n if (is.nullOrUndefined(opts.host)) {\n debug('set host address to default 127.0.0.1');\n opts.host = '127.0.0.1';\n }\n\n function cleanUp() {\n if (client) {\n client.removeAllListeners('connect');\n client.removeAllListeners('error');\n client.end();\n client.destroy();\n client.unref();\n }\n //debug('listeners removed from client socket');\n }\n\n function onConnectCb() {\n //debug('check - promise resolved - in use');\n deferred.resolve(inUse);\n cleanUp();\n }\n\n function onErrorCb(err) {\n if (err.code !== 'ECONNREFUSED') {\n //debug('check - promise rejected, error: '+err.message);\n deferred.reject(err);\n } else {\n //debug('ECONNREFUSED');\n inUse = false;\n //debug('check - promise resolved - not in use');\n deferred.resolve(inUse);\n }\n cleanUp();\n }\n\n client = new net.Socket();\n client.once('connect', onConnectCb);\n client.once('error', onErrorCb);\n client.connect({port: opts.port, host: opts.host}, function() {});\n\n return deferred.promise;\n}\n\n/**\n * Creates a deferred promise and fulfills it only when the socket's usage\n * equals status in terms of 'in use' (false === not in use, true === in use).\n * Will retry on an interval specified in retryTimeMs. Note: you have to be\n * super user to correctly test system ports (0-1023).\n * @param {Number|Object} port a valid TCP port number, if an object, has all the parameters described as properties.\n * @param {String} host The DNS name or IP address.\n * @param {Boolean} status The desired in use status to wait for false === not in use, true === in use\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 200ms\n * @param {Number} [timeOutMs] the amount of time to wait until port is free default is 1000ms\n * @return {Object} A deferred promise from the Q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitForStatus(44204, 'some.host.com', true, 500, 4000)\n * .then(function() {\n * console.log('Port 44204 is now in use.');\n * }, function(err) {\n * console.log('Error: ', error.message);\n * });\n */\nfunction waitForStatus(port, host, inUse, retryTimeMs, timeOutMs) {\n\n var deferred = getDeferred();\n var timeoutId;\n var timedout = false;\n var retryId;\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n } else {\n opts = makeOptionsObj(port, host, inUse, retryTimeMs, timeOutMs);\n }\n\n //debug('opts:'+util.inspect(opts);\n\n if (!is.bool(opts.inUse)) {\n deferred.reject(new Error('inUse must be a boolean'));\n return deferred.promise;\n }\n\n if (!is.positiveInt(opts.retryTimeMs)) {\n opts.retryTimeMs = RETRYTIME;\n debug('set retryTime to default '+RETRYTIME+'ms');\n }\n\n if (!is.positiveInt(opts.timeOutMs)) {\n opts.timeOutMs = TIMEOUT;\n debug('set timeOutMs to default '+TIMEOUT+'ms');\n }\n\n function cleanUp() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (retryId) {\n clearTimeout(retryId);\n }\n }\n\n function timeoutFunc() {\n timedout = true;\n cleanUp();\n deferred.reject(new Error('timeout'));\n }\n timeoutId = setTimeout(timeoutFunc, opts.timeOutMs);\n\n function doCheck() {\n check(opts.port, opts.host)\n .then(function(inUse) {\n if (timedout) {\n return;\n }\n //debug('doCheck inUse: '+inUse);\n //debug('doCheck opts.inUse: '+opts.inUse);\n if (inUse === opts.inUse) {\n deferred.resolve();\n cleanUp();\n return;\n } else {\n retryId = setTimeout(function() { doCheck(); }, opts.retryTimeMs);\n return;\n }\n }, function(err) {\n if (timedout) {\n return;\n }\n deferred.reject(err);\n cleanUp();\n });\n }\n\n doCheck();\n return deferred.promise;\n}\n\n/**\n * Creates a deferred promise and fulfills it only when the socket is free.\n * Will retry on an interval specified in retryTimeMs.\n * Note: you have to be super user to correctly test system ports (0-1023).\n * @param {Number} port a valid TCP port number\n * @param {String} [host] The hostname or IP address of where the socket is.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 100ms.\n * @param {Number} [timeOutMs] the amount of time to wait until port is free. Default 300ms.\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilFreeOnHost(44203, 'some.host.com', 500, 4000)\n * .then(function() {\n * console.log('Port 44203 is now free.');\n * }, function(err) {\n * console.loh('Error: ', error.message);\n * });\n */\nfunction waitUntilFreeOnHost(port, host, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.inUse = false;\n } else {\n opts = makeOptionsObj(port, host, false, retryTimeMs, timeOutMs);\n }\n\n return waitForStatus(opts);\n}\n\n/**\n * For compatibility with previous version of the module, that did not provide\n * arguements for hostnames. The host is set to the localhost '127.0.0.1'.\n * @param {Number|Object} port a valid TCP port number. If an object, must contain all the parameters as properties.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 100ms.\n * @param {Number} [timeOutMs] the amount of time to wait until port is free. Default 300ms.\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilFree(44203, 500, 4000)\n * .then(function() {\n * console.log('Port 44203 is now free.');\n * }, function(err) {\n * console.loh('Error: ', error.message);\n * });\n */\nfunction waitUntilFree(port, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.host = '127.0.0.1';\n opts.inUse = false;\n } else {\n opts = makeOptionsObj(port, '127.0.0.1', false, retryTimeMs, timeOutMs);\n }\n\n return waitForStatus(opts);\n}\n\n/**\n * Creates a deferred promise and fulfills it only when the socket is used.\n * Will retry on an interval specified in retryTimeMs.\n * Note: you have to be super user to correctly test system ports (0-1023).\n * @param {Number|Object} port a valid TCP port number. If an object, must contain all the parameters as properties.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 500ms\n * @param {Number} [timeOutMs] the amount of time to wait until port is free\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilUsedOnHost(44204, 'some.host.com', 500, 4000)\n * .then(function() {\n * console.log('Port 44204 is now in use.');\n * }, function(err) {\n * console.log('Error: ', error.message);\n * });\n */\nfunction waitUntilUsedOnHost(port, host, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.inUse = true;\n } else {\n opts = makeOptionsObj(port, host, true, retryTimeMs, timeOutMs);\n }\n\n return waitForStatus(opts);\n}\n\n/**\n * For compatibility to previous version of module which did not have support\n * for host addresses. This function works only for localhost.\n * @param {Number} port a valid TCP port number. If an Object, must contain all the parameters as properties.\n * @param {Number} [retryTimeMs] the retry interval in milliseconds - defaultis is 500ms\n * @param {Number} [timeOutMs] the amount of time to wait until port is free\n * @return {Object} A deferred promise from the q library.\n *\n * Example usage:\n *\n * var tcpPortUsed = require('tcp-port-used');\n * tcpPortUsed.waitUntilUsed(44204, 500, 4000)\n * .then(function() {\n * console.log('Port 44204 is now in use.');\n * }, function(err) {\n * console.log('Error: ', error.message);\n * });\n */\nfunction waitUntilUsed(port, retryTimeMs, timeOutMs) {\n\n // the first arument may be an object, if it is not, make an object\n var opts;\n if (is.obj(port)) {\n opts = port;\n opts.host = '127.0.0.1';\n opts.inUse = true;\n } else {\n opts = makeOptionsObj(port, '127.0.0.1', true, retryTimeMs, timeOutMs);\n }\n\n return waitUntilUsedOnHost(opts);\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/tcp-port-used/index.js?");
|
|
35378
35344
|
|
|
35379
35345
|
/***/ }),
|
|
35380
35346
|
|
|
@@ -38376,7 +38342,7 @@ eval("class Node {\n\t/// value;\n\t/// next;\n\n\tconstructor(value) {\n\t\tthi
|
|
|
38376
38342
|
/*! exports provided: name, productName, description, homepage, version, main, copyright, license, author, scripts, config, engines, jest, build, dependencies, devDependencies, default */
|
|
38377
38343
|
/***/ (function(module) {
|
|
38378
38344
|
|
|
38379
|
-
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"open-lens\\\",\\\"productName\\\":\\\"OpenLens\\\",\\\"description\\\":\\\"OpenLens - Open Source IDE for Kubernetes\\\",\\\"homepage\\\":\\\"https://github.com/lensapp/lens\\\",\\\"version\\\":\\\"5.3.0\\\",\\\"main\\\":\\\"static/build/main.js\\\",\\\"copyright\\\":\\\"© 2021 OpenLens Authors\\\",\\\"license\\\":\\\"MIT\\\",\\\"author\\\":{\\\"name\\\":\\\"OpenLens Authors\\\",\\\"email\\\":\\\"info@k8slens.dev\\\"},\\\"scripts\\\":{\\\"dev\\\":\\\"concurrently -i -k \\\\\\\"yarn run dev-run -C\\\\\\\" yarn:dev:*\\\",\\\"dev-build\\\":\\\"concurrently yarn:compile:*\\\",\\\"debug-build\\\":\\\"concurrently yarn:compile:main yarn:compile:extension-types\\\",\\\"dev-run\\\":\\\"nodemon --watch static/build/main.js --exec \\\\\\\"electron --remote-debugging-port=9223 --inspect .\\\\\\\"\\\",\\\"dev:main\\\":\\\"yarn run compile:main --watch\\\",\\\"dev:renderer\\\":\\\"yarn run webpack-dev-server --config webpack.renderer.ts\\\",\\\"dev:extension-types\\\":\\\"yarn run compile:extension-types --watch\\\",\\\"compile\\\":\\\"env NODE_ENV=production concurrently yarn:compile:*\\\",\\\"compile:main\\\":\\\"yarn run webpack --config webpack.main.ts\\\",\\\"compile:renderer\\\":\\\"yarn run webpack --config webpack.renderer.ts\\\",\\\"compile:extension-types\\\":\\\"yarn run webpack --config webpack.extensions.ts\\\",\\\"npm:fix-build-version\\\":\\\"yarn run ts-node build/set_build_version.ts\\\",\\\"npm:fix-package-version\\\":\\\"yarn run ts-node build/set_npm_version.ts\\\",\\\"build:linux\\\":\\\"yarn run compile && electron-builder --linux --dir\\\",\\\"build:mac\\\":\\\"yarn run compile && electron-builder --mac --dir\\\",\\\"build:win\\\":\\\"yarn run compile && electron-builder --win --dir\\\",\\\"integration\\\":\\\"jest --runInBand --detectOpenHandles --forceExit integration\\\",\\\"dist\\\":\\\"yarn run compile && electron-builder --publish onTag\\\",\\\"dist:dir\\\":\\\"yarn run dist --dir -c.compression=store -c.mac.identity=null\\\",\\\"download-bins\\\":\\\"concurrently yarn:download:*\\\",\\\"download:kubectl\\\":\\\"yarn run ts-node build/download_kubectl.ts\\\",\\\"download:helm\\\":\\\"yarn run ts-node build/download_helm.ts\\\",\\\"build:tray-icons\\\":\\\"yarn run ts-node build/build_tray_icon.ts\\\",\\\"build:theme-vars\\\":\\\"yarn run ts-node build/build_theme_vars.ts\\\",\\\"lint\\\":\\\"PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .\\\",\\\"lint:fix\\\":\\\"yarn run lint --fix\\\",\\\"mkdocs-serve-local\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest\\\",\\\"verify-docs\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict\\\",\\\"typedocs-extensions-api\\\":\\\"yarn run typedoc src/extensions/extension-api.ts\\\",\\\"version-checkout\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release/v%s\\\\\\\" | xargs git checkout -b\\\",\\\"version-commit\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release v%s\\\\\\\" | git commit --no-edit -s -F -\\\",\\\"version\\\":\\\"yarn run version-checkout && git add package.json && yarn run version-commit\\\",\\\"postversion\\\":\\\"git push --set-upstream ${GIT_REMOTE:-origin} release/v$npm_package_version\\\"},\\\"config\\\":{\\\"bundledKubectlVersion\\\":\\\"1.21.2\\\",\\\"bundledHelmVersion\\\":\\\"3.6.3\\\",\\\"sentryDsn\\\":\\\"\\\"},\\\"engines\\\":{\\\"node\\\":\\\">=14 <15\\\"},\\\"jest\\\":{\\\"collectCoverage\\\":false,\\\"verbose\\\":true,\\\"transform\\\":{\\\"^.+\\\\\\\\.tsx?$\\\":\\\"ts-jest\\\"},\\\"moduleNameMapper\\\":{\\\"\\\\\\\\.(css|scss)$\\\":\\\"<rootDir>/__mocks__/styleMock.ts\\\",\\\"\\\\\\\\.(svg)$\\\":\\\"<rootDir>/__mocks__/imageMock.ts\\\",\\\"src/(.*)\\\":\\\"<rootDir>/__mocks__/windowMock.ts\\\"},\\\"modulePathIgnorePatterns\\\":[\\\"<rootDir>/dist\\\",\\\"<rootDir>/src/extensions/npm\\\"],\\\"setupFiles\\\":[\\\"<rootDir>/src/jest.setup.ts\\\",\\\"jest-canvas-mock\\\"],\\\"globals\\\":{\\\"ts-jest\\\":{\\\"isolatedModules\\\":true}}},\\\"build\\\":{\\\"generateUpdatesFilesForAllChannels\\\":true,\\\"files\\\":[\\\"static/build/main.js\\\"],\\\"afterSign\\\":\\\"build/notarize.js\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"locales/\\\",\\\"to\\\":\\\"locales/\\\",\\\"filter\\\":\\\"**/*.js\\\"},{\\\"from\\\":\\\"static/\\\",\\\"to\\\":\\\"static/\\\",\\\"filter\\\":\\\"!**/main.js\\\"},{\\\"from\\\":\\\"build/tray\\\",\\\"to\\\":\\\"static/icons\\\",\\\"filter\\\":\\\"*.png\\\"},{\\\"from\\\":\\\"extensions/\\\",\\\"to\\\":\\\"./extensions/\\\",\\\"filter\\\":[\\\"**/*.tgz\\\",\\\"**/package.json\\\",\\\"!**/node_modules\\\"]},{\\\"from\\\":\\\"templates/\\\",\\\"to\\\":\\\"./templates/\\\",\\\"filter\\\":\\\"**/*.yaml\\\"},\\\"LICENSE\\\"],\\\"linux\\\":{\\\"category\\\":\\\"Network\\\",\\\"artifactName\\\":\\\"${productName}-${version}.${arch}.${ext}\\\",\\\"target\\\":[\\\"deb\\\",\\\"rpm\\\",\\\"AppImage\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/linux/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"rpm\\\":{\\\"fpm\\\":[\\\"--rpm-rpmbuild-define=%define _build_id_links none\\\"]},\\\"mac\\\":{\\\"hardenedRuntime\\\":true,\\\"gatekeeperAssess\\\":false,\\\"entitlements\\\":\\\"build/entitlements.mac.plist\\\",\\\"entitlementsInherit\\\":\\\"build/entitlements.mac.plist\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/darwin/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"win\\\":{\\\"target\\\":[\\\"nsis\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/windows/x64/kubectl.exe\\\",\\\"to\\\":\\\"./x64/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/windows/ia32/kubectl.exe\\\",\\\"to\\\":\\\"./ia32/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/x64/helm3/helm3.exe\\\",\\\"to\\\":\\\"./helm3/helm3.exe\\\"}]},\\\"nsis\\\":{\\\"include\\\":\\\"build/installer.nsh\\\",\\\"oneClick\\\":false,\\\"allowElevation\\\":true,\\\"createStartMenuShortcut\\\":true,\\\"allowToChangeInstallationDirectory\\\":true},\\\"protocols\\\":{\\\"name\\\":\\\"Lens Protocol Handler\\\",\\\"schemes\\\":[\\\"lens\\\"],\\\"role\\\":\\\"Viewer\\\"}},\\\"dependencies\\\":{\\\"@electron/remote\\\":\\\"^1.2.2\\\",\\\"@hapi/call\\\":\\\"^8.0.1\\\",\\\"@hapi/subtext\\\":\\\"^7.0.3\\\",\\\"@kubernetes/client-node\\\":\\\"^0.16.1\\\",\\\"@ogre-tools/injectable\\\":\\\"2.0.0\\\",\\\"@ogre-tools/injectable-react\\\":\\\"2.0.0\\\",\\\"@sentry/electron\\\":\\\"^2.5.4\\\",\\\"@sentry/integrations\\\":\\\"^6.15.0\\\",\\\"abort-controller\\\":\\\"^3.0.0\\\",\\\"auto-bind\\\":\\\"^4.0.0\\\",\\\"autobind-decorator\\\":\\\"^2.4.0\\\",\\\"await-lock\\\":\\\"^2.1.0\\\",\\\"byline\\\":\\\"^5.0.0\\\",\\\"chokidar\\\":\\\"^3.4.3\\\",\\\"conf\\\":\\\"^7.1.2\\\",\\\"crypto-js\\\":\\\"^4.1.1\\\",\\\"electron-devtools-installer\\\":\\\"^3.2.0\\\",\\\"electron-updater\\\":\\\"^4.6.1\\\",\\\"electron-window-state\\\":\\\"^5.0.3\\\",\\\"filehound\\\":\\\"^1.17.5\\\",\\\"fs-extra\\\":\\\"^9.0.1\\\",\\\"glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"got\\\":\\\"^11.8.2\\\",\\\"grapheme-splitter\\\":\\\"^1.0.4\\\",\\\"handlebars\\\":\\\"^4.7.7\\\",\\\"http-proxy\\\":\\\"^1.18.1\\\",\\\"immer\\\":\\\"^9.0.6\\\",\\\"joi\\\":\\\"^17.5.0\\\",\\\"js-yaml\\\":\\\"^4.1.0\\\",\\\"jsdom\\\":\\\"^16.7.0\\\",\\\"jsonpath\\\":\\\"^1.1.1\\\",\\\"lodash\\\":\\\"^4.17.15\\\",\\\"mac-ca\\\":\\\"^1.0.6\\\",\\\"marked\\\":\\\"^2.1.3\\\",\\\"md5-file\\\":\\\"^5.0.0\\\",\\\"mobx\\\":\\\"^6.3.7\\\",\\\"mobx-observable-history\\\":\\\"^2.0.3\\\",\\\"mobx-react\\\":\\\"^7.2.1\\\",\\\"mock-fs\\\":\\\"^5.1.2\\\",\\\"moment\\\":\\\"^2.29.1\\\",\\\"moment-timezone\\\":\\\"^0.5.34\\\",\\\"monaco-editor\\\":\\\"^0.29.1\\\",\\\"monaco-editor-webpack-plugin\\\":\\\"^5.0.0\\\",\\\"node-fetch\\\":\\\"lensapp/node-fetch#2.x\\\",\\\"node-pty\\\":\\\"^0.10.1\\\",\\\"npm\\\":\\\"^6.14.15\\\",\\\"p-limit\\\":\\\"^3.1.0\\\",\\\"path-to-regexp\\\":\\\"^6.2.0\\\",\\\"proper-lockfile\\\":\\\"^4.1.2\\\",\\\"react\\\":\\\"^17.0.2\\\",\\\"react-dom\\\":\\\"^17.0.2\\\",\\\"react-material-ui-carousel\\\":\\\"^2.3.8\\\",\\\"react-router\\\":\\\"^5.2.0\\\",\\\"react-virtualized-auto-sizer\\\":\\\"^1.0.6\\\",\\\"readable-stream\\\":\\\"^3.6.0\\\",\\\"request\\\":\\\"^2.88.2\\\",\\\"request-promise-native\\\":\\\"^1.0.9\\\",\\\"rfc6902\\\":\\\"^4.0.2\\\",\\\"semver\\\":\\\"^7.3.2\\\",\\\"shell-env\\\":\\\"^3.0.1\\\",\\\"spdy\\\":\\\"^4.0.2\\\",\\\"tar\\\":\\\"^6.1.11\\\",\\\"tcp-port-used\\\":\\\"^1.0.2\\\",\\\"tempy\\\":\\\"1.0.1\\\",\\\"url-parse\\\":\\\"^1.5.3\\\",\\\"uuid\\\":\\\"^8.3.2\\\",\\\"win-ca\\\":\\\"^3.4.5\\\",\\\"winston\\\":\\\"^3.3.3\\\",\\\"winston-console-format\\\":\\\"^1.0.8\\\",\\\"winston-transport-browserconsole\\\":\\\"^1.0.5\\\",\\\"ws\\\":\\\"^7.5.5\\\"},\\\"devDependencies\\\":{\\\"@async-fn/jest\\\":\\\"1.5.3\\\",\\\"@material-ui/core\\\":\\\"^4.12.3\\\",\\\"@material-ui/icons\\\":\\\"^4.11.2\\\",\\\"@material-ui/lab\\\":\\\"^4.0.0-alpha.60\\\",\\\"@pmmmwh/react-refresh-webpack-plugin\\\":\\\"^0.4.3\\\",\\\"@sentry/types\\\":\\\"^6.14.1\\\",\\\"@testing-library/jest-dom\\\":\\\"^5.16.1\\\",\\\"@testing-library/react\\\":\\\"^11.2.7\\\",\\\"@testing-library/user-event\\\":\\\"^13.5.0\\\",\\\"@types/byline\\\":\\\"^4.2.33\\\",\\\"@types/chart.js\\\":\\\"^2.9.34\\\",\\\"@types/color\\\":\\\"^3.0.2\\\",\\\"@types/crypto-js\\\":\\\"^3.1.47\\\",\\\"@types/dompurify\\\":\\\"^2.3.1\\\",\\\"@types/electron-devtools-installer\\\":\\\"^2.2.0\\\",\\\"@types/fs-extra\\\":\\\"^9.0.13\\\",\\\"@types/glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"@types/hoist-non-react-statics\\\":\\\"^3.3.1\\\",\\\"@types/html-webpack-plugin\\\":\\\"^3.2.6\\\",\\\"@types/http-proxy\\\":\\\"^1.17.7\\\",\\\"@types/jest\\\":\\\"^26.0.24\\\",\\\"@types/js-yaml\\\":\\\"^4.0.5\\\",\\\"@types/jsdom\\\":\\\"^16.2.13\\\",\\\"@types/jsonpath\\\":\\\"^0.2.0\\\",\\\"@types/lodash\\\":\\\"^4.14.177\\\",\\\"@types/marked\\\":\\\"^2.0.5\\\",\\\"@types/md5-file\\\":\\\"^4.0.2\\\",\\\"@types/mini-css-extract-plugin\\\":\\\"^0.9.1\\\",\\\"@types/mock-fs\\\":\\\"^4.13.1\\\",\\\"@types/node\\\":\\\"14.17.33\\\",\\\"@types/node-fetch\\\":\\\"^2.5.12\\\",\\\"@types/npm\\\":\\\"^2.0.32\\\",\\\"@types/progress-bar-webpack-plugin\\\":\\\"^2.1.2\\\",\\\"@types/proper-lockfile\\\":\\\"^4.1.2\\\",\\\"@types/randomcolor\\\":\\\"^0.5.6\\\",\\\"@types/react\\\":\\\"^17.0.34\\\",\\\"@types/react-beautiful-dnd\\\":\\\"^13.1.2\\\",\\\"@types/react-dom\\\":\\\"^17.0.11\\\",\\\"@types/react-router-dom\\\":\\\"^5.3.2\\\",\\\"@types/react-select\\\":\\\"3.1.2\\\",\\\"@types/react-table\\\":\\\"^7.7.8\\\",\\\"@types/react-virtualized-auto-sizer\\\":\\\"^1.0.1\\\",\\\"@types/react-window\\\":\\\"^1.8.5\\\",\\\"@types/readable-stream\\\":\\\"^2.3.12\\\",\\\"@types/request\\\":\\\"^2.48.7\\\",\\\"@types/request-promise-native\\\":\\\"^1.0.18\\\",\\\"@types/semver\\\":\\\"^7.3.9\\\",\\\"@types/sharp\\\":\\\"^0.29.4\\\",\\\"@types/spdy\\\":\\\"^3.4.5\\\",\\\"@types/tar\\\":\\\"^4.0.5\\\",\\\"@types/tcp-port-used\\\":\\\"^1.0.0\\\",\\\"@types/tempy\\\":\\\"^0.3.0\\\",\\\"@types/triple-beam\\\":\\\"^1.3.2\\\",\\\"@types/url-parse\\\":\\\"^1.4.5\\\",\\\"@types/uuid\\\":\\\"^8.3.3\\\",\\\"@types/webpack\\\":\\\"^4.41.32\\\",\\\"@types/webpack-dev-server\\\":\\\"^3.11.6\\\",\\\"@types/webpack-env\\\":\\\"^1.16.3\\\",\\\"@types/webpack-node-externals\\\":\\\"^1.7.1\\\",\\\"@typescript-eslint/eslint-plugin\\\":\\\"^5.7.0\\\",\\\"@typescript-eslint/parser\\\":\\\"^5.7.0\\\",\\\"ansi_up\\\":\\\"^5.1.0\\\",\\\"chart.js\\\":\\\"^2.9.4\\\",\\\"circular-dependency-plugin\\\":\\\"^5.2.2\\\",\\\"color\\\":\\\"^3.2.1\\\",\\\"concurrently\\\":\\\"^5.3.0\\\",\\\"css-loader\\\":\\\"^5.2.7\\\",\\\"deepdash\\\":\\\"^5.3.9\\\",\\\"dompurify\\\":\\\"^2.3.3\\\",\\\"electron\\\":\\\"^13.6.1\\\",\\\"electron-builder\\\":\\\"^22.14.5\\\",\\\"electron-notarize\\\":\\\"^0.3.0\\\",\\\"esbuild\\\":\\\"^0.13.15\\\",\\\"esbuild-loader\\\":\\\"^2.16.0\\\",\\\"eslint\\\":\\\"^7.32.0\\\",\\\"eslint-plugin-header\\\":\\\"^3.1.1\\\",\\\"eslint-plugin-react\\\":\\\"^7.27.1\\\",\\\"eslint-plugin-react-hooks\\\":\\\"^4.3.0\\\",\\\"eslint-plugin-unused-imports\\\":\\\"^1.1.5\\\",\\\"file-loader\\\":\\\"^6.2.0\\\",\\\"flex.box\\\":\\\"^3.4.4\\\",\\\"fork-ts-checker-webpack-plugin\\\":\\\"^5.2.1\\\",\\\"hoist-non-react-statics\\\":\\\"^3.3.2\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.2\\\",\\\"include-media\\\":\\\"^1.4.9\\\",\\\"jest\\\":\\\"26.6.3\\\",\\\"jest-canvas-mock\\\":\\\"^2.3.1\\\",\\\"jest-fetch-mock\\\":\\\"^3.0.3\\\",\\\"jest-mock-extended\\\":\\\"^1.0.18\\\",\\\"make-plural\\\":\\\"^6.2.2\\\",\\\"mini-css-extract-plugin\\\":\\\"^1.6.2\\\",\\\"node-gyp\\\":\\\"7.1.2\\\",\\\"node-loader\\\":\\\"^1.0.3\\\",\\\"nodemon\\\":\\\"^2.0.14\\\",\\\"playwright\\\":\\\"^1.17.1\\\",\\\"postcss\\\":\\\"^8.4.5\\\",\\\"postcss-loader\\\":\\\"^4.3.0\\\",\\\"progress-bar-webpack-plugin\\\":\\\"^2.1.0\\\",\\\"randomcolor\\\":\\\"^0.6.2\\\",\\\"raw-loader\\\":\\\"^4.0.2\\\",\\\"react-beautiful-dnd\\\":\\\"^13.1.0\\\",\\\"react-refresh\\\":\\\"^0.9.0\\\",\\\"react-router-dom\\\":\\\"^5.3.0\\\",\\\"react-select\\\":\\\"3.2.0\\\",\\\"react-select-event\\\":\\\"^5.1.0\\\",\\\"react-table\\\":\\\"^7.7.0\\\",\\\"react-window\\\":\\\"^1.8.6\\\",\\\"sass\\\":\\\"^1.45.1\\\",\\\"sass-loader\\\":\\\"^10.2.0\\\",\\\"sharp\\\":\\\"^0.29.3\\\",\\\"style-loader\\\":\\\"^2.0.0\\\",\\\"tailwindcss\\\":\\\"^3.0.7\\\",\\\"ts-jest\\\":\\\"26.5.6\\\",\\\"ts-loader\\\":\\\"^7.0.5\\\",\\\"ts-node\\\":\\\"^10.4.0\\\",\\\"type-fest\\\":\\\"^1.0.2\\\",\\\"typed-emitter\\\":\\\"^1.4.0\\\",\\\"typedoc\\\":\\\"0.22.10\\\",\\\"typedoc-plugin-markdown\\\":\\\"^3.11.3\\\",\\\"typeface-roboto\\\":\\\"^1.1.13\\\",\\\"typescript\\\":\\\"^4.5.2\\\",\\\"typescript-plugin-css-modules\\\":\\\"^3.4.0\\\",\\\"url-loader\\\":\\\"^4.1.1\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.3\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\",\\\"xterm\\\":\\\"^4.15.0\\\",\\\"xterm-addon-fit\\\":\\\"^0.5.0\\\"}}\");\n\n//# sourceURL=webpack:///./package.json?");
|
|
38345
|
+
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"open-lens\\\",\\\"productName\\\":\\\"OpenLens\\\",\\\"description\\\":\\\"OpenLens - Open Source IDE for Kubernetes\\\",\\\"homepage\\\":\\\"https://github.com/lensapp/lens\\\",\\\"version\\\":\\\"5.3.0\\\",\\\"main\\\":\\\"static/build/main.js\\\",\\\"copyright\\\":\\\"© 2021 OpenLens Authors\\\",\\\"license\\\":\\\"MIT\\\",\\\"author\\\":{\\\"name\\\":\\\"OpenLens Authors\\\",\\\"email\\\":\\\"info@k8slens.dev\\\"},\\\"scripts\\\":{\\\"dev\\\":\\\"concurrently -i -k \\\\\\\"yarn run dev-run -C\\\\\\\" yarn:dev:*\\\",\\\"dev-build\\\":\\\"concurrently yarn:compile:*\\\",\\\"debug-build\\\":\\\"concurrently yarn:compile:main yarn:compile:extension-types\\\",\\\"dev-run\\\":\\\"nodemon --watch static/build/main.js --exec \\\\\\\"electron --remote-debugging-port=9223 --inspect .\\\\\\\"\\\",\\\"dev:main\\\":\\\"yarn run compile:main --watch\\\",\\\"dev:renderer\\\":\\\"yarn run webpack-dev-server --config webpack.renderer.ts\\\",\\\"dev:extension-types\\\":\\\"yarn run compile:extension-types --watch\\\",\\\"compile\\\":\\\"env NODE_ENV=production concurrently yarn:compile:*\\\",\\\"compile:main\\\":\\\"yarn run webpack --config webpack.main.ts\\\",\\\"compile:renderer\\\":\\\"yarn run webpack --config webpack.renderer.ts\\\",\\\"compile:extension-types\\\":\\\"yarn run webpack --config webpack.extensions.ts\\\",\\\"npm:fix-build-version\\\":\\\"yarn run ts-node build/set_build_version.ts\\\",\\\"npm:fix-package-version\\\":\\\"yarn run ts-node build/set_npm_version.ts\\\",\\\"build:linux\\\":\\\"yarn run compile && electron-builder --linux --dir\\\",\\\"build:mac\\\":\\\"yarn run compile && electron-builder --mac --dir\\\",\\\"build:win\\\":\\\"yarn run compile && electron-builder --win --dir\\\",\\\"integration\\\":\\\"jest --runInBand --detectOpenHandles --forceExit integration\\\",\\\"dist\\\":\\\"yarn run compile && electron-builder --publish onTag\\\",\\\"dist:dir\\\":\\\"yarn run dist --dir -c.compression=store -c.mac.identity=null\\\",\\\"download-bins\\\":\\\"concurrently yarn:download:*\\\",\\\"download:kubectl\\\":\\\"yarn run ts-node build/download_kubectl.ts\\\",\\\"download:helm\\\":\\\"yarn run ts-node build/download_helm.ts\\\",\\\"build:tray-icons\\\":\\\"yarn run ts-node build/build_tray_icon.ts\\\",\\\"build:theme-vars\\\":\\\"yarn run ts-node build/build_theme_vars.ts\\\",\\\"lint\\\":\\\"PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .\\\",\\\"lint:fix\\\":\\\"yarn run lint --fix\\\",\\\"mkdocs-serve-local\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest\\\",\\\"verify-docs\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict\\\",\\\"typedocs-extensions-api\\\":\\\"yarn run typedoc src/extensions/extension-api.ts\\\",\\\"version-checkout\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release/v%s\\\\\\\" | xargs git checkout -b\\\",\\\"version-commit\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release v%s\\\\\\\" | git commit --no-edit -s -F -\\\",\\\"version\\\":\\\"yarn run version-checkout && git add package.json && yarn run version-commit\\\",\\\"postversion\\\":\\\"git push --set-upstream ${GIT_REMOTE:-origin} release/v$npm_package_version\\\"},\\\"config\\\":{\\\"bundledKubectlVersion\\\":\\\"1.21.2\\\",\\\"bundledHelmVersion\\\":\\\"3.6.3\\\",\\\"sentryDsn\\\":\\\"\\\"},\\\"engines\\\":{\\\"node\\\":\\\">=14 <15\\\"},\\\"jest\\\":{\\\"collectCoverage\\\":false,\\\"verbose\\\":true,\\\"transform\\\":{\\\"^.+\\\\\\\\.tsx?$\\\":\\\"ts-jest\\\"},\\\"moduleNameMapper\\\":{\\\"\\\\\\\\.(css|scss)$\\\":\\\"<rootDir>/__mocks__/styleMock.ts\\\",\\\"\\\\\\\\.(svg)$\\\":\\\"<rootDir>/__mocks__/imageMock.ts\\\"},\\\"modulePathIgnorePatterns\\\":[\\\"<rootDir>/dist\\\",\\\"<rootDir>/src/extensions/npm\\\"],\\\"setupFiles\\\":[\\\"<rootDir>/src/jest.setup.ts\\\",\\\"jest-canvas-mock\\\"],\\\"globals\\\":{\\\"ts-jest\\\":{\\\"isolatedModules\\\":true}}},\\\"build\\\":{\\\"generateUpdatesFilesForAllChannels\\\":true,\\\"files\\\":[\\\"static/build/main.js\\\"],\\\"afterSign\\\":\\\"build/notarize.js\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"locales/\\\",\\\"to\\\":\\\"locales/\\\",\\\"filter\\\":\\\"**/*.js\\\"},{\\\"from\\\":\\\"static/\\\",\\\"to\\\":\\\"static/\\\",\\\"filter\\\":\\\"!**/main.js\\\"},{\\\"from\\\":\\\"build/tray\\\",\\\"to\\\":\\\"static/icons\\\",\\\"filter\\\":\\\"*.png\\\"},{\\\"from\\\":\\\"extensions/\\\",\\\"to\\\":\\\"./extensions/\\\",\\\"filter\\\":[\\\"**/*.tgz\\\",\\\"**/package.json\\\",\\\"!**/node_modules\\\"]},{\\\"from\\\":\\\"templates/\\\",\\\"to\\\":\\\"./templates/\\\",\\\"filter\\\":\\\"**/*.yaml\\\"},\\\"LICENSE\\\"],\\\"linux\\\":{\\\"category\\\":\\\"Network\\\",\\\"artifactName\\\":\\\"${productName}-${version}.${arch}.${ext}\\\",\\\"target\\\":[\\\"deb\\\",\\\"rpm\\\",\\\"AppImage\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/linux/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"rpm\\\":{\\\"fpm\\\":[\\\"--rpm-rpmbuild-define=%define _build_id_links none\\\"]},\\\"mac\\\":{\\\"hardenedRuntime\\\":true,\\\"gatekeeperAssess\\\":false,\\\"entitlements\\\":\\\"build/entitlements.mac.plist\\\",\\\"entitlementsInherit\\\":\\\"build/entitlements.mac.plist\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/darwin/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"win\\\":{\\\"target\\\":[\\\"nsis\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/windows/x64/kubectl.exe\\\",\\\"to\\\":\\\"./x64/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/windows/ia32/kubectl.exe\\\",\\\"to\\\":\\\"./ia32/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/x64/helm3/helm3.exe\\\",\\\"to\\\":\\\"./helm3/helm3.exe\\\"}]},\\\"nsis\\\":{\\\"include\\\":\\\"build/installer.nsh\\\",\\\"oneClick\\\":false,\\\"allowElevation\\\":true,\\\"createStartMenuShortcut\\\":true,\\\"allowToChangeInstallationDirectory\\\":true},\\\"protocols\\\":{\\\"name\\\":\\\"Lens Protocol Handler\\\",\\\"schemes\\\":[\\\"lens\\\"],\\\"role\\\":\\\"Viewer\\\"}},\\\"dependencies\\\":{\\\"@electron/remote\\\":\\\"^1.2.2\\\",\\\"@hapi/call\\\":\\\"^8.0.1\\\",\\\"@hapi/subtext\\\":\\\"^7.0.3\\\",\\\"@kubernetes/client-node\\\":\\\"^0.16.1\\\",\\\"@ogre-tools/injectable\\\":\\\"2.0.0\\\",\\\"@ogre-tools/injectable-react\\\":\\\"2.0.0\\\",\\\"@sentry/electron\\\":\\\"^2.5.4\\\",\\\"@sentry/integrations\\\":\\\"^6.15.0\\\",\\\"@types/circular-dependency-plugin\\\":\\\"5.0.4\\\",\\\"abort-controller\\\":\\\"^3.0.0\\\",\\\"auto-bind\\\":\\\"^4.0.0\\\",\\\"autobind-decorator\\\":\\\"^2.4.0\\\",\\\"await-lock\\\":\\\"^2.1.0\\\",\\\"byline\\\":\\\"^5.0.0\\\",\\\"chokidar\\\":\\\"^3.4.3\\\",\\\"conf\\\":\\\"^7.1.2\\\",\\\"crypto-js\\\":\\\"^4.1.1\\\",\\\"electron-devtools-installer\\\":\\\"^3.2.0\\\",\\\"electron-updater\\\":\\\"^4.6.1\\\",\\\"electron-window-state\\\":\\\"^5.0.3\\\",\\\"filehound\\\":\\\"^1.17.5\\\",\\\"fs-extra\\\":\\\"^9.0.1\\\",\\\"glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"got\\\":\\\"^11.8.3\\\",\\\"grapheme-splitter\\\":\\\"^1.0.4\\\",\\\"handlebars\\\":\\\"^4.7.7\\\",\\\"http-proxy\\\":\\\"^1.18.1\\\",\\\"immer\\\":\\\"^9.0.6\\\",\\\"joi\\\":\\\"^17.5.0\\\",\\\"js-yaml\\\":\\\"^4.1.0\\\",\\\"jsdom\\\":\\\"^16.7.0\\\",\\\"jsonpath\\\":\\\"^1.1.1\\\",\\\"lodash\\\":\\\"^4.17.15\\\",\\\"mac-ca\\\":\\\"^1.0.6\\\",\\\"marked\\\":\\\"^2.1.3\\\",\\\"md5-file\\\":\\\"^5.0.0\\\",\\\"mobx\\\":\\\"^6.3.7\\\",\\\"mobx-observable-history\\\":\\\"^2.0.3\\\",\\\"mobx-react\\\":\\\"^7.2.1\\\",\\\"mock-fs\\\":\\\"^5.1.2\\\",\\\"moment\\\":\\\"^2.29.1\\\",\\\"moment-timezone\\\":\\\"^0.5.34\\\",\\\"monaco-editor\\\":\\\"^0.29.1\\\",\\\"monaco-editor-webpack-plugin\\\":\\\"^5.0.0\\\",\\\"node-fetch\\\":\\\"lensapp/node-fetch#2.x\\\",\\\"node-pty\\\":\\\"^0.10.1\\\",\\\"npm\\\":\\\"^6.14.15\\\",\\\"p-limit\\\":\\\"^3.1.0\\\",\\\"path-to-regexp\\\":\\\"^6.2.0\\\",\\\"proper-lockfile\\\":\\\"^4.1.2\\\",\\\"react\\\":\\\"^17.0.2\\\",\\\"react-dom\\\":\\\"^17.0.2\\\",\\\"react-material-ui-carousel\\\":\\\"^2.3.8\\\",\\\"react-router\\\":\\\"^5.2.0\\\",\\\"react-virtualized-auto-sizer\\\":\\\"^1.0.6\\\",\\\"readable-stream\\\":\\\"^3.6.0\\\",\\\"request\\\":\\\"^2.88.2\\\",\\\"request-promise-native\\\":\\\"^1.0.9\\\",\\\"rfc6902\\\":\\\"^4.0.2\\\",\\\"semver\\\":\\\"^7.3.2\\\",\\\"shell-env\\\":\\\"^3.0.1\\\",\\\"spdy\\\":\\\"^4.0.2\\\",\\\"tar\\\":\\\"^6.1.11\\\",\\\"tcp-port-used\\\":\\\"^1.0.2\\\",\\\"tempy\\\":\\\"1.0.1\\\",\\\"url-parse\\\":\\\"^1.5.3\\\",\\\"uuid\\\":\\\"^8.3.2\\\",\\\"win-ca\\\":\\\"^3.4.5\\\",\\\"winston\\\":\\\"^3.3.3\\\",\\\"winston-console-format\\\":\\\"^1.0.8\\\",\\\"winston-transport-browserconsole\\\":\\\"^1.0.5\\\",\\\"ws\\\":\\\"^7.5.5\\\"},\\\"devDependencies\\\":{\\\"@async-fn/jest\\\":\\\"1.5.3\\\",\\\"@material-ui/core\\\":\\\"^4.12.3\\\",\\\"@material-ui/icons\\\":\\\"^4.11.2\\\",\\\"@material-ui/lab\\\":\\\"^4.0.0-alpha.60\\\",\\\"@pmmmwh/react-refresh-webpack-plugin\\\":\\\"^0.4.3\\\",\\\"@sentry/types\\\":\\\"^6.14.1\\\",\\\"@testing-library/jest-dom\\\":\\\"^5.16.1\\\",\\\"@testing-library/react\\\":\\\"^11.2.7\\\",\\\"@testing-library/user-event\\\":\\\"^13.5.0\\\",\\\"@types/byline\\\":\\\"^4.2.33\\\",\\\"@types/chart.js\\\":\\\"^2.9.34\\\",\\\"@types/color\\\":\\\"^3.0.2\\\",\\\"@types/crypto-js\\\":\\\"^3.1.47\\\",\\\"@types/dompurify\\\":\\\"^2.3.1\\\",\\\"@types/electron-devtools-installer\\\":\\\"^2.2.0\\\",\\\"@types/fs-extra\\\":\\\"^9.0.13\\\",\\\"@types/glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"@types/hoist-non-react-statics\\\":\\\"^3.3.1\\\",\\\"@types/html-webpack-plugin\\\":\\\"^3.2.6\\\",\\\"@types/http-proxy\\\":\\\"^1.17.7\\\",\\\"@types/jest\\\":\\\"^26.0.24\\\",\\\"@types/js-yaml\\\":\\\"^4.0.5\\\",\\\"@types/jsdom\\\":\\\"^16.2.13\\\",\\\"@types/jsonpath\\\":\\\"^0.2.0\\\",\\\"@types/lodash\\\":\\\"^4.14.177\\\",\\\"@types/marked\\\":\\\"^2.0.5\\\",\\\"@types/md5-file\\\":\\\"^4.0.2\\\",\\\"@types/mini-css-extract-plugin\\\":\\\"^0.9.1\\\",\\\"@types/mock-fs\\\":\\\"^4.13.1\\\",\\\"@types/node\\\":\\\"14.17.33\\\",\\\"@types/node-fetch\\\":\\\"^2.5.12\\\",\\\"@types/npm\\\":\\\"^2.0.32\\\",\\\"@types/progress-bar-webpack-plugin\\\":\\\"^2.1.2\\\",\\\"@types/proper-lockfile\\\":\\\"^4.1.2\\\",\\\"@types/randomcolor\\\":\\\"^0.5.6\\\",\\\"@types/react\\\":\\\"^17.0.34\\\",\\\"@types/react-beautiful-dnd\\\":\\\"^13.1.2\\\",\\\"@types/react-dom\\\":\\\"^17.0.11\\\",\\\"@types/react-router-dom\\\":\\\"^5.3.2\\\",\\\"@types/react-select\\\":\\\"3.1.2\\\",\\\"@types/react-table\\\":\\\"^7.7.8\\\",\\\"@types/react-virtualized-auto-sizer\\\":\\\"^1.0.1\\\",\\\"@types/react-window\\\":\\\"^1.8.5\\\",\\\"@types/readable-stream\\\":\\\"^2.3.12\\\",\\\"@types/request\\\":\\\"^2.48.7\\\",\\\"@types/request-promise-native\\\":\\\"^1.0.18\\\",\\\"@types/semver\\\":\\\"^7.3.9\\\",\\\"@types/sharp\\\":\\\"^0.29.4\\\",\\\"@types/spdy\\\":\\\"^3.4.5\\\",\\\"@types/tar\\\":\\\"^4.0.5\\\",\\\"@types/tcp-port-used\\\":\\\"^1.0.0\\\",\\\"@types/tempy\\\":\\\"^0.3.0\\\",\\\"@types/triple-beam\\\":\\\"^1.3.2\\\",\\\"@types/url-parse\\\":\\\"^1.4.5\\\",\\\"@types/uuid\\\":\\\"^8.3.3\\\",\\\"@types/webpack\\\":\\\"^4.41.32\\\",\\\"@types/webpack-dev-server\\\":\\\"^3.11.6\\\",\\\"@types/webpack-env\\\":\\\"^1.16.3\\\",\\\"@types/webpack-node-externals\\\":\\\"^1.7.1\\\",\\\"@typescript-eslint/eslint-plugin\\\":\\\"^5.7.0\\\",\\\"@typescript-eslint/parser\\\":\\\"^5.7.0\\\",\\\"ansi_up\\\":\\\"^5.1.0\\\",\\\"chart.js\\\":\\\"^2.9.4\\\",\\\"circular-dependency-plugin\\\":\\\"^5.2.2\\\",\\\"color\\\":\\\"^3.2.1\\\",\\\"concurrently\\\":\\\"^5.3.0\\\",\\\"css-loader\\\":\\\"^5.2.7\\\",\\\"deepdash\\\":\\\"^5.3.9\\\",\\\"dompurify\\\":\\\"^2.3.4\\\",\\\"electron\\\":\\\"^13.6.1\\\",\\\"electron-builder\\\":\\\"^22.14.5\\\",\\\"electron-notarize\\\":\\\"^0.3.0\\\",\\\"esbuild\\\":\\\"^0.13.15\\\",\\\"esbuild-loader\\\":\\\"^2.16.0\\\",\\\"eslint\\\":\\\"^7.32.0\\\",\\\"eslint-plugin-header\\\":\\\"^3.1.1\\\",\\\"eslint-plugin-import\\\":\\\"^2.25.3\\\",\\\"eslint-plugin-react\\\":\\\"^7.27.1\\\",\\\"eslint-plugin-react-hooks\\\":\\\"^4.3.0\\\",\\\"eslint-plugin-unused-imports\\\":\\\"^1.1.5\\\",\\\"file-loader\\\":\\\"^6.2.0\\\",\\\"flex.box\\\":\\\"^3.4.4\\\",\\\"fork-ts-checker-webpack-plugin\\\":\\\"^5.2.1\\\",\\\"hoist-non-react-statics\\\":\\\"^3.3.2\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.2\\\",\\\"include-media\\\":\\\"^1.4.9\\\",\\\"jest\\\":\\\"26.6.3\\\",\\\"jest-canvas-mock\\\":\\\"^2.3.1\\\",\\\"jest-fetch-mock\\\":\\\"^3.0.3\\\",\\\"jest-mock-extended\\\":\\\"^1.0.18\\\",\\\"make-plural\\\":\\\"^6.2.2\\\",\\\"mini-css-extract-plugin\\\":\\\"^1.6.2\\\",\\\"node-gyp\\\":\\\"7.1.2\\\",\\\"node-loader\\\":\\\"^1.0.3\\\",\\\"nodemon\\\":\\\"^2.0.14\\\",\\\"playwright\\\":\\\"^1.17.1\\\",\\\"postcss\\\":\\\"^8.4.5\\\",\\\"postcss-loader\\\":\\\"^4.3.0\\\",\\\"progress-bar-webpack-plugin\\\":\\\"^2.1.0\\\",\\\"randomcolor\\\":\\\"^0.6.2\\\",\\\"raw-loader\\\":\\\"^4.0.2\\\",\\\"react-beautiful-dnd\\\":\\\"^13.1.0\\\",\\\"react-refresh\\\":\\\"^0.9.0\\\",\\\"react-router-dom\\\":\\\"^5.3.0\\\",\\\"react-select\\\":\\\"3.2.0\\\",\\\"react-select-event\\\":\\\"^5.1.0\\\",\\\"react-table\\\":\\\"^7.7.0\\\",\\\"react-window\\\":\\\"^1.8.6\\\",\\\"sass\\\":\\\"^1.45.1\\\",\\\"sass-loader\\\":\\\"^10.2.0\\\",\\\"sharp\\\":\\\"^0.29.3\\\",\\\"style-loader\\\":\\\"^2.0.0\\\",\\\"tailwindcss\\\":\\\"^3.0.7\\\",\\\"ts-jest\\\":\\\"26.5.6\\\",\\\"ts-loader\\\":\\\"^7.0.5\\\",\\\"ts-node\\\":\\\"^10.4.0\\\",\\\"type-fest\\\":\\\"^1.0.2\\\",\\\"typed-emitter\\\":\\\"^1.4.0\\\",\\\"typedoc\\\":\\\"0.22.10\\\",\\\"typedoc-plugin-markdown\\\":\\\"^3.11.3\\\",\\\"typeface-roboto\\\":\\\"^1.1.13\\\",\\\"typescript\\\":\\\"^4.5.2\\\",\\\"typescript-plugin-css-modules\\\":\\\"^3.4.0\\\",\\\"url-loader\\\":\\\"^4.1.1\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.3\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\",\\\"xterm\\\":\\\"^4.15.0\\\",\\\"xterm-addon-fit\\\":\\\"^0.5.0\\\"}}\");\n\n//# sourceURL=webpack:///./package.json?");
|
|
38380
38346
|
|
|
38381
38347
|
/***/ }),
|
|
38382
38348
|
|
|
@@ -38388,7 +38354,7 @@ eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"open-lens\\\",\\\"productN
|
|
|
38388
38354
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38389
38355
|
|
|
38390
38356
|
"use strict";
|
|
38391
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AppPaths\", function() { return AppPaths; });\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ \"./src/common/logger.ts\");\n/* harmony import */ var
|
|
38357
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AppPaths\", function() { return AppPaths; });\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ \"./src/common/logger.ts\");\n/* harmony import */ var _utils_objects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/objects */ \"./src/common/utils/objects.ts\");\n/* harmony import */ var _utils_toJS__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/toJS */ \"./src/common/utils/toJS.ts\");\n/* harmony import */ var _vars__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vars */ \"./src/common/vars.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\nconst pathNames = [\n \"home\",\n \"appData\",\n \"userData\",\n \"cache\",\n \"temp\",\n \"exe\",\n \"module\",\n \"desktop\",\n \"documents\",\n \"downloads\",\n \"music\",\n \"pictures\",\n \"videos\",\n \"logs\",\n \"crashDumps\",\n];\nif (_vars__WEBPACK_IMPORTED_MODULE_6__[\"isWindows\"]) {\n pathNames.push(\"recent\");\n}\nclass AppPaths {\n /**\n * Initializes the local copy of the paths from electron.\n */\n static async init() {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[APP-PATHS]: initializing`);\n if (AppPaths.paths.get()) {\n return void _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(\"[APP-PATHS]: init called more than once\");\n }\n if (electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"]) {\n AppPaths.initMain();\n }\n else {\n await AppPaths.initRenderer();\n }\n }\n static initMain() {\n if (process.env.CICD) {\n electron__WEBPACK_IMPORTED_MODULE_0__[\"app\"].setPath(\"appData\", process.env.CICD);\n }\n electron__WEBPACK_IMPORTED_MODULE_0__[\"app\"].setPath(\"userData\", path__WEBPACK_IMPORTED_MODULE_2___default.a.join(electron__WEBPACK_IMPORTED_MODULE_0__[\"app\"].getPath(\"appData\"), electron__WEBPACK_IMPORTED_MODULE_0__[\"app\"].getName()));\n const getPath = (pathName) => {\n try {\n return electron__WEBPACK_IMPORTED_MODULE_0__[\"app\"].getPath(pathName);\n }\n catch (_a) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[APP-PATHS] No path found for ${pathName}`);\n return \"\";\n }\n };\n AppPaths.paths.set(Object(_utils_objects__WEBPACK_IMPORTED_MODULE_4__[\"fromEntries\"])(pathNames.map(pathName => [pathName, getPath(pathName)]).filter(([, path]) => path)));\n electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"].handle(AppPaths.ipcChannel, () => Object(_utils_toJS__WEBPACK_IMPORTED_MODULE_5__[\"toJS\"])(AppPaths.paths.get()));\n }\n static async initRenderer() {\n const paths = await electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"].invoke(AppPaths.ipcChannel);\n if (!paths || typeof paths !== \"object\") {\n throw Object.assign(new Error(\"[APP-PATHS]: ipc handler returned unexpected data\"), { data: paths });\n }\n AppPaths.paths.set(paths);\n }\n /**\n * An alternative to `app.getPath()` for use in renderer and common.\n * This function throws if called before initialization.\n * @param name The name of the path field\n */\n static get(name) {\n if (!AppPaths.paths.get()) {\n throw new Error(\"AppPaths.init() has not been called\");\n }\n return AppPaths.paths.get()[name];\n }\n /**\n * An async version of `AppPaths.get()` which waits for `AppPaths.init()` to\n * be called before returning\n */\n static async getAsync(name) {\n await Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"when\"])(() => Boolean(AppPaths.paths.get()));\n return AppPaths.paths.get()[name];\n }\n}\nObject.defineProperty(AppPaths, \"paths\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"].box()\n});\nObject.defineProperty(AppPaths, \"ipcChannel\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"get-app-paths\"\n});\n\n\n//# sourceURL=webpack:///./src/common/app-paths.ts?");
|
|
38392
38358
|
|
|
38393
38359
|
/***/ }),
|
|
38394
38360
|
|
|
@@ -38436,7 +38402,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _gen
|
|
|
38436
38402
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38437
38403
|
|
|
38438
38404
|
"use strict";
|
|
38439
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LensKubernetesClusterStatus\", function() { return LensKubernetesClusterStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubernetesCluster\", function() { return KubernetesCluster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"kubernetesClusterCategory\", function() { return kubernetesClusterCategory; });\n/* harmony import */ var _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../catalog/catalog-category-registry */ \"./src/common/catalog/catalog-category-registry.ts\");\n/* harmony import */ var _catalog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../catalog */ \"./src/common/catalog/index.ts\");\n/* harmony import */ var _cluster_ipc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cluster-ipc */ \"./src/common/cluster-ipc.ts\");\n/* harmony import */ var _cluster_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-store */ \"./src/common/cluster-store.ts\");\n/* harmony import */ var _ipc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _renderer_navigation_events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../renderer/navigation/events */ \"./src/renderer/navigation/events.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\
|
|
38405
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LensKubernetesClusterStatus\", function() { return LensKubernetesClusterStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubernetesCluster\", function() { return KubernetesCluster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"kubernetesClusterCategory\", function() { return kubernetesClusterCategory; });\n/* harmony import */ var _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../catalog/catalog-category-registry */ \"./src/common/catalog/catalog-category-registry.ts\");\n/* harmony import */ var _catalog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../catalog */ \"./src/common/catalog/index.ts\");\n/* harmony import */ var _cluster_ipc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cluster-ipc */ \"./src/common/cluster-ipc.ts\");\n/* harmony import */ var _cluster_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-store */ \"./src/common/cluster-store.ts\");\n/* harmony import */ var _ipc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _renderer_navigation_events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../renderer/navigation/events */ \"./src/renderer/navigation/events.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\nvar LensKubernetesClusterStatus;\n(function (LensKubernetesClusterStatus) {\n LensKubernetesClusterStatus[\"DELETING\"] = \"deleting\";\n LensKubernetesClusterStatus[\"CONNECTING\"] = \"connecting\";\n LensKubernetesClusterStatus[\"CONNECTED\"] = \"connected\";\n LensKubernetesClusterStatus[\"DISCONNECTED\"] = \"disconnected\";\n})(LensKubernetesClusterStatus || (LensKubernetesClusterStatus = {}));\nclass KubernetesCluster extends _catalog__WEBPACK_IMPORTED_MODULE_1__[\"CatalogEntity\"] {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: KubernetesCluster.apiVersion\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: KubernetesCluster.kind\n });\n }\n async connect() {\n var _a;\n if (electron__WEBPACK_IMPORTED_MODULE_5__[\"app\"]) {\n await ((_a = _cluster_store__WEBPACK_IMPORTED_MODULE_3__[\"ClusterStore\"].getInstance().getById(this.metadata.uid)) === null || _a === void 0 ? void 0 : _a.activate());\n }\n else {\n await Object(_ipc__WEBPACK_IMPORTED_MODULE_4__[\"requestMain\"])(_cluster_ipc__WEBPACK_IMPORTED_MODULE_2__[\"clusterActivateHandler\"], this.metadata.uid, false);\n }\n }\n async disconnect() {\n var _a;\n if (electron__WEBPACK_IMPORTED_MODULE_5__[\"app\"]) {\n (_a = _cluster_store__WEBPACK_IMPORTED_MODULE_3__[\"ClusterStore\"].getInstance().getById(this.metadata.uid)) === null || _a === void 0 ? void 0 : _a.disconnect();\n }\n else {\n await Object(_ipc__WEBPACK_IMPORTED_MODULE_4__[\"requestMain\"])(_cluster_ipc__WEBPACK_IMPORTED_MODULE_2__[\"clusterDisconnectHandler\"], this.metadata.uid, false);\n }\n }\n async onRun(context) {\n context.navigate(`/cluster/${this.metadata.uid}`);\n }\n onDetailsOpen() {\n //\n }\n onSettingsOpen() {\n //\n }\n async onContextMenuOpen(context) {\n var _a;\n if (!this.metadata.source || this.metadata.source === \"local\") {\n context.menuItems.push({\n title: \"Settings\",\n icon: \"settings\",\n onClick: () => Object(_ipc__WEBPACK_IMPORTED_MODULE_4__[\"broadcastMessage\"])(_renderer_navigation_events__WEBPACK_IMPORTED_MODULE_6__[\"IpcRendererNavigationEvents\"].NAVIGATE_IN_APP, `/entity/${this.metadata.uid}/settings`),\n });\n }\n switch (this.status.phase) {\n case LensKubernetesClusterStatus.CONNECTED:\n case LensKubernetesClusterStatus.CONNECTING:\n context.menuItems.push({\n title: \"Disconnect\",\n icon: \"link_off\",\n onClick: () => Object(_ipc__WEBPACK_IMPORTED_MODULE_4__[\"requestMain\"])(_cluster_ipc__WEBPACK_IMPORTED_MODULE_2__[\"clusterDisconnectHandler\"], this.metadata.uid),\n });\n break;\n case LensKubernetesClusterStatus.DISCONNECTED:\n context.menuItems.push({\n title: \"Connect\",\n icon: \"link\",\n onClick: () => context.navigate(`/cluster/${this.metadata.uid}`),\n });\n break;\n }\n (_a = _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_0__[\"catalogCategoryRegistry\"]\n .getCategoryForEntity(this)) === null || _a === void 0 ? void 0 : _a.emit(\"contextMenuOpen\", this, context);\n }\n}\nObject.defineProperty(KubernetesCluster, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"entity.k8slens.dev/v1alpha1\"\n});\nObject.defineProperty(KubernetesCluster, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"KubernetesCluster\"\n});\nclass KubernetesClusterCategory extends _catalog__WEBPACK_IMPORTED_MODULE_1__[\"CatalogCategory\"] {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"catalog.k8slens.dev/v1alpha1\"\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"CatalogCategory\"\n });\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n name: \"Clusters\",\n icon: __webpack_require__(/*! !raw-loader!./icons/kubernetes.svg */ \"./node_modules/raw-loader/dist/cjs.js!./src/common/catalog-entities/icons/kubernetes.svg\").default, // eslint-disable-line\n }\n });\n Object.defineProperty(this, \"spec\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n group: \"entity.k8slens.dev\",\n versions: [\n {\n name: \"v1alpha1\",\n entityClass: KubernetesCluster,\n },\n ],\n names: {\n kind: \"KubernetesCluster\",\n },\n }\n });\n }\n}\nconst kubernetesClusterCategory = new KubernetesClusterCategory();\n_catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_0__[\"catalogCategoryRegistry\"].add(kubernetesClusterCategory);\n\n\n//# sourceURL=webpack:///./src/common/catalog-entities/kubernetes-cluster.ts?");
|
|
38440
38406
|
|
|
38441
38407
|
/***/ }),
|
|
38442
38408
|
|
|
@@ -38448,7 +38414,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
38448
38414
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38449
38415
|
|
|
38450
38416
|
"use strict";
|
|
38451
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebLink\", function() { return WebLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebLinkCategory\", function() { return WebLinkCategory; });\n/* harmony import */ var _catalog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../catalog */ \"./src/common/catalog/index.ts\");\n/* harmony import */ var _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../catalog/catalog-category-registry */ \"./src/common/catalog/catalog-category-registry.ts\");\n/* harmony import */ var _vars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../vars */ \"./src/common/vars.ts\");\n/* harmony import */ var _weblink_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../weblink-store */ \"./src/common/weblink-store.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\nclass WebLink extends _catalog__WEBPACK_IMPORTED_MODULE_0__[\"CatalogEntity\"] {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: WebLink.apiVersion\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: WebLink.kind\n });\n }\n async onRun() {\n window.open(this.spec.url, \"_blank\");\n }\n onSettingsOpen() {\n return;\n }\n async onContextMenuOpen(context) {\n var _a;\n if (this.metadata.source === \"local\") {\n context.menuItems.push({\n title: \"Delete\",\n icon: \"delete\",\n onClick: async () => _weblink_store__WEBPACK_IMPORTED_MODULE_3__[\"WeblinkStore\"].getInstance().removeById(this.metadata.uid),\n confirm: {\n message: `Remove Web Link \"${this.metadata.name}\" from ${_vars__WEBPACK_IMPORTED_MODULE_2__[\"productName\"]}?`,\n },\n });\n }\n (_a = _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_1__[\"catalogCategoryRegistry\"]\n .getCategoryForEntity(this)) === null || _a === void 0 ? void 0 : _a.emit(\"contextMenuOpen\", this, context);\n }\n}\nObject.defineProperty(WebLink, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"entity.k8slens.dev/v1alpha1\"\n});\nObject.defineProperty(WebLink, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"WebLink\"\n});\nclass WebLinkCategory extends _catalog__WEBPACK_IMPORTED_MODULE_0__[\"CatalogCategory\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"catalog.k8slens.dev/v1alpha1\"\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"CatalogCategory\"\n });\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n name: \"Web Links\",\n icon: \"public\",\n }\n });\n Object.defineProperty(this, \"spec\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n group: \"entity.k8slens.dev\",\n versions: [\n {\n name: \"v1alpha1\",\n entityClass: WebLink,\n },\n ],\n names: {\n kind: \"WebLink\",\n },\n }\n });\n
|
|
38417
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebLink\", function() { return WebLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebLinkCategory\", function() { return WebLinkCategory; });\n/* harmony import */ var _catalog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../catalog */ \"./src/common/catalog/index.ts\");\n/* harmony import */ var _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../catalog/catalog-category-registry */ \"./src/common/catalog/catalog-category-registry.ts\");\n/* harmony import */ var _vars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../vars */ \"./src/common/vars.ts\");\n/* harmony import */ var _weblink_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../weblink-store */ \"./src/common/weblink-store.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\nclass WebLink extends _catalog__WEBPACK_IMPORTED_MODULE_0__[\"CatalogEntity\"] {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: WebLink.apiVersion\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: WebLink.kind\n });\n }\n async onRun() {\n window.open(this.spec.url, \"_blank\");\n }\n onSettingsOpen() {\n return;\n }\n async onContextMenuOpen(context) {\n var _a;\n if (this.metadata.source === \"local\") {\n context.menuItems.push({\n title: \"Delete\",\n icon: \"delete\",\n onClick: async () => _weblink_store__WEBPACK_IMPORTED_MODULE_3__[\"WeblinkStore\"].getInstance().removeById(this.metadata.uid),\n confirm: {\n message: `Remove Web Link \"${this.metadata.name}\" from ${_vars__WEBPACK_IMPORTED_MODULE_2__[\"productName\"]}?`,\n },\n });\n }\n (_a = _catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_1__[\"catalogCategoryRegistry\"]\n .getCategoryForEntity(this)) === null || _a === void 0 ? void 0 : _a.emit(\"contextMenuOpen\", this, context);\n }\n}\nObject.defineProperty(WebLink, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"entity.k8slens.dev/v1alpha1\"\n});\nObject.defineProperty(WebLink, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"WebLink\"\n});\nclass WebLinkCategory extends _catalog__WEBPACK_IMPORTED_MODULE_0__[\"CatalogCategory\"] {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"catalog.k8slens.dev/v1alpha1\"\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"CatalogCategory\"\n });\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n name: \"Web Links\",\n icon: \"public\",\n }\n });\n Object.defineProperty(this, \"spec\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n group: \"entity.k8slens.dev\",\n versions: [\n {\n name: \"v1alpha1\",\n entityClass: WebLink,\n },\n ],\n names: {\n kind: \"WebLink\",\n },\n }\n });\n }\n}\n_catalog_catalog_category_registry__WEBPACK_IMPORTED_MODULE_1__[\"catalogCategoryRegistry\"].add(new WebLinkCategory());\n\n\n//# sourceURL=webpack:///./src/common/catalog-entities/web-link.ts?");
|
|
38452
38418
|
|
|
38453
38419
|
/***/ }),
|
|
38454
38420
|
|
|
@@ -38624,11 +38590,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
38624
38590
|
/*!*********************************!*\
|
|
38625
38591
|
!*** ./src/common/ipc/index.ts ***!
|
|
38626
38592
|
\*********************************/
|
|
38627
|
-
/*! exports provided: dialogShowOpenDialogHandler, requestMain, ipcMainHandle, broadcastMessage, ipcMainOn, ipcRendererOn, bindBroadcastHandlers, InvalidKubeconfigChannel, UpdateAvailableChannel, AutoUpdateChecking, AutoUpdateNoUpdateAvailable, AutoUpdateLogPrefix, areArgsUpdateAvailableFromMain, areArgsUpdateAvailableToBackchannel, ClusterListNamespaceForbiddenChannel, isListNamespaceForbiddenArgs, onceCorrect, onCorrect, handleCorrect, HotbarTooManyItems, BundledExtensionsLoaded */
|
|
38593
|
+
/*! exports provided: dialogShowOpenDialogHandler, catalogEntityRunListener, requestMain, ipcMainHandle, broadcastMessage, ipcMainOn, ipcRendererOn, bindBroadcastHandlers, InvalidKubeconfigChannel, UpdateAvailableChannel, AutoUpdateChecking, AutoUpdateNoUpdateAvailable, AutoUpdateLogPrefix, areArgsUpdateAvailableFromMain, areArgsUpdateAvailableToBackchannel, ClusterListNamespaceForbiddenChannel, isListNamespaceForbiddenArgs, onceCorrect, onCorrect, handleCorrect, HotbarTooManyItems, BundledExtensionsLoaded */
|
|
38628
38594
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38629
38595
|
|
|
38630
38596
|
"use strict";
|
|
38631
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dialogShowOpenDialogHandler\", function() { return dialogShowOpenDialogHandler; });\n/* harmony import */ var _ipc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ipc */ \"./src/common/ipc/ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"requestMain\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"requestMain\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ipcMainHandle\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"ipcMainHandle\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"broadcastMessage\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"broadcastMessage\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ipcMainOn\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"ipcMainOn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ipcRendererOn\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"ipcRendererOn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"bindBroadcastHandlers\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"bindBroadcastHandlers\"]; });\n\n/* harmony import */ var _invalid_kubeconfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./invalid-kubeconfig */ \"./src/common/ipc/invalid-kubeconfig/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InvalidKubeconfigChannel\", function() { return _invalid_kubeconfig__WEBPACK_IMPORTED_MODULE_1__[\"InvalidKubeconfigChannel\"]; });\n\n/* harmony import */ var _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./update-available.ipc */ \"./src/common/ipc/update-available.ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"UpdateAvailableChannel\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"UpdateAvailableChannel\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AutoUpdateChecking\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"AutoUpdateChecking\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AutoUpdateNoUpdateAvailable\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"AutoUpdateNoUpdateAvailable\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AutoUpdateLogPrefix\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"AutoUpdateLogPrefix\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"areArgsUpdateAvailableFromMain\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"areArgsUpdateAvailableFromMain\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"areArgsUpdateAvailableToBackchannel\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"areArgsUpdateAvailableToBackchannel\"]; });\n\n/* harmony import */ var _cluster_ipc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cluster.ipc */ \"./src/common/ipc/cluster.ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ClusterListNamespaceForbiddenChannel\", function() { return _cluster_ipc__WEBPACK_IMPORTED_MODULE_3__[\"ClusterListNamespaceForbiddenChannel\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isListNamespaceForbiddenArgs\", function() { return _cluster_ipc__WEBPACK_IMPORTED_MODULE_3__[\"isListNamespaceForbiddenArgs\"]; });\n\n/* harmony import */ var _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./type-enforced-ipc */ \"./src/common/ipc/type-enforced-ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"onceCorrect\", function() { return _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__[\"onceCorrect\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"onCorrect\", function() { return _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__[\"onCorrect\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"handleCorrect\", function() { return _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__[\"handleCorrect\"]; });\n\n/* harmony import */ var _hotbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hotbar */ \"./src/common/ipc/hotbar.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"HotbarTooManyItems\", function() { return _hotbar__WEBPACK_IMPORTED_MODULE_5__[\"HotbarTooManyItems\"]; });\n\n/* harmony import */ var _extension_loader_ipc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./extension-loader.ipc */ \"./src/common/ipc/extension-loader.ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BundledExtensionsLoaded\", function() { return _extension_loader_ipc__WEBPACK_IMPORTED_MODULE_6__[\"BundledExtensionsLoaded\"]; });\n\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nconst dialogShowOpenDialogHandler = \"dialog:show-open-dialog\";\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./src/common/ipc/index.ts?");
|
|
38597
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dialogShowOpenDialogHandler\", function() { return dialogShowOpenDialogHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"catalogEntityRunListener\", function() { return catalogEntityRunListener; });\n/* harmony import */ var _ipc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ipc */ \"./src/common/ipc/ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"requestMain\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"requestMain\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ipcMainHandle\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"ipcMainHandle\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"broadcastMessage\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"broadcastMessage\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ipcMainOn\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"ipcMainOn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ipcRendererOn\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"ipcRendererOn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"bindBroadcastHandlers\", function() { return _ipc__WEBPACK_IMPORTED_MODULE_0__[\"bindBroadcastHandlers\"]; });\n\n/* harmony import */ var _invalid_kubeconfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./invalid-kubeconfig */ \"./src/common/ipc/invalid-kubeconfig/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InvalidKubeconfigChannel\", function() { return _invalid_kubeconfig__WEBPACK_IMPORTED_MODULE_1__[\"InvalidKubeconfigChannel\"]; });\n\n/* harmony import */ var _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./update-available.ipc */ \"./src/common/ipc/update-available.ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"UpdateAvailableChannel\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"UpdateAvailableChannel\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AutoUpdateChecking\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"AutoUpdateChecking\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AutoUpdateNoUpdateAvailable\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"AutoUpdateNoUpdateAvailable\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AutoUpdateLogPrefix\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"AutoUpdateLogPrefix\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"areArgsUpdateAvailableFromMain\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"areArgsUpdateAvailableFromMain\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"areArgsUpdateAvailableToBackchannel\", function() { return _update_available_ipc__WEBPACK_IMPORTED_MODULE_2__[\"areArgsUpdateAvailableToBackchannel\"]; });\n\n/* harmony import */ var _cluster_ipc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cluster.ipc */ \"./src/common/ipc/cluster.ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ClusterListNamespaceForbiddenChannel\", function() { return _cluster_ipc__WEBPACK_IMPORTED_MODULE_3__[\"ClusterListNamespaceForbiddenChannel\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isListNamespaceForbiddenArgs\", function() { return _cluster_ipc__WEBPACK_IMPORTED_MODULE_3__[\"isListNamespaceForbiddenArgs\"]; });\n\n/* harmony import */ var _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./type-enforced-ipc */ \"./src/common/ipc/type-enforced-ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"onceCorrect\", function() { return _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__[\"onceCorrect\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"onCorrect\", function() { return _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__[\"onCorrect\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"handleCorrect\", function() { return _type_enforced_ipc__WEBPACK_IMPORTED_MODULE_4__[\"handleCorrect\"]; });\n\n/* harmony import */ var _hotbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hotbar */ \"./src/common/ipc/hotbar.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"HotbarTooManyItems\", function() { return _hotbar__WEBPACK_IMPORTED_MODULE_5__[\"HotbarTooManyItems\"]; });\n\n/* harmony import */ var _extension_loader_ipc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./extension-loader.ipc */ \"./src/common/ipc/extension-loader.ipc.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BundledExtensionsLoaded\", function() { return _extension_loader_ipc__WEBPACK_IMPORTED_MODULE_6__[\"BundledExtensionsLoaded\"]; });\n\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nconst dialogShowOpenDialogHandler = \"dialog:show-open-dialog\";\nconst catalogEntityRunListener = \"catalog-entity:run\";\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./src/common/ipc/index.ts?");
|
|
38632
38598
|
|
|
38633
38599
|
/***/ }),
|
|
38634
38600
|
|
|
@@ -38652,7 +38618,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
38652
38618
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38653
38619
|
|
|
38654
38620
|
"use strict";
|
|
38655
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestMain\", function() { return requestMain; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ipcMainHandle\", function() { return ipcMainHandle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"broadcastMessage\", function() { return broadcastMessage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ipcMainOn\", function() { return ipcMainOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ipcRendererOn\", function() { return ipcRendererOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bindBroadcastHandlers\", function() { return bindBroadcastHandlers; });\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_toJS__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/toJS */ \"./src/common/utils/toJS.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _cluster_frames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-frames */ \"./src/common/cluster-frames.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Inter-process communications (main <-> renderer)\n// https://www.electronjs.org/docs/api/ipc-main\n// https://www.electronjs.org/docs/api/ipc-renderer\n\n\n\n\nconst electronRemote = electron__WEBPACK_IMPORTED_MODULE_0__[\"
|
|
38621
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestMain\", function() { return requestMain; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ipcMainHandle\", function() { return ipcMainHandle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"broadcastMessage\", function() { return broadcastMessage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ipcMainOn\", function() { return ipcMainOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ipcRendererOn\", function() { return ipcRendererOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bindBroadcastHandlers\", function() { return bindBroadcastHandlers; });\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_toJS__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/toJS */ \"./src/common/utils/toJS.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _cluster_frames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-frames */ \"./src/common/cluster-frames.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Inter-process communications (main <-> renderer)\n// https://www.electronjs.org/docs/api/ipc-main\n// https://www.electronjs.org/docs/api/ipc-renderer\n\n\n\n\nconst electronRemote = (() => {\n if (electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"]) {\n try {\n return __webpack_require__(/*! @electron/remote */ \"./node_modules/@electron/remote/renderer/index.js\");\n }\n catch (_a) {\n // ignore temp\n }\n }\n return null;\n})();\nconst subFramesChannel = \"ipc:get-sub-frames\";\nasync function requestMain(channel, ...args) {\n return electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"].invoke(channel, ...args.map(sanitizePayload));\n}\nfunction ipcMainHandle(channel, listener) {\n electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"].handle(channel, async (event, ...args) => {\n return sanitizePayload(await listener(event, ...args));\n });\n}\nfunction getSubFrames() {\n return Array.from(_cluster_frames__WEBPACK_IMPORTED_MODULE_3__[\"clusterFrameMap\"].values());\n}\nfunction broadcastMessage(channel, ...args) {\n const subFramesP = electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"]\n ? requestMain(subFramesChannel)\n : Promise.resolve(getSubFrames());\n subFramesP\n .then(subFrames => {\n var _a;\n const views = (_a = (electron__WEBPACK_IMPORTED_MODULE_0__[\"webContents\"] || (electronRemote === null || electronRemote === void 0 ? void 0 : electronRemote.webContents))) === null || _a === void 0 ? void 0 : _a.getAllWebContents();\n if (!views || !Array.isArray(views) || views.length === 0)\n return;\n args = args.map(sanitizePayload);\n electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"] === null || electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"] === void 0 ? void 0 : electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"].send(channel, ...args);\n electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"] === null || electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"] === void 0 ? void 0 : electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"].emit(channel, ...args);\n for (const view of views) {\n let viewType = \"unknown\";\n // There will be a uncaught exception if the view is destroyed.\n try {\n viewType = view.getType();\n }\n catch (_b) {\n // We can ignore the view destroyed exception as viewType is only used for logging.\n }\n // Send message to views.\n try {\n _main_logger__WEBPACK_IMPORTED_MODULE_2__[\"default\"].silly(`[IPC]: broadcasting \"${channel}\" to ${viewType}=${view.id}`, { args });\n view.send(channel, ...args);\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_2__[\"default\"].error(`[IPC]: failed to send IPC message \"${channel}\" to view \"${viewType}=${view.id}\"`, { error: String(error) });\n }\n // Send message to subFrames of views.\n for (const frameInfo of subFrames) {\n _main_logger__WEBPACK_IMPORTED_MODULE_2__[\"default\"].silly(`[IPC]: broadcasting \"${channel}\" to subframe \"frameInfo.processId\"=${frameInfo.processId} \"frameInfo.frameId\"=${frameInfo.frameId}`, { args });\n try {\n view.sendToFrame([frameInfo.processId, frameInfo.frameId], channel, ...args);\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_2__[\"default\"].error(`[IPC]: failed to send IPC message \"${channel}\" to view \"${viewType}=${view.id}\"'s subframe \"frameInfo.processId\"=${frameInfo.processId} \"frameInfo.frameId\"=${frameInfo.frameId}`, { error: String(error) });\n }\n }\n }\n });\n}\nfunction ipcMainOn(channel, listener) {\n electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"].on(channel, listener);\n return () => electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcMain\"].off(channel, listener);\n}\nfunction ipcRendererOn(channel, listener) {\n electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"].on(channel, listener);\n return () => electron__WEBPACK_IMPORTED_MODULE_0__[\"ipcRenderer\"].off(channel, listener);\n}\nfunction bindBroadcastHandlers() {\n ipcMainHandle(subFramesChannel, () => getSubFrames());\n}\n/**\n * Sanitizing data for IPC-messaging before send.\n * Removes possible observable values to avoid exceptions like \"can't clone object\".\n */\nfunction sanitizePayload(data) {\n return Object(_utils_toJS__WEBPACK_IMPORTED_MODULE_1__[\"toJS\"])(data);\n}\n\n\n//# sourceURL=webpack:///./src/common/ipc/ipc.ts?");
|
|
38656
38622
|
|
|
38657
38623
|
/***/ }),
|
|
38658
38624
|
|
|
@@ -38760,7 +38726,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
38760
38726
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38761
38727
|
|
|
38762
38728
|
"use strict";
|
|
38763
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CustomResourceDefinition\", function() { return CustomResourceDefinition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"crdApi\", function() { return crdApi; });\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _kube_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _routes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../routes */ \"./src/common/routes/index.ts\");\n/* harmony import */ var _utils_cluster_id_url_parsing__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/cluster-id-url-parsing */ \"./src/common/utils/cluster-id-url-parsing.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nclass CustomResourceDefinition extends _kube_object__WEBPACK_IMPORTED_MODULE_0__[\"KubeObject\"] {\n constructor(data) {\n super(data);\n if (!data.spec || typeof data.spec !== \"object\") {\n throw new _kube_object__WEBPACK_IMPORTED_MODULE_0__[\"KubeCreationError\"](\"Cannot create a CustomResourceDefinition from an object without spec\", data);\n }\n }\n getResourceUrl() {\n return Object(_routes__WEBPACK_IMPORTED_MODULE_2__[\"crdResourcesURL\"])({\n params: {\n group: this.getGroup(),\n name: this.getPluralName(),\n },\n });\n }\n getResourceApiBase() {\n const { group } = this.spec;\n return `/apis/${group}/${this.getVersion()}/${this.getPluralName()}`;\n }\n getPluralName() {\n return this.getNames().plural;\n }\n getResourceKind() {\n return this.spec.names.kind;\n }\n getResourceTitle() {\n const name = this.getPluralName();\n return name[0].toUpperCase() + name.substr(1);\n }\n getGroup() {\n return this.spec.group;\n }\n getScope() {\n return this.spec.scope;\n }\n getPreferedVersion() {\n
|
|
38729
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CustomResourceDefinition\", function() { return CustomResourceDefinition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"crdApi\", function() { return crdApi; });\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _kube_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _routes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../routes */ \"./src/common/routes/index.ts\");\n/* harmony import */ var _utils_cluster_id_url_parsing__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/cluster-id-url-parsing */ \"./src/common/utils/cluster-id-url-parsing.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nclass CustomResourceDefinition extends _kube_object__WEBPACK_IMPORTED_MODULE_0__[\"KubeObject\"] {\n constructor(data) {\n super(data);\n if (!data.spec || typeof data.spec !== \"object\") {\n throw new _kube_object__WEBPACK_IMPORTED_MODULE_0__[\"KubeCreationError\"](\"Cannot create a CustomResourceDefinition from an object without spec\", data);\n }\n }\n getResourceUrl() {\n return Object(_routes__WEBPACK_IMPORTED_MODULE_2__[\"crdResourcesURL\"])({\n params: {\n group: this.getGroup(),\n name: this.getPluralName(),\n },\n });\n }\n getResourceApiBase() {\n const { group } = this.spec;\n return `/apis/${group}/${this.getVersion()}/${this.getPluralName()}`;\n }\n getPluralName() {\n return this.getNames().plural;\n }\n getResourceKind() {\n return this.spec.names.kind;\n }\n getResourceTitle() {\n const name = this.getPluralName();\n return name[0].toUpperCase() + name.substr(1);\n }\n getGroup() {\n return this.spec.group;\n }\n getScope() {\n return this.spec.scope;\n }\n getPreferedVersion() {\n const { apiVersion } = this;\n switch (apiVersion) {\n case \"apiextensions.k8s.io/v1\":\n for (const version of this.spec.versions) {\n if (version.storage) {\n return version;\n }\n }\n break;\n case \"apiextensions.k8s.io/v1beta1\": {\n const { additionalPrinterColumns: apc } = this.spec;\n const additionalPrinterColumns = apc === null || apc === void 0 ? void 0 : apc.map((_a) => {\n var { JSONPath } = _a, apc = __rest(_a, [\"JSONPath\"]);\n return (Object.assign(Object.assign({}, apc), { jsonPath: JSONPath }));\n });\n return {\n name: this.spec.version,\n served: true,\n storage: true,\n schema: this.spec.validation,\n additionalPrinterColumns,\n };\n }\n }\n throw new Error(`Unknown apiVersion=${apiVersion}: Failed to find a version for CustomResourceDefinition ${this.metadata.name}`);\n }\n getVersion() {\n return this.getPreferedVersion().name;\n }\n isNamespaced() {\n return this.getScope() === \"Namespaced\";\n }\n getStoredVersions() {\n return this.status.storedVersions.join(\", \");\n }\n getNames() {\n return this.spec.names;\n }\n getConversion() {\n return JSON.stringify(this.spec.conversion);\n }\n getPrinterColumns(ignorePriority = true) {\n var _a;\n const columns = (_a = this.getPreferedVersion().additionalPrinterColumns) !== null && _a !== void 0 ? _a : [];\n return columns\n .filter(column => column.name.toLowerCase() != \"age\" && (ignorePriority || !column.priority));\n }\n getValidation() {\n return JSON.stringify(this.getPreferedVersion().schema, null, 2);\n }\n getConditions() {\n var _a;\n if (!((_a = this.status) === null || _a === void 0 ? void 0 : _a.conditions))\n return [];\n return this.status.conditions.map(condition => {\n const { message, reason, lastTransitionTime, status } = condition;\n return Object.assign(Object.assign({}, condition), { isReady: status === \"True\", tooltip: `${message || reason} (${lastTransitionTime})` });\n });\n }\n}\nObject.defineProperty(CustomResourceDefinition, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"CustomResourceDefinition\"\n});\nObject.defineProperty(CustomResourceDefinition, \"namespaced\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n});\nObject.defineProperty(CustomResourceDefinition, \"apiBase\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"/apis/apiextensions.k8s.io/v1/customresourcedefinitions\"\n});\n/**\n * Only available within kubernetes cluster pages\n */\nlet crdApi;\nif (Object(_utils_cluster_id_url_parsing__WEBPACK_IMPORTED_MODULE_3__[\"isClusterPageContext\"])()) {\n crdApi = new _kube_api__WEBPACK_IMPORTED_MODULE_1__[\"KubeApi\"]({\n objectConstructor: CustomResourceDefinition,\n checkPreferredVersion: true,\n });\n}\n\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/endpoints/crd.api.ts?");
|
|
38764
38730
|
|
|
38765
38731
|
/***/ }),
|
|
38766
38732
|
|
|
@@ -38856,7 +38822,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _clu
|
|
|
38856
38822
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38857
38823
|
|
|
38858
38824
|
"use strict";
|
|
38859
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IngressApi\", function() { return IngressApi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMetricsForIngress\", function() { return getMetricsForIngress; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBackendServiceNamePort\", function() { return getBackendServiceNamePort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Ingress\", function() { return Ingress; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ingressApi\", function() { return ingressApi; });\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _metrics_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./metrics.api */ \"./src/common/k8s-api/endpoints/metrics.api.ts\");\n/* harmony import */ var _kube_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _utils_cluster_id_url_parsing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/cluster-id-url-parsing */ \"./src/common/utils/cluster-id-url-parsing.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\nclass IngressApi extends _kube_api__WEBPACK_IMPORTED_MODULE_3__[\"KubeApi\"] {\n}\nfunction getMetricsForIngress(ingress, namespace) {\n const opts = { category: \"ingress\", ingress, namespace };\n return _metrics_api__WEBPACK_IMPORTED_MODULE_2__[\"metricsApi\"].getMetrics({\n bytesSentSuccess: opts,\n bytesSentFailure: opts,\n requestDurationSeconds: opts,\n responseDurationSeconds: opts,\n }, {\n namespace,\n });\n}\nconst getBackendServiceNamePort = (backend) => {\n var _a;\n // .service is available with networking.k8s.io/v1, otherwise using extensions/v1beta1 interface\n const serviceName = \"service\" in backend ? backend.service.name : backend.serviceName;\n // Port is specified either with a number or name\n const servicePort = \"service\" in backend ? (_a = backend.service.port.number) !== null && _a !== void 0 ? _a : backend.service.port.name : backend.servicePort;\n return { serviceName, servicePort };\n};\nclass Ingress extends _kube_object__WEBPACK_IMPORTED_MODULE_0__[\"KubeObject\"] {\n constructor(data) {\n super(data);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n }\n getRoutes() {\n const { spec: { tls, rules } } = this;\n if (!rules)\n return [];\n let protocol = \"http\";\n const routes = [];\n if (tls && tls.length > 0) {\n protocol += \"s\";\n }\n rules.map(rule => {\n const host = rule.host ? rule.host : \"*\";\n if (rule.http && rule.http.paths) {\n rule.http.paths.forEach(path => {\n const { serviceName, servicePort } = getBackendServiceNamePort(path.backend);\n routes.push(`${protocol}://${host}${path.path || \"/\"} ⇢ ${serviceName}:${servicePort}`);\n });\n }\n });\n return routes;\n }\n getServiceNamePort() {\n var _a, _b, _c, _d, _e, _f;\n const { spec: { backend, defaultBackend } = {} } = this;\n const serviceName = (_b = (_a = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : backend === null || backend === void 0 ? void 0 : backend.serviceName;\n const servicePort = (_f = (_d = (_c = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service) === null || _c === void 0 ? void 0 : _c.port.number) !== null && _d !== void 0 ? _d : (_e = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service) === null || _e === void 0 ? void 0 : _e.port.name) !== null && _f !== void 0 ? _f : backend === null || backend === void 0 ? void 0 : backend.servicePort;\n return {\n serviceName,\n servicePort,\n };\n }\n getHosts() {\n const { spec: { rules } } = this;\n if (!rules)\n return [];\n return rules.filter(rule => rule.host).map(rule => rule.host);\n }\n getPorts() {\n var _a;\n const ports = [];\n const { spec: { tls, rules, backend, defaultBackend } } = this;\n const httpPort = 80;\n const tlsPort = 443;\n // Note: not using the port name (string)\n const servicePort = (_a = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service.port.number) !== null && _a !== void 0 ? _a : backend === null || backend === void 0 ? void 0 : backend.servicePort;\n if (rules && rules.length > 0) {\n if (rules.some(rule =>
|
|
38825
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IngressApi\", function() { return IngressApi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMetricsForIngress\", function() { return getMetricsForIngress; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBackendServiceNamePort\", function() { return getBackendServiceNamePort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Ingress\", function() { return Ingress; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ingressApi\", function() { return ingressApi; });\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _metrics_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./metrics.api */ \"./src/common/k8s-api/endpoints/metrics.api.ts\");\n/* harmony import */ var _kube_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _utils_cluster_id_url_parsing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/cluster-id-url-parsing */ \"./src/common/utils/cluster-id-url-parsing.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\nclass IngressApi extends _kube_api__WEBPACK_IMPORTED_MODULE_3__[\"KubeApi\"] {\n}\nfunction getMetricsForIngress(ingress, namespace) {\n const opts = { category: \"ingress\", ingress, namespace };\n return _metrics_api__WEBPACK_IMPORTED_MODULE_2__[\"metricsApi\"].getMetrics({\n bytesSentSuccess: opts,\n bytesSentFailure: opts,\n requestDurationSeconds: opts,\n responseDurationSeconds: opts,\n }, {\n namespace,\n });\n}\nconst getBackendServiceNamePort = (backend) => {\n var _a;\n // .service is available with networking.k8s.io/v1, otherwise using extensions/v1beta1 interface\n const serviceName = \"service\" in backend ? backend.service.name : backend.serviceName;\n // Port is specified either with a number or name\n const servicePort = \"service\" in backend ? (_a = backend.service.port.number) !== null && _a !== void 0 ? _a : backend.service.port.name : backend.servicePort;\n return { serviceName, servicePort };\n};\nclass Ingress extends _kube_object__WEBPACK_IMPORTED_MODULE_0__[\"KubeObject\"] {\n constructor(data) {\n super(data);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n }\n getRoutes() {\n const { spec: { tls, rules } } = this;\n if (!rules)\n return [];\n let protocol = \"http\";\n const routes = [];\n if (tls && tls.length > 0) {\n protocol += \"s\";\n }\n rules.map(rule => {\n const host = rule.host ? rule.host : \"*\";\n if (rule.http && rule.http.paths) {\n rule.http.paths.forEach(path => {\n const { serviceName, servicePort } = getBackendServiceNamePort(path.backend);\n routes.push(`${protocol}://${host}${path.path || \"/\"} ⇢ ${serviceName}:${servicePort}`);\n });\n }\n });\n return routes;\n }\n getServiceNamePort() {\n var _a, _b, _c, _d, _e, _f;\n const { spec: { backend, defaultBackend } = {} } = this;\n const serviceName = (_b = (_a = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : backend === null || backend === void 0 ? void 0 : backend.serviceName;\n const servicePort = (_f = (_d = (_c = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service) === null || _c === void 0 ? void 0 : _c.port.number) !== null && _d !== void 0 ? _d : (_e = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service) === null || _e === void 0 ? void 0 : _e.port.name) !== null && _f !== void 0 ? _f : backend === null || backend === void 0 ? void 0 : backend.servicePort;\n return {\n serviceName,\n servicePort,\n };\n }\n getHosts() {\n const { spec: { rules } } = this;\n if (!rules)\n return [];\n return rules.filter(rule => rule.host).map(rule => rule.host);\n }\n getPorts() {\n var _a;\n const ports = [];\n const { spec: { tls, rules, backend, defaultBackend } } = this;\n const httpPort = 80;\n const tlsPort = 443;\n // Note: not using the port name (string)\n const servicePort = (_a = defaultBackend === null || defaultBackend === void 0 ? void 0 : defaultBackend.service.port.number) !== null && _a !== void 0 ? _a : backend === null || backend === void 0 ? void 0 : backend.servicePort;\n if (rules && rules.length > 0) {\n if (rules.some(rule => Object.prototype.hasOwnProperty.call(rule, \"http\"))) {\n ports.push(httpPort);\n }\n }\n else if (servicePort !== undefined) {\n ports.push(Number(servicePort));\n }\n if (tls && tls.length > 0) {\n ports.push(tlsPort);\n }\n return ports.join(\", \");\n }\n getLoadBalancers() {\n var _a;\n const { status: { loadBalancer = { ingress: [] } } } = this;\n return ((_a = loadBalancer.ingress) !== null && _a !== void 0 ? _a : []).map(address => (address.hostname || address.ip));\n }\n}\nObject.defineProperty(Ingress, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"Ingress\"\n});\nObject.defineProperty(Ingress, \"namespaced\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n});\nObject.defineProperty(Ingress, \"apiBase\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"/apis/networking.k8s.io/v1/ingresses\"\n});\nlet ingressApi;\nif (Object(_utils_cluster_id_url_parsing__WEBPACK_IMPORTED_MODULE_4__[\"isClusterPageContext\"])()) {\n ingressApi = new IngressApi({\n objectConstructor: Ingress,\n // Add fallback for Kubernetes <1.19\n checkPreferredVersion: true,\n fallbackApiBases: [\"/apis/extensions/v1beta1/ingresses\"],\n });\n}\n\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/endpoints/ingress.api.ts?");
|
|
38860
38826
|
|
|
38861
38827
|
/***/ }),
|
|
38862
38828
|
|
|
@@ -38892,7 +38858,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
38892
38858
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
38893
38859
|
|
|
38894
38860
|
"use strict";
|
|
38895
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"metricsApi\", function() { return metricsApi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalizeMetrics\", function() { return normalizeMetrics; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isMetricsEmpty\", function() { return isMetricsEmpty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getItemMetrics\", function() { return getItemMetrics; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMetricLastPoints\", function() { return getMetricLastPoints; });\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../index */ \"./src/common/k8s-api/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Metrics api\n\n\nconst metricsApi = {\n async getMetrics(query, reqParams = {}) {\n const { range = 3600, step = 60, namespace } = reqParams;\n let { start, end } = reqParams;\n if (!start && !end) {\n const timeNow = Date.now() / 1000;\n const now = moment__WEBPACK_IMPORTED_MODULE_0___default.a.unix(timeNow).startOf(\"minute\").unix(); // round date to minutes\n start = now - range;\n end = now;\n }\n return _index__WEBPACK_IMPORTED_MODULE_1__[\"apiBase\"].post(\"/metrics\", {\n data: query,\n query: {\n start, end, step,\n \"kubernetes_namespace\": namespace,\n },\n });\n },\n async getMetricProviders() {\n return _index__WEBPACK_IMPORTED_MODULE_1__[\"apiBase\"].get(\"/metrics/providers\");\n },\n};\nfunction normalizeMetrics(metrics, frames = 60) {\n var _a;\n if (!((_a = metrics === null || metrics === void 0 ? void 0 : metrics.data) === null || _a === void 0 ? void 0 : _a.result)) {\n return {\n data: {\n resultType: \"\",\n result: [{\n metric: {},\n values: [],\n }],\n },\n status: \"\",\n };\n }\n const { result } = metrics.data;\n if (result.length) {\n if (frames > 0) {\n // fill the gaps\n result.forEach(res => {\n if (!res.values || !res.values.length)\n return;\n let now = moment__WEBPACK_IMPORTED_MODULE_0___default()().startOf(\"minute\").subtract(1, \"minute\").unix();\n let timestamp = res.values[0][0];\n while (timestamp <= now) {\n timestamp = moment__WEBPACK_IMPORTED_MODULE_0___default.a.unix(timestamp).add(1, \"minute\").unix();\n if (!res.values.find((value) => value[0] === timestamp)) {\n res.values.push([timestamp, \"0\"]);\n }\n }\n while (res.values.length < frames) {\n const timestamp = moment__WEBPACK_IMPORTED_MODULE_0___default.a.unix(res.values[0][0]).subtract(1, \"minute\").unix();\n if (!res.values.find((value) => value[0] === timestamp)) {\n res.values.unshift([timestamp, \"0\"]);\n }\n now = timestamp;\n }\n });\n }\n }\n else {\n // always return at least empty values array\n result.push({\n metric: {},\n values: [],\n });\n }\n return metrics;\n}\nfunction isMetricsEmpty(metrics) {\n return Object.values(metrics).every(metric => { var _a, _b; return !((_b = (_a = metric === null || metric === void 0 ? void 0 : metric.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.length); });\n}\nfunction getItemMetrics(metrics, itemName) {\n var _a, _b;\n if (!metrics)\n return;\n const itemMetrics = Object.assign({}, metrics);\n for (const metric in metrics) {\n if (!((_b = (_a = metrics[metric]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.result)) {\n continue;\n }\n const results = metrics[metric].data.result;\n const result = results.find(res => Object.values(res.metric)[0] == itemName);\n itemMetrics[metric].data.result = result ? [result] : [];\n }\n return itemMetrics;\n}\nfunction getMetricLastPoints(metrics) {\n const result = {};\n Object.keys(metrics).forEach(metricName => {\n try {\n const metric = metrics[metricName];\n if (metric.data.result.length) {\n result[metricName] = +metric.data.result[0].values.slice(-1)[0][1];\n }\n }\n catch (
|
|
38861
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"metricsApi\", function() { return metricsApi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalizeMetrics\", function() { return normalizeMetrics; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isMetricsEmpty\", function() { return isMetricsEmpty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getItemMetrics\", function() { return getItemMetrics; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMetricLastPoints\", function() { return getMetricLastPoints; });\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../index */ \"./src/common/k8s-api/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Metrics api\n\n\nconst metricsApi = {\n async getMetrics(query, reqParams = {}) {\n const { range = 3600, step = 60, namespace } = reqParams;\n let { start, end } = reqParams;\n if (!start && !end) {\n const timeNow = Date.now() / 1000;\n const now = moment__WEBPACK_IMPORTED_MODULE_0___default.a.unix(timeNow).startOf(\"minute\").unix(); // round date to minutes\n start = now - range;\n end = now;\n }\n return _index__WEBPACK_IMPORTED_MODULE_1__[\"apiBase\"].post(\"/metrics\", {\n data: query,\n query: {\n start, end, step,\n \"kubernetes_namespace\": namespace,\n },\n });\n },\n async getMetricProviders() {\n return _index__WEBPACK_IMPORTED_MODULE_1__[\"apiBase\"].get(\"/metrics/providers\");\n },\n};\nfunction normalizeMetrics(metrics, frames = 60) {\n var _a;\n if (!((_a = metrics === null || metrics === void 0 ? void 0 : metrics.data) === null || _a === void 0 ? void 0 : _a.result)) {\n return {\n data: {\n resultType: \"\",\n result: [{\n metric: {},\n values: [],\n }],\n },\n status: \"\",\n };\n }\n const { result } = metrics.data;\n if (result.length) {\n if (frames > 0) {\n // fill the gaps\n result.forEach(res => {\n if (!res.values || !res.values.length)\n return;\n let now = moment__WEBPACK_IMPORTED_MODULE_0___default()().startOf(\"minute\").subtract(1, \"minute\").unix();\n let timestamp = res.values[0][0];\n while (timestamp <= now) {\n timestamp = moment__WEBPACK_IMPORTED_MODULE_0___default.a.unix(timestamp).add(1, \"minute\").unix();\n if (!res.values.find((value) => value[0] === timestamp)) {\n res.values.push([timestamp, \"0\"]);\n }\n }\n while (res.values.length < frames) {\n const timestamp = moment__WEBPACK_IMPORTED_MODULE_0___default.a.unix(res.values[0][0]).subtract(1, \"minute\").unix();\n if (!res.values.find((value) => value[0] === timestamp)) {\n res.values.unshift([timestamp, \"0\"]);\n }\n now = timestamp;\n }\n });\n }\n }\n else {\n // always return at least empty values array\n result.push({\n metric: {},\n values: [],\n });\n }\n return metrics;\n}\nfunction isMetricsEmpty(metrics) {\n return Object.values(metrics).every(metric => { var _a, _b; return !((_b = (_a = metric === null || metric === void 0 ? void 0 : metric.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.length); });\n}\nfunction getItemMetrics(metrics, itemName) {\n var _a, _b;\n if (!metrics)\n return;\n const itemMetrics = Object.assign({}, metrics);\n for (const metric in metrics) {\n if (!((_b = (_a = metrics[metric]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.result)) {\n continue;\n }\n const results = metrics[metric].data.result;\n const result = results.find(res => Object.values(res.metric)[0] == itemName);\n itemMetrics[metric].data.result = result ? [result] : [];\n }\n return itemMetrics;\n}\nfunction getMetricLastPoints(metrics) {\n const result = {};\n Object.keys(metrics).forEach(metricName => {\n try {\n const metric = metrics[metricName];\n if (metric.data.result.length) {\n result[metricName] = +metric.data.result[0].values.slice(-1)[0][1];\n }\n }\n catch (_a) {\n // ignore error\n }\n return result;\n }, {});\n return result;\n}\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/endpoints/metrics.api.ts?");
|
|
38896
38862
|
|
|
38897
38863
|
/***/ }),
|
|
38898
38864
|
|
|
@@ -39180,7 +39146,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
39180
39146
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39181
39147
|
|
|
39182
39148
|
"use strict";
|
|
39183
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forCluster\", function() { return forCluster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forRemoteCluster\", function() { return forRemoteCluster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ensureObjectSelfLink\", function() { return ensureObjectSelfLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubeApi\", function() { return KubeApi; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! querystring */ \"querystring\");\n/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/vars */ \"./src/common/vars.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _api_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ \"./src/common/k8s-api/index.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var byline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! byline */ \"./node_modules/byline/lib/byline.js\");\n/* harmony import */ var byline__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(byline__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _kube_json_api__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./kube-json-api */ \"./src/common/k8s-api/kube-json-api.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! abort-controller */ \"./node_modules/abort-controller/browser.js\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(abort_controller__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! https */ \"https\");\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(https__WEBPACK_IMPORTED_MODULE_12__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n// Base class for building all kubernetes apis\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction forCluster(cluster, kubeClass, apiClass = null) {\n const url = new URL(_index__WEBPACK_IMPORTED_MODULE_5__[\"apiBase\"].config.serverAddress);\n const request = new _kube_json_api__WEBPACK_IMPORTED_MODULE_9__[\"KubeJsonApi\"]({\n serverAddress: _index__WEBPACK_IMPORTED_MODULE_5__[\"apiBase\"].config.serverAddress,\n apiBase: _common_vars__WEBPACK_IMPORTED_MODULE_2__[\"apiKubePrefix\"],\n debug: _common_vars__WEBPACK_IMPORTED_MODULE_2__[\"isDevelopment\"],\n }, {\n headers: {\n \"Host\": `${cluster.metadata.uid}.localhost:${url.port}`,\n },\n });\n if (!apiClass) {\n apiClass = KubeApi;\n }\n return new apiClass({\n objectConstructor: kubeClass,\n request,\n });\n}\nfunction forRemoteCluster(config, kubeClass, apiClass = null) {\n const reqInit = {};\n const agentOptions = {};\n if (config.cluster.skipTLSVerify === true) {\n agentOptions.rejectUnauthorized = false;\n }\n if (config.user.clientCertificateData) {\n agentOptions.cert = config.user.clientCertificateData;\n }\n if (config.user.clientKeyData) {\n agentOptions.key = config.user.clientKeyData;\n }\n if (config.cluster.caData) {\n agentOptions.ca = config.cluster.caData;\n }\n if (Object.keys(agentOptions).length > 0) {\n reqInit.agent = new https__WEBPACK_IMPORTED_MODULE_12__[\"Agent\"](agentOptions);\n }\n const token = config.user.token;\n const request = new _kube_json_api__WEBPACK_IMPORTED_MODULE_9__[\"KubeJsonApi\"](Object.assign({ serverAddress: config.cluster.server, apiBase: \"\", debug: _common_vars__WEBPACK_IMPORTED_MODULE_2__[\"isDevelopment\"] }, (token ? {\n getRequestOptions: async () => ({\n headers: {\n \"Authorization\": `Bearer ${Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(token) ? await token() : token}`,\n },\n }),\n } : {})), reqInit);\n if (!apiClass) {\n apiClass = KubeApi;\n }\n return new apiClass({\n objectConstructor: kubeClass,\n request,\n });\n}\nfunction ensureObjectSelfLink(api, object) {\n if (!object.metadata.selfLink) {\n object.metadata.selfLink = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"createKubeApiURL\"])({\n apiPrefix: api.apiPrefix,\n apiVersion: api.apiVersionWithGroup,\n resource: api.apiResource,\n namespace: api.isNamespaced ? object.metadata.namespace : undefined,\n name: object.metadata.name,\n });\n }\n}\nconst patchTypeHeaders = {\n \"merge\": \"application/merge-patch+json\",\n \"json\": \"application/json-patch+json\",\n \"strategic\": \"application/strategic-merge-patch+json\",\n};\nclass KubeApi {\n constructor(options) {\n var _a;\n Object.defineProperty(this, \"options\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: options\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiBase\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiPrefix\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiGroup\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiVersionPreferred\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiResource\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"isNamespaced\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"objectConstructor\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"request\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"resourceVersions\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n Object.defineProperty(this, \"watchDisposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"watchId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 1\n });\n const { objectConstructor, request, kind, isNamespaced } = options;\n const { apiBase, apiPrefix, apiGroup, apiVersion, resource } = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"parseKubeApi\"])(options.apiBase || objectConstructor.apiBase);\n this.options = options;\n this.kind = kind !== null && kind !== void 0 ? kind : objectConstructor.kind;\n this.isNamespaced = (_a = isNamespaced !== null && isNamespaced !== void 0 ? isNamespaced : objectConstructor.namespaced) !== null && _a !== void 0 ? _a : false;\n this.apiBase = apiBase;\n this.apiPrefix = apiPrefix;\n this.apiGroup = apiGroup;\n this.apiVersion = apiVersion;\n this.apiResource = resource;\n this.request = request !== null && request !== void 0 ? request : _index__WEBPACK_IMPORTED_MODULE_5__[\"apiKube\"];\n this.objectConstructor = objectConstructor;\n this.parseResponse = this.parseResponse.bind(this);\n _api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerApi(apiBase, this);\n }\n get apiVersionWithGroup() {\n var _a;\n return [this.apiGroup, (_a = this.apiVersionPreferred) !== null && _a !== void 0 ? _a : this.apiVersion]\n .filter(Boolean)\n .join(\"/\");\n }\n /**\n * Returns the latest API prefix/group that contains the required resource.\n * First tries options.apiBase, then urls in order from options.fallbackApiBases.\n */\n async getLatestApiPrefixGroup() {\n var _a;\n // Note that this.options.apiBase is the \"full\" url, whereas this.apiBase is parsed\n const apiBases = [this.options.apiBase, this.objectConstructor.apiBase, ...this.options.fallbackApiBases];\n for (const apiUrl of apiBases) {\n if (!apiUrl) {\n continue;\n }\n try {\n // Split e.g. \"/apis/extensions/v1beta1/ingresses\" to parts\n const { apiPrefix, apiGroup, apiVersionWithGroup, resource } = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"parseKubeApi\"])(apiUrl);\n // Request available resources\n const response = await this.request.get(`${apiPrefix}/${apiVersionWithGroup}`);\n // If the resource is found in the group, use this apiUrl\n if ((_a = response.resources) === null || _a === void 0 ? void 0 : _a.find(kubeResource => kubeResource.name === resource)) {\n return { apiPrefix, apiGroup };\n }\n }\n catch (error) {\n // Exception is ignored as we can try the next url\n }\n }\n throw new Error(`Can't find working API for the Kubernetes resource ${this.apiResource}`);\n }\n /**\n * Get the apiPrefix and apiGroup to be used for fetching the preferred version.\n */\n async getPreferredVersionPrefixGroup() {\n if (this.options.fallbackApiBases) {\n try {\n return await this.getLatestApiPrefixGroup();\n }\n catch (error) {\n // If valid API wasn't found, log the error and return defaults below\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBE-API]: ${error}`);\n }\n }\n return {\n apiPrefix: this.apiPrefix,\n apiGroup: this.apiGroup,\n };\n }\n async checkPreferredVersion() {\n var _a, _b;\n if (this.options.fallbackApiBases && !this.options.checkPreferredVersion) {\n throw new Error(\"checkPreferredVersion must be enabled if fallbackApiBases is set in KubeApi\");\n }\n if (this.options.checkPreferredVersion && this.apiVersionPreferred === undefined) {\n const { apiPrefix, apiGroup } = await this.getPreferredVersionPrefixGroup();\n // The apiPrefix and apiGroup might change due to fallbackApiBases, so we must override them\n this.apiPrefix = apiPrefix;\n this.apiGroup = apiGroup;\n const url = [apiPrefix, apiGroup].filter(Boolean).join(\"/\");\n const res = await this.request.get(url);\n this.apiVersionPreferred = (_b = (_a = res === null || res === void 0 ? void 0 : res.preferredVersion) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : null;\n if (this.apiVersionPreferred) {\n this.apiBase = this.computeApiBase();\n _api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerApi(this.apiBase, this);\n }\n }\n }\n setResourceVersion(namespace = \"\", newVersion) {\n this.resourceVersions.set(namespace, newVersion);\n }\n getResourceVersion(namespace = \"\") {\n return this.resourceVersions.get(namespace);\n }\n async refreshResourceVersion(params) {\n return this.list(params, { limit: 1 });\n }\n computeApiBase() {\n return Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"createKubeApiURL\"])({\n apiPrefix: this.apiPrefix,\n apiVersion: this.apiVersionWithGroup,\n resource: this.apiResource,\n });\n }\n getUrl({ name, namespace } = {}, query) {\n const resourcePath = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"createKubeApiURL\"])({\n apiPrefix: this.apiPrefix,\n apiVersion: this.apiVersionWithGroup,\n resource: this.apiResource,\n namespace: this.isNamespaced ? namespace !== null && namespace !== void 0 ? namespace : \"default\" : undefined,\n name,\n });\n return resourcePath + (query ? `?${Object(querystring__WEBPACK_IMPORTED_MODULE_1__[\"stringify\"])(this.normalizeQuery(query))}` : \"\");\n }\n normalizeQuery(query = {}) {\n if (query.labelSelector) {\n query.labelSelector = [query.labelSelector].flat().join(\",\");\n }\n if (query.fieldSelector) {\n query.fieldSelector = [query.fieldSelector].flat().join(\",\");\n }\n return query;\n }\n parseResponse(data, namespace) {\n if (!data)\n return null;\n const KubeObjectConstructor = this.objectConstructor;\n // process items list response, check before single item since there is overlap\n if (_kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"].isJsonApiDataList(data, _kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"].isPartialJsonApiData)) {\n const { apiVersion, items, metadata } = data;\n this.setResourceVersion(namespace, metadata.resourceVersion);\n this.setResourceVersion(\"\", metadata.resourceVersion);\n return items.map((item) => {\n const object = new KubeObjectConstructor(Object.assign({ kind: this.kind, apiVersion }, item));\n ensureObjectSelfLink(this, object);\n return object;\n });\n }\n // process a single item\n if (_kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"].isJsonApiData(data)) {\n const object = new KubeObjectConstructor(data);\n ensureObjectSelfLink(this, object);\n return object;\n }\n // custom apis might return array for list response, e.g. users, groups, etc.\n if (Array.isArray(data)) {\n return data.map(data => new KubeObjectConstructor(data));\n }\n return null;\n }\n async list({ namespace = \"\", reqInit } = {}, query) {\n await this.checkPreferredVersion();\n const url = this.getUrl({ namespace });\n const res = await this.request.get(url, { query }, reqInit);\n const parsed = this.parseResponse(res, namespace);\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (!parsed) {\n return null;\n }\n throw new Error(`GET multiple request to ${url} returned not an array: ${JSON.stringify(parsed)}`);\n }\n async get(desc, query) {\n await this.checkPreferredVersion();\n const url = this.getUrl(desc);\n const res = await this.request.get(url, { query });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`GET single request to ${url} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async create({ name, namespace }, data) {\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl({ namespace });\n const res = await this.request.post(apiUrl, {\n data: Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"merge\"])(data, {\n kind: this.kind,\n apiVersion: this.apiVersionWithGroup,\n metadata: {\n name,\n namespace,\n },\n }),\n });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`POST request to ${apiUrl} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async update({ name, namespace }, data) {\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl({ namespace, name });\n const res = await this.request.put(apiUrl, {\n data: Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"merge\"])(data, {\n metadata: {\n name,\n namespace,\n },\n }),\n });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`PUT request to ${apiUrl} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async patch(desc, data, strategy = \"strategic\") {\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl(desc);\n const res = await this.request.patch(apiUrl, { data }, {\n headers: {\n \"content-type\": patchTypeHeaders[strategy],\n },\n });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`PATCH request to ${apiUrl} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async delete(_a) {\n var { propagationPolicy = \"Background\" } = _a, desc = __rest(_a, [\"propagationPolicy\"]);\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl(desc);\n return this.request.del(apiUrl, {\n query: {\n propagationPolicy,\n },\n });\n }\n getWatchUrl(namespace = \"\", query = {}) {\n return this.getUrl({ namespace }, Object.assign({ watch: 1, resourceVersion: this.getResourceVersion(namespace) }, query));\n }\n watch(opts = { namespace: \"\", retry: false }) {\n let errorReceived = false;\n let timedRetry;\n const { namespace, callback = _utils__WEBPACK_IMPORTED_MODULE_10__[\"noop\"], retry, timeout } = opts;\n const { watchId = `${this.kind.toLowerCase()}-${this.watchId++}` } = opts;\n // Create AbortController for this request\n const abortController = new abort_controller__WEBPACK_IMPORTED_MODULE_11___default.a();\n // If caller aborts, abort using request's abortController\n if (opts.abortController) {\n opts.abortController.signal.addEventListener(\"abort\", () => {\n abortController.abort();\n });\n }\n abortController.signal.addEventListener(\"abort\", () => {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] watch (${watchId}) aborted ${watchUrl}`);\n clearTimeout(timedRetry);\n });\n const requestParams = timeout ? { query: { timeoutSeconds: timeout } } : {};\n const watchUrl = this.getWatchUrl(namespace);\n const responsePromise = this.request.getResponse(watchUrl, requestParams, {\n signal: abortController.signal,\n timeout: 600000,\n });\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] watch (${watchId}) ${retry === true ? \"retried\" : \"started\"} ${watchUrl}`);\n responsePromise\n .then(response => {\n // True if the current watch request was retried\n let requestRetried = false;\n if (!response.ok) {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn(`[KUBE-API] watch (${watchId}) error response ${watchUrl}`, { status: response.status });\n return callback(null, response);\n }\n // Add mechanism to retry in case timeoutSeconds is set but the watch wasn't timed out.\n // This can happen if e.g. network is offline and AWS NLB is used.\n if (timeout) {\n setTimeout(() => {\n // We only retry if we haven't retried, haven't aborted and haven't received k8s error\n if (requestRetried || abortController.signal.aborted || errorReceived) {\n return;\n }\n // Close current request\n abortController.abort();\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] Watch timeout set, but not retried, retrying now`);\n requestRetried = true;\n // Clearing out any possible timeout, although we don't expect this to be set\n clearTimeout(timedRetry);\n this.watch(Object.assign(Object.assign({}, opts), { namespace, callback, watchId, retry: true }));\n // We wait longer than the timeout, as we expect the request to be retried with timeoutSeconds\n }, timeout * 1000 * 1.1);\n }\n [\"end\", \"close\", \"error\"].forEach((eventName) => {\n response.body.on(eventName, () => {\n // We only retry if we haven't retried, haven't aborted and haven't received k8s error\n // kubernetes errors (=errorReceived set) should be handled in a callback\n if (requestRetried || abortController.signal.aborted || errorReceived) {\n return;\n }\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] watch (${watchId}) ${eventName} ${watchUrl}`);\n requestRetried = true;\n clearTimeout(timedRetry);\n timedRetry = setTimeout(() => {\n this.watch(Object.assign(Object.assign({}, opts), { namespace, callback, watchId, retry: true }));\n }, 1000);\n });\n });\n byline__WEBPACK_IMPORTED_MODULE_8___default()(response.body).on(\"data\", (line) => {\n try {\n const event = JSON.parse(line);\n if (event.type === \"ERROR\" && event.object.kind === \"Status\") {\n errorReceived = true;\n return callback(null, new _kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeStatus\"](event.object));\n }\n this.modifyWatchEvent(event);\n callback(event, null);\n }\n catch (ignore) {\n // ignore parse errors\n }\n });\n })\n .catch(error => {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBE-API] watch (${watchId}) throwed ${watchUrl}`, error);\n callback(null, error);\n });\n return abortController.abort;\n }\n modifyWatchEvent(event) {\n switch (event.type) {\n case \"ADDED\":\n case \"DELETED\":\n case \"MODIFIED\": {\n ensureObjectSelfLink(this, event.object);\n const { namespace, resourceVersion } = event.object.metadata;\n this.setResourceVersion(namespace, resourceVersion);\n this.setResourceVersion(\"\", resourceVersion);\n break;\n }\n }\n }\n}\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/kube-api.ts?");
|
|
39149
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forCluster\", function() { return forCluster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forRemoteCluster\", function() { return forRemoteCluster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ensureObjectSelfLink\", function() { return ensureObjectSelfLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubeApi\", function() { return KubeApi; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! querystring */ \"querystring\");\n/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/vars */ \"./src/common/vars.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _api_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ \"./src/common/k8s-api/index.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var byline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! byline */ \"./node_modules/byline/lib/byline.js\");\n/* harmony import */ var byline__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(byline__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _kube_json_api__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./kube-json-api */ \"./src/common/k8s-api/kube-json-api.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! abort-controller */ \"./node_modules/abort-controller/browser.js\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(abort_controller__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! https */ \"https\");\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(https__WEBPACK_IMPORTED_MODULE_12__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n// Base class for building all kubernetes apis\n\n\n\n\n\n\n\n\n\n\n\n// BUG: https://github.com/mysticatea/abort-controller/pull/22\n// eslint-disable-next-line import/no-named-as-default\n\n\nfunction forCluster(cluster, kubeClass, apiClass = null) {\n const url = new URL(_index__WEBPACK_IMPORTED_MODULE_5__[\"apiBase\"].config.serverAddress);\n const request = new _kube_json_api__WEBPACK_IMPORTED_MODULE_9__[\"KubeJsonApi\"]({\n serverAddress: _index__WEBPACK_IMPORTED_MODULE_5__[\"apiBase\"].config.serverAddress,\n apiBase: _common_vars__WEBPACK_IMPORTED_MODULE_2__[\"apiKubePrefix\"],\n debug: _common_vars__WEBPACK_IMPORTED_MODULE_2__[\"isDevelopment\"],\n }, {\n headers: {\n \"Host\": `${cluster.metadata.uid}.localhost:${url.port}`,\n },\n });\n if (!apiClass) {\n apiClass = KubeApi;\n }\n return new apiClass({\n objectConstructor: kubeClass,\n request,\n });\n}\nfunction forRemoteCluster(config, kubeClass, apiClass = null) {\n const reqInit = {};\n const agentOptions = {};\n if (config.cluster.skipTLSVerify === true) {\n agentOptions.rejectUnauthorized = false;\n }\n if (config.user.clientCertificateData) {\n agentOptions.cert = config.user.clientCertificateData;\n }\n if (config.user.clientKeyData) {\n agentOptions.key = config.user.clientKeyData;\n }\n if (config.cluster.caData) {\n agentOptions.ca = config.cluster.caData;\n }\n if (Object.keys(agentOptions).length > 0) {\n reqInit.agent = new https__WEBPACK_IMPORTED_MODULE_12__[\"Agent\"](agentOptions);\n }\n const token = config.user.token;\n const request = new _kube_json_api__WEBPACK_IMPORTED_MODULE_9__[\"KubeJsonApi\"](Object.assign({ serverAddress: config.cluster.server, apiBase: \"\", debug: _common_vars__WEBPACK_IMPORTED_MODULE_2__[\"isDevelopment\"] }, (token ? {\n getRequestOptions: async () => ({\n headers: {\n \"Authorization\": `Bearer ${Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(token) ? await token() : token}`,\n },\n }),\n } : {})), reqInit);\n if (!apiClass) {\n apiClass = KubeApi;\n }\n return new apiClass({\n objectConstructor: kubeClass,\n request,\n });\n}\nfunction ensureObjectSelfLink(api, object) {\n if (!object.metadata.selfLink) {\n object.metadata.selfLink = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"createKubeApiURL\"])({\n apiPrefix: api.apiPrefix,\n apiVersion: api.apiVersionWithGroup,\n resource: api.apiResource,\n namespace: api.isNamespaced ? object.metadata.namespace : undefined,\n name: object.metadata.name,\n });\n }\n}\nconst patchTypeHeaders = {\n \"merge\": \"application/merge-patch+json\",\n \"json\": \"application/json-patch+json\",\n \"strategic\": \"application/strategic-merge-patch+json\",\n};\nclass KubeApi {\n constructor(options) {\n var _a;\n Object.defineProperty(this, \"options\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: options\n });\n Object.defineProperty(this, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiBase\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiPrefix\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiGroup\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiVersionPreferred\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"apiResource\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"isNamespaced\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"objectConstructor\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"request\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"resourceVersions\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n Object.defineProperty(this, \"watchDisposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"watchId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 1\n });\n const { objectConstructor, request, kind, isNamespaced } = options;\n const { apiBase, apiPrefix, apiGroup, apiVersion, resource } = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"parseKubeApi\"])(options.apiBase || objectConstructor.apiBase);\n this.options = options;\n this.kind = kind !== null && kind !== void 0 ? kind : objectConstructor.kind;\n this.isNamespaced = (_a = isNamespaced !== null && isNamespaced !== void 0 ? isNamespaced : objectConstructor.namespaced) !== null && _a !== void 0 ? _a : false;\n this.apiBase = apiBase;\n this.apiPrefix = apiPrefix;\n this.apiGroup = apiGroup;\n this.apiVersion = apiVersion;\n this.apiResource = resource;\n this.request = request !== null && request !== void 0 ? request : _index__WEBPACK_IMPORTED_MODULE_5__[\"apiKube\"];\n this.objectConstructor = objectConstructor;\n this.parseResponse = this.parseResponse.bind(this);\n _api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerApi(apiBase, this);\n }\n get apiVersionWithGroup() {\n var _a;\n return [this.apiGroup, (_a = this.apiVersionPreferred) !== null && _a !== void 0 ? _a : this.apiVersion]\n .filter(Boolean)\n .join(\"/\");\n }\n /**\n * Returns the latest API prefix/group that contains the required resource.\n * First tries options.apiBase, then urls in order from options.fallbackApiBases.\n */\n async getLatestApiPrefixGroup() {\n var _a;\n // Note that this.options.apiBase is the \"full\" url, whereas this.apiBase is parsed\n const apiBases = [this.options.apiBase, this.objectConstructor.apiBase, ...this.options.fallbackApiBases];\n for (const apiUrl of apiBases) {\n if (!apiUrl) {\n continue;\n }\n try {\n // Split e.g. \"/apis/extensions/v1beta1/ingresses\" to parts\n const { apiPrefix, apiGroup, apiVersionWithGroup, resource } = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"parseKubeApi\"])(apiUrl);\n // Request available resources\n const response = await this.request.get(`${apiPrefix}/${apiVersionWithGroup}`);\n // If the resource is found in the group, use this apiUrl\n if ((_a = response.resources) === null || _a === void 0 ? void 0 : _a.find(kubeResource => kubeResource.name === resource)) {\n return { apiPrefix, apiGroup };\n }\n }\n catch (error) {\n // Exception is ignored as we can try the next url\n }\n }\n throw new Error(`Can't find working API for the Kubernetes resource ${this.apiResource}`);\n }\n /**\n * Get the apiPrefix and apiGroup to be used for fetching the preferred version.\n */\n async getPreferredVersionPrefixGroup() {\n if (this.options.fallbackApiBases) {\n try {\n return await this.getLatestApiPrefixGroup();\n }\n catch (error) {\n // If valid API wasn't found, log the error and return defaults below\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBE-API]: ${error}`);\n }\n }\n return {\n apiPrefix: this.apiPrefix,\n apiGroup: this.apiGroup,\n };\n }\n async checkPreferredVersion() {\n var _a, _b;\n if (this.options.fallbackApiBases && !this.options.checkPreferredVersion) {\n throw new Error(\"checkPreferredVersion must be enabled if fallbackApiBases is set in KubeApi\");\n }\n if (this.options.checkPreferredVersion && this.apiVersionPreferred === undefined) {\n const { apiPrefix, apiGroup } = await this.getPreferredVersionPrefixGroup();\n // The apiPrefix and apiGroup might change due to fallbackApiBases, so we must override them\n this.apiPrefix = apiPrefix;\n this.apiGroup = apiGroup;\n const url = [apiPrefix, apiGroup].filter(Boolean).join(\"/\");\n const res = await this.request.get(url);\n this.apiVersionPreferred = (_b = (_a = res === null || res === void 0 ? void 0 : res.preferredVersion) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : null;\n if (this.apiVersionPreferred) {\n this.apiBase = this.computeApiBase();\n _api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerApi(this.apiBase, this);\n }\n }\n }\n setResourceVersion(namespace = \"\", newVersion) {\n this.resourceVersions.set(namespace, newVersion);\n }\n getResourceVersion(namespace = \"\") {\n return this.resourceVersions.get(namespace);\n }\n async refreshResourceVersion(params) {\n return this.list(params, { limit: 1 });\n }\n computeApiBase() {\n return Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"createKubeApiURL\"])({\n apiPrefix: this.apiPrefix,\n apiVersion: this.apiVersionWithGroup,\n resource: this.apiResource,\n });\n }\n getUrl({ name, namespace } = {}, query) {\n const resourcePath = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_6__[\"createKubeApiURL\"])({\n apiPrefix: this.apiPrefix,\n apiVersion: this.apiVersionWithGroup,\n resource: this.apiResource,\n namespace: this.isNamespaced ? namespace !== null && namespace !== void 0 ? namespace : \"default\" : undefined,\n name,\n });\n return resourcePath + (query ? `?${Object(querystring__WEBPACK_IMPORTED_MODULE_1__[\"stringify\"])(this.normalizeQuery(query))}` : \"\");\n }\n normalizeQuery(query = {}) {\n if (query.labelSelector) {\n query.labelSelector = [query.labelSelector].flat().join(\",\");\n }\n if (query.fieldSelector) {\n query.fieldSelector = [query.fieldSelector].flat().join(\",\");\n }\n return query;\n }\n parseResponse(data, namespace) {\n if (!data)\n return null;\n const KubeObjectConstructor = this.objectConstructor;\n // process items list response, check before single item since there is overlap\n if (_kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"].isJsonApiDataList(data, _kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"].isPartialJsonApiData)) {\n const { apiVersion, items, metadata } = data;\n this.setResourceVersion(namespace, metadata.resourceVersion);\n this.setResourceVersion(\"\", metadata.resourceVersion);\n return items.map((item) => {\n const object = new KubeObjectConstructor(Object.assign({ kind: this.kind, apiVersion }, item));\n ensureObjectSelfLink(this, object);\n return object;\n });\n }\n // process a single item\n if (_kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"].isJsonApiData(data)) {\n const object = new KubeObjectConstructor(data);\n ensureObjectSelfLink(this, object);\n return object;\n }\n // custom apis might return array for list response, e.g. users, groups, etc.\n if (Array.isArray(data)) {\n return data.map(data => new KubeObjectConstructor(data));\n }\n return null;\n }\n async list({ namespace = \"\", reqInit } = {}, query) {\n await this.checkPreferredVersion();\n const url = this.getUrl({ namespace });\n const res = await this.request.get(url, { query }, reqInit);\n const parsed = this.parseResponse(res, namespace);\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (!parsed) {\n return null;\n }\n throw new Error(`GET multiple request to ${url} returned not an array: ${JSON.stringify(parsed)}`);\n }\n async get(desc, query) {\n await this.checkPreferredVersion();\n const url = this.getUrl(desc);\n const res = await this.request.get(url, { query });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`GET single request to ${url} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async create({ name, namespace }, data) {\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl({ namespace });\n const res = await this.request.post(apiUrl, {\n data: Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"merge\"])(data, {\n kind: this.kind,\n apiVersion: this.apiVersionWithGroup,\n metadata: {\n name,\n namespace,\n },\n }),\n });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`POST request to ${apiUrl} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async update({ name, namespace }, data) {\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl({ namespace, name });\n const res = await this.request.put(apiUrl, {\n data: Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"merge\"])(data, {\n metadata: {\n name,\n namespace,\n },\n }),\n });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`PUT request to ${apiUrl} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async patch(desc, data, strategy = \"strategic\") {\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl(desc);\n const res = await this.request.patch(apiUrl, { data }, {\n headers: {\n \"content-type\": patchTypeHeaders[strategy],\n },\n });\n const parsed = this.parseResponse(res);\n if (Array.isArray(parsed)) {\n throw new Error(`PATCH request to ${apiUrl} returned an array: ${JSON.stringify(parsed)}`);\n }\n return parsed;\n }\n async delete(_a) {\n var { propagationPolicy = \"Background\" } = _a, desc = __rest(_a, [\"propagationPolicy\"]);\n await this.checkPreferredVersion();\n const apiUrl = this.getUrl(desc);\n return this.request.del(apiUrl, {\n query: {\n propagationPolicy,\n },\n });\n }\n getWatchUrl(namespace = \"\", query = {}) {\n return this.getUrl({ namespace }, Object.assign({ watch: 1, resourceVersion: this.getResourceVersion(namespace) }, query));\n }\n watch(opts = { namespace: \"\", retry: false }) {\n let errorReceived = false;\n let timedRetry;\n const { namespace, callback = _utils__WEBPACK_IMPORTED_MODULE_10__[\"noop\"], retry, timeout } = opts;\n const { watchId = `${this.kind.toLowerCase()}-${this.watchId++}` } = opts;\n // Create AbortController for this request\n const abortController = new abort_controller__WEBPACK_IMPORTED_MODULE_11___default.a();\n // If caller aborts, abort using request's abortController\n if (opts.abortController) {\n opts.abortController.signal.addEventListener(\"abort\", () => {\n abortController.abort();\n });\n }\n abortController.signal.addEventListener(\"abort\", () => {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] watch (${watchId}) aborted ${watchUrl}`);\n clearTimeout(timedRetry);\n });\n const requestParams = timeout ? { query: { timeoutSeconds: timeout } } : {};\n const watchUrl = this.getWatchUrl(namespace);\n const responsePromise = this.request.getResponse(watchUrl, requestParams, {\n signal: abortController.signal,\n timeout: 600000,\n });\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] watch (${watchId}) ${retry === true ? \"retried\" : \"started\"} ${watchUrl}`);\n responsePromise\n .then(response => {\n // True if the current watch request was retried\n let requestRetried = false;\n if (!response.ok) {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn(`[KUBE-API] watch (${watchId}) error response ${watchUrl}`, { status: response.status });\n return callback(null, response);\n }\n // Add mechanism to retry in case timeoutSeconds is set but the watch wasn't timed out.\n // This can happen if e.g. network is offline and AWS NLB is used.\n if (timeout) {\n setTimeout(() => {\n // We only retry if we haven't retried, haven't aborted and haven't received k8s error\n if (requestRetried || abortController.signal.aborted || errorReceived) {\n return;\n }\n // Close current request\n abortController.abort();\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] Watch timeout set, but not retried, retrying now`);\n requestRetried = true;\n // Clearing out any possible timeout, although we don't expect this to be set\n clearTimeout(timedRetry);\n this.watch(Object.assign(Object.assign({}, opts), { namespace, callback, watchId, retry: true }));\n // We wait longer than the timeout, as we expect the request to be retried with timeoutSeconds\n }, timeout * 1000 * 1.1);\n }\n [\"end\", \"close\", \"error\"].forEach((eventName) => {\n response.body.on(eventName, () => {\n // We only retry if we haven't retried, haven't aborted and haven't received k8s error\n // kubernetes errors (=errorReceived set) should be handled in a callback\n if (requestRetried || abortController.signal.aborted || errorReceived) {\n return;\n }\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`[KUBE-API] watch (${watchId}) ${eventName} ${watchUrl}`);\n requestRetried = true;\n clearTimeout(timedRetry);\n timedRetry = setTimeout(() => {\n this.watch(Object.assign(Object.assign({}, opts), { namespace, callback, watchId, retry: true }));\n }, 1000);\n });\n });\n byline__WEBPACK_IMPORTED_MODULE_8___default()(response.body).on(\"data\", (line) => {\n try {\n const event = JSON.parse(line);\n if (event.type === \"ERROR\" && event.object.kind === \"Status\") {\n errorReceived = true;\n return callback(null, new _kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeStatus\"](event.object));\n }\n this.modifyWatchEvent(event);\n callback(event, null);\n }\n catch (ignore) {\n // ignore parse errors\n }\n });\n })\n .catch(error => {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBE-API] watch (${watchId}) throwed ${watchUrl}`, error);\n callback(null, error);\n });\n return abortController.abort;\n }\n modifyWatchEvent(event) {\n if (event.type === \"ERROR\") {\n return;\n }\n ensureObjectSelfLink(this, event.object);\n const { namespace, resourceVersion } = event.object.metadata;\n this.setResourceVersion(namespace, resourceVersion);\n this.setResourceVersion(\"\", resourceVersion);\n }\n}\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/kube-api.ts?");
|
|
39184
39150
|
|
|
39185
39151
|
/***/ }),
|
|
39186
39152
|
|
|
@@ -39204,7 +39170,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
39204
39170
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39205
39171
|
|
|
39206
39172
|
"use strict";
|
|
39207
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectStore\", function() { return KubeObjectStore; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _item_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../item.store */ \"./src/common/item.store.ts\");\n/* harmony import */ var _kube_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! abort-controller */ \"./node_modules/abort-controller/browser.js\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(abort_controller__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\nclass KubeObjectStore extends _item_store__WEBPACK_IMPORTED_MODULE_3__[\"ItemStore\"] {\n constructor(api) {\n super();\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"limit\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"bufferSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 50000\n });\n Object.defineProperty(this, \"loadedNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n // collect items from watch-api events to avoid UI blowing up with huge streams of data\n Object.defineProperty(this, \"eventsBuffer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].array([], { deep: false })\n });\n if (api)\n this.api = api;\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n this.bindWatchEventsUpdater();\n }\n get contextReady() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"when\"])(() => Boolean(this.context));\n }\n get namespacesReady() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"when\"])(() => Boolean(this.loadedNamespaces));\n }\n get context() {\n return KubeObjectStore.defaultContext.get();\n }\n get contextItems() {\n var _a, _b;\n const namespaces = (_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.contextNamespaces) !== null && _b !== void 0 ? _b : [];\n return this.items.filter(item => {\n const itemNamespace = item.getNs();\n return !itemNamespace /* cluster-wide */ || namespaces.includes(itemNamespace);\n });\n }\n getTotalCount() {\n return this.contextItems.length;\n }\n get query() {\n const { limit } = this;\n if (!limit) {\n return {};\n }\n return { limit };\n }\n getAllByNs(namespace, strict = false) {\n const namespaces = [].concat(namespace);\n if (namespaces.length) {\n return this.items.filter(item => namespaces.includes(item.getNs()));\n }\n if (!strict) {\n return this.items;\n }\n return [];\n }\n getById(id) {\n return this.items.find(item => item.getId() === id);\n }\n getByName(name, namespace) {\n return this.items.find(item => {\n return item.getName() === name && (namespace ? item.getNs() === namespace : true);\n });\n }\n getByPath(path) {\n return this.items.find(item => item.selfLink === path);\n }\n getByLabel(labels) {\n if (Array.isArray(labels)) {\n return this.items.filter((item) => {\n const itemLabels = item.getLabels();\n return labels.every(label => itemLabels.includes(label));\n });\n }\n else {\n return this.items.filter((item) => {\n const itemLabels = item.metadata.labels || {};\n return Object.entries(labels)\n .every(([key, value]) => itemLabels[key] === value);\n });\n }\n }\n async loadItems({ namespaces, reqInit, onLoadFailure }) {\n var _a, _b;\n if (!((_a = this.context) === null || _a === void 0 ? void 0 : _a.cluster.isAllowedResource(this.api.kind))) {\n return [];\n }\n const isLoadingAll = ((_b = this.context.allNamespaces) === null || _b === void 0 ? void 0 : _b.length) > 1\n && this.context.cluster.accessibleNamespaces.length === 0\n && this.context.allNamespaces.every(ns => namespaces.includes(ns));\n if (!this.api.isNamespaced || isLoadingAll) {\n if (this.api.isNamespaced) {\n this.loadedNamespaces = [];\n }\n const res = this.api.list({ reqInit }, this.query);\n if (onLoadFailure) {\n try {\n return await res;\n }\n catch (error) {\n onLoadFailure((error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.toString()) || \"Unknown error\");\n // reset the store because we are loading all, so that nothing is displayed\n this.items.clear();\n this.selectedItemsIds.clear();\n return [];\n }\n }\n return res;\n }\n this.loadedNamespaces = namespaces;\n const results = await Promise.allSettled(namespaces.map(namespace => this.api.list({ namespace, reqInit }, this.query)));\n const res = [];\n for (const result of results) {\n switch (result.status) {\n case \"fulfilled\":\n res.push(...result.value);\n break;\n case \"rejected\":\n if (onLoadFailure) {\n onLoadFailure(result.reason.message || result.reason);\n }\n else {\n // if onLoadFailure is not provided then preserve old behaviour\n throw result.reason;\n }\n }\n }\n return res;\n }\n filterItemsOnLoad(items) {\n return items;\n }\n async loadAll({ namespaces = this.context.contextNamespaces, merge = true, reqInit, onLoadFailure } = {}) {\n await this.contextReady;\n this.isLoading = true;\n try {\n const items = await this.loadItems({ namespaces, reqInit, onLoadFailure });\n this.mergeItems(items, { merge });\n this.isLoaded = true;\n this.failedLoading = false;\n return items;\n }\n catch (error) {\n console.warn(\"[KubeObjectStore] loadAll failed\", this.api.apiBase, error);\n this.resetOnError(error);\n this.failedLoading = true;\n }\n finally {\n this.isLoading = false;\n }\n }\n async reloadAll(opts = {}) {\n const { force = false } = opts, loadingOptions = __rest(opts, [\"force\"]);\n if (this.isLoading || (this.isLoaded && !force)) {\n return;\n }\n return this.loadAll(loadingOptions);\n }\n mergeItems(partialItems, { merge = true, updateStore = true, sort = true, filter = true } = {}) {\n let items = partialItems;\n // update existing items\n if (merge) {\n const namespaces = partialItems.map(item => item.getNs());\n items = [\n ...this.items.filter(existingItem => !namespaces.includes(existingItem.getNs())),\n ...partialItems,\n ];\n }\n if (filter)\n items = this.filterItemsOnLoad(items);\n if (sort)\n items = this.sortItems(items);\n if (updateStore)\n this.items.replace(items);\n return items;\n }\n resetOnError(error) {\n if (error)\n this.reset();\n }\n async loadItem(params) {\n return this.api.get(params);\n }\n async load(params) {\n const { name, namespace } = params;\n let item = this.getByName(name, namespace);\n if (!item) {\n item = await this.loadItem(params);\n const newItems = this.sortItems([...this.items, item]);\n this.items.replace(newItems);\n }\n return item;\n }\n async loadFromPath(resourcePath) {\n const { namespace, name } = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_5__[\"parseKubeApi\"])(resourcePath);\n return this.load({ name, namespace });\n }\n async createItem(params, data) {\n return this.api.create(params, data);\n }\n async create(params, data) {\n const newItem = await this.createItem(params, data);\n const items = this.sortItems([...this.items, newItem]);\n this.items.replace(items);\n return newItem;\n }\n postUpdate(rawItem) {\n const newItem = new this.api.objectConstructor(rawItem);\n const index = this.items.findIndex(item => item.getId() === newItem.getId());\n Object(_kube_api__WEBPACK_IMPORTED_MODULE_4__[\"ensureObjectSelfLink\"])(this.api, newItem);\n if (index < 0) {\n this.items.push(newItem);\n }\n else {\n this.items[index] = newItem;\n }\n return newItem;\n }\n async patch(item, patch) {\n return this.postUpdate(await this.api.patch({\n name: item.getName(), namespace: item.getNs(),\n }, patch, \"json\"));\n }\n async update(item, data) {\n return this.postUpdate(await this.api.update({\n name: item.getName(),\n namespace: item.getNs(),\n }, data));\n }\n async remove(item) {\n await this.api.delete({ name: item.getName(), namespace: item.getNs() });\n this.selectedItemsIds.delete(item.getId());\n }\n async removeSelectedItems() {\n return Promise.all(this.selectedItems.map(this.remove));\n }\n bindWatchEventsUpdater(delay = 1000) {\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.eventsBuffer.length, this.updateFromEventsBuffer, {\n delay,\n });\n }\n subscribe({ onLoadFailure, abortController = new abort_controller__WEBPACK_IMPORTED_MODULE_6___default.a() } = {}) {\n if (this.api.isNamespaced) {\n Promise.race([Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"rejectPromiseBy\"])(abortController.signal), Promise.all([this.contextReady, this.namespacesReady])])\n .then(() => {\n if (this.context.cluster.isGlobalWatchEnabled && this.loadedNamespaces.length === 0) {\n return this.watchNamespace(\"\", abortController, { onLoadFailure });\n }\n for (const namespace of this.loadedNamespaces) {\n this.watchNamespace(namespace, abortController, { onLoadFailure });\n }\n })\n .catch(_utils__WEBPACK_IMPORTED_MODULE_1__[\"noop\"]); // ignore DOMExceptions\n }\n else {\n this.watchNamespace(\"\", abortController, { onLoadFailure });\n }\n return () => abortController.abort();\n }\n watchNamespace(namespace, abortController, opts) {\n if (!this.api.getResourceVersion(namespace)) {\n return;\n }\n let timedRetry;\n const watch = () => this.api.watch({\n namespace,\n abortController,\n callback,\n });\n const { signal } = abortController;\n const callback = (data, error) => {\n if (!this.isLoaded || (error === null || error === void 0 ? void 0 : error.type) === \"aborted\")\n return;\n if (error instanceof Response) {\n if (error.status === 404 || error.status === 401) {\n // api has gone, or credentials are not permitted, let's not retry\n return;\n }\n // not sure what to do, best to retry\n clearTimeout(timedRetry);\n timedRetry = setTimeout(watch, 5000);\n }\n else if (error instanceof _kube_object__WEBPACK_IMPORTED_MODULE_2__[\"KubeStatus\"] && error.code === 410) {\n clearTimeout(timedRetry);\n // resourceVersion has gone, let's try to reload\n timedRetry = setTimeout(() => {\n (namespace\n ? this.loadAll(Object.assign({ namespaces: [namespace], reqInit: { signal } }, opts))\n : this.loadAll(Object.assign({ merge: false, reqInit: { signal } }, opts))).then(watch);\n }, 1000);\n }\n else if (error) { // not sure what to do, best to retry\n clearTimeout(timedRetry);\n timedRetry = setTimeout(watch, 5000);\n }\n if (data) {\n this.eventsBuffer.push(data);\n }\n };\n signal.addEventListener(\"abort\", () => clearTimeout(timedRetry));\n watch();\n }\n updateFromEventsBuffer() {\n const items = this.getItems();\n for (const { type, object } of this.eventsBuffer.clear()) {\n const index = items.findIndex(item => { var _a; return item.getId() === ((_a = object.metadata) === null || _a === void 0 ? void 0 : _a.uid); });\n const item = items[index];\n switch (type) {\n case \"ADDED\":\n case \"MODIFIED\":\n const newItem = new this.api.objectConstructor(object);\n if (!item) {\n items.push(newItem);\n }\n else {\n items[index] = newItem;\n }\n break;\n case \"DELETED\":\n if (item) {\n items.splice(index, 1);\n }\n break;\n }\n }\n // update items\n this.items.replace(this.sortItems(items.slice(-this.bufferSize)));\n }\n}\nObject.defineProperty(KubeObjectStore, \"defaultContext\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].box()\n}); // TODO: support multiple cluster contexts\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"],\n __metadata(\"design:type\", Array)\n], KubeObjectStore.prototype, \"loadedNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], KubeObjectStore.prototype, \"contextItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"loadAll\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"reloadAll\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Array, Object]),\n __metadata(\"design:returntype\", Array)\n], KubeObjectStore.prototype, \"mergeItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"load\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [String]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"loadFromPath\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], KubeObjectStore.prototype, \"updateFromEventsBuffer\", null);\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/kube-object.store.ts?");
|
|
39173
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectStore\", function() { return KubeObjectStore; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _kube_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _item_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../item.store */ \"./src/common/item.store.ts\");\n/* harmony import */ var _kube_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! abort-controller */ \"./node_modules/abort-controller/browser.js\");\n/* harmony import */ var abort_controller__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(abort_controller__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n// BUG: https://github.com/mysticatea/abort-controller/pull/22\n// eslint-disable-next-line import/no-named-as-default\n\nclass KubeObjectStore extends _item_store__WEBPACK_IMPORTED_MODULE_3__[\"ItemStore\"] {\n constructor(api) {\n super();\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"limit\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"bufferSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 50000\n });\n Object.defineProperty(this, \"loadedNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n // collect items from watch-api events to avoid UI blowing up with huge streams of data\n Object.defineProperty(this, \"eventsBuffer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].array([], { deep: false })\n });\n if (api)\n this.api = api;\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n this.bindWatchEventsUpdater();\n }\n get contextReady() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"when\"])(() => Boolean(this.context));\n }\n get namespacesReady() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"when\"])(() => Boolean(this.loadedNamespaces));\n }\n get context() {\n return KubeObjectStore.defaultContext.get();\n }\n get contextItems() {\n var _a, _b;\n const namespaces = (_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.contextNamespaces) !== null && _b !== void 0 ? _b : [];\n return this.items.filter(item => {\n const itemNamespace = item.getNs();\n return !itemNamespace /* cluster-wide */ || namespaces.includes(itemNamespace);\n });\n }\n getTotalCount() {\n return this.contextItems.length;\n }\n get query() {\n const { limit } = this;\n if (!limit) {\n return {};\n }\n return { limit };\n }\n getAllByNs(namespace, strict = false) {\n const namespaces = [].concat(namespace);\n if (namespaces.length) {\n return this.items.filter(item => namespaces.includes(item.getNs()));\n }\n if (!strict) {\n return this.items;\n }\n return [];\n }\n getById(id) {\n return this.items.find(item => item.getId() === id);\n }\n getByName(name, namespace) {\n return this.items.find(item => {\n return item.getName() === name && (namespace ? item.getNs() === namespace : true);\n });\n }\n getByPath(path) {\n return this.items.find(item => item.selfLink === path);\n }\n getByLabel(labels) {\n if (Array.isArray(labels)) {\n return this.items.filter((item) => {\n const itemLabels = item.getLabels();\n return labels.every(label => itemLabels.includes(label));\n });\n }\n else {\n return this.items.filter((item) => {\n const itemLabels = item.metadata.labels || {};\n return Object.entries(labels)\n .every(([key, value]) => itemLabels[key] === value);\n });\n }\n }\n async loadItems({ namespaces, reqInit, onLoadFailure }) {\n var _a, _b;\n if (!((_a = this.context) === null || _a === void 0 ? void 0 : _a.cluster.isAllowedResource(this.api.kind))) {\n return [];\n }\n const isLoadingAll = ((_b = this.context.allNamespaces) === null || _b === void 0 ? void 0 : _b.length) > 1\n && this.context.cluster.accessibleNamespaces.length === 0\n && this.context.allNamespaces.every(ns => namespaces.includes(ns));\n if (!this.api.isNamespaced || isLoadingAll) {\n if (this.api.isNamespaced) {\n this.loadedNamespaces = [];\n }\n const res = this.api.list({ reqInit }, this.query);\n if (onLoadFailure) {\n try {\n return await res;\n }\n catch (error) {\n onLoadFailure((error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.toString()) || \"Unknown error\");\n // reset the store because we are loading all, so that nothing is displayed\n this.items.clear();\n this.selectedItemsIds.clear();\n return [];\n }\n }\n return res;\n }\n this.loadedNamespaces = namespaces;\n const results = await Promise.allSettled(namespaces.map(namespace => this.api.list({ namespace, reqInit }, this.query)));\n const res = [];\n for (const result of results) {\n switch (result.status) {\n case \"fulfilled\":\n res.push(...result.value);\n break;\n case \"rejected\":\n if (onLoadFailure) {\n onLoadFailure(result.reason.message || result.reason);\n }\n else {\n // if onLoadFailure is not provided then preserve old behaviour\n throw result.reason;\n }\n }\n }\n return res;\n }\n filterItemsOnLoad(items) {\n return items;\n }\n async loadAll({ namespaces, merge = true, reqInit, onLoadFailure } = {}) {\n await this.contextReady;\n namespaces !== null && namespaces !== void 0 ? namespaces : (namespaces = this.context.contextNamespaces);\n this.isLoading = true;\n try {\n const items = await this.loadItems({ namespaces, reqInit, onLoadFailure });\n this.mergeItems(items, { merge });\n this.isLoaded = true;\n this.failedLoading = false;\n return items;\n }\n catch (error) {\n console.warn(\"[KubeObjectStore] loadAll failed\", this.api.apiBase, error);\n this.resetOnError(error);\n this.failedLoading = true;\n }\n finally {\n this.isLoading = false;\n }\n }\n async reloadAll(opts = {}) {\n const { force = false } = opts, loadingOptions = __rest(opts, [\"force\"]);\n if (this.isLoading || (this.isLoaded && !force)) {\n return;\n }\n return this.loadAll(loadingOptions);\n }\n mergeItems(partialItems, { merge = true, updateStore = true, sort = true, filter = true } = {}) {\n let items = partialItems;\n // update existing items\n if (merge) {\n const namespaces = partialItems.map(item => item.getNs());\n items = [\n ...this.items.filter(existingItem => !namespaces.includes(existingItem.getNs())),\n ...partialItems,\n ];\n }\n if (filter)\n items = this.filterItemsOnLoad(items);\n if (sort)\n items = this.sortItems(items);\n if (updateStore)\n this.items.replace(items);\n return items;\n }\n resetOnError(error) {\n if (error)\n this.reset();\n }\n async loadItem(params) {\n return this.api.get(params);\n }\n async load(params) {\n const { name, namespace } = params;\n let item = this.getByName(name, namespace);\n if (!item) {\n item = await this.loadItem(params);\n const newItems = this.sortItems([...this.items, item]);\n this.items.replace(newItems);\n }\n return item;\n }\n async loadFromPath(resourcePath) {\n const { namespace, name } = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_5__[\"parseKubeApi\"])(resourcePath);\n return this.load({ name, namespace });\n }\n async createItem(params, data) {\n return this.api.create(params, data);\n }\n async create(params, data) {\n const newItem = await this.createItem(params, data);\n const items = this.sortItems([...this.items, newItem]);\n this.items.replace(items);\n return newItem;\n }\n postUpdate(rawItem) {\n const newItem = new this.api.objectConstructor(rawItem);\n const index = this.items.findIndex(item => item.getId() === newItem.getId());\n Object(_kube_api__WEBPACK_IMPORTED_MODULE_4__[\"ensureObjectSelfLink\"])(this.api, newItem);\n if (index < 0) {\n this.items.push(newItem);\n }\n else {\n this.items[index] = newItem;\n }\n return newItem;\n }\n async patch(item, patch) {\n return this.postUpdate(await this.api.patch({\n name: item.getName(), namespace: item.getNs(),\n }, patch, \"json\"));\n }\n async update(item, data) {\n return this.postUpdate(await this.api.update({\n name: item.getName(),\n namespace: item.getNs(),\n }, data));\n }\n async remove(item) {\n await this.api.delete({ name: item.getName(), namespace: item.getNs() });\n this.selectedItemsIds.delete(item.getId());\n }\n async removeSelectedItems() {\n return Promise.all(this.selectedItems.map(this.remove));\n }\n bindWatchEventsUpdater(delay = 1000) {\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.eventsBuffer.length, this.updateFromEventsBuffer, {\n delay,\n });\n }\n subscribe({ onLoadFailure, abortController = new abort_controller__WEBPACK_IMPORTED_MODULE_6___default.a() } = {}) {\n if (this.api.isNamespaced) {\n Promise.race([Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"rejectPromiseBy\"])(abortController.signal), Promise.all([this.contextReady, this.namespacesReady])])\n .then(() => {\n if (this.context.cluster.isGlobalWatchEnabled && this.loadedNamespaces.length === 0) {\n return this.watchNamespace(\"\", abortController, { onLoadFailure });\n }\n for (const namespace of this.loadedNamespaces) {\n this.watchNamespace(namespace, abortController, { onLoadFailure });\n }\n })\n .catch(_utils__WEBPACK_IMPORTED_MODULE_1__[\"noop\"]); // ignore DOMExceptions\n }\n else {\n this.watchNamespace(\"\", abortController, { onLoadFailure });\n }\n return () => abortController.abort();\n }\n watchNamespace(namespace, abortController, opts) {\n if (!this.api.getResourceVersion(namespace)) {\n return;\n }\n let timedRetry;\n const watch = () => this.api.watch({\n namespace,\n abortController,\n callback,\n });\n const { signal } = abortController;\n const callback = (data, error) => {\n if (!this.isLoaded || (error === null || error === void 0 ? void 0 : error.type) === \"aborted\")\n return;\n if (error instanceof Response) {\n if (error.status === 404 || error.status === 401) {\n // api has gone, or credentials are not permitted, let's not retry\n return;\n }\n // not sure what to do, best to retry\n clearTimeout(timedRetry);\n timedRetry = setTimeout(watch, 5000);\n }\n else if (error instanceof _kube_object__WEBPACK_IMPORTED_MODULE_2__[\"KubeStatus\"] && error.code === 410) {\n clearTimeout(timedRetry);\n // resourceVersion has gone, let's try to reload\n timedRetry = setTimeout(() => {\n (namespace\n ? this.loadAll(Object.assign({ namespaces: [namespace], reqInit: { signal } }, opts))\n : this.loadAll(Object.assign({ merge: false, reqInit: { signal } }, opts))).then(watch);\n }, 1000);\n }\n else if (error) { // not sure what to do, best to retry\n clearTimeout(timedRetry);\n timedRetry = setTimeout(watch, 5000);\n }\n if (data) {\n this.eventsBuffer.push(data);\n }\n };\n signal.addEventListener(\"abort\", () => clearTimeout(timedRetry));\n watch();\n }\n updateFromEventsBuffer() {\n const items = this.getItems();\n for (const { type, object } of this.eventsBuffer.clear()) {\n const index = items.findIndex(item => { var _a; return item.getId() === ((_a = object.metadata) === null || _a === void 0 ? void 0 : _a.uid); });\n const item = items[index];\n switch (type) {\n case \"ADDED\":\n // falls through\n case \"MODIFIED\": {\n const newItem = new this.api.objectConstructor(object);\n if (!item) {\n items.push(newItem);\n }\n else {\n items[index] = newItem;\n }\n break;\n }\n case \"DELETED\":\n if (item) {\n items.splice(index, 1);\n }\n break;\n }\n }\n // update items\n this.items.replace(this.sortItems(items.slice(-this.bufferSize)));\n }\n}\nObject.defineProperty(KubeObjectStore, \"defaultContext\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].box()\n}); // TODO: support multiple cluster contexts\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"],\n __metadata(\"design:type\", Array)\n], KubeObjectStore.prototype, \"loadedNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], KubeObjectStore.prototype, \"contextItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"loadAll\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"reloadAll\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Array, Object]),\n __metadata(\"design:returntype\", Array)\n], KubeObjectStore.prototype, \"mergeItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"load\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [String]),\n __metadata(\"design:returntype\", Promise)\n], KubeObjectStore.prototype, \"loadFromPath\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], KubeObjectStore.prototype, \"updateFromEventsBuffer\", null);\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/kube-object.store.ts?");
|
|
39208
39174
|
|
|
39209
39175
|
/***/ }),
|
|
39210
39176
|
|
|
@@ -39292,18 +39258,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
39292
39258
|
|
|
39293
39259
|
/***/ }),
|
|
39294
39260
|
|
|
39295
|
-
/***/ "./src/common/request.ts":
|
|
39296
|
-
/*!*******************************!*\
|
|
39297
|
-
!*** ./src/common/request.ts ***!
|
|
39298
|
-
\*******************************/
|
|
39299
|
-
/*! exports provided: customRequest, customRequestPromise */
|
|
39300
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39301
|
-
|
|
39302
|
-
"use strict";
|
|
39303
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"customRequest\", function() { return customRequest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"customRequestPromise\", function() { return customRequestPromise; });\n/* harmony import */ var request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! request */ \"./node_modules/request/index.js\");\n/* harmony import */ var request__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(request__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var request_promise_native__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! request-promise-native */ \"./node_modules/request-promise-native/lib/rp.js\");\n/* harmony import */ var request_promise_native__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(request_promise_native__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _user_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./user-store */ \"./src/common/user-store/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n// todo: get rid of \"request\" (deprecated)\n// https://github.com/lensapp/lens/issues/459\nfunction getDefaultRequestOpts() {\n const { httpsProxy, allowUntrustedCAs } = _user_store__WEBPACK_IMPORTED_MODULE_2__[\"UserStore\"].getInstance();\n return {\n proxy: httpsProxy || undefined,\n rejectUnauthorized: !allowUntrustedCAs,\n };\n}\n/**\n * @deprecated\n */\nfunction customRequest(opts) {\n return request__WEBPACK_IMPORTED_MODULE_0___default.a.defaults(getDefaultRequestOpts())(opts);\n}\n/**\n * @deprecated\n */\nfunction customRequestPromise(opts) {\n return request_promise_native__WEBPACK_IMPORTED_MODULE_1___default.a.defaults(getDefaultRequestOpts())(opts);\n}\n\n\n//# sourceURL=webpack:///./src/common/request.ts?");
|
|
39304
|
-
|
|
39305
|
-
/***/ }),
|
|
39306
|
-
|
|
39307
39261
|
/***/ "./src/common/routes/add-cluster.ts":
|
|
39308
39262
|
/*!******************************************!*\
|
|
39309
39263
|
!*** ./src/common/routes/add-cluster.ts ***!
|
|
@@ -39744,7 +39698,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _use
|
|
|
39744
39698
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39745
39699
|
|
|
39746
39700
|
"use strict";
|
|
39747
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultEditorConfig\", function() { return defaultEditorConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultPackageMirror\", function() { return defaultPackageMirror; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"packageMirrors\", function() { return packageMirrors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtensionRegistryLocation\", function() { return ExtensionRegistryLocation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultExtensionRegistryUrl\", function() { return defaultExtensionRegistryUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DESCRIPTORS\", function() { return DESCRIPTORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CONSTANTS\", function() { return CONSTANTS; });\n/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-timezone */ \"./node_modules/moment-timezone/index.js\");\n/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_timezone__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! os */ \"os\");\n/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderer_theme_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../renderer/theme.store */ \"./src/renderer/theme.store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/merge */ \"./node_modules/lodash/merge.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! semver */ \"./node_modules/semver/index.js\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar _a;\n\n\n\n\n\n\n\nconst defaultEditorConfig = {\n tabSize: 2,\n lineNumbers: \"on\",\n minimap: {\n enabled: true,\n side: \"right\",\n },\n};\nconst httpsProxy = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n return val || undefined;\n },\n};\nconst shell = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n return val || undefined;\n },\n};\nconst colorTheme = {\n fromStore(val) {\n return val || _renderer_theme_store__WEBPACK_IMPORTED_MODULE_3__[\"ThemeStore\"].defaultTheme;\n },\n toStore(val) {\n if (!val || val === _renderer_theme_store__WEBPACK_IMPORTED_MODULE_3__[\"ThemeStore\"].defaultTheme) {\n return undefined;\n }\n return val;\n },\n};\nconst localeTimezone = {\n fromStore(val) {\n return val || moment_timezone__WEBPACK_IMPORTED_MODULE_0___default.a.tz.guess(true) || \"UTC\";\n },\n toStore(val) {\n if (!val || val === moment_timezone__WEBPACK_IMPORTED_MODULE_0___default.a.tz.guess(true) || val === \"UTC\") {\n return undefined;\n }\n return val;\n },\n};\nconst allowUntrustedCAs = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : false;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst allowTelemetry = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : true;\n },\n toStore(val) {\n if (val === true) {\n return undefined;\n }\n return val;\n },\n};\nconst allowErrorReporting = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : true;\n },\n toStore(val) {\n if (val === true) {\n return undefined;\n }\n return val;\n },\n};\nconst defaultPackageMirror = \"default\";\nconst packageMirrors = new Map([\n [defaultPackageMirror, {\n url: \"https://storage.googleapis.com/kubernetes-release/release\",\n label: \"Default (Google)\",\n platforms: new Set([\"darwin\", \"win32\", \"linux\"]),\n }],\n [\"china\", {\n url: \"https://mirror.azure.cn/kubernetes/kubectl\",\n label: \"China (Azure)\",\n platforms: new Set([\"win32\", \"linux\"]),\n }],\n]);\nconst downloadMirror = {\n fromStore(val) {\n return packageMirrors.has(val) ? val : defaultPackageMirror;\n },\n toStore(val) {\n if (!val || val === defaultPackageMirror) {\n return undefined;\n }\n return val;\n },\n};\nconst downloadKubectlBinaries = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : true;\n },\n toStore(val) {\n if (val === true) {\n return undefined;\n }\n return val;\n },\n};\nconst downloadBinariesPath = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst kubectlBinariesPath = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst openAtLogin = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : false;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst terminalCopyOnSelect = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : false;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst hiddenTableColumns = {\n fromStore(val) {\n return new Map((val !== null && val !== void 0 ? val : []).map(([tableId, columnIds]) => [tableId, new _utils__WEBPACK_IMPORTED_MODULE_4__[\"ObservableToggleSet\"](columnIds)]));\n },\n toStore(val) {\n const res = [];\n for (const [table, columns] of val) {\n if (columns.size) {\n res.push([table, Array.from(columns)]);\n }\n }\n return res.length ? res : undefined;\n },\n};\nconst mainKubeFolder = path__WEBPACK_IMPORTED_MODULE_1___default.a.join(os__WEBPACK_IMPORTED_MODULE_2___default.a.homedir(), \".kube\");\nconst syncKubeconfigEntries = {\n fromStore(val) {\n var _a;\n return new Map((_a = val === null || val === void 0 ? void 0 : val.map((_a) => {\n var { filePath } = _a, rest = __rest(_a, [\"filePath\"]);\n return [filePath, rest];\n })) !== null && _a !== void 0 ? _a : [[mainKubeFolder, {}]]);\n },\n toStore(val) {\n if (val.size === 1 && val.has(mainKubeFolder)) {\n return undefined;\n }\n return Array.from(val, ([filePath, rest]) => (Object.assign({ filePath }, rest)));\n },\n};\nconst editorConfiguration = {\n fromStore(val) {\n return lodash_merge__WEBPACK_IMPORTED_MODULE_5___default()(defaultEditorConfig, val);\n },\n toStore(val) {\n return val;\n },\n};\nconst updateChannels = new Map([\n [\"latest\", {\n label: \"Stable\",\n }],\n [\"beta\", {\n label: \"Beta\",\n }],\n [\"alpha\", {\n label: \"Alpha\",\n }],\n]);\nconst defaultUpdateChannel = ((_a = new semver__WEBPACK_IMPORTED_MODULE_6__[\"SemVer\"](Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"getAppVersion\"])()).prerelease[0]) === null || _a === void 0 ? void 0 : _a.toString()) || \"latest\";\nconst updateChannel = {\n fromStore(val) {\n return updateChannels.has(val) ? val : defaultUpdateChannel;\n },\n toStore(val) {\n if (!updateChannels.has(val) || val === defaultUpdateChannel) {\n return undefined;\n }\n return val;\n },\n};\nvar ExtensionRegistryLocation;\n(function (ExtensionRegistryLocation) {\n ExtensionRegistryLocation[\"DEFAULT\"] = \"default\";\n ExtensionRegistryLocation[\"NPMRC\"] = \"npmrc\";\n ExtensionRegistryLocation[\"CUSTOM\"] = \"custom\";\n})(ExtensionRegistryLocation || (ExtensionRegistryLocation = {}));\nconst defaultExtensionRegistryUrl = \"https://registry.npmjs.org\";\nconst extensionRegistryUrl = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : {\n location: ExtensionRegistryLocation.DEFAULT,\n };\n },\n toStore(val) {\n if (val.location === ExtensionRegistryLocation.DEFAULT) {\n return undefined;\n }\n return val;\n },\n};\nconst DESCRIPTORS = {\n httpsProxy,\n shell,\n colorTheme,\n localeTimezone,\n allowUntrustedCAs,\n allowTelemetry,\n allowErrorReporting,\n downloadMirror,\n downloadKubectlBinaries,\n downloadBinariesPath,\n kubectlBinariesPath,\n openAtLogin,\n hiddenTableColumns,\n syncKubeconfigEntries,\n editorConfiguration,\n terminalCopyOnSelect,\n updateChannel,\n extensionRegistryUrl,\n};\nconst CONSTANTS = {\n updateChannels,\n};\n\n\n//# sourceURL=webpack:///./src/common/user-store/preferences-helpers.ts?");
|
|
39701
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultEditorConfig\", function() { return defaultEditorConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultPackageMirror\", function() { return defaultPackageMirror; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"packageMirrors\", function() { return packageMirrors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtensionRegistryLocation\", function() { return ExtensionRegistryLocation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultExtensionRegistryUrl\", function() { return defaultExtensionRegistryUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DESCRIPTORS\", function() { return DESCRIPTORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CONSTANTS\", function() { return CONSTANTS; });\n/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-timezone */ \"./node_modules/moment-timezone/index.js\");\n/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_timezone__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! os */ \"os\");\n/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/merge */ \"./node_modules/lodash/merge.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! semver */ \"./node_modules/semver/index.js\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _vars__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../vars */ \"./src/common/vars.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar _a;\n\n\n\n\n\n\n\nconst defaultEditorConfig = {\n tabSize: 2,\n lineNumbers: \"on\",\n minimap: {\n enabled: true,\n side: \"right\",\n },\n};\nconst httpsProxy = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n return val || undefined;\n },\n};\nconst shell = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n return val || undefined;\n },\n};\nconst colorTheme = {\n fromStore(val) {\n return val || _vars__WEBPACK_IMPORTED_MODULE_6__[\"defaultTheme\"];\n },\n toStore(val) {\n if (!val || val === _vars__WEBPACK_IMPORTED_MODULE_6__[\"defaultTheme\"]) {\n return undefined;\n }\n return val;\n },\n};\nconst localeTimezone = {\n fromStore(val) {\n return val || moment_timezone__WEBPACK_IMPORTED_MODULE_0___default.a.tz.guess(true) || \"UTC\";\n },\n toStore(val) {\n if (!val || val === moment_timezone__WEBPACK_IMPORTED_MODULE_0___default.a.tz.guess(true) || val === \"UTC\") {\n return undefined;\n }\n return val;\n },\n};\nconst allowUntrustedCAs = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : false;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst allowTelemetry = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : true;\n },\n toStore(val) {\n if (val === true) {\n return undefined;\n }\n return val;\n },\n};\nconst allowErrorReporting = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : true;\n },\n toStore(val) {\n if (val === true) {\n return undefined;\n }\n return val;\n },\n};\nconst defaultPackageMirror = \"default\";\nconst packageMirrors = new Map([\n [defaultPackageMirror, {\n url: \"https://storage.googleapis.com/kubernetes-release/release\",\n label: \"Default (Google)\",\n platforms: new Set([\"darwin\", \"win32\", \"linux\"]),\n }],\n [\"china\", {\n url: \"https://mirror.azure.cn/kubernetes/kubectl\",\n label: \"China (Azure)\",\n platforms: new Set([\"win32\", \"linux\"]),\n }],\n]);\nconst downloadMirror = {\n fromStore(val) {\n return packageMirrors.has(val) ? val : defaultPackageMirror;\n },\n toStore(val) {\n if (!val || val === defaultPackageMirror) {\n return undefined;\n }\n return val;\n },\n};\nconst downloadKubectlBinaries = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : true;\n },\n toStore(val) {\n if (val === true) {\n return undefined;\n }\n return val;\n },\n};\nconst downloadBinariesPath = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst kubectlBinariesPath = {\n fromStore(val) {\n return val;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst openAtLogin = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : false;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst terminalCopyOnSelect = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : false;\n },\n toStore(val) {\n if (!val) {\n return undefined;\n }\n return val;\n },\n};\nconst hiddenTableColumns = {\n fromStore(val) {\n return new Map((val !== null && val !== void 0 ? val : []).map(([tableId, columnIds]) => [tableId, new _utils__WEBPACK_IMPORTED_MODULE_3__[\"ObservableToggleSet\"](columnIds)]));\n },\n toStore(val) {\n const res = [];\n for (const [table, columns] of val) {\n if (columns.size) {\n res.push([table, Array.from(columns)]);\n }\n }\n return res.length ? res : undefined;\n },\n};\nconst mainKubeFolder = path__WEBPACK_IMPORTED_MODULE_1___default.a.join(os__WEBPACK_IMPORTED_MODULE_2___default.a.homedir(), \".kube\");\nconst syncKubeconfigEntries = {\n fromStore(val) {\n var _a;\n return new Map((_a = val === null || val === void 0 ? void 0 : val.map((_a) => {\n var { filePath } = _a, rest = __rest(_a, [\"filePath\"]);\n return [filePath, rest];\n })) !== null && _a !== void 0 ? _a : [[mainKubeFolder, {}]]);\n },\n toStore(val) {\n if (val.size === 1 && val.has(mainKubeFolder)) {\n return undefined;\n }\n return Array.from(val, ([filePath, rest]) => (Object.assign({ filePath }, rest)));\n },\n};\nconst editorConfiguration = {\n fromStore(val) {\n return lodash_merge__WEBPACK_IMPORTED_MODULE_4___default()(defaultEditorConfig, val);\n },\n toStore(val) {\n return val;\n },\n};\nconst updateChannels = new Map([\n [\"latest\", {\n label: \"Stable\",\n }],\n [\"beta\", {\n label: \"Beta\",\n }],\n [\"alpha\", {\n label: \"Alpha\",\n }],\n]);\nconst defaultUpdateChannel = ((_a = new semver__WEBPACK_IMPORTED_MODULE_5__[\"SemVer\"](Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"getAppVersion\"])()).prerelease[0]) === null || _a === void 0 ? void 0 : _a.toString()) || \"latest\";\nconst updateChannel = {\n fromStore(val) {\n return updateChannels.has(val) ? val : defaultUpdateChannel;\n },\n toStore(val) {\n if (!updateChannels.has(val) || val === defaultUpdateChannel) {\n return undefined;\n }\n return val;\n },\n};\nvar ExtensionRegistryLocation;\n(function (ExtensionRegistryLocation) {\n ExtensionRegistryLocation[\"DEFAULT\"] = \"default\";\n ExtensionRegistryLocation[\"NPMRC\"] = \"npmrc\";\n ExtensionRegistryLocation[\"CUSTOM\"] = \"custom\";\n})(ExtensionRegistryLocation || (ExtensionRegistryLocation = {}));\nconst defaultExtensionRegistryUrl = \"https://registry.npmjs.org\";\nconst extensionRegistryUrl = {\n fromStore(val) {\n return val !== null && val !== void 0 ? val : {\n location: ExtensionRegistryLocation.DEFAULT,\n };\n },\n toStore(val) {\n if (val.location === ExtensionRegistryLocation.DEFAULT) {\n return undefined;\n }\n return val;\n },\n};\nconst DESCRIPTORS = {\n httpsProxy,\n shell,\n colorTheme,\n localeTimezone,\n allowUntrustedCAs,\n allowTelemetry,\n allowErrorReporting,\n downloadMirror,\n downloadKubectlBinaries,\n downloadBinariesPath,\n kubectlBinariesPath,\n openAtLogin,\n hiddenTableColumns,\n syncKubeconfigEntries,\n editorConfiguration,\n terminalCopyOnSelect,\n updateChannel,\n extensionRegistryUrl,\n};\nconst CONSTANTS = {\n updateChannels,\n};\n\n\n//# sourceURL=webpack:///./src/common/user-store/preferences-helpers.ts?");
|
|
39748
39702
|
|
|
39749
39703
|
/***/ }),
|
|
39750
39704
|
|
|
@@ -39912,7 +39866,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
39912
39866
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39913
39867
|
|
|
39914
39868
|
"use strict";
|
|
39915
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineGlobal\", function() { return defineGlobal; });\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Setup variable in global scope (top-level object)\n// Global type definition must be added separately to `mocks.d.ts` in form:\n// declare const __globalName: any;\nfunction defineGlobal(propName, descriptor) {\n const scope = typeof global !== \"undefined\" ? global : window;\n if (
|
|
39869
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineGlobal\", function() { return defineGlobal; });\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Setup variable in global scope (top-level object)\n// Global type definition must be added separately to `mocks.d.ts` in form:\n// declare const __globalName: any;\nfunction defineGlobal(propName, descriptor) {\n const scope = typeof global !== \"undefined\" ? global : window;\n if (Object.prototype.hasOwnProperty.call(scope, propName)) {\n return;\n }\n Object.defineProperty(scope, propName, descriptor);\n}\n\n\n//# sourceURL=webpack:///./src/common/utils/defineGlobal.ts?");
|
|
39916
39870
|
|
|
39917
39871
|
/***/ }),
|
|
39918
39872
|
|
|
@@ -40032,7 +39986,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40032
39986
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40033
39987
|
|
|
40034
39988
|
"use strict";
|
|
40035
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newEmpty\", function() { return newEmpty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"take\", function() { return take; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return map; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterFlatMap\", function() { return filterFlatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flatMap\", function() { return flatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return filter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMap\", function() { return filterMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMapStrict\", function() { return filterMapStrict; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return find; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return reduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"join\", function() { return join; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return every; });\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * Create a new type safe empty Iterable\n * @returns An `Iterable` that yields 0 items\n */\nfunction* newEmpty() {\n return;\n}\n/**\n * Creates a new `Iterable` that yields at most n items from src.\n * Does not modify `src` which can be used later.\n * @param src An initial iterator\n * @param n The maximum number of elements to take from src. Yields up to the floor of `n` and 0 items if n < 0\n */\nfunction* take(src, n) {\n outer: for (let i = 0; i < n; i += 1) {\n for (const item of src) {\n yield item;\n continue outer;\n }\n // if we are here that means that `src` has been exhausted. Don't bother trying again.\n break outer;\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * result of `fn` for each item.\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* map(src, fn) {\n for (const from of src) {\n yield fn(from);\n }\n}\n/**\n * The single layer flattening of an iterator, discarding `Falsey` values.\n * @param src A type that can be iterated over\n * @param fn The function that returns either an iterable over items that should be filtered out or a `Falsey` value indicating that it should be ignored\n */\nfunction* filterFlatMap(src, fn) {\n for (const from of src) {\n if (!from) {\n continue;\n }\n const mapping = fn(from);\n if (!mapping) {\n continue;\n }\n for (const mapped of mapping) {\n if (mapped) {\n yield mapped;\n }\n }\n }\n}\n/**\n * Returns a new iterator that yields the items that each call to `fn` would produce\n * @param src A type that can be iterated over\n * @param fn A function that returns an iterator\n */\nfunction* flatMap(src, fn) {\n for (const from of src) {\n yield* fn(from);\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * items that return a `truthy` value from `fn`.\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* filter(src, fn) {\n for (const from of src) {\n if (fn(from)) {\n yield from;\n }\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * result of `fn` when it is `truthy`\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* filterMap(src, fn) {\n for (const from of src) {\n const res = fn(from);\n if (res) {\n yield res;\n }\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * result of `fn` when it is not null or undefined\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* filterMapStrict(src, fn) {\n for (const from of src) {\n const res = fn(from);\n if (res != null) {\n yield res;\n }\n }\n}\n/**\n * Iterate through `src` until `match` returns a truthy value\n * @param src A type that can be iterated over\n * @param match A function that should return a truthy value for the item that you want to find\n * @returns The first entry that `match` returns a truthy value for, or `undefined`\n */\nfunction find(src, match) {\n for (const from of src) {\n if (match(from)) {\n return from;\n }\n }\n return void 0;\n}\nfunction reduce(src, reducer, initial) {\n let acc = initial;\n for (const item of src) {\n acc = reducer(acc, item);\n }\n return acc;\n}\n/**\n * A convenience function for reducing over an iterator of strings and concatenating them together\n * @param src The value to iterate over\n * @param connector The string value to intersperse between the yielded values\n * @returns The concatenated entries of `src` interspersed with copies of `connector`\n */\nfunction join(src, connector = \",\") {\n return reduce(src, (acc, cur) => `${acc}${connector}${cur}`, \"\");\n}\n/**\n * Iterate through `src` and return `true` if `fn` returns a thruthy value for every yielded value.\n * Otherwise, return `false`. This function short circuits.\n * @param src The type to be iterated over\n * @param fn A function to check each iteration\n */\nfunction every(src, fn) {\n for (const val of src) {\n if (!fn(val)) {\n return false;\n }\n }\n return true;\n}\n\n\n//# sourceURL=webpack:///./src/common/utils/iter.ts?");
|
|
39989
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newEmpty\", function() { return newEmpty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"take\", function() { return take; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return map; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterFlatMap\", function() { return filterFlatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flatMap\", function() { return flatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return filter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMap\", function() { return filterMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMapStrict\", function() { return filterMapStrict; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return find; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return reduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"join\", function() { return join; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return every; });\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * Create a new type safe empty Iterable\n * @returns An `Iterable` that yields 0 items\n */\n// eslint-disable-next-line require-yield\nfunction* newEmpty() {\n return;\n}\n/**\n * Creates a new `Iterable` that yields at most n items from src.\n * Does not modify `src` which can be used later.\n * @param src An initial iterator\n * @param n The maximum number of elements to take from src. Yields up to the floor of `n` and 0 items if n < 0\n */\nfunction* take(src, n) {\n outer: for (let i = 0; i < n; i += 1) {\n for (const item of src) {\n yield item;\n continue outer;\n }\n // if we are here that means that `src` has been exhausted. Don't bother trying again.\n break outer;\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * result of `fn` for each item.\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* map(src, fn) {\n for (const from of src) {\n yield fn(from);\n }\n}\n/**\n * The single layer flattening of an iterator, discarding `Falsey` values.\n * @param src A type that can be iterated over\n * @param fn The function that returns either an iterable over items that should be filtered out or a `Falsey` value indicating that it should be ignored\n */\nfunction* filterFlatMap(src, fn) {\n for (const from of src) {\n if (!from) {\n continue;\n }\n const mapping = fn(from);\n if (!mapping) {\n continue;\n }\n for (const mapped of mapping) {\n if (mapped) {\n yield mapped;\n }\n }\n }\n}\n/**\n * Returns a new iterator that yields the items that each call to `fn` would produce\n * @param src A type that can be iterated over\n * @param fn A function that returns an iterator\n */\nfunction* flatMap(src, fn) {\n for (const from of src) {\n yield* fn(from);\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * items that return a `truthy` value from `fn`.\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* filter(src, fn) {\n for (const from of src) {\n if (fn(from)) {\n yield from;\n }\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * result of `fn` when it is `truthy`\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* filterMap(src, fn) {\n for (const from of src) {\n const res = fn(from);\n if (res) {\n yield res;\n }\n }\n}\n/**\n * Creates a new iterator that iterates (lazily) over its input and yields the\n * result of `fn` when it is not null or undefined\n * @param src A type that can be iterated over\n * @param fn The function that is called for each value\n */\nfunction* filterMapStrict(src, fn) {\n for (const from of src) {\n const res = fn(from);\n if (res != null) {\n yield res;\n }\n }\n}\n/**\n * Iterate through `src` until `match` returns a truthy value\n * @param src A type that can be iterated over\n * @param match A function that should return a truthy value for the item that you want to find\n * @returns The first entry that `match` returns a truthy value for, or `undefined`\n */\nfunction find(src, match) {\n for (const from of src) {\n if (match(from)) {\n return from;\n }\n }\n return void 0;\n}\nfunction reduce(src, reducer, initial) {\n let acc = initial;\n for (const item of src) {\n acc = reducer(acc, item);\n }\n return acc;\n}\n/**\n * A convenience function for reducing over an iterator of strings and concatenating them together\n * @param src The value to iterate over\n * @param connector The string value to intersperse between the yielded values\n * @returns The concatenated entries of `src` interspersed with copies of `connector`\n */\nfunction join(src, connector = \",\") {\n return reduce(src, (acc, cur) => `${acc}${connector}${cur}`, \"\");\n}\n/**\n * Iterate through `src` and return `true` if `fn` returns a thruthy value for every yielded value.\n * Otherwise, return `false`. This function short circuits.\n * @param src The type to be iterated over\n * @param fn A function to check each iteration\n */\nfunction every(src, fn) {\n for (const val of src) {\n if (!fn(val)) {\n return false;\n }\n }\n return true;\n}\n\n\n//# sourceURL=webpack:///./src/common/utils/iter.ts?");
|
|
40036
39990
|
|
|
40037
39991
|
/***/ }),
|
|
40038
39992
|
|
|
@@ -40164,7 +40118,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40164
40118
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40165
40119
|
|
|
40166
40120
|
"use strict";
|
|
40167
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"readFileFromTar\", function() { return readFileFromTar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"listTarEntries\", function() { return listTarEntries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractTar\", function() { return extractTar; });\n/* harmony import */ var tar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tar */ \"./node_modules/tar/index.js\");\n/* harmony import */ var tar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tar__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Helper for working with tarball files (.tar, .tgz)\n// Docs: https://github.com/npm/node-tar\n\n\nfunction readFileFromTar({ tarPath, filePath, parseJson }) {\n return new Promise(
|
|
40121
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"readFileFromTar\", function() { return readFileFromTar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"listTarEntries\", function() { return listTarEntries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractTar\", function() { return extractTar; });\n/* harmony import */ var tar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tar */ \"./node_modules/tar/index.js\");\n/* harmony import */ var tar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tar__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Helper for working with tarball files (.tar, .tgz)\n// Docs: https://github.com/npm/node-tar\n\n\nfunction readFileFromTar({ tarPath, filePath, parseJson }) {\n return new Promise((resolve, reject) => {\n const fileChunks = [];\n tar__WEBPACK_IMPORTED_MODULE_0___default.a.list({\n file: tarPath,\n filter: entryPath => path__WEBPACK_IMPORTED_MODULE_1___default.a.normalize(entryPath) === filePath,\n sync: true,\n onentry(entry) {\n entry.on(\"data\", chunk => {\n fileChunks.push(chunk);\n });\n entry.once(\"error\", err => {\n reject(new Error(`reading file has failed ${entry.path}: ${err}`));\n });\n entry.once(\"end\", () => {\n const data = Buffer.concat(fileChunks);\n const result = parseJson ? JSON.parse(data.toString(\"utf8\")) : data;\n resolve(result);\n });\n },\n });\n if (!fileChunks.length) {\n reject(new Error(\"Not found\"));\n }\n });\n}\nasync function listTarEntries(filePath) {\n const entries = [];\n await tar__WEBPACK_IMPORTED_MODULE_0___default.a.list({\n file: filePath,\n onentry: (entry) => {\n entries.push(path__WEBPACK_IMPORTED_MODULE_1___default.a.normalize(entry.path));\n },\n });\n return entries;\n}\nfunction extractTar(filePath, opts = {}) {\n return tar__WEBPACK_IMPORTED_MODULE_0___default.a.extract(Object.assign({ file: filePath, cwd: path__WEBPACK_IMPORTED_MODULE_1___default.a.dirname(filePath) }, opts));\n}\n\n\n//# sourceURL=webpack:///./src/common/utils/tar.ts?");
|
|
40168
40122
|
|
|
40169
40123
|
/***/ }),
|
|
40170
40124
|
|
|
@@ -40200,7 +40154,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40200
40154
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40201
40155
|
|
|
40202
40156
|
"use strict";
|
|
40203
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zip\", function() { return zip; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filled\", function() { return filled; });\n/* harmony import */ var
|
|
40157
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zip\", function() { return zip; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filled\", function() { return filled; });\n/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/array */ \"./src/common/utils/array.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/**\n * Iterates over `sources` yielding full tuples until one of the tuple arrays\n * is empty. Then it returns a tuple with the rest of each of tuples\n * @param sources The source arrays\n * @yields A tuple of the next element from each of the sources\n * @returns The tuple of all the sources as soon as at least one of the sources is exausted\n */\nfunction* zip(...sources) {\n const maxSafeLength = Math.min(...sources.map(source => source.length));\n for (let i = 0; i < maxSafeLength; i += 1) {\n yield sources.map(source => source[i]);\n }\n return sources.map(source => source.slice(maxSafeLength));\n}\n/**\n * Returns a `length` tuple filled with copies of `value`\n * @param length The size of the tuple\n * @param value The value for each of the tuple entries\n */\nfunction filled(length, value) {\n return _utils_array__WEBPACK_IMPORTED_MODULE_0__[\"filled\"](length, value);\n}\n\n\n//# sourceURL=webpack:///./src/common/utils/tuple.ts?");
|
|
40204
40158
|
|
|
40205
40159
|
/***/ }),
|
|
40206
40160
|
|
|
@@ -40232,11 +40186,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Copyright (c) 2021 Op
|
|
|
40232
40186
|
/*!****************************!*\
|
|
40233
40187
|
!*** ./src/common/vars.ts ***!
|
|
40234
40188
|
\****************************/
|
|
40235
|
-
/*! exports provided: isMac, isWindows, isLinux, isDebugging, isSnap, isProduction, isTestEnv, isDevelopment, isPublishConfigured, integrationTestingArg, isIntegrationTesting, productName, appName, publicPath, contextDir, buildDir, preloadEntrypoint, mainDir, rendererDir, htmlTemplate, sassCommonVars, webpackDevServerPort, apiPrefix, apiKubePrefix, issuesTrackerUrl, slackUrl, supportUrl, appSemVer, docsUrl, sentryDsn */
|
|
40189
|
+
/*! exports provided: isMac, isWindows, isLinux, isDebugging, isSnap, isProduction, isTestEnv, isDevelopment, isPublishConfigured, integrationTestingArg, isIntegrationTesting, productName, appName, publicPath, defaultTheme, contextDir, buildDir, preloadEntrypoint, mainDir, rendererDir, htmlTemplate, sassCommonVars, webpackDevServerPort, apiPrefix, apiKubePrefix, issuesTrackerUrl, slackUrl, supportUrl, appSemVer, docsUrl, sentryDsn */
|
|
40236
40190
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40237
40191
|
|
|
40238
40192
|
"use strict";
|
|
40239
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isMac\", function() { return isMac; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isWindows\", function() { return isWindows; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isLinux\", function() { return isLinux; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isDebugging\", function() { return isDebugging; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSnap\", function() { return isSnap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isProduction\", function() { return isProduction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isTestEnv\", function() { return isTestEnv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isDevelopment\", function() { return isDevelopment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPublishConfigured\", function() { return isPublishConfigured; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"integrationTestingArg\", function() { return integrationTestingArg; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isIntegrationTesting\", function() { return isIntegrationTesting; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productName\", function() { return productName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"appName\", function() { return appName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"publicPath\", function() { return publicPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"contextDir\", function() { return contextDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildDir\", function() { return buildDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"preloadEntrypoint\", function() { return preloadEntrypoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mainDir\", function() { return mainDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rendererDir\", function() { return rendererDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"htmlTemplate\", function() { return htmlTemplate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sassCommonVars\", function() { return sassCommonVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"webpackDevServerPort\", function() { return webpackDevServerPort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiPrefix\", function() { return apiPrefix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiKubePrefix\", function() { return apiKubePrefix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"issuesTrackerUrl\", function() { return issuesTrackerUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"slackUrl\", function() { return slackUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"supportUrl\", function() { return supportUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"appSemVer\", function() { return appSemVer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"docsUrl\", function() { return docsUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sentryDsn\", function() { return sentryDsn; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! semver */ \"./node_modules/semver/index.js\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./package.json\", 1);\n/* harmony import */ var _utils_defineGlobal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/defineGlobal */ \"./src/common/utils/defineGlobal.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar _a, _b, _c;\n// App's common configuration for any process (main, renderer, build pipeline, etc.)\n\n\n\n\nconst isMac = process.platform === \"darwin\";\nconst isWindows = process.platform === \"win32\";\nconst isLinux = process.platform === \"linux\";\nconst isDebugging = [\"true\", \"1\", \"yes\", \"y\", \"on\"].includes(((_a = process.env.DEBUG) !== null && _a !== void 0 ? _a : \"\").toLowerCase());\nconst isSnap = !!process.env.SNAP;\nconst isProduction = \"development\" === \"production\";\nconst isTestEnv = !!process.env.JEST_WORKER_ID;\nconst isDevelopment = !isTestEnv && !isProduction;\nconst isPublishConfigured = Object.keys(_package_json__WEBPACK_IMPORTED_MODULE_2__.build).includes(\"publish\");\nconst integrationTestingArg = \"--integration-testing\";\nconst isIntegrationTesting = process.argv.includes(integrationTestingArg);\nconst productName = _package_json__WEBPACK_IMPORTED_MODULE_2__.productName;\nconst appName = `${_package_json__WEBPACK_IMPORTED_MODULE_2__.productName}${isDevelopment ? \"Dev\" : \"\"}`;\nconst publicPath = \"/build/\";\n// Webpack build paths\nconst contextDir = process.cwd();\nconst buildDir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"static\", publicPath);\nconst preloadEntrypoint = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"src/preload.ts\");\nconst mainDir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"src/main\");\nconst rendererDir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"src/renderer\");\nconst htmlTemplate = path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(rendererDir, \"template.html\");\nconst sassCommonVars = path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(rendererDir, \"components/vars.scss\");\nconst webpackDevServerPort = 9009;\n// Special runtime paths\nObject(_utils_defineGlobal__WEBPACK_IMPORTED_MODULE_3__[\"defineGlobal\"])(\"__static\", {\n get() {\n var _a;\n const root = isDevelopment\n ? contextDir\n : ((_a = process.resourcesPath) !== null && _a !== void 0 ? _a : contextDir);\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(root, \"static\");\n },\n});\n// Apis\nconst apiPrefix = \"/api\"; // local router apis\nconst apiKubePrefix = \"/api-kube\"; // k8s cluster apis\n// Links\nconst issuesTrackerUrl = \"https://github.com/lensapp/lens/issues\";\nconst slackUrl = \"https://join.slack.com/t/k8slens/shared_invite/zt-wcl8jq3k-68R5Wcmk1o95MLBE5igUDQ\";\nconst supportUrl = \"https://docs.k8slens.dev/latest/support/\";\nconst appSemVer = new semver__WEBPACK_IMPORTED_MODULE_1__[\"SemVer\"](_package_json__WEBPACK_IMPORTED_MODULE_2__.version);\nconst docsUrl = \"https://docs.k8slens.dev/main/\";\nconst sentryDsn = (_c = (_b = _package_json__WEBPACK_IMPORTED_MODULE_2__.config) === null || _b === void 0 ? void 0 : _b.sentryDsn) !== null && _c !== void 0 ? _c : \"\";\n\n\n//# sourceURL=webpack:///./src/common/vars.ts?");
|
|
40193
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isMac\", function() { return isMac; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isWindows\", function() { return isWindows; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isLinux\", function() { return isLinux; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isDebugging\", function() { return isDebugging; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSnap\", function() { return isSnap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isProduction\", function() { return isProduction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isTestEnv\", function() { return isTestEnv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isDevelopment\", function() { return isDevelopment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPublishConfigured\", function() { return isPublishConfigured; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"integrationTestingArg\", function() { return integrationTestingArg; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isIntegrationTesting\", function() { return isIntegrationTesting; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productName\", function() { return productName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"appName\", function() { return appName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"publicPath\", function() { return publicPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultTheme\", function() { return defaultTheme; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"contextDir\", function() { return contextDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildDir\", function() { return buildDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"preloadEntrypoint\", function() { return preloadEntrypoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mainDir\", function() { return mainDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rendererDir\", function() { return rendererDir; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"htmlTemplate\", function() { return htmlTemplate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sassCommonVars\", function() { return sassCommonVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"webpackDevServerPort\", function() { return webpackDevServerPort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiPrefix\", function() { return apiPrefix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiKubePrefix\", function() { return apiKubePrefix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"issuesTrackerUrl\", function() { return issuesTrackerUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"slackUrl\", function() { return slackUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"supportUrl\", function() { return supportUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"appSemVer\", function() { return appSemVer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"docsUrl\", function() { return docsUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sentryDsn\", function() { return sentryDsn; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! semver */ \"./node_modules/semver/index.js\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./package.json\", 1);\n/* harmony import */ var _utils_defineGlobal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/defineGlobal */ \"./src/common/utils/defineGlobal.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar _a, _b, _c;\n// App's common configuration for any process (main, renderer, build pipeline, etc.)\n\n\n\n\nconst isMac = process.platform === \"darwin\";\nconst isWindows = process.platform === \"win32\";\nconst isLinux = process.platform === \"linux\";\nconst isDebugging = [\"true\", \"1\", \"yes\", \"y\", \"on\"].includes(((_a = process.env.DEBUG) !== null && _a !== void 0 ? _a : \"\").toLowerCase());\nconst isSnap = !!process.env.SNAP;\nconst isProduction = \"development\" === \"production\";\nconst isTestEnv = !!process.env.JEST_WORKER_ID;\nconst isDevelopment = !isTestEnv && !isProduction;\nconst isPublishConfigured = Object.keys(_package_json__WEBPACK_IMPORTED_MODULE_2__.build).includes(\"publish\");\nconst integrationTestingArg = \"--integration-testing\";\nconst isIntegrationTesting = process.argv.includes(integrationTestingArg);\nconst productName = _package_json__WEBPACK_IMPORTED_MODULE_2__.productName;\nconst appName = `${_package_json__WEBPACK_IMPORTED_MODULE_2__.productName}${isDevelopment ? \"Dev\" : \"\"}`;\nconst publicPath = \"/build/\";\nconst defaultTheme = \"lens-dark\";\n// Webpack build paths\nconst contextDir = process.cwd();\nconst buildDir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"static\", publicPath);\nconst preloadEntrypoint = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"src/preload.ts\");\nconst mainDir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"src/main\");\nconst rendererDir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(contextDir, \"src/renderer\");\nconst htmlTemplate = path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(rendererDir, \"template.html\");\nconst sassCommonVars = path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(rendererDir, \"components/vars.scss\");\nconst webpackDevServerPort = 9009;\n// Special runtime paths\nObject(_utils_defineGlobal__WEBPACK_IMPORTED_MODULE_3__[\"defineGlobal\"])(\"__static\", {\n get() {\n var _a;\n const root = isDevelopment\n ? contextDir\n : ((_a = process.resourcesPath) !== null && _a !== void 0 ? _a : contextDir);\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(root, \"static\");\n },\n});\n// Apis\nconst apiPrefix = \"/api\"; // local router apis\nconst apiKubePrefix = \"/api-kube\"; // k8s cluster apis\n// Links\nconst issuesTrackerUrl = \"https://github.com/lensapp/lens/issues\";\nconst slackUrl = \"https://join.slack.com/t/k8slens/shared_invite/zt-wcl8jq3k-68R5Wcmk1o95MLBE5igUDQ\";\nconst supportUrl = \"https://docs.k8slens.dev/latest/support/\";\nconst appSemVer = new semver__WEBPACK_IMPORTED_MODULE_1__[\"SemVer\"](_package_json__WEBPACK_IMPORTED_MODULE_2__.version);\nconst docsUrl = \"https://docs.k8slens.dev/main/\";\nconst sentryDsn = (_c = (_b = _package_json__WEBPACK_IMPORTED_MODULE_2__.config) === null || _b === void 0 ? void 0 : _b.sentryDsn) !== null && _c !== void 0 ? _c : \"\";\n\n\n//# sourceURL=webpack:///./src/common/vars.ts?");
|
|
40240
40194
|
|
|
40241
40195
|
/***/ }),
|
|
40242
40196
|
|
|
@@ -40252,6 +40206,30 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40252
40206
|
|
|
40253
40207
|
/***/ }),
|
|
40254
40208
|
|
|
40209
|
+
/***/ "./src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api.ts":
|
|
40210
|
+
/*!*********************************************************************************************************!*\
|
|
40211
|
+
!*** ./src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api.ts ***!
|
|
40212
|
+
\*********************************************************************************************************/
|
|
40213
|
+
/*! exports provided: asLegacyGlobalObjectForExtensionApi */
|
|
40214
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40215
|
+
|
|
40216
|
+
"use strict";
|
|
40217
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"asLegacyGlobalObjectForExtensionApi\", function() { return asLegacyGlobalObjectForExtensionApi; });\n/* harmony import */ var _legacy_global_di_for_extension_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./legacy-global-di-for-extension-api */ \"./src/extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api.ts\");\n\nconst asLegacyGlobalObjectForExtensionApi = (injectableKey, ...instantiationParameter) => new Proxy({}, {\n get(target, propertyName) {\n if (propertyName === \"$$typeof\") {\n return undefined;\n }\n const instance = Object(_legacy_global_di_for_extension_api__WEBPACK_IMPORTED_MODULE_0__[\"getLegacyGlobalDiForExtensionApi\"])().inject(injectableKey, ...instantiationParameter);\n const propertyValue = instance[propertyName];\n if (typeof propertyValue === \"function\") {\n return function (...args) {\n return propertyValue.apply(instance, args);\n };\n }\n return propertyValue;\n },\n});\n\n\n//# sourceURL=webpack:///./src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api.ts?");
|
|
40218
|
+
|
|
40219
|
+
/***/ }),
|
|
40220
|
+
|
|
40221
|
+
/***/ "./src/extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api.ts":
|
|
40222
|
+
/*!**************************************************************************************************!*\
|
|
40223
|
+
!*** ./src/extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api.ts ***!
|
|
40224
|
+
\**************************************************************************************************/
|
|
40225
|
+
/*! exports provided: setLegacyGlobalDiForExtensionApi, getLegacyGlobalDiForExtensionApi */
|
|
40226
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40227
|
+
|
|
40228
|
+
"use strict";
|
|
40229
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setLegacyGlobalDiForExtensionApi\", function() { return setLegacyGlobalDiForExtensionApi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLegacyGlobalDiForExtensionApi\", function() { return getLegacyGlobalDiForExtensionApi; });\nlet legacyGlobalDi;\nconst setLegacyGlobalDiForExtensionApi = (di) => {\n legacyGlobalDi = di;\n};\nconst getLegacyGlobalDiForExtensionApi = () => legacyGlobalDi;\n\n\n//# sourceURL=webpack:///./src/extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api.ts?");
|
|
40230
|
+
|
|
40231
|
+
/***/ }),
|
|
40232
|
+
|
|
40255
40233
|
/***/ "./src/extensions/common-api/app.ts":
|
|
40256
40234
|
/*!******************************************!*\
|
|
40257
40235
|
!*** ./src/extensions/common-api/app.ts ***!
|
|
@@ -40536,7 +40514,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40536
40514
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40537
40515
|
|
|
40538
40516
|
"use strict";
|
|
40539
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BaseRegistry\", function() { return BaseRegistry; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/utils */ \"./src/common/utils/index.ts\");\n
|
|
40517
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BaseRegistry\", function() { return BaseRegistry; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/utils */ \"./src/common/utils/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n// Base class for extensions-api registries\n\n\nclass BaseRegistry extends _common_utils__WEBPACK_IMPORTED_MODULE_1__[\"Singleton\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"items\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map([], { deep: false })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n }\n getItems() {\n return Array.from(this.items.values());\n }\n add(items, extension) {\n const itemArray = [items].flat();\n itemArray.forEach(item => {\n this.items.set(item, this.getRegisteredItem(item, extension));\n });\n return () => this.remove(...itemArray);\n }\n // eslint-disable-next-line unused-imports/no-unused-vars-ts\n getRegisteredItem(item, extension) {\n return item;\n }\n remove(...items) {\n items.forEach(item => {\n this.items.delete(item);\n });\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object, Function]),\n __metadata(\"design:returntype\", void 0)\n], BaseRegistry.prototype, \"add\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], BaseRegistry.prototype, \"remove\", null);\n\n\n//# sourceURL=webpack:///./src/extensions/registries/base-registry.ts?");
|
|
40540
40518
|
|
|
40541
40519
|
/***/ }),
|
|
40542
40520
|
|
|
@@ -40552,18 +40530,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40552
40530
|
|
|
40553
40531
|
/***/ }),
|
|
40554
40532
|
|
|
40555
|
-
/***/ "./src/extensions/registries/command-registry.ts":
|
|
40556
|
-
/*!*******************************************************!*\
|
|
40557
|
-
!*** ./src/extensions/registries/command-registry.ts ***!
|
|
40558
|
-
\*******************************************************/
|
|
40559
|
-
/*! exports provided: CommandRegistry */
|
|
40560
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40561
|
-
|
|
40562
|
-
"use strict";
|
|
40563
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommandRegistry\", function() { return CommandRegistry; });\n/* harmony import */ var _base_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-registry */ \"./src/extensions/registries/base-registry.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Extensions API -> Commands\n\nclass CommandRegistry extends _base_registry__WEBPACK_IMPORTED_MODULE_0__[\"BaseRegistry\"] {\n add(items, extension) {\n const itemArray = [items].flat();\n const newIds = itemArray.map((item) => item.id);\n const currentIds = this.getItems().map((item) => item.id);\n const filteredIds = newIds.filter((id) => !currentIds.includes(id));\n const filteredItems = itemArray.filter((item) => filteredIds.includes(item.id));\n return super.add(filteredItems, extension);\n }\n}\n\n\n//# sourceURL=webpack:///./src/extensions/registries/command-registry.ts?");
|
|
40564
|
-
|
|
40565
|
-
/***/ }),
|
|
40566
|
-
|
|
40567
40533
|
/***/ "./src/extensions/registries/entity-setting-registry.ts":
|
|
40568
40534
|
/*!**************************************************************!*\
|
|
40569
40535
|
!*** ./src/extensions/registries/entity-setting-registry.ts ***!
|
|
@@ -40572,7 +40538,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40572
40538
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40573
40539
|
|
|
40574
40540
|
"use strict";
|
|
40575
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EntitySettingRegistry\", function() { return EntitySettingRegistry; });\n/* harmony import */ var _base_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-registry */ \"./src/extensions/registries/base-registry.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nclass EntitySettingRegistry extends _base_registry__WEBPACK_IMPORTED_MODULE_0__[\"BaseRegistry\"] {\n
|
|
40541
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EntitySettingRegistry\", function() { return EntitySettingRegistry; });\n/* harmony import */ var _base_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-registry */ \"./src/extensions/registries/base-registry.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nclass EntitySettingRegistry extends _base_registry__WEBPACK_IMPORTED_MODULE_0__[\"BaseRegistry\"] {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"getItemsForKind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (kind, apiVersion, source) => {\n let items = this.getItems().filter((item) => {\n return item.kind === kind && item.apiVersions.includes(apiVersion);\n });\n if (source) {\n items = items.filter((item) => {\n return !item.source || item.source === source;\n });\n }\n return items.sort((a, b) => { var _a, _b; return ((_a = b.priority) !== null && _a !== void 0 ? _a : 50) - ((_b = a.priority) !== null && _b !== void 0 ? _b : 50); });\n }\n });\n }\n getRegisteredItem(item) {\n return Object.assign({ id: item.id || item.title.toLowerCase() }, item);\n }\n}\n\n\n//# sourceURL=webpack:///./src/extensions/registries/entity-setting-registry.ts?");
|
|
40576
40542
|
|
|
40577
40543
|
/***/ }),
|
|
40578
40544
|
|
|
@@ -40580,11 +40546,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40580
40546
|
/*!********************************************!*\
|
|
40581
40547
|
!*** ./src/extensions/registries/index.ts ***!
|
|
40582
40548
|
\********************************************/
|
|
40583
|
-
/*! exports provided: getExtensionPageUrl, ClusterPageRegistry, GlobalPageRegistry, ClusterPageMenuRegistry, AppPreferenceRegistry, StatusBarRegistry, KubeObjectDetailRegistry, KubeObjectMenuRegistry, KubeObjectStatusRegistry,
|
|
40549
|
+
/*! exports provided: getExtensionPageUrl, ClusterPageRegistry, GlobalPageRegistry, ClusterPageMenuRegistry, AppPreferenceRegistry, StatusBarRegistry, KubeObjectDetailRegistry, KubeObjectMenuRegistry, KubeObjectStatusRegistry, EntitySettingRegistry, CatalogEntityDetailRegistry, WorkloadsOverviewDetailRegistry */
|
|
40584
40550
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40585
40551
|
|
|
40586
40552
|
"use strict";
|
|
40587
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _page_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./page-registry */ \"./src/extensions/registries/page-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getExtensionPageUrl\", function() { return _page_registry__WEBPACK_IMPORTED_MODULE_0__[\"getExtensionPageUrl\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ClusterPageRegistry\", function() { return _page_registry__WEBPACK_IMPORTED_MODULE_0__[\"ClusterPageRegistry\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GlobalPageRegistry\", function() { return _page_registry__WEBPACK_IMPORTED_MODULE_0__[\"GlobalPageRegistry\"]; });\n\n/* harmony import */ var _page_menu_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./page-menu-registry */ \"./src/extensions/registries/page-menu-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ClusterPageMenuRegistry\", function() { return _page_menu_registry__WEBPACK_IMPORTED_MODULE_1__[\"ClusterPageMenuRegistry\"]; });\n\n/* harmony import */ var _app_preference_registry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./app-preference-registry */ \"./src/extensions/registries/app-preference-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AppPreferenceRegistry\", function() { return _app_preference_registry__WEBPACK_IMPORTED_MODULE_2__[\"AppPreferenceRegistry\"]; });\n\n/* harmony import */ var _status_bar_registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./status-bar-registry */ \"./src/extensions/registries/status-bar-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StatusBarRegistry\", function() { return _status_bar_registry__WEBPACK_IMPORTED_MODULE_3__[\"StatusBarRegistry\"]; });\n\n/* harmony import */ var _kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./kube-object-detail-registry */ \"./src/extensions/registries/kube-object-detail-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectDetailRegistry\", function() { return _kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_4__[\"KubeObjectDetailRegistry\"]; });\n\n/* harmony import */ var _kube_object_menu_registry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./kube-object-menu-registry */ \"./src/extensions/registries/kube-object-menu-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectMenuRegistry\", function() { return _kube_object_menu_registry__WEBPACK_IMPORTED_MODULE_5__[\"KubeObjectMenuRegistry\"]; });\n\n/* harmony import */ var _kube_object_status_registry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kube-object-status-registry */ \"./src/extensions/registries/kube-object-status-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectStatusRegistry\", function() { return _kube_object_status_registry__WEBPACK_IMPORTED_MODULE_6__[\"KubeObjectStatusRegistry\"]; });\n\n/* harmony import */ var
|
|
40553
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _page_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./page-registry */ \"./src/extensions/registries/page-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getExtensionPageUrl\", function() { return _page_registry__WEBPACK_IMPORTED_MODULE_0__[\"getExtensionPageUrl\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ClusterPageRegistry\", function() { return _page_registry__WEBPACK_IMPORTED_MODULE_0__[\"ClusterPageRegistry\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GlobalPageRegistry\", function() { return _page_registry__WEBPACK_IMPORTED_MODULE_0__[\"GlobalPageRegistry\"]; });\n\n/* harmony import */ var _page_menu_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./page-menu-registry */ \"./src/extensions/registries/page-menu-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ClusterPageMenuRegistry\", function() { return _page_menu_registry__WEBPACK_IMPORTED_MODULE_1__[\"ClusterPageMenuRegistry\"]; });\n\n/* harmony import */ var _app_preference_registry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./app-preference-registry */ \"./src/extensions/registries/app-preference-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AppPreferenceRegistry\", function() { return _app_preference_registry__WEBPACK_IMPORTED_MODULE_2__[\"AppPreferenceRegistry\"]; });\n\n/* harmony import */ var _status_bar_registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./status-bar-registry */ \"./src/extensions/registries/status-bar-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StatusBarRegistry\", function() { return _status_bar_registry__WEBPACK_IMPORTED_MODULE_3__[\"StatusBarRegistry\"]; });\n\n/* harmony import */ var _kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./kube-object-detail-registry */ \"./src/extensions/registries/kube-object-detail-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectDetailRegistry\", function() { return _kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_4__[\"KubeObjectDetailRegistry\"]; });\n\n/* harmony import */ var _kube_object_menu_registry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./kube-object-menu-registry */ \"./src/extensions/registries/kube-object-menu-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectMenuRegistry\", function() { return _kube_object_menu_registry__WEBPACK_IMPORTED_MODULE_5__[\"KubeObjectMenuRegistry\"]; });\n\n/* harmony import */ var _kube_object_status_registry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kube-object-status-registry */ \"./src/extensions/registries/kube-object-status-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectStatusRegistry\", function() { return _kube_object_status_registry__WEBPACK_IMPORTED_MODULE_6__[\"KubeObjectStatusRegistry\"]; });\n\n/* harmony import */ var _entity_setting_registry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./entity-setting-registry */ \"./src/extensions/registries/entity-setting-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EntitySettingRegistry\", function() { return _entity_setting_registry__WEBPACK_IMPORTED_MODULE_7__[\"EntitySettingRegistry\"]; });\n\n/* harmony import */ var _catalog_entity_detail_registry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./catalog-entity-detail-registry */ \"./src/extensions/registries/catalog-entity-detail-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CatalogEntityDetailRegistry\", function() { return _catalog_entity_detail_registry__WEBPACK_IMPORTED_MODULE_8__[\"CatalogEntityDetailRegistry\"]; });\n\n/* harmony import */ var _workloads_overview_detail_registry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./workloads-overview-detail-registry */ \"./src/extensions/registries/workloads-overview-detail-registry.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WorkloadsOverviewDetailRegistry\", function() { return _workloads_overview_detail_registry__WEBPACK_IMPORTED_MODULE_9__[\"WorkloadsOverviewDetailRegistry\"]; });\n\n/* harmony import */ var _protocol_handler__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./protocol-handler */ \"./src/extensions/registries/protocol-handler.ts\");\n/* empty/unused harmony star reexport *//**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// All registries managed by extensions api\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./src/extensions/registries/index.ts?");
|
|
40588
40554
|
|
|
40589
40555
|
/***/ }),
|
|
40590
40556
|
|
|
@@ -40644,7 +40610,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40644
40610
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40645
40611
|
|
|
40646
40612
|
"use strict";
|
|
40647
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExtensionPageUrl\", function() { return getExtensionPageUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ClusterPageRegistry\", function() { return ClusterPageRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GlobalPageRegistry\", function() { return GlobalPageRegistry; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _base_registry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base-registry */ \"./src/extensions/registries/base-registry.ts\");\n/* harmony import */ var _lens_extension__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lens-extension */ \"./src/extensions/lens-extension.ts\");\n/* harmony import */ var _renderer_navigation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/navigation */ \"./src/renderer/navigation/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Extensions-api -> Custom page registration\n\n\n\n\n\nfunction getExtensionPageUrl(target) {\n const { extensionId, pageId = \"\", params: targetParams = {} } = target;\n const pagePath = [\"/extension\", Object(_lens_extension__WEBPACK_IMPORTED_MODULE_3__[\"sanitizeExtensionName\"])(extensionId), pageId]\n .filter(Boolean)\n .join(\"/\").replace(/\\/+/g, \"/\").replace(/\\/$/, \"\"); // normalize multi-slashes (e.g. coming from page.id)\n const pageUrl = new URL(pagePath, `http://localhost`);\n // stringify params to matched target page\n const registeredPage = GlobalPageRegistry.getInstance().getByPageTarget(target) || ClusterPageRegistry.getInstance().getByPageTarget(target);\n if (registeredPage === null || registeredPage === void 0 ? void 0 : registeredPage.params) {\n Object.entries(registeredPage.params).forEach(([name, param]) => {\n pageUrl.searchParams.delete(name); // first off, clear existing value(s)\n param.stringify(targetParams[name]).forEach(value => {\n if (_renderer_navigation__WEBPACK_IMPORTED_MODULE_4__[\"searchParamsOptions\"].skipEmpty && !value)\n return;\n pageUrl.searchParams.append(name, value);\n });\n });\n }\n return pageUrl.href.replace(pageUrl.origin, \"\");\n}\nclass PageRegistry extends _base_registry__WEBPACK_IMPORTED_MODULE_2__[\"BaseRegistry\"] {\n getRegisteredItem(page, ext) {\n const { id: pageId } = page;\n const extensionId = ext.name;\n const params = this.normalizeParams(extensionId, page.params);\n const components = this.normalizeComponents(page.components, params);\n const url = getExtensionPageUrl({ extensionId, pageId });\n return {\n id: pageId, extensionId, params, components, url,\n };\n }\n normalizeComponents(components, params) {\n if (params) {\n const { Page } = components;\n // inject extension's page component props.params\n components.Page = Object(mobx_react__WEBPACK_IMPORTED_MODULE_1__[\"observer\"])((props) => react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Page, Object.assign({ params }, props)));\n }\n return components;\n }\n normalizeParams(extensionId, params) {\n if (!params)\n return undefined;\n const normalizedParams = {};\n Object.entries(params).forEach(([paramName, paramValue]) => {\n const paramInit = {\n name: paramName,\n prefix: `${extensionId}:`,\n defaultValue: paramValue,\n };\n // handle non-string params\n if (typeof paramValue !== \"string\") {\n const { defaultValue: value, parse, stringify } = paramValue;\n const notAStringValue = typeof value !== \"string\" || (Array.isArray(value) && !value.every(value => typeof value === \"string\"));\n if (notAStringValue && !(parse || stringify)) {\n throw new Error(`PageRegistry: param's \"${paramName}\" initialization has failed:
|
|
40613
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExtensionPageUrl\", function() { return getExtensionPageUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ClusterPageRegistry\", function() { return ClusterPageRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GlobalPageRegistry\", function() { return GlobalPageRegistry; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _base_registry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base-registry */ \"./src/extensions/registries/base-registry.ts\");\n/* harmony import */ var _lens_extension__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lens-extension */ \"./src/extensions/lens-extension.ts\");\n/* harmony import */ var _renderer_navigation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/navigation */ \"./src/renderer/navigation/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Extensions-api -> Custom page registration\n\n\n\n\n\nfunction getExtensionPageUrl(target) {\n const { extensionId, pageId = \"\", params: targetParams = {} } = target;\n const pagePath = [\"/extension\", Object(_lens_extension__WEBPACK_IMPORTED_MODULE_3__[\"sanitizeExtensionName\"])(extensionId), pageId]\n .filter(Boolean)\n .join(\"/\").replace(/\\/+/g, \"/\").replace(/\\/$/, \"\"); // normalize multi-slashes (e.g. coming from page.id)\n const pageUrl = new URL(pagePath, `http://localhost`);\n // stringify params to matched target page\n const registeredPage = GlobalPageRegistry.getInstance().getByPageTarget(target) || ClusterPageRegistry.getInstance().getByPageTarget(target);\n if (registeredPage === null || registeredPage === void 0 ? void 0 : registeredPage.params) {\n Object.entries(registeredPage.params).forEach(([name, param]) => {\n pageUrl.searchParams.delete(name); // first off, clear existing value(s)\n param.stringify(targetParams[name]).forEach(value => {\n if (_renderer_navigation__WEBPACK_IMPORTED_MODULE_4__[\"searchParamsOptions\"].skipEmpty && !value)\n return;\n pageUrl.searchParams.append(name, value);\n });\n });\n }\n return pageUrl.href.replace(pageUrl.origin, \"\");\n}\nclass PageRegistry extends _base_registry__WEBPACK_IMPORTED_MODULE_2__[\"BaseRegistry\"] {\n getRegisteredItem(page, ext) {\n const { id: pageId } = page;\n const extensionId = ext.name;\n const params = this.normalizeParams(extensionId, page.params);\n const components = this.normalizeComponents(page.components, params);\n const url = getExtensionPageUrl({ extensionId, pageId });\n return {\n id: pageId, extensionId, params, components, url,\n };\n }\n normalizeComponents(components, params) {\n if (params) {\n const { Page } = components;\n // inject extension's page component props.params\n components.Page = Object(mobx_react__WEBPACK_IMPORTED_MODULE_1__[\"observer\"])((props) => react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Page, Object.assign({ params }, props)));\n }\n return components;\n }\n normalizeParams(extensionId, params) {\n if (!params)\n return undefined;\n const normalizedParams = {};\n Object.entries(params).forEach(([paramName, paramValue]) => {\n const paramInit = {\n name: paramName,\n prefix: `${extensionId}:`,\n defaultValue: paramValue,\n };\n // handle non-string params\n if (typeof paramValue !== \"string\") {\n const { defaultValue: value, parse, stringify } = paramValue;\n const notAStringValue = typeof value !== \"string\" || (Array.isArray(value) && !value.every(value => typeof value === \"string\"));\n if (notAStringValue && !(parse || stringify)) {\n throw new Error(`PageRegistry: param's \"${paramName}\" initialization has failed: paramInit.parse() and paramInit.stringify() are required for non string | string[] \"defaultValue\"`);\n }\n paramInit.defaultValue = value;\n paramInit.parse = parse;\n paramInit.stringify = stringify;\n }\n normalizedParams[paramName] = Object(_renderer_navigation__WEBPACK_IMPORTED_MODULE_4__[\"createPageParam\"])(paramInit);\n });\n return normalizedParams;\n }\n getByPageTarget(target) {\n return this.getItems().find(page => page.extensionId === target.extensionId && page.id === target.pageId) || null;\n }\n}\nclass ClusterPageRegistry extends PageRegistry {\n}\nclass GlobalPageRegistry extends PageRegistry {\n}\n\n\n//# sourceURL=webpack:///./src/extensions/registries/page-registry.ts?");
|
|
40648
40614
|
|
|
40649
40615
|
/***/ }),
|
|
40650
40616
|
|
|
@@ -40704,7 +40670,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40704
40670
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40705
40671
|
|
|
40706
40672
|
"use strict";
|
|
40707
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _renderer_components_layout_main_layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../renderer/components/layout/main-layout */ \"./src/renderer/components/layout/main-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MainLayout\", function() { return _renderer_components_layout_main_layout__WEBPACK_IMPORTED_MODULE_0__[\"MainLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_setting_layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../renderer/components/layout/setting-layout */ \"./src/renderer/components/layout/setting-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SettingLayout\", function() { return _renderer_components_layout_setting_layout__WEBPACK_IMPORTED_MODULE_1__[\"SettingLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_page_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../renderer/components/layout/page-layout */ \"./src/renderer/components/layout/page-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PageLayout\", function() { return _renderer_components_layout_page_layout__WEBPACK_IMPORTED_MODULE_2__[\"PageLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_wizard_layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../renderer/components/layout/wizard-layout */ \"./src/renderer/components/layout/wizard-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WizardLayout\", function() { return _renderer_components_layout_wizard_layout__WEBPACK_IMPORTED_MODULE_3__[\"WizardLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_tab_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/components/layout/tab-layout */ \"./src/renderer/components/layout/tab-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TabLayout\", function() { return _renderer_components_layout_tab_layout__WEBPACK_IMPORTED_MODULE_4__[\"TabLayout\"]; });\n\n/* harmony import */ var _renderer_components_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../renderer/components/button */ \"./src/renderer/components/button/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Button\", function() { return _renderer_components_button__WEBPACK_IMPORTED_MODULE_5__[\"Button\"]; });\n\n/* harmony import */ var _renderer_components_checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../renderer/components/checkbox */ \"./src/renderer/components/checkbox/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Checkbox\", function() { return _renderer_components_checkbox__WEBPACK_IMPORTED_MODULE_6__[\"Checkbox\"]; });\n\n/* harmony import */ var _renderer_components_radio__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../renderer/components/radio */ \"./src/renderer/components/radio/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RadioGroup\", function() { return _renderer_components_radio__WEBPACK_IMPORTED_MODULE_7__[\"RadioGroup\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Radio\", function() { return _renderer_components_radio__WEBPACK_IMPORTED_MODULE_7__[\"Radio\"]; });\n\n/* harmony import */ var _renderer_components_select__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../renderer/components/select */ \"./src/renderer/components/select/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Select\", function() { return _renderer_components_select__WEBPACK_IMPORTED_MODULE_8__[\"Select\"]; });\n\n/* harmony import */ var _renderer_components_slider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../renderer/components/slider */ \"./src/renderer/components/slider/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Slider\", function() { return _renderer_components_slider__WEBPACK_IMPORTED_MODULE_9__[\"Slider\"]; });\n\n/* harmony import */ var _renderer_components_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../renderer/components/switch */ \"./src/renderer/components/switch/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Switcher\", function() { return _renderer_components_switch__WEBPACK_IMPORTED_MODULE_10__[\"Switcher\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"FormSwitch\", function() { return _renderer_components_switch__WEBPACK_IMPORTED_MODULE_10__[\"FormSwitch\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Switch\", function() { return _renderer_components_switch__WEBPACK_IMPORTED_MODULE_10__[\"Switch\"]; });\n\n/* harmony import */ var _renderer_components_input_input__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../renderer/components/input/input */ \"./src/renderer/components/input/input.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InputValidators\", function() { return _renderer_components_input_input__WEBPACK_IMPORTED_MODULE_11__[\"InputValidators\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Input\", function() { return _renderer_components_input_input__WEBPACK_IMPORTED_MODULE_11__[\"Input\"]; });\n\n/* harmony import */ var _renderer_components_command_palette__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../renderer/components/command-palette */ \"./src/renderer/components/command-palette/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CommandOverlay\", function() { return _renderer_components_command_palette__WEBPACK_IMPORTED_MODULE_12__[\"CommandOverlay\"]; });\n\n/* harmony import */ var _renderer_components_icon__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../renderer/components/icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Icon\", function() { return _renderer_components_icon__WEBPACK_IMPORTED_MODULE_13__[\"Icon\"]; });\n\n/* harmony import */ var _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../renderer/components/tooltip */ \"./src/renderer/components/tooltip/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TooltipPosition\", function() { return _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_14__[\"TooltipPosition\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_14__[\"Tooltip\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"withTooltip\", function() { return _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_14__[\"withTooltip\"]; });\n\n/* harmony import */ var _renderer_components_tabs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../renderer/components/tabs */ \"./src/renderer/components/tabs/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tabs\", function() { return _renderer_components_tabs__WEBPACK_IMPORTED_MODULE_15__[\"Tabs\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tab\", function() { return _renderer_components_tabs__WEBPACK_IMPORTED_MODULE_15__[\"Tab\"]; });\n\n/* harmony import */ var _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../renderer/components/table */ \"./src/renderer/components/table/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"sortByUrlParam\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__[\"sortByUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"orderByUrlParam\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__[\"orderByUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Table\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__[\"Table\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TableHead\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__[\"TableHead\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TableRow\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__[\"TableRow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TableCell\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_16__[\"TableCell\"]; });\n\n/* harmony import */ var _renderer_components_badge__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../renderer/components/badge */ \"./src/renderer/components/badge/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Badge\", function() { return _renderer_components_badge__WEBPACK_IMPORTED_MODULE_17__[\"Badge\"]; });\n\n/* harmony import */ var _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../renderer/components/drawer */ \"./src/renderer/components/drawer/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Drawer\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_18__[\"Drawer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerTitle\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_18__[\"DrawerTitle\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerItem\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_18__[\"DrawerItem\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerItemLabels\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_18__[\"DrawerItemLabels\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerParamToggler\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_18__[\"DrawerParamToggler\"]; });\n\n/* harmony import */ var _renderer_components_dialog__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../renderer/components/dialog */ \"./src/renderer/components/dialog/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Dialog\", function() { return _renderer_components_dialog__WEBPACK_IMPORTED_MODULE_19__[\"Dialog\"]; });\n\n/* harmony import */ var _renderer_components_confirm_dialog__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../renderer/components/confirm-dialog */ \"./src/renderer/components/confirm-dialog/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConfirmDialog\", function() { return _renderer_components_confirm_dialog__WEBPACK_IMPORTED_MODULE_20__[\"ConfirmDialog\"]; });\n\n/* harmony import */ var _renderer_components_line_progress__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../renderer/components/line-progress */ \"./src/renderer/components/line-progress/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LineProgress\", function() { return _renderer_components_line_progress__WEBPACK_IMPORTED_MODULE_21__[\"LineProgress\"]; });\n\n/* harmony import */ var _renderer_components_menu__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../renderer/components/menu */ \"./src/renderer/components/menu/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MenuContext\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_22__[\"MenuContext\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_22__[\"Menu\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SubMenu\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_22__[\"SubMenu\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MenuItem\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_22__[\"MenuItem\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MenuActions\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_22__[\"MenuActions\"]; });\n\n/* harmony import */ var _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../renderer/components/notifications */ \"./src/renderer/components/notifications/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Notifications\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_23__[\"Notifications\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NotificationStatus\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_23__[\"NotificationStatus\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NotificationsStore\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_23__[\"NotificationsStore\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"notificationsStore\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_23__[\"notificationsStore\"]; });\n\n/* harmony import */ var _renderer_components_spinner__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../renderer/components/spinner */ \"./src/renderer/components/spinner/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Spinner\", function() { return _renderer_components_spinner__WEBPACK_IMPORTED_MODULE_24__[\"Spinner\"]; });\n\n/* harmony import */ var _renderer_components_stepper__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../renderer/components/stepper */ \"./src/renderer/components/stepper/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Stepper\", function() { return _renderer_components_stepper__WEBPACK_IMPORTED_MODULE_25__[\"Stepper\"]; });\n\n/* harmony import */ var _renderer_components_wizard__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../renderer/components/wizard */ \"./src/renderer/components/wizard/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Wizard\", function() { return _renderer_components_wizard__WEBPACK_IMPORTED_MODULE_26__[\"Wizard\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WizardStep\", function() { return _renderer_components_wizard__WEBPACK_IMPORTED_MODULE_26__[\"WizardStep\"]; });\n\n/* harmony import */ var _renderer_components_workloads_pods_pod_details_list__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../renderer/components/+workloads-pods/pod-details-list */ \"./src/renderer/components/+workloads-pods/pod-details-list.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PodDetailsList\", function() { return _renderer_components_workloads_pods_pod_details_list__WEBPACK_IMPORTED_MODULE_27__[\"PodDetailsList\"]; });\n\n/* harmony import */ var _renderer_components_namespaces_namespace_select__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../renderer/components/+namespaces/namespace-select */ \"./src/renderer/components/+namespaces/namespace-select.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NamespaceSelect\", function() { return _renderer_components_namespaces_namespace_select__WEBPACK_IMPORTED_MODULE_28__[\"NamespaceSelect\"]; });\n\n/* harmony import */ var _renderer_components_namespaces_namespace_select_filter__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../renderer/components/+namespaces/namespace-select-filter */ \"./src/renderer/components/+namespaces/namespace-select-filter.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NamespaceSelectFilter\", function() { return _renderer_components_namespaces_namespace_select_filter__WEBPACK_IMPORTED_MODULE_29__[\"NamespaceSelectFilter\"]; });\n\n/* harmony import */ var _renderer_components_layout_sub_title__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../renderer/components/layout/sub-title */ \"./src/renderer/components/layout/sub-title.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SubTitle\", function() { return _renderer_components_layout_sub_title__WEBPACK_IMPORTED_MODULE_30__[\"SubTitle\"]; });\n\n/* harmony import */ var _renderer_components_input_search_input__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../renderer/components/input/search-input */ \"./src/renderer/components/input/search-input.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SearchInput\", function() { return _renderer_components_input_search_input__WEBPACK_IMPORTED_MODULE_31__[\"SearchInput\"]; });\n\n/* harmony import */ var _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../renderer/components/chart/bar-chart */ \"./src/renderer/components/chart/bar-chart.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BarChart\", function() { return _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_32__[\"BarChart\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"memoryOptions\", function() { return _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_32__[\"memoryOptions\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"cpuOptions\", function() { return _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_32__[\"cpuOptions\"]; });\n\n/* harmony import */ var _renderer_components_chart_pie_chart__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../renderer/components/chart/pie-chart */ \"./src/renderer/components/chart/pie-chart.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PieChart\", function() { return _renderer_components_chart_pie_chart__WEBPACK_IMPORTED_MODULE_33__[\"PieChart\"]; });\n\n/* harmony import */ var _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../renderer/components/kube-detail-params */ \"./src/renderer/components/kube-detail-params/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"kubeDetailsUrlParam\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__[\"kubeDetailsUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"kubeSelectedUrlParam\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__[\"kubeSelectedUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toggleDetails\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__[\"toggleDetails\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"showDetails\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__[\"showDetails\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hideDetails\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__[\"hideDetails\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getDetailsUrl\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_34__[\"getDetailsUrl\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_details__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../renderer/components/kube-object-details */ \"./src/renderer/components/kube-object-details/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectDetails\", function() { return _renderer_components_kube_object_details__WEBPACK_IMPORTED_MODULE_35__[\"KubeObjectDetails\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_list_layout__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../renderer/components/kube-object-list-layout */ \"./src/renderer/components/kube-object-list-layout/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectListLayout\", function() { return _renderer_components_kube_object_list_layout__WEBPACK_IMPORTED_MODULE_36__[\"KubeObjectListLayout\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_menu__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../renderer/components/kube-object-menu */ \"./src/renderer/components/kube-object-menu/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectMenu\", function() { return _renderer_components_kube_object_menu__WEBPACK_IMPORTED_MODULE_37__[\"KubeObjectMenu\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_meta__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../renderer/components/kube-object-meta */ \"./src/renderer/components/kube-object-meta/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectMeta\", function() { return _renderer_components_kube_object_meta__WEBPACK_IMPORTED_MODULE_38__[\"KubeObjectMeta\"]; });\n\n/* harmony import */ var _renderer_components_events_kube_event_details__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../../renderer/components/+events/kube-event-details */ \"./src/renderer/components/+events/kube-event-details.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeEventDetails\", function() { return _renderer_components_events_kube_event_details__WEBPACK_IMPORTED_MODULE_39__[\"KubeEventDetails\"]; });\n\n/* harmony import */ var _renderer_components_status_brick__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../../renderer/components/status-brick */ \"./src/renderer/components/status-brick/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StatusBrick\", function() { return _renderer_components_status_brick__WEBPACK_IMPORTED_MODULE_40__[\"StatusBrick\"]; });\n\n/* harmony import */ var _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../renderer/components/dock/terminal.store */ \"./src/renderer/components/dock/terminal.store.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"terminalStore\", function() { return _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_41__[\"terminalStore\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createTerminalTab\", function() { return _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_41__[\"createTerminalTab\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TerminalStore\", function() { return _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_41__[\"TerminalStore\"]; });\n\n/* harmony import */ var _renderer_components_dock_log_tab_store__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../renderer/components/dock/log-tab.store */ \"./src/renderer/components/dock/log-tab.store.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"logTabStore\", function() { return _renderer_components_dock_log_tab_store__WEBPACK_IMPORTED_MODULE_42__[\"logTabStore\"]; });\n\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// layouts\n\n\n\n\n\n// form-controls\n\n\n\n\n\n\n\n// command-overlay\n\n// other components\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// kube helpers\n\n\n\n\n\n\n// specific exports\n\n\n\n\n\n//# sourceURL=webpack:///./src/extensions/renderer-api/components.ts?");
|
|
40673
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommandOverlay\", function() { return CommandOverlay; });\n/* harmony import */ var _renderer_components_command_palette_command_overlay_injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../renderer/components/command-palette/command-overlay.injectable */ \"./src/renderer/components/command-palette/command-overlay.injectable.ts\");\n/* harmony import */ var _as_legacy_globals_for_extension_api_as_legacy_global_object_for_extension_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api */ \"./src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api.ts\");\n/* harmony import */ var _renderer_components_layout_main_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../renderer/components/layout/main-layout */ \"./src/renderer/components/layout/main-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MainLayout\", function() { return _renderer_components_layout_main_layout__WEBPACK_IMPORTED_MODULE_2__[\"MainLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_setting_layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../renderer/components/layout/setting-layout */ \"./src/renderer/components/layout/setting-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SettingLayout\", function() { return _renderer_components_layout_setting_layout__WEBPACK_IMPORTED_MODULE_3__[\"SettingLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_page_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/components/layout/page-layout */ \"./src/renderer/components/layout/page-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PageLayout\", function() { return _renderer_components_layout_page_layout__WEBPACK_IMPORTED_MODULE_4__[\"PageLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_wizard_layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../renderer/components/layout/wizard-layout */ \"./src/renderer/components/layout/wizard-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WizardLayout\", function() { return _renderer_components_layout_wizard_layout__WEBPACK_IMPORTED_MODULE_5__[\"WizardLayout\"]; });\n\n/* harmony import */ var _renderer_components_layout_tab_layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../renderer/components/layout/tab-layout */ \"./src/renderer/components/layout/tab-layout.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TabLayout\", function() { return _renderer_components_layout_tab_layout__WEBPACK_IMPORTED_MODULE_6__[\"TabLayout\"]; });\n\n/* harmony import */ var _renderer_components_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../renderer/components/button */ \"./src/renderer/components/button/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Button\", function() { return _renderer_components_button__WEBPACK_IMPORTED_MODULE_7__[\"Button\"]; });\n\n/* harmony import */ var _renderer_components_checkbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../renderer/components/checkbox */ \"./src/renderer/components/checkbox/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Checkbox\", function() { return _renderer_components_checkbox__WEBPACK_IMPORTED_MODULE_8__[\"Checkbox\"]; });\n\n/* harmony import */ var _renderer_components_radio__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../renderer/components/radio */ \"./src/renderer/components/radio/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RadioGroup\", function() { return _renderer_components_radio__WEBPACK_IMPORTED_MODULE_9__[\"RadioGroup\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Radio\", function() { return _renderer_components_radio__WEBPACK_IMPORTED_MODULE_9__[\"Radio\"]; });\n\n/* harmony import */ var _renderer_components_select__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../renderer/components/select */ \"./src/renderer/components/select/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Select\", function() { return _renderer_components_select__WEBPACK_IMPORTED_MODULE_10__[\"Select\"]; });\n\n/* harmony import */ var _renderer_components_slider__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../renderer/components/slider */ \"./src/renderer/components/slider/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Slider\", function() { return _renderer_components_slider__WEBPACK_IMPORTED_MODULE_11__[\"Slider\"]; });\n\n/* harmony import */ var _renderer_components_switch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../renderer/components/switch */ \"./src/renderer/components/switch/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Switcher\", function() { return _renderer_components_switch__WEBPACK_IMPORTED_MODULE_12__[\"Switcher\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"FormSwitch\", function() { return _renderer_components_switch__WEBPACK_IMPORTED_MODULE_12__[\"FormSwitch\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Switch\", function() { return _renderer_components_switch__WEBPACK_IMPORTED_MODULE_12__[\"Switch\"]; });\n\n/* harmony import */ var _renderer_components_input_input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../renderer/components/input/input */ \"./src/renderer/components/input/input.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InputValidators\", function() { return _renderer_components_input_input__WEBPACK_IMPORTED_MODULE_13__[\"InputValidators\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Input\", function() { return _renderer_components_input_input__WEBPACK_IMPORTED_MODULE_13__[\"Input\"]; });\n\n/* harmony import */ var _renderer_components_icon__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../renderer/components/icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Icon\", function() { return _renderer_components_icon__WEBPACK_IMPORTED_MODULE_14__[\"Icon\"]; });\n\n/* harmony import */ var _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../renderer/components/tooltip */ \"./src/renderer/components/tooltip/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TooltipPosition\", function() { return _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_15__[\"TooltipPosition\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_15__[\"Tooltip\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"withTooltip\", function() { return _renderer_components_tooltip__WEBPACK_IMPORTED_MODULE_15__[\"withTooltip\"]; });\n\n/* harmony import */ var _renderer_components_tabs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../renderer/components/tabs */ \"./src/renderer/components/tabs/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tabs\", function() { return _renderer_components_tabs__WEBPACK_IMPORTED_MODULE_16__[\"Tabs\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tab\", function() { return _renderer_components_tabs__WEBPACK_IMPORTED_MODULE_16__[\"Tab\"]; });\n\n/* harmony import */ var _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../renderer/components/table */ \"./src/renderer/components/table/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"sortByUrlParam\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__[\"sortByUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"orderByUrlParam\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__[\"orderByUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Table\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__[\"Table\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TableHead\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__[\"TableHead\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TableRow\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__[\"TableRow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TableCell\", function() { return _renderer_components_table__WEBPACK_IMPORTED_MODULE_17__[\"TableCell\"]; });\n\n/* harmony import */ var _renderer_components_badge__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../renderer/components/badge */ \"./src/renderer/components/badge/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Badge\", function() { return _renderer_components_badge__WEBPACK_IMPORTED_MODULE_18__[\"Badge\"]; });\n\n/* harmony import */ var _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../renderer/components/drawer */ \"./src/renderer/components/drawer/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Drawer\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_19__[\"Drawer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerTitle\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_19__[\"DrawerTitle\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerItem\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_19__[\"DrawerItem\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerItemLabels\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_19__[\"DrawerItemLabels\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DrawerParamToggler\", function() { return _renderer_components_drawer__WEBPACK_IMPORTED_MODULE_19__[\"DrawerParamToggler\"]; });\n\n/* harmony import */ var _renderer_components_dialog__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../renderer/components/dialog */ \"./src/renderer/components/dialog/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Dialog\", function() { return _renderer_components_dialog__WEBPACK_IMPORTED_MODULE_20__[\"Dialog\"]; });\n\n/* harmony import */ var _renderer_components_confirm_dialog__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../renderer/components/confirm-dialog */ \"./src/renderer/components/confirm-dialog/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConfirmDialog\", function() { return _renderer_components_confirm_dialog__WEBPACK_IMPORTED_MODULE_21__[\"ConfirmDialog\"]; });\n\n/* harmony import */ var _renderer_components_line_progress__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../renderer/components/line-progress */ \"./src/renderer/components/line-progress/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LineProgress\", function() { return _renderer_components_line_progress__WEBPACK_IMPORTED_MODULE_22__[\"LineProgress\"]; });\n\n/* harmony import */ var _renderer_components_menu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../renderer/components/menu */ \"./src/renderer/components/menu/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MenuContext\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_23__[\"MenuContext\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_23__[\"Menu\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SubMenu\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_23__[\"SubMenu\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MenuItem\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_23__[\"MenuItem\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MenuActions\", function() { return _renderer_components_menu__WEBPACK_IMPORTED_MODULE_23__[\"MenuActions\"]; });\n\n/* harmony import */ var _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../renderer/components/notifications */ \"./src/renderer/components/notifications/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Notifications\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_24__[\"Notifications\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NotificationStatus\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_24__[\"NotificationStatus\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NotificationsStore\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_24__[\"NotificationsStore\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"notificationsStore\", function() { return _renderer_components_notifications__WEBPACK_IMPORTED_MODULE_24__[\"notificationsStore\"]; });\n\n/* harmony import */ var _renderer_components_spinner__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../renderer/components/spinner */ \"./src/renderer/components/spinner/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Spinner\", function() { return _renderer_components_spinner__WEBPACK_IMPORTED_MODULE_25__[\"Spinner\"]; });\n\n/* harmony import */ var _renderer_components_stepper__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../renderer/components/stepper */ \"./src/renderer/components/stepper/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Stepper\", function() { return _renderer_components_stepper__WEBPACK_IMPORTED_MODULE_26__[\"Stepper\"]; });\n\n/* harmony import */ var _renderer_components_wizard__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../renderer/components/wizard */ \"./src/renderer/components/wizard/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Wizard\", function() { return _renderer_components_wizard__WEBPACK_IMPORTED_MODULE_27__[\"Wizard\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WizardStep\", function() { return _renderer_components_wizard__WEBPACK_IMPORTED_MODULE_27__[\"WizardStep\"]; });\n\n/* harmony import */ var _renderer_components_workloads_pods_pod_details_list__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../renderer/components/+workloads-pods/pod-details-list */ \"./src/renderer/components/+workloads-pods/pod-details-list.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PodDetailsList\", function() { return _renderer_components_workloads_pods_pod_details_list__WEBPACK_IMPORTED_MODULE_28__[\"PodDetailsList\"]; });\n\n/* harmony import */ var _renderer_components_namespaces_namespace_select__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../renderer/components/+namespaces/namespace-select */ \"./src/renderer/components/+namespaces/namespace-select.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NamespaceSelect\", function() { return _renderer_components_namespaces_namespace_select__WEBPACK_IMPORTED_MODULE_29__[\"NamespaceSelect\"]; });\n\n/* harmony import */ var _renderer_components_namespaces_namespace_select_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../renderer/components/+namespaces/namespace-select-filter */ \"./src/renderer/components/+namespaces/namespace-select-filter.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NamespaceSelectFilter\", function() { return _renderer_components_namespaces_namespace_select_filter__WEBPACK_IMPORTED_MODULE_30__[\"NamespaceSelectFilter\"]; });\n\n/* harmony import */ var _renderer_components_layout_sub_title__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../renderer/components/layout/sub-title */ \"./src/renderer/components/layout/sub-title.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SubTitle\", function() { return _renderer_components_layout_sub_title__WEBPACK_IMPORTED_MODULE_31__[\"SubTitle\"]; });\n\n/* harmony import */ var _renderer_components_input_search_input__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../renderer/components/input/search-input */ \"./src/renderer/components/input/search-input.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SearchInput\", function() { return _renderer_components_input_search_input__WEBPACK_IMPORTED_MODULE_32__[\"SearchInput\"]; });\n\n/* harmony import */ var _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../renderer/components/chart/bar-chart */ \"./src/renderer/components/chart/bar-chart.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BarChart\", function() { return _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_33__[\"BarChart\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"memoryOptions\", function() { return _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_33__[\"memoryOptions\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"cpuOptions\", function() { return _renderer_components_chart_bar_chart__WEBPACK_IMPORTED_MODULE_33__[\"cpuOptions\"]; });\n\n/* harmony import */ var _renderer_components_chart_pie_chart__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../renderer/components/chart/pie-chart */ \"./src/renderer/components/chart/pie-chart.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PieChart\", function() { return _renderer_components_chart_pie_chart__WEBPACK_IMPORTED_MODULE_34__[\"PieChart\"]; });\n\n/* harmony import */ var _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../renderer/components/kube-detail-params */ \"./src/renderer/components/kube-detail-params/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"kubeDetailsUrlParam\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__[\"kubeDetailsUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"kubeSelectedUrlParam\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__[\"kubeSelectedUrlParam\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toggleDetails\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__[\"toggleDetails\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"showDetails\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__[\"showDetails\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hideDetails\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__[\"hideDetails\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getDetailsUrl\", function() { return _renderer_components_kube_detail_params__WEBPACK_IMPORTED_MODULE_35__[\"getDetailsUrl\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_details__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../renderer/components/kube-object-details */ \"./src/renderer/components/kube-object-details/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectDetails\", function() { return _renderer_components_kube_object_details__WEBPACK_IMPORTED_MODULE_36__[\"KubeObjectDetails\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_list_layout__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../renderer/components/kube-object-list-layout */ \"./src/renderer/components/kube-object-list-layout/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectListLayout\", function() { return _renderer_components_kube_object_list_layout__WEBPACK_IMPORTED_MODULE_37__[\"KubeObjectListLayout\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_menu__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../renderer/components/kube-object-menu */ \"./src/renderer/components/kube-object-menu/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectMenu\", function() { return _renderer_components_kube_object_menu__WEBPACK_IMPORTED_MODULE_38__[\"KubeObjectMenu\"]; });\n\n/* harmony import */ var _renderer_components_kube_object_meta__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../../renderer/components/kube-object-meta */ \"./src/renderer/components/kube-object-meta/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectMeta\", function() { return _renderer_components_kube_object_meta__WEBPACK_IMPORTED_MODULE_39__[\"KubeObjectMeta\"]; });\n\n/* harmony import */ var _renderer_components_events_kube_event_details__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../../renderer/components/+events/kube-event-details */ \"./src/renderer/components/+events/kube-event-details.tsx\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"KubeEventDetails\", function() { return _renderer_components_events_kube_event_details__WEBPACK_IMPORTED_MODULE_40__[\"KubeEventDetails\"]; });\n\n/* harmony import */ var _renderer_components_status_brick__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../renderer/components/status-brick */ \"./src/renderer/components/status-brick/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StatusBrick\", function() { return _renderer_components_status_brick__WEBPACK_IMPORTED_MODULE_41__[\"StatusBrick\"]; });\n\n/* harmony import */ var _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../renderer/components/dock/terminal.store */ \"./src/renderer/components/dock/terminal.store.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"terminalStore\", function() { return _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_42__[\"terminalStore\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createTerminalTab\", function() { return _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_42__[\"createTerminalTab\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TerminalStore\", function() { return _renderer_components_dock_terminal_store__WEBPACK_IMPORTED_MODULE_42__[\"TerminalStore\"]; });\n\n/* harmony import */ var _renderer_components_dock_log_tab_store__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../../renderer/components/dock/log-tab.store */ \"./src/renderer/components/dock/log-tab.store.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"logTabStore\", function() { return _renderer_components_dock_log_tab_store__WEBPACK_IMPORTED_MODULE_43__[\"logTabStore\"]; });\n\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n// layouts\n\n\n\n\n\n// form-controls\n\n\n\n\n\n\n\n// command-overlay\nconst CommandOverlay = Object(_as_legacy_globals_for_extension_api_as_legacy_global_object_for_extension_api__WEBPACK_IMPORTED_MODULE_1__[\"asLegacyGlobalObjectForExtensionApi\"])(_renderer_components_command_palette_command_overlay_injectable__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n// other components\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// kube helpers\n\n\n\n\n\n\n// specific exports\n\n\n\n\n\n//# sourceURL=webpack:///./src/extensions/renderer-api/components.ts?");
|
|
40708
40674
|
|
|
40709
40675
|
/***/ }),
|
|
40710
40676
|
|
|
@@ -40920,7 +40886,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40920
40886
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40921
40887
|
|
|
40922
40888
|
"use strict";
|
|
40923
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bundledKubectlPath\", function() { return bundledKubectlPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Kubectl\", function() { return Kubectl; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/utils/promise-exec */ \"./src/common/utils/promise-exec.ts\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ \"./src/main/logger.ts\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var proper_lockfile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! proper-lockfile */ \"./node_modules/proper-lockfile/index.js\");\n/* harmony import */ var proper_lockfile__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(proper_lockfile__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _helm_helm_cli__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helm/helm-cli */ \"./src/main/helm/helm-cli.ts\");\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var _common_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/request */ \"./src/common/request.ts\");\n/* harmony import */ var _common_utils_app_version__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/utils/app-version */ \"./src/common/utils/app-version.ts\");\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/vars */ \"./src/common/vars.ts\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! semver */ \"./node_modules/semver/index.js\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/user-store/preferences-helpers */ \"./src/common/user-store/preferences-helpers.ts\");\n/* harmony import */ var _common_app_paths__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/app-paths */ \"./src/common/app-paths.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst bundledVersion = Object(_common_utils_app_version__WEBPACK_IMPORTED_MODULE_9__[\"getBundledKubectlVersion\"])();\nconst kubectlMap = new Map([\n [\"1.7\", \"1.8.15\"],\n [\"1.8\", \"1.9.10\"],\n [\"1.9\", \"1.10.13\"],\n [\"1.10\", \"1.11.10\"],\n [\"1.11\", \"1.12.10\"],\n [\"1.12\", \"1.13.12\"],\n [\"1.13\", \"1.13.12\"],\n [\"1.14\", \"1.14.10\"],\n [\"1.15\", \"1.15.11\"],\n [\"1.16\", \"1.16.15\"],\n [\"1.17\", \"1.17.17\"],\n [\"1.18\", \"1.18.20\"],\n [\"1.19\", \"1.19.12\"],\n [\"1.20\", \"1.20.8\"],\n [\"1.21\", bundledVersion],\n]);\nlet bundledPath;\nconst initScriptVersionString = \"# lens-initscript v3\\n\";\nfunction bundledKubectlPath() {\n if (bundledPath) {\n return bundledPath;\n }\n if (_common_vars__WEBPACK_IMPORTED_MODULE_10__[\"isDevelopment\"] || _common_vars__WEBPACK_IMPORTED_MODULE_10__[\"isTestEnv\"]) {\n const platformName = _common_vars__WEBPACK_IMPORTED_MODULE_10__[\"isWindows\"] ? \"windows\" : process.platform;\n bundledPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(process.cwd(), \"binaries\", \"client\", platformName, process.arch, \"kubectl\");\n }\n else {\n bundledPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(process.resourcesPath, process.arch, \"kubectl\");\n }\n if (_common_vars__WEBPACK_IMPORTED_MODULE_10__[\"isWindows\"]) {\n bundledPath = `${bundledPath}.exe`;\n }\n return bundledPath;\n}\nclass Kubectl {\n constructor(clusterVersion) {\n Object.defineProperty(this, \"kubectlVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"directory\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"url\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"path\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"dirname\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n let version;\n try {\n version = new semver__WEBPACK_IMPORTED_MODULE_11__[\"SemVer\"](clusterVersion, { includePrerelease: false });\n }\n catch (_a) {\n version = new semver__WEBPACK_IMPORTED_MODULE_11__[\"SemVer\"](Kubectl.bundledKubectlVersion);\n }\n const minorVersion = `${version.major}.${version.minor}`;\n /* minorVersion is the first two digits of kube server version\n if the version map includes that, use that version, if not, fallback to the exact x.y.z of kube version */\n if (kubectlMap.has(minorVersion)) {\n this.kubectlVersion = kubectlMap.get(minorVersion);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Set kubectl version ${this.kubectlVersion} for cluster version ${clusterVersion} using version map`);\n }\n else {\n this.kubectlVersion = version.format();\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Set kubectl version ${this.kubectlVersion} for cluster version ${clusterVersion} using fallback`);\n }\n let arch = null;\n if (process.arch == \"x64\") {\n arch = \"amd64\";\n }\n else if (process.arch == \"x86\" || process.arch == \"ia32\") {\n arch = \"386\";\n }\n else {\n arch = process.arch;\n }\n const platformName = _common_vars__WEBPACK_IMPORTED_MODULE_10__[\"isWindows\"] ? \"windows\" : process.platform;\n const binaryName = _common_vars__WEBPACK_IMPORTED_MODULE_10__[\"isWindows\"] ? \"kubectl.exe\" : \"kubectl\";\n this.url = `${this.getDownloadMirror()}/v${this.kubectlVersion}/bin/${platformName}/${arch}/${binaryName}`;\n this.dirname = path__WEBPACK_IMPORTED_MODULE_0___default.a.normalize(path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.getDownloadDir(), this.kubectlVersion));\n this.path = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.dirname, binaryName);\n }\n static get kubectlDir() {\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.join(_common_app_paths__WEBPACK_IMPORTED_MODULE_13__[\"AppPaths\"].get(\"userData\"), \"binaries\", \"kubectl\");\n }\n // Returns the single bundled Kubectl instance\n static bundled() {\n var _a;\n return (_a = Kubectl.bundledInstance) !== null && _a !== void 0 ? _a : (Kubectl.bundledInstance = new Kubectl(Kubectl.bundledKubectlVersion));\n }\n getBundledPath() {\n return bundledKubectlPath();\n }\n getPathFromPreferences() {\n return _common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().kubectlBinariesPath || this.getBundledPath();\n }\n getDownloadDir() {\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadBinariesPath) {\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.join(_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadBinariesPath, \"kubectl\");\n }\n return Kubectl.kubectlDir;\n }\n async getPath(bundled = false) {\n if (bundled) {\n return this.getBundledPath();\n }\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadKubectlBinaries === false) {\n return this.getPathFromPreferences();\n }\n // return binary name if bundled path is not functional\n if (!await this.checkBinary(this.getBundledPath(), false)) {\n Kubectl.invalidBundle = true;\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.basename(this.getBundledPath());\n }\n try {\n if (!await this.ensureKubectl()) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(\"Failed to ensure kubectl, fallback to the bundled version\");\n return this.getBundledPath();\n }\n return this.path;\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(\"Failed to ensure kubectl, fallback to the bundled version\");\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(err);\n return this.getBundledPath();\n }\n }\n async binDir() {\n try {\n await this.ensureKubectl();\n await this.writeInitScripts();\n return this.dirname;\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(err);\n return \"\";\n }\n }\n async checkBinary(path, checkVersion = true) {\n const exists = await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"pathExists\"])(path);\n if (exists) {\n try {\n const args = [\n \"version\",\n \"--client\", \"true\",\n \"--output\", \"json\",\n ];\n const { stdout } = await Object(_common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_2__[\"promiseExecFile\"])(path, args);\n const output = JSON.parse(stdout);\n if (!checkVersion) {\n return true;\n }\n let version = output.clientVersion.gitVersion;\n if (version[0] === \"v\") {\n version = version.slice(1);\n }\n if (version === this.kubectlVersion) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Local kubectl is version ${this.kubectlVersion}`);\n return true;\n }\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Local kubectl is version ${version}, expected ${this.kubectlVersion}, unlinking`);\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Local kubectl failed to run properly (${err.message}), unlinking`);\n }\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.unlink(this.path);\n }\n return false;\n }\n async checkBundled() {\n if (this.kubectlVersion === Kubectl.bundledKubectlVersion) {\n try {\n const exist = await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"pathExists\"])(this.path);\n if (!exist) {\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.copyFile(this.getBundledPath(), this.path);\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.chmod(this.path, 0o755);\n }\n return true;\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Could not copy the bundled kubectl to app-data: ${err}`);\n return false;\n }\n }\n else {\n return false;\n }\n }\n async ensureKubectl() {\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadKubectlBinaries === false) {\n return true;\n }\n if (Kubectl.invalidBundle) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Detected invalid bundle binary, returning ...`);\n return false;\n }\n await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"ensureDir\"])(this.dirname, 0o755);\n try {\n const release = await proper_lockfile__WEBPACK_IMPORTED_MODULE_5__[\"lock\"](this.dirname);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Acquired a lock for ${this.kubectlVersion}`);\n const bundled = await this.checkBundled();\n let isValid = await this.checkBinary(this.path, !bundled);\n if (!isValid && !bundled) {\n try {\n await this.downloadKubectl();\n }\n catch (error) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBECTL]: failed to download kubectl`, error);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[KUBECTL]: Releasing lock for ${this.kubectlVersion}`);\n await release();\n return false;\n }\n isValid = await this.checkBinary(this.path, false);\n }\n if (!isValid) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[KUBECTL]: Releasing lock for ${this.kubectlVersion}`);\n await release();\n return false;\n }\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[KUBECTL]: Releasing lock for ${this.kubectlVersion}`);\n await release();\n return true;\n }\n catch (error) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBECTL]: Failed to get a lock for ${this.kubectlVersion}`, error);\n return false;\n }\n }\n async downloadKubectl() {\n await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"ensureDir\"])(path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname(this.path), 0o755);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`Downloading kubectl ${this.kubectlVersion} from ${this.url} to ${this.path}`);\n return new Promise((resolve, reject) => {\n const stream = Object(_common_request__WEBPACK_IMPORTED_MODULE_8__[\"customRequest\"])({\n url: this.url,\n gzip: true,\n });\n const file = fs__WEBPACK_IMPORTED_MODULE_1___default.a.createWriteStream(this.path);\n stream.on(\"complete\", () => {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(\"kubectl binary download finished\");\n file.end();\n });\n stream.on(\"error\", (error) => {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(error);\n fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlink(this.path, () => {\n // do nothing\n });\n reject(error);\n });\n file.on(\"close\", () => {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(\"kubectl binary download closed\");\n fs__WEBPACK_IMPORTED_MODULE_1___default.a.chmod(this.path, 0o755, (err) => {\n if (err)\n reject(err);\n });\n resolve();\n });\n stream.pipe(file);\n });\n }\n async writeInitScripts() {\n const kubectlPath = _common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadKubectlBinaries ? this.dirname : path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname(this.getPathFromPreferences());\n const helmPath = _helm_helm_cli__WEBPACK_IMPORTED_MODULE_6__[\"helmCli\"].getBinaryDir();\n const fsPromises = fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises;\n const bashScriptPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.dirname, \".bash_set_path\");\n let bashScript = `${initScriptVersionString}`;\n bashScript += \"tempkubeconfig=\\\"$KUBECONFIG\\\"\\n\";\n bashScript += \"test -f \\\"/etc/profile\\\" && . \\\"/etc/profile\\\"\\n\";\n bashScript += \"if test -f \\\"$HOME/.bash_profile\\\"; then\\n\";\n bashScript += \" . \\\"$HOME/.bash_profile\\\"\\n\";\n bashScript += \"elif test -f \\\"$HOME/.bash_login\\\"; then\\n\";\n bashScript += \" . \\\"$HOME/.bash_login\\\"\\n\";\n bashScript += \"elif test -f \\\"$HOME/.profile\\\"; then\\n\";\n bashScript += \" . \\\"$HOME/.profile\\\"\\n\";\n bashScript += \"fi\\n\";\n bashScript += `export PATH=\"${helmPath}:${kubectlPath}:$PATH\"\\n`;\n bashScript += \"export KUBECONFIG=\\\"$tempkubeconfig\\\"\\n\";\n bashScript += `NO_PROXY=\\\",\\${NO_PROXY:-localhost},\\\"\\n`;\n bashScript += `NO_PROXY=\\\"\\${NO_PROXY//,localhost,/,}\\\"\\n`;\n bashScript += `NO_PROXY=\\\"\\${NO_PROXY//,127.0.0.1,/,}\\\"\\n`;\n bashScript += `NO_PROXY=\\\"localhost,127.0.0.1\\${NO_PROXY%,}\\\"\\n`;\n bashScript += \"export NO_PROXY\\n\";\n bashScript += \"unset tempkubeconfig\\n\";\n await fsPromises.writeFile(bashScriptPath, bashScript.toString(), { mode: 0o644 });\n const zshScriptPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.dirname, \".zlogin\");\n let zshScript = `${initScriptVersionString}`;\n zshScript += \"tempkubeconfig=\\\"$KUBECONFIG\\\"\\n\";\n // restore previous ZDOTDIR\n zshScript += \"export ZDOTDIR=\\\"$OLD_ZDOTDIR\\\"\\n\";\n // source all the files\n zshScript += \"test -f \\\"$OLD_ZDOTDIR/.zshenv\\\" && . \\\"$OLD_ZDOTDIR/.zshenv\\\"\\n\";\n zshScript += \"test -f \\\"$OLD_ZDOTDIR/.zprofile\\\" && . \\\"$OLD_ZDOTDIR/.zprofile\\\"\\n\";\n zshScript += \"test -f \\\"$OLD_ZDOTDIR/.zlogin\\\" && . \\\"$OLD_ZDOTDIR/.zlogin\\\"\\n\";\n zshScript += \"test -f \\\"$OLD_ZDOTDIR/.zshrc\\\" && . \\\"$OLD_ZDOTDIR/.zshrc\\\"\\n\";\n // voodoo to replace any previous occurrences of kubectl path in the PATH\n zshScript += `kubectlpath=\\\"${kubectlPath}\"\\n`;\n zshScript += `helmpath=\\\"${helmPath}\"\\n`;\n zshScript += \"p=\\\":$kubectlpath:\\\"\\n\";\n zshScript += \"d=\\\":$PATH:\\\"\\n\";\n zshScript += `d=\\${d//$p/:}\\n`;\n zshScript += `d=\\${d/#:/}\\n`;\n zshScript += `export PATH=\\\"$helmpath:$kubectlpath:\\${d/%:/}\\\"\\n`;\n zshScript += \"export KUBECONFIG=\\\"$tempkubeconfig\\\"\\n\";\n zshScript += `NO_PROXY=\\\",\\${NO_PROXY:-localhost},\\\"\\n`;\n zshScript += `NO_PROXY=\\\"\\${NO_PROXY//,localhost,/,}\\\"\\n`;\n zshScript += `NO_PROXY=\\\"\\${NO_PROXY//,127.0.0.1,/,}\\\"\\n`;\n zshScript += `NO_PROXY=\\\"localhost,127.0.0.1\\${NO_PROXY%,}\\\"\\n`;\n zshScript += \"export NO_PROXY\\n\";\n zshScript += \"unset tempkubeconfig\\n\";\n zshScript += \"unset OLD_ZDOTDIR\\n\";\n await fsPromises.writeFile(zshScriptPath, zshScript.toString(), { mode: 0o644 });\n }\n getDownloadMirror() {\n // MacOS packages are only available from default\n var _a;\n const mirror = (_a = _common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_12__[\"packageMirrors\"].get(_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadMirror)) !== null && _a !== void 0 ? _a : _common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_12__[\"packageMirrors\"].get(_common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_12__[\"defaultPackageMirror\"]);\n return mirror.url;\n }\n}\nObject.defineProperty(Kubectl, \"bundledKubectlVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: bundledVersion\n});\nObject.defineProperty(Kubectl, \"invalidBundle\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n});\n\n\n//# sourceURL=webpack:///./src/main/kubectl.ts?");
|
|
40889
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bundledKubectlPath\", function() { return bundledKubectlPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Kubectl\", function() { return Kubectl; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/utils/promise-exec */ \"./src/common/utils/promise-exec.ts\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ \"./src/main/logger.ts\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var proper_lockfile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! proper-lockfile */ \"./node_modules/proper-lockfile/index.js\");\n/* harmony import */ var proper_lockfile__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(proper_lockfile__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _helm_helm_cli__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helm/helm-cli */ \"./src/main/helm/helm-cli.ts\");\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var _common_utils_app_version__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/utils/app-version */ \"./src/common/utils/app-version.ts\");\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/vars */ \"./src/common/vars.ts\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! semver */ \"./node_modules/semver/index.js\");\n/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/user-store/preferences-helpers */ \"./src/common/user-store/preferences-helpers.ts\");\n/* harmony import */ var _common_app_paths__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/app-paths */ \"./src/common/app-paths.ts\");\n/* harmony import */ var got_dist_source__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! got/dist/source */ \"./node_modules/got/dist/source/index.js\");\n/* harmony import */ var got_dist_source__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(got_dist_source__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! util */ \"util\");\n/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _renderer_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../renderer/utils */ \"./src/renderer/utils/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst bundledVersion = Object(_common_utils_app_version__WEBPACK_IMPORTED_MODULE_8__[\"getBundledKubectlVersion\"])();\nconst kubectlMap = new Map([\n [\"1.7\", \"1.8.15\"],\n [\"1.8\", \"1.9.10\"],\n [\"1.9\", \"1.10.13\"],\n [\"1.10\", \"1.11.10\"],\n [\"1.11\", \"1.12.10\"],\n [\"1.12\", \"1.13.12\"],\n [\"1.13\", \"1.13.12\"],\n [\"1.14\", \"1.14.10\"],\n [\"1.15\", \"1.15.11\"],\n [\"1.16\", \"1.16.15\"],\n [\"1.17\", \"1.17.17\"],\n [\"1.18\", \"1.18.20\"],\n [\"1.19\", \"1.19.12\"],\n [\"1.20\", \"1.20.8\"],\n [\"1.21\", bundledVersion],\n]);\nlet bundledPath;\nconst initScriptVersionString = \"# lens-initscript v3\";\nfunction bundledKubectlPath() {\n if (bundledPath) {\n return bundledPath;\n }\n if (_common_vars__WEBPACK_IMPORTED_MODULE_9__[\"isDevelopment\"] || _common_vars__WEBPACK_IMPORTED_MODULE_9__[\"isTestEnv\"]) {\n const platformName = _common_vars__WEBPACK_IMPORTED_MODULE_9__[\"isWindows\"] ? \"windows\" : process.platform;\n bundledPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(process.cwd(), \"binaries\", \"client\", platformName, process.arch, \"kubectl\");\n }\n else {\n bundledPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(process.resourcesPath, process.arch, \"kubectl\");\n }\n if (_common_vars__WEBPACK_IMPORTED_MODULE_9__[\"isWindows\"]) {\n bundledPath = `${bundledPath}.exe`;\n }\n return bundledPath;\n}\nclass Kubectl {\n constructor(clusterVersion) {\n Object.defineProperty(this, \"kubectlVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"directory\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"url\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"path\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"dirname\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n let version;\n try {\n version = new semver__WEBPACK_IMPORTED_MODULE_10__[\"SemVer\"](clusterVersion, { includePrerelease: false });\n }\n catch (_a) {\n version = new semver__WEBPACK_IMPORTED_MODULE_10__[\"SemVer\"](Kubectl.bundledKubectlVersion);\n }\n const minorVersion = `${version.major}.${version.minor}`;\n /* minorVersion is the first two digits of kube server version\n if the version map includes that, use that version, if not, fallback to the exact x.y.z of kube version */\n if (kubectlMap.has(minorVersion)) {\n this.kubectlVersion = kubectlMap.get(minorVersion);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Set kubectl version ${this.kubectlVersion} for cluster version ${clusterVersion} using version map`);\n }\n else {\n this.kubectlVersion = version.format();\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Set kubectl version ${this.kubectlVersion} for cluster version ${clusterVersion} using fallback`);\n }\n let arch = null;\n if (process.arch == \"x64\") {\n arch = \"amd64\";\n }\n else if (process.arch == \"x86\" || process.arch == \"ia32\") {\n arch = \"386\";\n }\n else {\n arch = process.arch;\n }\n const platformName = _common_vars__WEBPACK_IMPORTED_MODULE_9__[\"isWindows\"] ? \"windows\" : process.platform;\n const binaryName = _common_vars__WEBPACK_IMPORTED_MODULE_9__[\"isWindows\"] ? \"kubectl.exe\" : \"kubectl\";\n this.url = `${this.getDownloadMirror()}/v${this.kubectlVersion}/bin/${platformName}/${arch}/${binaryName}`;\n this.dirname = path__WEBPACK_IMPORTED_MODULE_0___default.a.normalize(path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.getDownloadDir(), this.kubectlVersion));\n this.path = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.dirname, binaryName);\n }\n static get kubectlDir() {\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.join(_common_app_paths__WEBPACK_IMPORTED_MODULE_12__[\"AppPaths\"].get(\"userData\"), \"binaries\", \"kubectl\");\n }\n // Returns the single bundled Kubectl instance\n static bundled() {\n var _a;\n return (_a = Kubectl.bundledInstance) !== null && _a !== void 0 ? _a : (Kubectl.bundledInstance = new Kubectl(Kubectl.bundledKubectlVersion));\n }\n getBundledPath() {\n return bundledKubectlPath();\n }\n getPathFromPreferences() {\n return _common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().kubectlBinariesPath || this.getBundledPath();\n }\n getDownloadDir() {\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadBinariesPath) {\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.join(_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadBinariesPath, \"kubectl\");\n }\n return Kubectl.kubectlDir;\n }\n async getPath(bundled = false) {\n if (bundled) {\n return this.getBundledPath();\n }\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadKubectlBinaries === false) {\n return this.getPathFromPreferences();\n }\n // return binary name if bundled path is not functional\n if (!await this.checkBinary(this.getBundledPath(), false)) {\n Kubectl.invalidBundle = true;\n return path__WEBPACK_IMPORTED_MODULE_0___default.a.basename(this.getBundledPath());\n }\n try {\n if (!await this.ensureKubectl()) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(\"Failed to ensure kubectl, fallback to the bundled version\");\n return this.getBundledPath();\n }\n return this.path;\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(\"Failed to ensure kubectl, fallback to the bundled version\");\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(err);\n return this.getBundledPath();\n }\n }\n async binDir() {\n try {\n await this.ensureKubectl();\n await this.writeInitScripts();\n return this.dirname;\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(err);\n return \"\";\n }\n }\n async checkBinary(path, checkVersion = true) {\n const exists = await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"pathExists\"])(path);\n if (exists) {\n try {\n const args = [\n \"version\",\n \"--client\", \"true\",\n \"--output\", \"json\",\n ];\n const { stdout } = await Object(_common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_2__[\"promiseExecFile\"])(path, args);\n const output = JSON.parse(stdout);\n if (!checkVersion) {\n return true;\n }\n let version = output.clientVersion.gitVersion;\n if (version[0] === \"v\") {\n version = version.slice(1);\n }\n if (version === this.kubectlVersion) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Local kubectl is version ${this.kubectlVersion}`);\n return true;\n }\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Local kubectl is version ${version}, expected ${this.kubectlVersion}, unlinking`);\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Local kubectl failed to run properly (${err.message}), unlinking`);\n }\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.unlink(this.path);\n }\n return false;\n }\n async checkBundled() {\n if (this.kubectlVersion === Kubectl.bundledKubectlVersion) {\n try {\n const exist = await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"pathExists\"])(this.path);\n if (!exist) {\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.copyFile(this.getBundledPath(), this.path);\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.chmod(this.path, 0o755);\n }\n return true;\n }\n catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Could not copy the bundled kubectl to app-data: ${err}`);\n return false;\n }\n }\n else {\n return false;\n }\n }\n async ensureKubectl() {\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadKubectlBinaries === false) {\n return true;\n }\n if (Kubectl.invalidBundle) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`Detected invalid bundle binary, returning ...`);\n return false;\n }\n await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"ensureDir\"])(this.dirname, 0o755);\n try {\n const release = await proper_lockfile__WEBPACK_IMPORTED_MODULE_5__[\"lock\"](this.dirname);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`Acquired a lock for ${this.kubectlVersion}`);\n const bundled = await this.checkBundled();\n let isValid = await this.checkBinary(this.path, !bundled);\n if (!isValid && !bundled) {\n try {\n await this.downloadKubectl();\n }\n catch (error) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBECTL]: failed to download kubectl`, error);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[KUBECTL]: Releasing lock for ${this.kubectlVersion}`);\n await release();\n return false;\n }\n isValid = await this.checkBinary(this.path, false);\n }\n if (!isValid) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[KUBECTL]: Releasing lock for ${this.kubectlVersion}`);\n await release();\n return false;\n }\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(`[KUBECTL]: Releasing lock for ${this.kubectlVersion}`);\n await release();\n return true;\n }\n catch (error) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`[KUBECTL]: Failed to get a lock for ${this.kubectlVersion}`, error);\n return false;\n }\n }\n async downloadKubectl() {\n await Object(fs_extra__WEBPACK_IMPORTED_MODULE_4__[\"ensureDir\"])(path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname(this.path), 0o755);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].info(`Downloading kubectl ${this.kubectlVersion} from ${this.url} to ${this.path}`);\n const downloadStream = got_dist_source__WEBPACK_IMPORTED_MODULE_13___default.a.stream({ url: this.url, decompress: true });\n const fileWriteStream = fs__WEBPACK_IMPORTED_MODULE_1___default.a.createWriteStream(this.path, { mode: 0o755 });\n const pipeline = Object(util__WEBPACK_IMPORTED_MODULE_14__[\"promisify\"])(stream__WEBPACK_IMPORTED_MODULE_15___default.a.pipeline);\n try {\n await pipeline(downloadStream, fileWriteStream);\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.chmod(this.path, 0o755);\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].debug(\"kubectl binary download finished\");\n }\n catch (error) {\n await fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.unlink(this.path).catch(_renderer_utils__WEBPACK_IMPORTED_MODULE_16__[\"noop\"]);\n throw error;\n }\n }\n async writeInitScripts() {\n const kubectlPath = _common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadKubectlBinaries\n ? this.dirname\n : path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname(this.getPathFromPreferences());\n const helmPath = _helm_helm_cli__WEBPACK_IMPORTED_MODULE_6__[\"helmCli\"].getBinaryDir();\n const bashScriptPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.dirname, \".bash_set_path\");\n const bashScript = [\n initScriptVersionString,\n \"tempkubeconfig=\\\"$KUBECONFIG\\\"\",\n \"test -f \\\"/etc/profile\\\" && . \\\"/etc/profile\\\"\",\n \"if test -f \\\"$HOME/.bash_profile\\\"; then\",\n \" . \\\"$HOME/.bash_profile\\\"\",\n \"elif test -f \\\"$HOME/.bash_login\\\"; then\",\n \" . \\\"$HOME/.bash_login\\\"\",\n \"elif test -f \\\"$HOME/.profile\\\"; then\",\n \" . \\\"$HOME/.profile\\\"\",\n \"fi\",\n `export PATH=\"${helmPath}:${kubectlPath}:$PATH\"`,\n 'export KUBECONFIG=\"$tempkubeconfig\"',\n `NO_PROXY=\",\\${NO_PROXY:-localhost},\"`,\n `NO_PROXY=\"\\${NO_PROXY//,localhost,/,}\"`,\n `NO_PROXY=\"\\${NO_PROXY//,127.0.0.1,/,}\"`,\n `NO_PROXY=\"localhost,127.0.0.1\\${NO_PROXY%,}\"`,\n \"export NO_PROXY\",\n \"unset tempkubeconfig\",\n ].join(\"\\n\");\n const zshScriptPath = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(this.dirname, \".zlogin\");\n const zshScript = [\n initScriptVersionString,\n \"tempkubeconfig=\\\"$KUBECONFIG\\\"\",\n // restore previous ZDOTDIR\n \"export ZDOTDIR=\\\"$OLD_ZDOTDIR\\\"\",\n // source all the files\n \"test -f \\\"$OLD_ZDOTDIR/.zshenv\\\" && . \\\"$OLD_ZDOTDIR/.zshenv\\\"\",\n \"test -f \\\"$OLD_ZDOTDIR/.zprofile\\\" && . \\\"$OLD_ZDOTDIR/.zprofile\\\"\",\n \"test -f \\\"$OLD_ZDOTDIR/.zlogin\\\" && . \\\"$OLD_ZDOTDIR/.zlogin\\\"\",\n \"test -f \\\"$OLD_ZDOTDIR/.zshrc\\\" && . \\\"$OLD_ZDOTDIR/.zshrc\\\"\",\n // voodoo to replace any previous occurrences of kubectl path in the PATH\n `kubectlpath=\"${kubectlPath}\"`,\n `helmpath=\"${helmPath}\"`,\n \"p=\\\":$kubectlpath:\\\"\",\n \"d=\\\":$PATH:\\\"\",\n `d=\\${d//$p/:}`,\n `d=\\${d/#:/}`,\n `export PATH=\"$helmpath:$kubectlpath:\\${d/%:/}\"`,\n \"export KUBECONFIG=\\\"$tempkubeconfig\\\"\",\n `NO_PROXY=\",\\${NO_PROXY:-localhost},\"`,\n `NO_PROXY=\"\\${NO_PROXY//,localhost,/,}\"`,\n `NO_PROXY=\"\\${NO_PROXY//,127.0.0.1,/,}\"`,\n `NO_PROXY=\"localhost,127.0.0.1\\${NO_PROXY%,}\"`,\n \"export NO_PROXY\",\n \"unset tempkubeconfig\",\n \"unset OLD_ZDOTDIR\",\n ].join(\"\\n\");\n await Promise.all([\n fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.writeFile(bashScriptPath, bashScript, { mode: 0o644 }),\n fs__WEBPACK_IMPORTED_MODULE_1___default.a.promises.writeFile(zshScriptPath, zshScript, { mode: 0o644 }),\n ]);\n }\n getDownloadMirror() {\n // MacOS packages are only available from default\n var _a;\n const { url } = (_a = _common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_11__[\"packageMirrors\"].get(_common_user_store__WEBPACK_IMPORTED_MODULE_7__[\"UserStore\"].getInstance().downloadMirror)) !== null && _a !== void 0 ? _a : _common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_11__[\"packageMirrors\"].get(_common_user_store_preferences_helpers__WEBPACK_IMPORTED_MODULE_11__[\"defaultPackageMirror\"]);\n return url;\n }\n}\nObject.defineProperty(Kubectl, \"bundledKubectlVersion\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: bundledVersion\n});\nObject.defineProperty(Kubectl, \"invalidBundle\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n});\n\n\n//# sourceURL=webpack:///./src/main/kubectl.ts?");
|
|
40924
40890
|
|
|
40925
40891
|
/***/ }),
|
|
40926
40892
|
|
|
@@ -40980,7 +40946,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
40980
40946
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40981
40947
|
|
|
40982
40948
|
"use strict";
|
|
40983
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResourceApplier\", function() { return ResourceApplier; });\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! child_process */ \"child_process\");\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var js_yaml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! js-yaml */ \"./node_modules/js-yaml/dist/js-yaml.mjs\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var tempy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tempy */ \"./node_modules/tempy/index.js\");\n/* harmony import */ var tempy__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(tempy__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _common_event_bus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/event-bus */ \"./src/common/event-bus.ts\");\n/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/utils/promise-exec */ \"./src/common/utils/promise-exec.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\n\n\nclass ResourceApplier {\n constructor(cluster) {\n Object.defineProperty(this, \"cluster\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: cluster\n });\n }\n /**\n * Patch a kube resource's manifest, throwing any error that occurs.\n * @param name The name of the kube resource\n * @param kind The kind of the kube resource\n * @param patch The list of JSON operations\n * @param ns The optional namespace of the kube resource\n */\n async patch(name, kind, patch, ns) {\n var _a;\n _common_event_bus__WEBPACK_IMPORTED_MODULE_6__[\"appEventBus\"].emit({ name: \"resource\", action: \"patch\" });\n const kubectl = await this.cluster.ensureKubectl();\n const kubectlPath = await kubectl.getPath();\n const proxyKubeconfigPath = await this.cluster.getProxyKubeconfigPath();\n const args = [\n \"--kubeconfig\", proxyKubeconfigPath,\n \"patch\",\n kind,\n name,\n ];\n if (ns) {\n args.push(\"--namespace\", ns);\n }\n args.push(\"--type\", \"json\", \"--patch\", JSON.stringify(patch), \"-o\", \"json\");\n try {\n const { stdout } = await Object(_common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_8__[\"promiseExecFile\"])(kubectlPath, args);\n return stdout;\n }\n catch (error) {\n throw (_a = error.stderr) !== null && _a !== void 0 ? _a : error;\n }\n }\n async apply(resource) {\n resource = this.sanitizeObject(resource);\n _common_event_bus__WEBPACK_IMPORTED_MODULE_6__[\"appEventBus\"].emit({ name: \"resource\", action: \"apply\" });\n return this.kubectlApply(js_yaml__WEBPACK_IMPORTED_MODULE_2__[\"dump\"](resource));\n }\n async kubectlApply(content) {\n var _a, _b;\n const kubectl = await this.cluster.ensureKubectl();\n const kubectlPath = await kubectl.getPath();\n const proxyKubeconfigPath = await this.cluster.getProxyKubeconfigPath();\n const fileName =
|
|
40949
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResourceApplier\", function() { return ResourceApplier; });\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! child_process */ \"child_process\");\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var js_yaml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! js-yaml */ \"./node_modules/js-yaml/dist/js-yaml.mjs\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var tempy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tempy */ \"./node_modules/tempy/index.js\");\n/* harmony import */ var tempy__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(tempy__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _common_event_bus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/event-bus */ \"./src/common/event-bus.ts\");\n/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/utils/promise-exec */ \"./src/common/utils/promise-exec.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\n\n\n\n\n\n\nclass ResourceApplier {\n constructor(cluster) {\n Object.defineProperty(this, \"cluster\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: cluster\n });\n }\n /**\n * Patch a kube resource's manifest, throwing any error that occurs.\n * @param name The name of the kube resource\n * @param kind The kind of the kube resource\n * @param patch The list of JSON operations\n * @param ns The optional namespace of the kube resource\n */\n async patch(name, kind, patch, ns) {\n var _a;\n _common_event_bus__WEBPACK_IMPORTED_MODULE_6__[\"appEventBus\"].emit({ name: \"resource\", action: \"patch\" });\n const kubectl = await this.cluster.ensureKubectl();\n const kubectlPath = await kubectl.getPath();\n const proxyKubeconfigPath = await this.cluster.getProxyKubeconfigPath();\n const args = [\n \"--kubeconfig\", proxyKubeconfigPath,\n \"patch\",\n kind,\n name,\n ];\n if (ns) {\n args.push(\"--namespace\", ns);\n }\n args.push(\"--type\", \"json\", \"--patch\", JSON.stringify(patch), \"-o\", \"json\");\n try {\n const { stdout } = await Object(_common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_8__[\"promiseExecFile\"])(kubectlPath, args);\n return stdout;\n }\n catch (error) {\n throw (_a = error.stderr) !== null && _a !== void 0 ? _a : error;\n }\n }\n async apply(resource) {\n resource = this.sanitizeObject(resource);\n _common_event_bus__WEBPACK_IMPORTED_MODULE_6__[\"appEventBus\"].emit({ name: \"resource\", action: \"apply\" });\n return this.kubectlApply(js_yaml__WEBPACK_IMPORTED_MODULE_2__[\"dump\"](resource));\n }\n async kubectlApply(content) {\n var _a, _b;\n const kubectl = await this.cluster.ensureKubectl();\n const kubectlPath = await kubectl.getPath();\n const proxyKubeconfigPath = await this.cluster.getProxyKubeconfigPath();\n const fileName = tempy__WEBPACK_IMPORTED_MODULE_4___default.a.file({ name: \"resource.yaml\" });\n const args = [\n \"apply\",\n \"--kubeconfig\", proxyKubeconfigPath,\n \"-o\", \"json\",\n \"-f\", fileName,\n ];\n _logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].debug(`shooting manifests with ${kubectlPath}`, { args });\n const execEnv = Object.assign({}, process.env);\n const httpsProxy = (_a = this.cluster.preferences) === null || _a === void 0 ? void 0 : _a.httpsProxy;\n if (httpsProxy) {\n execEnv.HTTPS_PROXY = httpsProxy;\n }\n try {\n await fs_extra__WEBPACK_IMPORTED_MODULE_1___default.a.writeFile(fileName, content);\n const { stdout } = await Object(_common_utils_promise_exec__WEBPACK_IMPORTED_MODULE_8__[\"promiseExecFile\"])(kubectlPath, args);\n return stdout;\n }\n catch (error) {\n throw (_b = error === null || error === void 0 ? void 0 : error.stderr) !== null && _b !== void 0 ? _b : error;\n }\n finally {\n await fs_extra__WEBPACK_IMPORTED_MODULE_1___default.a.unlink(fileName);\n }\n }\n async kubectlApplyAll(resources, extraArgs = [\"-o\", \"json\"]) {\n return this.kubectlCmdAll(\"apply\", resources, extraArgs);\n }\n async kubectlDeleteAll(resources, extraArgs) {\n return this.kubectlCmdAll(\"delete\", resources, extraArgs);\n }\n async kubectlCmdAll(subCmd, resources, args = []) {\n const kubectl = await this.cluster.ensureKubectl();\n const kubectlPath = await kubectl.getPath();\n const proxyKubeconfigPath = await this.cluster.getProxyKubeconfigPath();\n return new Promise((resolve, reject) => {\n const tmpDir = tempy__WEBPACK_IMPORTED_MODULE_4___default.a.directory();\n // Dump each resource into tmpDir\n resources.forEach((resource, index) => {\n fs_extra__WEBPACK_IMPORTED_MODULE_1___default.a.writeFileSync(path__WEBPACK_IMPORTED_MODULE_3___default.a.join(tmpDir, `${index}.yaml`), resource);\n });\n args.push(\"-f\", `\"${tmpDir}\"`);\n const cmd = `\"${kubectlPath}\" ${subCmd} --kubeconfig \"${proxyKubeconfigPath}\" ${args.join(\" \")}`;\n _logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[RESOURCE-APPLIER] running cmd ${cmd}`);\n Object(child_process__WEBPACK_IMPORTED_MODULE_0__[\"exec\"])(cmd, (error, stdout) => {\n if (error) {\n _logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].error(`[RESOURCE-APPLIER] cmd errored: ${error}`);\n const splitError = error.toString().split(`.yaml\": `);\n if (splitError[1]) {\n reject(splitError[1]);\n }\n else {\n reject(error);\n }\n return;\n }\n resolve(stdout);\n });\n });\n }\n sanitizeObject(resource) {\n var _a, _b;\n resource = Object(_common_utils__WEBPACK_IMPORTED_MODULE_7__[\"cloneJsonObject\"])(resource);\n delete resource.status;\n (_a = resource.metadata) === null || _a === void 0 ? true : delete _a.resourceVersion;\n const annotations = (_b = resource.metadata) === null || _b === void 0 ? void 0 : _b.annotations;\n if (annotations) {\n delete annotations[\"kubectl.kubernetes.io/last-applied-configuration\"];\n }\n return resource;\n }\n}\n\n\n//# sourceURL=webpack:///./src/main/resource-applier.ts?");
|
|
40984
40950
|
|
|
40985
40951
|
/***/ }),
|
|
40986
40952
|
|
|
@@ -41028,7 +40994,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
41028
40994
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41029
40995
|
|
|
41030
40996
|
"use strict";
|
|
41031
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * Early store format had the kubeconfig directly under context name, this moves\n * it under the kubeConfig key\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: \"2.0.0-beta.2\",\n run(store) {\n for (const value of store) {\n const contextName = value[0];\n // Looping all the keys gives out the store internal stuff too...\n if (contextName === \"__internal__\" || value[1]
|
|
40997
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * Early store format had the kubeconfig directly under context name, this moves\n * it under the kubeConfig key\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: \"2.0.0-beta.2\",\n run(store) {\n for (const value of store) {\n const contextName = value[0];\n // Looping all the keys gives out the store internal stuff too...\n if (contextName === \"__internal__\" || Object.prototype.hasOwnProperty.call(value[1], \"kubeConfig\"))\n continue;\n store.set(contextName, { kubeConfig: value[1] });\n }\n },\n});\n\n\n//# sourceURL=webpack:///./src/migrations/cluster-store/2.0.0-beta.2.ts?");
|
|
41032
40998
|
|
|
41033
40999
|
/***/ }),
|
|
41034
41000
|
|
|
@@ -41064,7 +41030,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Copyright (c) 2021 Op
|
|
|
41064
41030
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41065
41031
|
|
|
41066
41032
|
"use strict";
|
|
41067
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var js_yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-yaml */ \"./node_modules/js-yaml/dist/js-yaml.mjs\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers */ \"./src/migrations/helpers.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: \"2.6.0-beta.3\",\n run(store) {\n for (const value of store) {\n const clusterKey = value[0];\n if (clusterKey === \"__internal__\")\n continue;\n const cluster = value[1];\n if (!cluster.kubeConfig)\n continue;\n const config = js_yaml__WEBPACK_IMPORTED_MODULE_0__[\"default\"].load(cluster.kubeConfig);\n if (!config || typeof config !== \"object\" || !
|
|
41033
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var js_yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-yaml */ \"./node_modules/js-yaml/dist/js-yaml.mjs\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers */ \"./src/migrations/helpers.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: \"2.6.0-beta.3\",\n run(store) {\n for (const value of store) {\n const clusterKey = value[0];\n if (clusterKey === \"__internal__\")\n continue;\n const cluster = value[1];\n if (!cluster.kubeConfig)\n continue;\n const config = js_yaml__WEBPACK_IMPORTED_MODULE_0__[\"default\"].load(cluster.kubeConfig);\n if (!config || typeof config !== \"object\" || !Object.prototype.hasOwnProperty.call(config, \"users\")) {\n continue;\n }\n const kubeConfig = config;\n const userObj = kubeConfig.users[0];\n if (userObj) {\n const user = userObj.user;\n if (user[\"auth-provider\"] && user[\"auth-provider\"].config) {\n const authConfig = user[\"auth-provider\"].config;\n if (authConfig[\"access-token\"]) {\n authConfig[\"access-token\"] = `${authConfig[\"access-token\"]}`;\n }\n if (authConfig.expiry) {\n authConfig.expiry = `${authConfig.expiry}`;\n }\n Object(_helpers__WEBPACK_IMPORTED_MODULE_1__[\"migrationLog\"])(authConfig);\n user[\"auth-provider\"].config = authConfig;\n kubeConfig.users = [{\n name: userObj.name,\n user,\n }];\n cluster.kubeConfig = js_yaml__WEBPACK_IMPORTED_MODULE_0__[\"default\"].dump(kubeConfig);\n store.set(clusterKey, cluster);\n }\n }\n }\n },\n});\n\n\n//# sourceURL=webpack:///./src/migrations/cluster-store/2.6.0-beta.3.ts?");
|
|
41068
41034
|
|
|
41069
41035
|
/***/ }),
|
|
41070
41036
|
|
|
@@ -41276,23 +41242,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _com
|
|
|
41276
41242
|
/*!*****************************************************!*\
|
|
41277
41243
|
!*** ./src/renderer/api/catalog-entity-registry.ts ***!
|
|
41278
41244
|
\*****************************************************/
|
|
41279
|
-
/*! exports provided: CatalogEntityRegistry, catalogEntityRegistry, getActiveClusterEntity */
|
|
41280
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41281
|
-
|
|
41282
|
-
"use strict";
|
|
41283
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CatalogEntityRegistry\", function() { return CatalogEntityRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"catalogEntityRegistry\", function() { return catalogEntityRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getActiveClusterEntity\", function() { return getActiveClusterEntity; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _common_ipc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var _common_catalog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/catalog */ \"./src/common/catalog/index.ts\");\n/* harmony import */ var _common_catalog_entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/catalog-entities */ \"./src/common/catalog-entities/index.ts\");\n/* harmony import */ var _common_cluster_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/cluster-store */ \"./src/common/cluster-store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _common_logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/logger */ \"./src/common/logger.ts\");\n/* harmony import */ var _catalog_entity__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./catalog-entity */ \"./src/renderer/api/catalog-entity.ts\");\n/* harmony import */ var _common_catalog_catalog_run_event__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/catalog/catalog-run-event */ \"./src/common/catalog/catalog-run-event.ts\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _common_ipc_catalog__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/ipc/catalog */ \"./src/common/ipc/catalog.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\n\n\nclass CatalogEntityRegistry {\n constructor(categoryRegistry) {\n Object.defineProperty(this, \"categoryRegistry\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: categoryRegistry\n });\n Object.defineProperty(this, \"activeEntityId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: undefined\n });\n Object.defineProperty(this, \"_entities\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map([], { deep: true })\n });\n Object.defineProperty(this, \"filters\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].set([], {\n deep: false,\n })\n });\n Object.defineProperty(this, \"onBeforeRunHooks\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].set([], {\n deep: false,\n })\n });\n /**\n * Buffer for keeping entities that don't yet have CatalogCategory synced\n */\n Object.defineProperty(this, \"rawEntities\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n }\n get activeEntity() {\n return this._entities.get(this.activeEntityId) || null;\n }\n set activeEntity(raw) {\n if (raw) {\n const id = typeof raw === \"string\"\n ? raw\n : raw.getId();\n this.activeEntityId = id;\n }\n else {\n this.activeEntityId = undefined;\n }\n }\n init() {\n Object(_common_ipc__WEBPACK_IMPORTED_MODULE_1__[\"ipcRendererOn\"])(_common_ipc_catalog__WEBPACK_IMPORTED_MODULE_11__[\"CatalogIpcEvents\"].ITEMS, (event, items) => {\n this.updateItems(items);\n });\n // Make sure that we get items ASAP and not the next time one of them changes\n electron__WEBPACK_IMPORTED_MODULE_10__[\"ipcRenderer\"].send(_common_ipc_catalog__WEBPACK_IMPORTED_MODULE_11__[\"CatalogIpcEvents\"].INIT);\n }\n updateItems(items) {\n this.rawEntities.length = 0;\n const newIds = new Set(items.map((item) => item.metadata.uid));\n for (const uid of this._entities.keys()) {\n if (!newIds.has(uid)) {\n this._entities.delete(uid);\n }\n }\n for (const item of items) {\n this.updateItem(item);\n }\n }\n updateItem(item) {\n const existing = this._entities.get(item.metadata.uid);\n if (!existing) {\n const entity = this.categoryRegistry.getEntityForData(item);\n if (entity) {\n this._entities.set(entity.metadata.uid, entity);\n }\n else {\n this.rawEntities.push(item);\n }\n }\n else {\n existing.metadata = item.metadata;\n existing.spec = item.spec;\n existing.status = item.status;\n }\n }\n processRawEntities() {\n const items = [...this.rawEntities];\n this.rawEntities.length = 0;\n for (const item of items) {\n this.updateItem(item);\n }\n }\n get items() {\n this.processRawEntities();\n return Array.from(this._entities.values());\n }\n get filteredItems() {\n return Array.from(_utils__WEBPACK_IMPORTED_MODULE_5__[\"iter\"].reduce(this.filters, _utils__WEBPACK_IMPORTED_MODULE_5__[\"iter\"].filter, this.items.values()));\n }\n get entities() {\n return new Map(this.items.map(entity => [entity.getId(), entity]));\n }\n get filteredEntities() {\n return new Map(this.filteredItems.map(entity => [entity.getId(), entity]));\n }\n getById(id) {\n return this.entities.get(id);\n }\n getItemsForApiKind(apiVersion, kind, { filtered = false } = {}) {\n const byApiKind = (item) => item.apiVersion === apiVersion && item.kind === kind;\n const entities = filtered ? this.filteredItems : this.items;\n return entities.filter(byApiKind);\n }\n getItemsForCategory(category, { filtered = false } = {}) {\n const supportedVersions = new Set(category.spec.versions.map((v) => `${category.spec.group}/${v.name}`));\n const byApiVersionKind = (item) => supportedVersions.has(item.apiVersion) && item.kind === category.spec.names.kind;\n const entities = filtered ? this.filteredItems : this.items;\n return entities.filter(byApiVersionKind);\n }\n /**\n * Add a new filter to the set of item filters\n * @param fn The function that should return a truthy value if that entity should be sent currently \"active\"\n * @returns A function to remove that filter\n */\n addCatalogFilter(fn) {\n this.filters.add(fn);\n return Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"once\"])(() => void this.filters.delete(fn));\n }\n /**\n * Add a onBeforeRun hook. If `onBeforeRun` was previously added then it will not be added again\n * @param onBeforeRun The function that should return a boolean if the onRun of catalog entity should be triggered.\n * @returns A function to remove that hook\n */\n addOnBeforeRun(onBeforeRun) {\n this.onBeforeRunHooks.add(onBeforeRun);\n return Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"once\"])(() => void this.onBeforeRunHooks.delete(onBeforeRun));\n }\n /**\n * Runs all the registered `onBeforeRun` hooks, short circuiting on the first event that's preventDefaulted\n * @param entity The entity to run the hooks on\n * @returns Whether the entities `onRun` method should be executed\n */\n async onBeforeRun(entity) {\n _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].debug(`[CATALOG-ENTITY-REGISTRY]: run onBeforeRun on ${entity.getId()}`);\n const runEvent = new _common_catalog_catalog_run_event__WEBPACK_IMPORTED_MODULE_9__[\"CatalogRunEvent\"]({ target: entity });\n for (const onBeforeRun of this.onBeforeRunHooks) {\n try {\n await onBeforeRun(runEvent);\n }\n catch (error) {\n _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].warn(`[CATALOG-ENTITY-REGISTRY]: entity ${entity.getId()} onBeforeRun threw an error`, error);\n }\n if (runEvent.defaultPrevented) {\n return false;\n }\n }\n return true;\n }\n /**\n * Perform the onBeforeRun check and, if successful, then proceed to call `entity`'s onRun method\n * @param entity The instance to invoke the hooks and then execute the onRun\n */\n onRun(entity) {\n this.onBeforeRun(entity)\n .then(doOnRun => {\n var _a;\n if (doOnRun) {\n return (_a = entity.onRun) === null || _a === void 0 ? void 0 : _a.call(entity, _catalog_entity__WEBPACK_IMPORTED_MODULE_8__[\"catalogEntityRunContext\"]);\n }\n else {\n _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].debug(`onBeforeRun for ${entity.getId()} returned false`);\n }\n })\n .catch(error => _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].error(`[CATALOG-ENTITY-REGISTRY]: entity ${entity.getId()} onRun threw an error`, error));\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"],\n __metadata(\"design:type\", String)\n], CatalogEntityRegistry.prototype, \"activeEntityId\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Array]),\n __metadata(\"design:returntype\", void 0)\n], CatalogEntityRegistry.prototype, \"updateItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], CatalogEntityRegistry.prototype, \"updateItem\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"items\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"filteredItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Map),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"entities\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Map),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"filteredEntities\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function]),\n __metadata(\"design:returntype\", Function)\n], CatalogEntityRegistry.prototype, \"addCatalogFilter\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function]),\n __metadata(\"design:returntype\", Function)\n], CatalogEntityRegistry.prototype, \"addOnBeforeRun\", null);\nconst catalogEntityRegistry = new CatalogEntityRegistry(_common_catalog__WEBPACK_IMPORTED_MODULE_2__[\"catalogCategoryRegistry\"]);\nfunction getActiveClusterEntity() {\n var _a;\n return _common_cluster_store__WEBPACK_IMPORTED_MODULE_4__[\"ClusterStore\"].getInstance().getById((_a = catalogEntityRegistry.activeEntity) === null || _a === void 0 ? void 0 : _a.getId());\n}\n\n\n//# sourceURL=webpack:///./src/renderer/api/catalog-entity-registry.ts?");
|
|
41284
|
-
|
|
41285
|
-
/***/ }),
|
|
41286
|
-
|
|
41287
|
-
/***/ "./src/renderer/api/catalog-entity.ts":
|
|
41288
|
-
/*!********************************************!*\
|
|
41289
|
-
!*** ./src/renderer/api/catalog-entity.ts ***!
|
|
41290
|
-
\********************************************/
|
|
41291
|
-
/*! exports provided: CatalogCategory, CatalogEntity, catalogEntityRunContext */
|
|
41245
|
+
/*! exports provided: catalogEntityRunContext, CatalogEntityRegistry, catalogEntityRegistry, getActiveClusterEntity */
|
|
41292
41246
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41293
41247
|
|
|
41294
41248
|
"use strict";
|
|
41295
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"catalogEntityRunContext\", function() { return catalogEntityRunContext; });\n/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../navigation */ \"./src/renderer/navigation/index.ts\");\n/* harmony import */ var _catalog_entity_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./catalog-entity-registry */ \"./src/renderer/api/catalog-entity-registry.ts\");\n/* harmony import */ var _common_catalog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/catalog */ \"./src/common/catalog/index.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CatalogCategory\", function() { return _common_catalog__WEBPACK_IMPORTED_MODULE_2__[\"CatalogCategory\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CatalogEntity\", function() { return _common_catalog__WEBPACK_IMPORTED_MODULE_2__[\"CatalogEntity\"]; });\n\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\nconst catalogEntityRunContext = {\n navigate: (url) => Object(_navigation__WEBPACK_IMPORTED_MODULE_0__[\"navigate\"])(url),\n setCommandPaletteContext: (entity) => {\n _catalog_entity_registry__WEBPACK_IMPORTED_MODULE_1__[\"catalogEntityRegistry\"].activeEntity = entity;\n },\n};\n\n\n//# sourceURL=webpack:///./src/renderer/api/catalog-entity.ts?");
|
|
41249
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"catalogEntityRunContext\", function() { return catalogEntityRunContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CatalogEntityRegistry\", function() { return CatalogEntityRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"catalogEntityRegistry\", function() { return catalogEntityRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getActiveClusterEntity\", function() { return getActiveClusterEntity; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _common_ipc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var _common_catalog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/catalog */ \"./src/common/catalog/index.ts\");\n/* harmony import */ var _common_catalog_entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/catalog-entities */ \"./src/common/catalog-entities/index.ts\");\n/* harmony import */ var _common_cluster_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/cluster-store */ \"./src/common/cluster-store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _common_logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/logger */ \"./src/common/logger.ts\");\n/* harmony import */ var _common_catalog_catalog_run_event__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/catalog/catalog-run-event */ \"./src/common/catalog/catalog-run-event.ts\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _common_ipc_catalog__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/ipc/catalog */ \"./src/common/ipc/catalog.ts\");\n/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../navigation */ \"./src/renderer/navigation/index.ts\");\n/* harmony import */ var process__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! process */ \"process\");\n/* harmony import */ var process__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(process__WEBPACK_IMPORTED_MODULE_12__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst catalogEntityRunContext = {\n navigate: (url) => Object(_navigation__WEBPACK_IMPORTED_MODULE_11__[\"navigate\"])(url),\n setCommandPaletteContext: (entity) => {\n catalogEntityRegistry.activeEntity = entity;\n },\n};\nclass CatalogEntityRegistry {\n constructor(categoryRegistry) {\n Object.defineProperty(this, \"categoryRegistry\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: categoryRegistry\n });\n Object.defineProperty(this, \"activeEntityId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: undefined\n });\n Object.defineProperty(this, \"_entities\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map([], { deep: true })\n });\n Object.defineProperty(this, \"filters\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].set([], {\n deep: false,\n })\n });\n Object.defineProperty(this, \"onBeforeRunHooks\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].set([], {\n deep: false,\n })\n });\n /**\n * Buffer for keeping entities that don't yet have CatalogCategory synced\n */\n Object.defineProperty(this, \"rawEntities\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n }\n get activeEntity() {\n return this._entities.get(this.activeEntityId) || null;\n }\n set activeEntity(raw) {\n if (raw) {\n const id = typeof raw === \"string\"\n ? raw\n : raw.getId();\n this.activeEntityId = id;\n }\n else {\n this.activeEntityId = undefined;\n }\n }\n init() {\n Object(_common_ipc__WEBPACK_IMPORTED_MODULE_1__[\"ipcRendererOn\"])(_common_ipc_catalog__WEBPACK_IMPORTED_MODULE_10__[\"CatalogIpcEvents\"].ITEMS, (event, items) => {\n this.updateItems(items);\n });\n // Make sure that we get items ASAP and not the next time one of them changes\n electron__WEBPACK_IMPORTED_MODULE_9__[\"ipcRenderer\"].send(_common_ipc_catalog__WEBPACK_IMPORTED_MODULE_10__[\"CatalogIpcEvents\"].INIT);\n if (process__WEBPACK_IMPORTED_MODULE_12__[\"isMainFrame\"]) {\n Object(_common_ipc__WEBPACK_IMPORTED_MODULE_1__[\"ipcRendererOn\"])(_common_ipc__WEBPACK_IMPORTED_MODULE_1__[\"catalogEntityRunListener\"], (event, id) => {\n const entity = this.getById(id);\n if (entity) {\n this.onRun(entity);\n }\n });\n }\n }\n updateItems(items) {\n this.rawEntities.length = 0;\n const newIds = new Set(items.map((item) => item.metadata.uid));\n for (const uid of this._entities.keys()) {\n if (!newIds.has(uid)) {\n this._entities.delete(uid);\n }\n }\n for (const item of items) {\n this.updateItem(item);\n }\n }\n updateItem(item) {\n const existing = this._entities.get(item.metadata.uid);\n if (!existing) {\n const entity = this.categoryRegistry.getEntityForData(item);\n if (entity) {\n this._entities.set(entity.metadata.uid, entity);\n }\n else {\n this.rawEntities.push(item);\n }\n }\n else {\n existing.metadata = item.metadata;\n existing.spec = item.spec;\n existing.status = item.status;\n }\n }\n processRawEntities() {\n const items = [...this.rawEntities];\n this.rawEntities.length = 0;\n for (const item of items) {\n this.updateItem(item);\n }\n }\n get items() {\n this.processRawEntities();\n return Array.from(this._entities.values());\n }\n get filteredItems() {\n return Array.from(_utils__WEBPACK_IMPORTED_MODULE_5__[\"iter\"].reduce(this.filters, _utils__WEBPACK_IMPORTED_MODULE_5__[\"iter\"].filter, this.items.values()));\n }\n get entities() {\n return new Map(this.items.map(entity => [entity.getId(), entity]));\n }\n get filteredEntities() {\n return new Map(this.filteredItems.map(entity => [entity.getId(), entity]));\n }\n getById(id) {\n return this.entities.get(id);\n }\n getItemsForApiKind(apiVersion, kind, { filtered = false } = {}) {\n const byApiKind = (item) => item.apiVersion === apiVersion && item.kind === kind;\n const entities = filtered ? this.filteredItems : this.items;\n return entities.filter(byApiKind);\n }\n getItemsForCategory(category, { filtered = false } = {}) {\n const supportedVersions = new Set(category.spec.versions.map((v) => `${category.spec.group}/${v.name}`));\n const byApiVersionKind = (item) => supportedVersions.has(item.apiVersion) && item.kind === category.spec.names.kind;\n const entities = filtered ? this.filteredItems : this.items;\n return entities.filter(byApiVersionKind);\n }\n /**\n * Add a new filter to the set of item filters\n * @param fn The function that should return a truthy value if that entity should be sent currently \"active\"\n * @returns A function to remove that filter\n */\n addCatalogFilter(fn) {\n this.filters.add(fn);\n return Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"once\"])(() => void this.filters.delete(fn));\n }\n /**\n * Add a onBeforeRun hook. If `onBeforeRun` was previously added then it will not be added again\n * @param onBeforeRun The function that should return a boolean if the onRun of catalog entity should be triggered.\n * @returns A function to remove that hook\n */\n addOnBeforeRun(onBeforeRun) {\n this.onBeforeRunHooks.add(onBeforeRun);\n return Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"once\"])(() => void this.onBeforeRunHooks.delete(onBeforeRun));\n }\n /**\n * Runs all the registered `onBeforeRun` hooks, short circuiting on the first event that's preventDefaulted\n * @param entity The entity to run the hooks on\n * @returns Whether the entities `onRun` method should be executed\n */\n async onBeforeRun(entity) {\n _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].debug(`[CATALOG-ENTITY-REGISTRY]: run onBeforeRun on ${entity.getId()}`);\n const runEvent = new _common_catalog_catalog_run_event__WEBPACK_IMPORTED_MODULE_8__[\"CatalogRunEvent\"]({ target: entity });\n for (const onBeforeRun of this.onBeforeRunHooks) {\n try {\n await onBeforeRun(runEvent);\n }\n catch (error) {\n _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].warn(`[CATALOG-ENTITY-REGISTRY]: entity ${entity.getId()} onBeforeRun threw an error`, error);\n }\n if (runEvent.defaultPrevented) {\n return false;\n }\n }\n return true;\n }\n /**\n * Perform the onBeforeRun check and, if successful, then proceed to call `entity`'s onRun method\n * @param entity The instance to invoke the hooks and then execute the onRun\n */\n onRun(entity) {\n this.onBeforeRun(entity)\n .then(doOnRun => {\n var _a;\n if (doOnRun) {\n return (_a = entity.onRun) === null || _a === void 0 ? void 0 : _a.call(entity, catalogEntityRunContext);\n }\n else {\n _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].debug(`onBeforeRun for ${entity.getId()} returned false`);\n }\n })\n .catch(error => _common_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].error(`[CATALOG-ENTITY-REGISTRY]: entity ${entity.getId()} onRun threw an error`, error));\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"],\n __metadata(\"design:type\", String)\n], CatalogEntityRegistry.prototype, \"activeEntityId\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Array]),\n __metadata(\"design:returntype\", void 0)\n], CatalogEntityRegistry.prototype, \"updateItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], CatalogEntityRegistry.prototype, \"updateItem\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"items\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"filteredItems\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Map),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"entities\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Map),\n __metadata(\"design:paramtypes\", [])\n], CatalogEntityRegistry.prototype, \"filteredEntities\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function]),\n __metadata(\"design:returntype\", Function)\n], CatalogEntityRegistry.prototype, \"addCatalogFilter\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function]),\n __metadata(\"design:returntype\", Function)\n], CatalogEntityRegistry.prototype, \"addOnBeforeRun\", null);\nconst catalogEntityRegistry = new CatalogEntityRegistry(_common_catalog__WEBPACK_IMPORTED_MODULE_2__[\"catalogCategoryRegistry\"]);\nfunction getActiveClusterEntity() {\n var _a;\n return _common_cluster_store__WEBPACK_IMPORTED_MODULE_4__[\"ClusterStore\"].getInstance().getById((_a = catalogEntityRegistry.activeEntity) === null || _a === void 0 ? void 0 : _a.getId());\n}\n\n\n//# sourceURL=webpack:///./src/renderer/api/catalog-entity-registry.ts?");
|
|
41296
41250
|
|
|
41297
41251
|
/***/ }),
|
|
41298
41252
|
|
|
@@ -41448,7 +41402,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
41448
41402
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41449
41403
|
|
|
41450
41404
|
"use strict";
|
|
41451
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CRDStore\", function() { return CRDStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"crdStore\", function() { return crdStore; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object.store */ \"./src/common/k8s-api/kube-object.store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_k8s_api_endpoints_crd_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/k8s-api/endpoints/crd.api */ \"./src/common/k8s-api/endpoints/crd.api.ts\");\n/* harmony import */ var _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/* harmony import */ var _common_k8s_api_kube_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/k8s-api/kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _crd_resource_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./crd-resource.store */ \"./src/renderer/components/+custom-resources/crd-resource.store.ts\");\n/* harmony import */ var _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\nfunction initStore(crd) {\n var _a;\n var _b;\n const objectConstructor = (_b = class extends _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"] {\n },\n Object.defineProperty(_b, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: crd.getResourceKind()\n }),\n Object.defineProperty(_b, \"namespaced\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: crd.isNamespaced()\n }),\n Object.defineProperty(_b, \"apiBase\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: crd.getResourceApiBase()\n }),\n _b);\n const api = (_a = _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].getApi(objectConstructor.apiBase)) !== null && _a !== void 0 ? _a : new _common_k8s_api_kube_api__WEBPACK_IMPORTED_MODULE_5__[\"KubeApi\"]({ objectConstructor });\n if (!_common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].getStore(api)) {\n _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerStore(new _crd_resource_store__WEBPACK_IMPORTED_MODULE_6__[\"CRDResourceStore\"](api));\n }\n}\nclass CRDStore extends _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_1__[\"KubeObjectStore\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: _common_k8s_api_endpoints_crd_api__WEBPACK_IMPORTED_MODULE_3__[\"crdApi\"]\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"autoBind\"])(this);\n // auto-init stores for crd-s\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.getItems(), items => items.forEach(initStore));\n }\n sortItems(items) {\n return super.sortItems(items, [\n crd => crd.getGroup(),\n crd => crd.getName(),\n ]);\n }\n get groups() {\n const groups = {};\n
|
|
41405
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CRDStore\", function() { return CRDStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"crdStore\", function() { return crdStore; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object.store */ \"./src/common/k8s-api/kube-object.store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_k8s_api_endpoints_crd_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/k8s-api/endpoints/crd.api */ \"./src/common/k8s-api/endpoints/crd.api.ts\");\n/* harmony import */ var _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/* harmony import */ var _common_k8s_api_kube_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/k8s-api/kube-api */ \"./src/common/k8s-api/kube-api.ts\");\n/* harmony import */ var _crd_resource_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./crd-resource.store */ \"./src/renderer/components/+custom-resources/crd-resource.store.ts\");\n/* harmony import */ var _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\nfunction initStore(crd) {\n var _a;\n var _b;\n const objectConstructor = (_b = class extends _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_7__[\"KubeObject\"] {\n },\n Object.defineProperty(_b, \"kind\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: crd.getResourceKind()\n }),\n Object.defineProperty(_b, \"namespaced\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: crd.isNamespaced()\n }),\n Object.defineProperty(_b, \"apiBase\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: crd.getResourceApiBase()\n }),\n _b);\n const api = (_a = _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].getApi(objectConstructor.apiBase)) !== null && _a !== void 0 ? _a : new _common_k8s_api_kube_api__WEBPACK_IMPORTED_MODULE_5__[\"KubeApi\"]({ objectConstructor });\n if (!_common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].getStore(api)) {\n _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerStore(new _crd_resource_store__WEBPACK_IMPORTED_MODULE_6__[\"CRDResourceStore\"](api));\n }\n}\nclass CRDStore extends _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_1__[\"KubeObjectStore\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: _common_k8s_api_endpoints_crd_api__WEBPACK_IMPORTED_MODULE_3__[\"crdApi\"]\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"autoBind\"])(this);\n // auto-init stores for crd-s\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.getItems(), items => items.forEach(initStore));\n }\n sortItems(items) {\n return super.sortItems(items, [\n crd => crd.getGroup(),\n crd => crd.getName(),\n ]);\n }\n get groups() {\n var _a;\n var _b;\n const groups = {};\n for (const crd of this.items) {\n ((_a = groups[_b = crd.getGroup()]) !== null && _a !== void 0 ? _a : (groups[_b] = [])).push(crd);\n }\n return groups;\n }\n getByGroup(group, pluralName) {\n var _a;\n return (_a = this.groups[group]) === null || _a === void 0 ? void 0 : _a.find(crd => crd.getPluralName() === pluralName);\n }\n getByObject(obj) {\n if (!obj)\n return null;\n const { kind, apiVersion } = obj;\n return this.items.find(crd => (kind === crd.getResourceKind() && apiVersion === `${crd.getGroup()}/${crd.getVersion()}`));\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], CRDStore.prototype, \"groups\", null);\nconst crdStore = new CRDStore();\n_common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerStore(crdStore);\n\n\n//# sourceURL=webpack:///./src/renderer/components/+custom-resources/crd.store.ts?");
|
|
41452
41406
|
|
|
41453
41407
|
/***/ }),
|
|
41454
41408
|
|
|
@@ -41848,63 +41802,15 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _che
|
|
|
41848
41802
|
|
|
41849
41803
|
/***/ }),
|
|
41850
41804
|
|
|
41851
|
-
/***/ "./src/renderer/components/command-palette/command-
|
|
41852
|
-
|
|
41853
|
-
!*** ./src/renderer/components/command-palette/command-
|
|
41854
|
-
|
|
41855
|
-
/*! exports provided: default */
|
|
41856
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41857
|
-
|
|
41858
|
-
"use strict";
|
|
41859
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_node_modules_postcss_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_ref_7_3_command_container_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/postcss-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js??ref--7-3!./command-container.scss */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js?!./src/renderer/components/command-palette/command-container.scss\");\n\n \n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_node_modules_postcss_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_ref_7_3_command_container_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"], options);\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_node_modules_css_loader_dist_cjs_js_node_modules_postcss_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_ref_7_3_command_container_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"].locals || {});\n\n//# sourceURL=webpack:///./src/renderer/components/command-palette/command-container.scss?");
|
|
41860
|
-
|
|
41861
|
-
/***/ }),
|
|
41862
|
-
|
|
41863
|
-
/***/ "./src/renderer/components/command-palette/command-container.tsx":
|
|
41864
|
-
/*!***********************************************************************!*\
|
|
41865
|
-
!*** ./src/renderer/components/command-palette/command-container.tsx ***!
|
|
41866
|
-
\***********************************************************************/
|
|
41867
|
-
/*! exports provided: CommandContainer */
|
|
41868
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41869
|
-
|
|
41870
|
-
"use strict";
|
|
41871
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommandContainer\", function() { return CommandContainer; });\n/* harmony import */ var _command_container_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command-container.scss */ \"./src/renderer/components/command-palette/command-container.scss\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dialog */ \"./src/renderer/components/dialog/index.ts\");\n/* harmony import */ var _common_ipc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var _command_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command-dialog */ \"./src/renderer/components/command-palette/command-dialog.tsx\");\n/* harmony import */ var _api_catalog_entity_registry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../api/catalog-entity-registry */ \"./src/renderer/api/catalog-entity-registry.ts\");\n/* harmony import */ var _extensions_registries_command_registry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../extensions/registries/command-registry */ \"./src/extensions/registries/command-registry.ts\");\n/* harmony import */ var _command_overlay__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./command-overlay */ \"./src/renderer/components/command-palette/command-overlay.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n\n\n\n\n\n\n\n\nlet CommandContainer = class CommandContainer extends react__WEBPACK_IMPORTED_MODULE_2___default.a.Component {\n escHandler(event) {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n _command_overlay__WEBPACK_IMPORTED_MODULE_8__[\"CommandOverlay\"].close();\n }\n }\n findCommandById(commandId) {\n return _extensions_registries_command_registry__WEBPACK_IMPORTED_MODULE_7__[\"CommandRegistry\"].getInstance().getItems().find((command) => command.id === commandId);\n }\n runCommand(command) {\n command.action({\n entity: _api_catalog_entity_registry__WEBPACK_IMPORTED_MODULE_6__[\"catalogEntityRegistry\"].activeEntity,\n });\n }\n componentDidMount() {\n if (this.props.clusterId) {\n Object(_common_ipc__WEBPACK_IMPORTED_MODULE_4__[\"ipcRendererOn\"])(`command-palette:run-action:${this.props.clusterId}`, (event, commandId) => {\n const command = this.findCommandById(commandId);\n if (command) {\n this.runCommand(command);\n }\n });\n }\n else {\n Object(_common_ipc__WEBPACK_IMPORTED_MODULE_4__[\"ipcRendererOn\"])(\"command-palette:open\", () => {\n _command_overlay__WEBPACK_IMPORTED_MODULE_8__[\"CommandOverlay\"].open(react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_command_dialog__WEBPACK_IMPORTED_MODULE_5__[\"CommandDialog\"], null));\n });\n }\n window.addEventListener(\"keyup\", (e) => this.escHandler(e), true);\n }\n render() {\n return (react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_dialog__WEBPACK_IMPORTED_MODULE_3__[\"Dialog\"], { isOpen: _command_overlay__WEBPACK_IMPORTED_MODULE_8__[\"CommandOverlay\"].isOpen, animated: true, onClose: _command_overlay__WEBPACK_IMPORTED_MODULE_8__[\"CommandOverlay\"].close, modal: false },\n react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(\"div\", { id: \"command-container\" }, _command_overlay__WEBPACK_IMPORTED_MODULE_8__[\"CommandOverlay\"].component)));\n }\n};\nCommandContainer = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_1__[\"observer\"]\n], CommandContainer);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/command-palette/command-container.tsx?");
|
|
41872
|
-
|
|
41873
|
-
/***/ }),
|
|
41874
|
-
|
|
41875
|
-
/***/ "./src/renderer/components/command-palette/command-dialog.tsx":
|
|
41876
|
-
/*!********************************************************************!*\
|
|
41877
|
-
!*** ./src/renderer/components/command-palette/command-dialog.tsx ***!
|
|
41878
|
-
\********************************************************************/
|
|
41879
|
-
/*! exports provided: CommandDialog */
|
|
41880
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41881
|
-
|
|
41882
|
-
"use strict";
|
|
41883
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommandDialog\", function() { return CommandDialog; });\n/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../select */ \"./src/renderer/components/select/index.ts\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _extensions_registries_command_registry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../extensions/registries/command-registry */ \"./src/extensions/registries/command-registry.ts\");\n/* harmony import */ var _command_overlay__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command-overlay */ \"./src/renderer/components/command-palette/command-overlay.ts\");\n/* harmony import */ var _common_ipc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../navigation */ \"./src/renderer/navigation/index.ts\");\n/* harmony import */ var _api_catalog_entity_registry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../api/catalog-entity-registry */ \"./src/renderer/api/catalog-entity-registry.ts\");\n/* harmony import */ var _common_routes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/routes */ \"./src/common/routes/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\nlet CommandDialog = class CommandDialog extends react__WEBPACK_IMPORTED_MODULE_3___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"menuIsOpen\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n });\n Object.defineProperty(this, \"searchValue\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: undefined\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"makeObservable\"])(this);\n }\n get activeEntity() {\n return _api_catalog_entity_registry__WEBPACK_IMPORTED_MODULE_8__[\"catalogEntityRegistry\"].activeEntity;\n }\n get options() {\n const registry = _extensions_registries_command_registry__WEBPACK_IMPORTED_MODULE_4__[\"CommandRegistry\"].getInstance();\n const context = {\n entity: this.activeEntity,\n };\n return registry.getItems().filter((command) => {\n var _a, _b;\n if (command.scope === \"entity\" && !this.activeEntity) {\n return false;\n }\n try {\n return (_b = (_a = command.isActive) === null || _a === void 0 ? void 0 : _a.call(command, context)) !== null && _b !== void 0 ? _b : true;\n }\n catch (e) {\n console.error(e);\n }\n return false;\n })\n .map((command) => ({\n value: command.id,\n label: command.title,\n }))\n .sort((a, b) => a.label > b.label ? 1 : -1);\n }\n onChange(value) {\n const registry = _extensions_registries_command_registry__WEBPACK_IMPORTED_MODULE_4__[\"CommandRegistry\"].getInstance();\n const command = registry.getItems().find((cmd) => cmd.id === value);\n if (!command) {\n return;\n }\n try {\n _command_overlay__WEBPACK_IMPORTED_MODULE_5__[\"CommandOverlay\"].close();\n if (command.scope === \"global\") {\n command.action({\n entity: this.activeEntity,\n });\n }\n else if (this.activeEntity) {\n Object(_navigation__WEBPACK_IMPORTED_MODULE_7__[\"navigate\"])(Object(_common_routes__WEBPACK_IMPORTED_MODULE_9__[\"clusterViewURL\"])({\n params: {\n clusterId: this.activeEntity.metadata.uid,\n },\n }));\n Object(_common_ipc__WEBPACK_IMPORTED_MODULE_6__[\"broadcastMessage\"])(`command-palette:run-action:${this.activeEntity.metadata.uid}`, command.id);\n }\n }\n catch (error) {\n console.error(\"[COMMAND-DIALOG] failed to execute command\", command.id, error);\n }\n }\n render() {\n return (react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_select__WEBPACK_IMPORTED_MODULE_0__[\"Select\"], { menuPortalTarget: null, onChange: v => this.onChange(v.value), components: {\n DropdownIndicator: null,\n IndicatorSeparator: null,\n }, menuIsOpen: this.menuIsOpen, options: this.options, autoFocus: true, escapeClearsValue: false, \"data-test-id\": \"command-palette-search\", placeholder: \"Type a command or search\\u2026\", onInputChange: (newValue, { action }) => {\n if (action === \"input-change\") {\n this.searchValue = newValue;\n }\n }, inputValue: this.searchValue }));\n }\n};\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"],\n __metadata(\"design:type\", Object)\n], CommandDialog.prototype, \"menuIsOpen\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"],\n __metadata(\"design:type\", Object)\n], CommandDialog.prototype, \"searchValue\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"computed\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [])\n], CommandDialog.prototype, \"activeEntity\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], CommandDialog.prototype, \"options\", null);\nCommandDialog = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], CommandDialog);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/command-palette/command-dialog.tsx?");
|
|
41884
|
-
|
|
41885
|
-
/***/ }),
|
|
41886
|
-
|
|
41887
|
-
/***/ "./src/renderer/components/command-palette/command-overlay.ts":
|
|
41888
|
-
/*!********************************************************************!*\
|
|
41889
|
-
!*** ./src/renderer/components/command-palette/command-overlay.ts ***!
|
|
41890
|
-
\********************************************************************/
|
|
41891
|
-
/*! exports provided: CommandOverlay */
|
|
41892
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41893
|
-
|
|
41894
|
-
"use strict";
|
|
41895
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommandOverlay\", function() { return CommandOverlay; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _a, _CommandOverlay_component;\n\n\nclass CommandOverlay {\n static get isOpen() {\n return Boolean(__classPrivateFieldGet(CommandOverlay, _a, \"f\", _CommandOverlay_component).get());\n }\n static open(component) {\n if (!react__WEBPACK_IMPORTED_MODULE_1___default.a.isValidElement(component)) {\n throw new TypeError(\"CommandOverlay.open must be passed a valid ReactElement\");\n }\n __classPrivateFieldGet(CommandOverlay, _a, \"f\", _CommandOverlay_component).set(component);\n }\n static close() {\n __classPrivateFieldGet(CommandOverlay, _a, \"f\", _CommandOverlay_component).set(null);\n }\n static get component() {\n return __classPrivateFieldGet(CommandOverlay, _a, \"f\", _CommandOverlay_component).get();\n }\n}\n_a = CommandOverlay;\n_CommandOverlay_component = { value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].box(null, { deep: false }) };\n\n\n//# sourceURL=webpack:///./src/renderer/components/command-palette/command-overlay.ts?");
|
|
41896
|
-
|
|
41897
|
-
/***/ }),
|
|
41898
|
-
|
|
41899
|
-
/***/ "./src/renderer/components/command-palette/index.ts":
|
|
41900
|
-
/*!**********************************************************!*\
|
|
41901
|
-
!*** ./src/renderer/components/command-palette/index.ts ***!
|
|
41902
|
-
\**********************************************************/
|
|
41903
|
-
/*! exports provided: CommandContainer, CommandDialog, CommandOverlay */
|
|
41805
|
+
/***/ "./src/renderer/components/command-palette/command-overlay.injectable.ts":
|
|
41806
|
+
/*!*******************************************************************************!*\
|
|
41807
|
+
!*** ./src/renderer/components/command-palette/command-overlay.injectable.ts ***!
|
|
41808
|
+
\*******************************************************************************/
|
|
41809
|
+
/*! exports provided: CommandOverlay, default */
|
|
41904
41810
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
41905
41811
|
|
|
41906
41812
|
"use strict";
|
|
41907
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony
|
|
41813
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommandOverlay\", function() { return CommandOverlay; });\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ogre-tools/injectable */ \"./node_modules/@ogre-tools/injectable/build/index.js\");\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CommandOverlay_component;\n\n\n\nclass CommandOverlay {\n constructor() {\n _CommandOverlay_component.set(this, mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"].box(null, { deep: false }));\n Object.defineProperty(this, \"open\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (component) => {\n if (!react__WEBPACK_IMPORTED_MODULE_2___default.a.isValidElement(component)) {\n throw new TypeError(\"CommandOverlay.open must be passed a valid ReactElement\");\n }\n __classPrivateFieldGet(this, _CommandOverlay_component, \"f\").set(component);\n }\n });\n Object.defineProperty(this, \"close\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n __classPrivateFieldGet(this, _CommandOverlay_component, \"f\").set(null);\n }\n });\n }\n get isOpen() {\n return Boolean(__classPrivateFieldGet(this, _CommandOverlay_component, \"f\").get());\n }\n get component() {\n return __classPrivateFieldGet(this, _CommandOverlay_component, \"f\").get();\n }\n}\n_CommandOverlay_component = new WeakMap();\nconst commandOverlayInjectable = Object(_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__[\"getInjectable\"])({\n instantiate: () => new CommandOverlay(),\n lifecycle: _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__[\"lifecycleEnum\"].singleton,\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (commandOverlayInjectable);\n\n\n//# sourceURL=webpack:///./src/renderer/components/command-palette/command-overlay.injectable.ts?");
|
|
41908
41814
|
|
|
41909
41815
|
/***/ }),
|
|
41910
41816
|
|
|
@@ -42048,7 +41954,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
42048
41954
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42049
41955
|
|
|
42050
41956
|
"use strict";
|
|
42051
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Terminal\", function() { return Terminal; });\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var xterm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! xterm */ \"./node_modules/xterm/lib/xterm.js\");\n/* harmony import */ var xterm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(xterm__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! xterm-addon-fit */ \"./node_modules/xterm-addon-fit/lib/xterm-addon-fit.js\");\n/* harmony import */ var xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dock_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dock.store */ \"./src/renderer/components/dock/dock.store.ts\");\n/* harmony import */ var _api_terminal_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../api/terminal-api */ \"./src/renderer/api/terminal-api.ts\");\n/* harmony import */ var _theme_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme.store */ \"./src/renderer/theme.store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/vars */ \"./src/common/vars.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _common_logger__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/logger */ \"./src/common/logger.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass Terminal {\n constructor(tabId, api) {\n Object.defineProperty(this, \"tabId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: tabId\n });\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: api\n });\n Object.defineProperty(this, \"xterm\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new xterm__WEBPACK_IMPORTED_MODULE_2__[\"Terminal\"]({\n cursorBlink: true,\n cursorStyle: \"bar\",\n fontSize: 13,\n fontFamily: \"RobotoMono\",\n })\n });\n Object.defineProperty(this, \"fitAddon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3__[\"FitAddon\"]()\n });\n Object.defineProperty(this, \"scrollPos\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 0\n });\n Object.defineProperty(this, \"disposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_7__[\"disposer\"])()\n });\n Object.defineProperty(this, \"fit\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n // Since this function is debounced we need to read this value as late as possible\n if (!this.isActive || !this.xterm) {\n return;\n }\n try {\n this.fitAddon.fit();\n const { cols, rows } = this.xterm;\n this.api.sendTerminalSize(cols, rows);\n }\n catch (error) {\n // see https://github.com/lensapp/lens/issues/1891\n _common_logger__WEBPACK_IMPORTED_MODULE_12__[\"default\"].error(`[TERMINAL]: failed to resize terminal to fit`, error);\n }\n }\n });\n Object.defineProperty(this, \"fitLazy\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(this.fit, 250)\n });\n Object.defineProperty(this, \"focus\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.xterm.focus();\n }\n });\n Object.defineProperty(this, \"onApiData\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (data) => {\n this.xterm.write(data);\n }\n });\n Object.defineProperty(this, \"onData\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (data) => {\n if (!this.api.isReady)\n return;\n this.api.sendMessage({\n type: _api_terminal_api__WEBPACK_IMPORTED_MODULE_5__[\"TerminalChannels\"].STDIN,\n data,\n });\n }\n });\n Object.defineProperty(this, \"onScroll\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.scrollPos = this.viewport.scrollTop;\n }\n });\n Object.defineProperty(this, \"onClear\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.xterm.clear();\n }\n });\n Object.defineProperty(this, \"onResize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.fitLazy();\n this.focus();\n }\n });\n Object.defineProperty(this, \"onActivate\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.fit();\n setTimeout(() => this.focus(), 250); // delay used to prevent focus on active tab\n this.viewport.scrollTop = this.scrollPos; // restore last scroll position\n }\n });\n Object.defineProperty(this, \"onClickLink\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (evt, link) => {\n window.open(link, \"_blank\");\n }\n });\n Object.defineProperty(this, \"onContextMenu\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (\n // don't paste if user hasn't turned on the feature\n _common_user_store__WEBPACK_IMPORTED_MODULE_10__[\"UserStore\"].getInstance().terminalCopyOnSelect\n // don't paste if the clipboard doesn't have text\n && electron__WEBPACK_IMPORTED_MODULE_11__[\"clipboard\"].availableFormats().includes(\"text/plain\")) {\n this.xterm.paste(electron__WEBPACK_IMPORTED_MODULE_11__[\"clipboard\"].readText());\n }\n }\n });\n Object.defineProperty(this, \"onSelectionChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n const selection = this.xterm.getSelection().trim();\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_10__[\"UserStore\"].getInstance().terminalCopyOnSelect && selection) {\n electron__WEBPACK_IMPORTED_MODULE_11__[\"clipboard\"].writeText(selection);\n }\n }\n });\n Object.defineProperty(this, \"keyHandler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (evt) => {\n const { code, ctrlKey, metaKey } = evt;\n // Handle custom hotkey bindings\n if (ctrlKey) {\n switch (code) {\n // Ctrl+C: prevent terminal exit on windows / linux (?)\n case \"KeyC\":\n if (this.xterm.hasSelection())\n return false;\n break;\n // Ctrl+W: prevent unexpected terminal tab closing, e.g. editing file in vim\n case \"KeyW\":\n evt.preventDefault();\n break;\n }\n }\n //Ctrl+K: clear the entire buffer, making the prompt line the new first line on mac os\n if (_common_vars__WEBPACK_IMPORTED_MODULE_8__[\"isMac\"] && metaKey) {\n switch (code) {\n case \"KeyK\":\n this.onClear();\n break;\n }\n }\n return true;\n }\n });\n // enable terminal addons\n this.xterm.loadAddon(this.fitAddon);\n this.xterm.open(Terminal.spawningPool);\n this.xterm.registerLinkMatcher(/https?:\\/\\/[^\\s]+/i, this.onClickLink);\n this.xterm.attachCustomKeyEventHandler(this.keyHandler);\n this.xterm.onSelectionChange(this.onSelectionChange);\n // bind events\n const onDataHandler = this.xterm.onData(this.onData);\n const clearOnce = Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"once\"])(this.onClear);\n this.viewport.addEventListener(\"scroll\", this.onScroll);\n this.elem.addEventListener(\"contextmenu\", this.onContextMenu);\n this.api.once(\"ready\", clearOnce);\n this.api.once(\"connected\", clearOnce);\n this.api.on(\"data\", this.onApiData);\n window.addEventListener(\"resize\", this.onResize);\n this.disposer.push(Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => _theme_store__WEBPACK_IMPORTED_MODULE_6__[\"ThemeStore\"].getInstance().activeTheme.colors, this.setTheme, {\n fireImmediately: true,\n }), _dock_store__WEBPACK_IMPORTED_MODULE_4__[\"dockStore\"].onResize(this.onResize), () => onDataHandler.dispose(), () => this.fitAddon.dispose(), () => this.api.removeAllListeners(), () => window.removeEventListener(\"resize\", this.onResize), () => this.elem.removeEventListener(\"contextmenu\", this.onContextMenu));\n }\n static async preloadFonts() {\n const fontPath = __webpack_require__(/*! ../fonts/roboto-mono-nerd.ttf */ \"./src/renderer/components/fonts/roboto-mono-nerd.ttf\").default; // eslint-disable-line @typescript-eslint/no-var-requires\n const fontFace = new FontFace(\"RobotoMono\", `url(${fontPath})`);\n await fontFace.load();\n document.fonts.add(fontFace);\n }\n setTheme(colors) {\n if (!this.xterm) {\n return;\n }\n // Replacing keys stored in styles to format accepted by terminal\n // E.g. terminalBrightBlack -> brightBlack\n const colorPrefix = \"terminal\";\n const terminalColorEntries = Object.entries(colors)\n .filter(([name]) => name.startsWith(colorPrefix))\n .map(([name, color]) => [Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"camelCase\"])(name.slice(colorPrefix.length)), color]);\n const terminalColors = Object.fromEntries(terminalColorEntries);\n this.xterm.setOption(\"theme\", terminalColors);\n }\n get elem() {\n var _a;\n return (_a = this.xterm) === null || _a === void 0 ? void 0 : _a.element;\n }\n get viewport() {\n return this.xterm.element.querySelector(\".xterm-viewport\");\n }\n get isActive() {\n const { isOpen, selectedTabId } = _dock_store__WEBPACK_IMPORTED_MODULE_4__[\"dockStore\"];\n return isOpen && selectedTabId === this.tabId;\n }\n attachTo(parentElem) {\n parentElem.appendChild(this.elem);\n this.onActivate();\n }\n detach() {\n const { elem } = this;\n if (elem) {\n Terminal.spawningPool.appendChild(elem);\n }\n }\n destroy() {\n if (this.xterm) {\n this.disposer();\n this.xterm.dispose();\n this.xterm = null;\n }\n }\n}\nObject.defineProperty(Terminal, \"spawningPool\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (() => {\n // terminal element must be in DOM before attaching via xterm.open(elem)\n // https://xtermjs.org/docs/api/terminal/classes/terminal/#open\n const pool = document.createElement(\"div\");\n pool.className = \"terminal-init\";\n pool.style.cssText = \"position: absolute; top: 0; left: 0; height: 0; visibility: hidden; overflow: hidden\";\n document.body.appendChild(pool);\n return pool;\n })()\n});\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_7__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Terminal.prototype, \"setTheme\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/components/dock/terminal.ts?");
|
|
41957
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Terminal\", function() { return Terminal; });\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var xterm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! xterm */ \"./node_modules/xterm/lib/xterm.js\");\n/* harmony import */ var xterm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(xterm__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! xterm-addon-fit */ \"./node_modules/xterm-addon-fit/lib/xterm-addon-fit.js\");\n/* harmony import */ var xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dock_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dock.store */ \"./src/renderer/components/dock/dock.store.ts\");\n/* harmony import */ var _api_terminal_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../api/terminal-api */ \"./src/renderer/api/terminal-api.ts\");\n/* harmony import */ var _theme_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme.store */ \"./src/renderer/theme.store.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/vars */ \"./src/common/vars.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _common_logger__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/logger */ \"./src/common/logger.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass Terminal {\n constructor(tabId, api) {\n Object.defineProperty(this, \"tabId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: tabId\n });\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: api\n });\n Object.defineProperty(this, \"xterm\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new xterm__WEBPACK_IMPORTED_MODULE_2__[\"Terminal\"]({\n cursorBlink: true,\n cursorStyle: \"bar\",\n fontSize: 13,\n fontFamily: \"RobotoMono\",\n })\n });\n Object.defineProperty(this, \"fitAddon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new xterm_addon_fit__WEBPACK_IMPORTED_MODULE_3__[\"FitAddon\"]()\n });\n Object.defineProperty(this, \"scrollPos\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 0\n });\n Object.defineProperty(this, \"disposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_7__[\"disposer\"])()\n });\n Object.defineProperty(this, \"fit\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n // Since this function is debounced we need to read this value as late as possible\n if (!this.isActive || !this.xterm) {\n return;\n }\n try {\n this.fitAddon.fit();\n const { cols, rows } = this.xterm;\n this.api.sendTerminalSize(cols, rows);\n }\n catch (error) {\n // see https://github.com/lensapp/lens/issues/1891\n _common_logger__WEBPACK_IMPORTED_MODULE_12__[\"default\"].error(`[TERMINAL]: failed to resize terminal to fit`, error);\n }\n }\n });\n Object.defineProperty(this, \"fitLazy\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(this.fit, 250)\n });\n Object.defineProperty(this, \"focus\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.xterm.focus();\n }\n });\n Object.defineProperty(this, \"onApiData\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (data) => {\n this.xterm.write(data);\n }\n });\n Object.defineProperty(this, \"onData\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (data) => {\n if (!this.api.isReady)\n return;\n this.api.sendMessage({\n type: _api_terminal_api__WEBPACK_IMPORTED_MODULE_5__[\"TerminalChannels\"].STDIN,\n data,\n });\n }\n });\n Object.defineProperty(this, \"onScroll\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.scrollPos = this.viewport.scrollTop;\n }\n });\n Object.defineProperty(this, \"onClear\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.xterm.clear();\n }\n });\n Object.defineProperty(this, \"onResize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.fitLazy();\n this.focus();\n }\n });\n Object.defineProperty(this, \"onActivate\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.fit();\n setTimeout(() => this.focus(), 250); // delay used to prevent focus on active tab\n this.viewport.scrollTop = this.scrollPos; // restore last scroll position\n }\n });\n Object.defineProperty(this, \"onClickLink\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (evt, link) => {\n window.open(link, \"_blank\");\n }\n });\n Object.defineProperty(this, \"onContextMenu\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (\n // don't paste if user hasn't turned on the feature\n _common_user_store__WEBPACK_IMPORTED_MODULE_10__[\"UserStore\"].getInstance().terminalCopyOnSelect\n // don't paste if the clipboard doesn't have text\n && electron__WEBPACK_IMPORTED_MODULE_11__[\"clipboard\"].availableFormats().includes(\"text/plain\")) {\n this.xterm.paste(electron__WEBPACK_IMPORTED_MODULE_11__[\"clipboard\"].readText());\n }\n }\n });\n Object.defineProperty(this, \"onSelectionChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n const selection = this.xterm.getSelection().trim();\n if (_common_user_store__WEBPACK_IMPORTED_MODULE_10__[\"UserStore\"].getInstance().terminalCopyOnSelect && selection) {\n electron__WEBPACK_IMPORTED_MODULE_11__[\"clipboard\"].writeText(selection);\n }\n }\n });\n Object.defineProperty(this, \"keyHandler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (evt) => {\n const { code, ctrlKey, metaKey } = evt;\n // Handle custom hotkey bindings\n if (ctrlKey) {\n switch (code) {\n // Ctrl+C: prevent terminal exit on windows / linux (?)\n case \"KeyC\":\n if (this.xterm.hasSelection())\n return false;\n break;\n // Ctrl+W: prevent unexpected terminal tab closing, e.g. editing file in vim\n case \"KeyW\":\n evt.preventDefault();\n break;\n }\n }\n //Ctrl+K: clear the entire buffer, making the prompt line the new first line on mac os\n if (_common_vars__WEBPACK_IMPORTED_MODULE_8__[\"isMac\"] && metaKey) {\n switch (code) {\n case \"KeyK\":\n this.onClear();\n break;\n }\n }\n return true;\n }\n });\n // enable terminal addons\n this.xterm.loadAddon(this.fitAddon);\n this.xterm.open(Terminal.spawningPool);\n this.xterm.registerLinkMatcher(/https?:\\/\\/[^\\s]+/i, this.onClickLink);\n this.xterm.attachCustomKeyEventHandler(this.keyHandler);\n this.xterm.onSelectionChange(this.onSelectionChange);\n // bind events\n const onDataHandler = this.xterm.onData(this.onData);\n const clearOnce = Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"once\"])(this.onClear);\n this.viewport.addEventListener(\"scroll\", this.onScroll);\n this.elem.addEventListener(\"contextmenu\", this.onContextMenu);\n this.api.once(\"ready\", clearOnce);\n this.api.once(\"connected\", clearOnce);\n this.api.on(\"data\", this.onApiData);\n window.addEventListener(\"resize\", this.onResize);\n this.disposer.push(Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => _theme_store__WEBPACK_IMPORTED_MODULE_6__[\"ThemeStore\"].getInstance().activeTheme.colors, this.setTheme, {\n fireImmediately: true,\n }), _dock_store__WEBPACK_IMPORTED_MODULE_4__[\"dockStore\"].onResize(this.onResize), () => onDataHandler.dispose(), () => this.fitAddon.dispose(), () => this.api.removeAllListeners(), () => window.removeEventListener(\"resize\", this.onResize), () => this.elem.removeEventListener(\"contextmenu\", this.onContextMenu));\n }\n static get spawningPool() {\n return document.getElementById(\"terminal-init\");\n }\n static async preloadFonts() {\n const fontPath = __webpack_require__(/*! ../fonts/roboto-mono-nerd.ttf */ \"./src/renderer/components/fonts/roboto-mono-nerd.ttf\").default; // eslint-disable-line @typescript-eslint/no-var-requires\n const fontFace = new FontFace(\"RobotoMono\", `url(${fontPath})`);\n await fontFace.load();\n document.fonts.add(fontFace);\n }\n setTheme(colors) {\n if (!this.xterm) {\n return;\n }\n // Replacing keys stored in styles to format accepted by terminal\n // E.g. terminalBrightBlack -> brightBlack\n const colorPrefix = \"terminal\";\n const terminalColorEntries = Object.entries(colors)\n .filter(([name]) => name.startsWith(colorPrefix))\n .map(([name, color]) => [Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"camelCase\"])(name.slice(colorPrefix.length)), color]);\n const terminalColors = Object.fromEntries(terminalColorEntries);\n this.xterm.setOption(\"theme\", terminalColors);\n }\n get elem() {\n var _a;\n return (_a = this.xterm) === null || _a === void 0 ? void 0 : _a.element;\n }\n get viewport() {\n return this.xterm.element.querySelector(\".xterm-viewport\");\n }\n get isActive() {\n const { isOpen, selectedTabId } = _dock_store__WEBPACK_IMPORTED_MODULE_4__[\"dockStore\"];\n return isOpen && selectedTabId === this.tabId;\n }\n attachTo(parentElem) {\n parentElem.appendChild(this.elem);\n this.onActivate();\n }\n detach() {\n const { elem } = this;\n if (elem) {\n Terminal.spawningPool.appendChild(elem);\n }\n }\n destroy() {\n if (this.xterm) {\n this.disposer();\n this.xterm.dispose();\n this.xterm = null;\n }\n }\n}\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_7__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Terminal.prototype, \"setTheme\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/components/dock/terminal.ts?");
|
|
42052
41958
|
|
|
42053
41959
|
/***/ }),
|
|
42054
41960
|
|
|
@@ -42251,7 +42157,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
42251
42157
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42252
42158
|
|
|
42253
42159
|
"use strict";
|
|
42254
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Icon\", function() { return Icon; });\n/* harmony import */ var _icon_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icon.scss */ \"./src/renderer/components/icon/icon.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ \"./src/renderer/components/tooltip/index.ts\");\n/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isNumber */ \"./node_modules/lodash/isNumber.js\");\n/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isNumber__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\nlet Icon = class Icon extends react__WEBPACK_IMPORTED_MODULE_1___default.a.PureComponent {\n get isInteractive() {\n const { interactive, onClick, href, link } = this.props;\n return interactive !== null && interactive !== void 0 ? interactive : !!(onClick || href || link);\n }\n onClick(evt) {\n if (this.props.disabled) {\n return;\n }\n if (this.props.onClick) {\n this.props.onClick(evt);\n }\n }\n onKeyDown(evt) {\n switch (evt.nativeEvent.code) {\n case \"Space\":\n case \"Enter\": {\n // eslint-disable-next-line react/no-find-dom-node\n const icon = Object(react_dom__WEBPACK_IMPORTED_MODULE_2__[\"findDOMNode\"])(this);\n setTimeout(() => icon.click());\n evt.preventDefault();\n break;\n }\n }\n if (this.props.onKeyDown) {\n this.props.onKeyDown(evt);\n }\n }\n render() {\n const { isInteractive } = this;\n const _a = this.props, { \n // skip passing props to icon's html element\n className, href, link, material, svg, size, smallest, small, big, disabled, sticker, active, focusable, children, interactive: _interactive, onClick: _onClick, onKeyDown: _onKeyDown } = _a, elemProps = __rest(_a, [\"className\", \"href\", \"link\", \"material\", \"svg\", \"size\", \"smallest\", \"small\", \"big\", \"disabled\", \"sticker\", \"active\", \"focusable\", \"children\", \"interactive\", \"onClick\", \"onKeyDown\"]);\n let iconContent;\n const iconProps = Object.assign({ className: Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"cssNames\"])(\"Icon\", className, { svg, material, interactive: isInteractive, disabled, sticker, active, focusable }, !size ? { smallest, small, big } : {}), onClick: isInteractive ? this.onClick : undefined, onKeyDown: isInteractive ? this.onKeyDown : undefined, tabIndex: isInteractive && focusable && !disabled ? 0 : undefined, style: size ? { \"--size\": size + (lodash_isNumber__WEBPACK_IMPORTED_MODULE_6___default()(size) ? \"px\" : \"\") } : undefined }, elemProps);\n // render as inline svg-icon\n if (typeof svg === \"string\") {\n const svgIconText = svg.includes(\"<svg\") ? svg : __webpack_require__(\"./src/renderer/components/icon sync recursive ./!./!./node_modules/raw-loader/dist/cjs.js!./ ^\\\\.\\\\/.*\\\\.svg$\")(`./${svg}.svg`).default;\n iconContent = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"icon\", dangerouslySetInnerHTML: { __html: svgIconText } });\n }\n // render as material-icon\n if (typeof material === \"string\") {\n iconContent = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"icon\", \"data-icon-name\": material }, material);\n }\n // wrap icon's content passed from decorator\n iconProps.children = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n iconContent,\n children));\n // render icon type\n if (link) {\n const { className, children } = iconProps;\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__[\"NavLink\"], { className: className, to: link }, children));\n }\n if (href) {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"a\", Object.assign({}, iconProps, { href: href }));\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"i\", Object.assign({}, iconProps));\n }\n};\nObject.defineProperty(Icon, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n focusable: true,\n }\n});\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Icon.prototype, \"onClick\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Icon.prototype, \"onKeyDown\", null);\nIcon = __decorate([\n _tooltip__WEBPACK_IMPORTED_MODULE_5__[\"withTooltip\"]\n], Icon);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/icon/icon.tsx?");
|
|
42160
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Icon\", function() { return Icon; });\n/* harmony import */ var _icon_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icon.scss */ \"./src/renderer/components/icon/icon.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ \"./src/renderer/components/tooltip/index.ts\");\n/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isNumber */ \"./node_modules/lodash/isNumber.js\");\n/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isNumber__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\nlet Icon = class Icon extends react__WEBPACK_IMPORTED_MODULE_1___default.a.PureComponent {\n get isInteractive() {\n const { interactive, onClick, href, link } = this.props;\n return interactive !== null && interactive !== void 0 ? interactive : !!(onClick || href || link);\n }\n onClick(evt) {\n if (this.props.disabled) {\n return;\n }\n if (this.props.onClick) {\n this.props.onClick(evt);\n }\n }\n onKeyDown(evt) {\n switch (evt.nativeEvent.code) {\n case \"Space\":\n // fallthrough\n case \"Enter\": {\n // eslint-disable-next-line react/no-find-dom-node\n const icon = Object(react_dom__WEBPACK_IMPORTED_MODULE_2__[\"findDOMNode\"])(this);\n setTimeout(() => icon.click());\n evt.preventDefault();\n break;\n }\n }\n if (this.props.onKeyDown) {\n this.props.onKeyDown(evt);\n }\n }\n render() {\n const { isInteractive } = this;\n const _a = this.props, { \n // skip passing props to icon's html element\n className, href, link, material, svg, size, smallest, small, big, disabled, sticker, active, focusable, children, interactive: _interactive, onClick: _onClick, onKeyDown: _onKeyDown } = _a, elemProps = __rest(_a, [\"className\", \"href\", \"link\", \"material\", \"svg\", \"size\", \"smallest\", \"small\", \"big\", \"disabled\", \"sticker\", \"active\", \"focusable\", \"children\", \"interactive\", \"onClick\", \"onKeyDown\"]);\n let iconContent;\n const iconProps = Object.assign({ className: Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"cssNames\"])(\"Icon\", className, { svg, material, interactive: isInteractive, disabled, sticker, active, focusable }, !size ? { smallest, small, big } : {}), onClick: isInteractive ? this.onClick : undefined, onKeyDown: isInteractive ? this.onKeyDown : undefined, tabIndex: isInteractive && focusable && !disabled ? 0 : undefined, style: size ? { \"--size\": size + (lodash_isNumber__WEBPACK_IMPORTED_MODULE_6___default()(size) ? \"px\" : \"\") } : undefined }, elemProps);\n // render as inline svg-icon\n if (typeof svg === \"string\") {\n const svgIconText = svg.includes(\"<svg\") ? svg : __webpack_require__(\"./src/renderer/components/icon sync recursive ./!./!./node_modules/raw-loader/dist/cjs.js!./ ^\\\\.\\\\/.*\\\\.svg$\")(`./${svg}.svg`).default;\n iconContent = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"icon\", dangerouslySetInnerHTML: { __html: svgIconText } });\n }\n // render as material-icon\n if (typeof material === \"string\") {\n iconContent = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"icon\", \"data-icon-name\": material }, material);\n }\n // wrap icon's content passed from decorator\n iconProps.children = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n iconContent,\n children));\n // render icon type\n if (link) {\n const { className, children } = iconProps;\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__[\"NavLink\"], { className: className, to: link }, children));\n }\n if (href) {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"a\", Object.assign({}, iconProps, { href: href }));\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"i\", Object.assign({}, iconProps));\n }\n};\nObject.defineProperty(Icon, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n focusable: true,\n }\n});\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Icon.prototype, \"onClick\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Icon.prototype, \"onKeyDown\", null);\nIcon = __decorate([\n _tooltip__WEBPACK_IMPORTED_MODULE_5__[\"withTooltip\"]\n], Icon);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/icon/icon.tsx?");
|
|
42255
42161
|
|
|
42256
42162
|
/***/ }),
|
|
42257
42163
|
|
|
@@ -42335,7 +42241,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
42335
42241
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42336
42242
|
|
|
42337
42243
|
"use strict";
|
|
42338
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InputValidators\", function() { return InputValidators; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Input\", function() { return Input; });\n/* harmony import */ var _input_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input.scss */ \"./src/renderer/components/input/input.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tooltip */ \"./src/renderer/components/tooltip/index.ts\");\n/* harmony import */ var _input_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./input_validators */ \"./src/renderer/components/input/input_validators.ts\");\n/* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\");\n/* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash/isBoolean */ \"./node_modules/lodash/isBoolean.js\");\n/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/uniqueId */ \"./node_modules/lodash/uniqueId.js\");\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\n\n\n\nconst { conditionalValidators } = _input_validators__WEBPACK_IMPORTED_MODULE_5__, InputValidators = __rest(_input_validators__WEBPACK_IMPORTED_MODULE_5__, [\"conditionalValidators\"]);\n\nconst defaultProps = {\n rows: 1,\n maxRows: 10000,\n showValidationLine: true,\n validators: [],\n};\nclass Input extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"input\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: null\n });\n Object.defineProperty(this, \"validators\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n Object.defineProperty(this, \"state\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n focused: false,\n valid: true,\n validating: false,\n dirty: !!this.props.dirty,\n errors: [],\n submitted: false,\n }\n });\n Object.defineProperty(this, \"validationId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"setDirtyOnChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"debounce\"])(() => this.setDirty(), 500)\n });\n }\n setValue(value = \"\") {\n if (value !== this.getValue()) {\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(this.input.constructor.prototype, \"value\").set;\n nativeInputValueSetter.call(this.input, value);\n const evt = new Event(\"input\", { bubbles: true });\n this.input.dispatchEvent(evt);\n }\n }\n getValue() {\n var _a, _b, _c;\n const { trim, value, defaultValue } = this.props;\n const rawValue = (_c = (_b = value !== null && value !== void 0 ? value : (_a = this.input) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : defaultValue) !== null && _c !== void 0 ? _c : \"\";\n return trim ? rawValue.trim() : rawValue;\n }\n focus() {\n this.input.focus();\n }\n blur() {\n this.input.blur();\n }\n select() {\n this.input.select();\n }\n autoFitHeight() {\n const { multiLine, rows, maxRows } = this.props;\n if (!multiLine) {\n return;\n }\n const textArea = this.input;\n const lineHeight = parseFloat(window.getComputedStyle(textArea).lineHeight);\n const rowsCount = (this.getValue().match(/\\n/g) || []).length + 1;\n const height = lineHeight * Math.min(Math.max(rowsCount, rows), maxRows);\n textArea.style.height = `${height}px`;\n }\n async validate() {\n var _a;\n const value = this.getValue();\n let validationId = (this.validationId = \"\"); // reset every time for async validators\n const asyncValidators = [];\n const errors = [];\n // run validators\n for (const validator of this.validators) {\n if (errors.length) {\n // stop validation check if there is an error already\n break;\n }\n const result = validator.validate(value, this.props);\n if (lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default()(result) && !result) {\n errors.push(this.getValidatorError(value, validator));\n }\n else if (result instanceof Promise) {\n if (!validationId) {\n this.validationId = validationId = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default()(\"validation_id_\");\n }\n asyncValidators.push(result.then(() => null, // don't consider any valid result from promise since we interested in errors only\n // don't consider any valid result from promise since we interested in errors only\n error => this.getValidatorError(value, validator) || error));\n }\n }\n // save sync validators result first\n this.setValidation(errors);\n // handle async validators result\n if (asyncValidators.length > 0) {\n this.setState({ validating: true, valid: false });\n const asyncErrors = await Promise.all(asyncValidators);\n if (this.validationId === validationId) {\n this.setValidation(errors.concat(...asyncErrors.filter(err => err)));\n }\n }\n (_a = this.input) === null || _a === void 0 ? void 0 : _a.setCustomValidity(errors.length ? errors[0].toString() : \"\");\n }\n setValidation(errors) {\n this.setState({\n validating: false,\n valid: !errors.length,\n errors,\n });\n }\n getValidatorError(value, { message }) {\n if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(message))\n return message(value, this.props);\n return message || \"\";\n }\n setupValidators() {\n this.validators = conditionalValidators\n // add conditional validators if matches input props\n .filter(validator => validator.condition(this.props))\n // add custom validators\n .concat(this.props.validators)\n // debounce async validators\n .map((_a) => {\n var { debounce } = _a, validator = __rest(_a, [\"debounce\"]);\n if (debounce)\n validator.validate = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"debouncePromise\"])(validator.validate, debounce);\n return validator;\n });\n // run validation\n this.validate();\n }\n setDirty(dirty = true) {\n this.setState({ dirty });\n }\n onFocus(evt) {\n const { onFocus, autoSelectOnFocus } = this.props;\n onFocus === null || onFocus === void 0 ? void 0 : onFocus(evt);\n if (autoSelectOnFocus)\n this.select();\n this.setState({ focused: true });\n }\n onBlur(evt) {\n var _a, _b;\n (_b = (_a = this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n this.setState({ focused: false });\n }\n onChange(evt) {\n var _a, _b;\n (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, evt.currentTarget.value, evt);\n this.validate();\n this.autoFitHeight();\n this.setDirtyOnChange();\n // re-render component when used as uncontrolled input\n // when used @defaultValue instead of @value changing real input.value doesn't call render()\n if (this.isUncontrolled && this.showMaxLenIndicator) {\n this.forceUpdate();\n }\n }\n onKeyDown(evt) {\n var _a, _b, _c, _d;\n (_b = (_a = this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n if (evt.shiftKey || evt.metaKey || evt.altKey || evt.ctrlKey || evt.repeat) {\n return;\n }\n if (evt.key === \"Enter\") {\n if (this.state.valid) {\n (_d = (_c = this.props).onSubmit) === null || _d === void 0 ? void 0 : _d.call(_c, this.getValue(), evt);\n this.setDirtyOnChange.cancel();\n this.setState({ submitted: true });\n if (this.input && typeof this.props.value !== \"string\") {\n this.input.value = \"\";\n }\n }\n else {\n this.setDirty();\n }\n }\n }\n get showMaxLenIndicator() {\n const { maxLength, multiLine } = this.props;\n return maxLength && multiLine;\n }\n get isUncontrolled() {\n return this.props.value === undefined;\n }\n componentDidMount() {\n this.setupValidators();\n this.autoFitHeight();\n }\n componentDidUpdate(prevProps) {\n const { defaultValue, value, dirty, validators } = this.props;\n if (prevProps.value !== value || defaultValue !== prevProps.defaultValue) {\n if (!this.state.submitted) {\n this.validate();\n }\n else {\n this.setState({ submitted: false });\n }\n this.autoFitHeight();\n }\n if (prevProps.dirty !== dirty) {\n this.setDirty(dirty);\n }\n if (prevProps.validators !== validators) {\n this.setupValidators();\n }\n }\n get themeSelection() {\n const { theme } = this.props;\n if (!theme) {\n return {};\n }\n return {\n theme: true,\n round: true,\n black: theme === \"round-black\",\n };\n }\n bindRef(elem) {\n this.input = elem;\n }\n renderIcon(iconData) {\n if (typeof iconData === \"string\") {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_3__[\"Icon\"], { material: iconData });\n }\n if (typeof iconData === \"function\") {\n return iconData({\n isDirty: Boolean(this.getValue()),\n });\n }\n return iconData;\n }\n render() {\n const _a = this.props, { multiLine, showValidationLine, validators, theme, maxRows, children, showErrorsAsTooltip, maxLength, rows, disabled, autoSelectOnFocus, iconLeft, iconRight, contentRight, id, dirty: _dirty, // excluded from passing to input-element\n defaultValue, trim } = _a, inputProps = __rest(_a, [\"multiLine\", \"showValidationLine\", \"validators\", \"theme\", \"maxRows\", \"children\", \"showErrorsAsTooltip\", \"maxLength\", \"rows\", \"disabled\", \"autoSelectOnFocus\", \"iconLeft\", \"iconRight\", \"contentRight\", \"id\", \"dirty\", \"defaultValue\", \"trim\"]);\n const { focused, dirty, valid, validating, errors } = this.state;\n const className = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"cssNames\"])(\"Input\", this.props.className, Object.assign(Object.assign({}, this.themeSelection), { focused,\n disabled, invalid: !valid, dirty,\n validating, validatingLine: validating && showValidationLine }));\n // prepare input props\n Object.assign(inputProps, {\n className: \"input box grow\",\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n onChange: this.onChange,\n onKeyDown: this.onKeyDown,\n rows: multiLine ? (rows || 1) : null,\n ref: this.bindRef,\n spellCheck: \"false\",\n disabled,\n });\n const showErrors = errors.length > 0 && !valid && dirty;\n const errorsInfo = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"errors box grow\" }, errors.map((error, i) => react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"p\", { key: i }, error))));\n const componentId = id || showErrorsAsTooltip ? Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"getRandId\"])({ prefix: \"input_tooltip_id\" }) : undefined;\n let tooltipError;\n if (showErrorsAsTooltip && showErrors) {\n const tooltipProps = typeof showErrorsAsTooltip === \"object\" ? showErrorsAsTooltip : {};\n tooltipProps.className = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"cssNames\"])(\"InputTooltipError\", tooltipProps.className);\n tooltipError = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_4__[\"Tooltip\"], Object.assign({ targetId: componentId }, tooltipProps),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"flex gaps align-center\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_3__[\"Icon\"], { material: \"error_outline\" }),\n errorsInfo)));\n }\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { id: componentId, className: className },\n tooltipError,\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"label\", { className: \"input-area flex gaps align-center\", id: \"\" },\n this.renderIcon(iconLeft),\n multiLine ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"textarea\", Object.assign({}, inputProps)) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"input\", Object.assign({}, inputProps)),\n this.renderIcon(iconRight),\n contentRight),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"input-info flex gaps\" },\n !showErrorsAsTooltip && showErrors && errorsInfo,\n this.showMaxLenIndicator && (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"maxLengthIndicator box right\" },\n this.getValue().length,\n \" / \",\n maxLength)))));\n }\n}\nObject.defineProperty(Input, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultProps\n});\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onFocus\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onBlur\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onChange\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onKeyDown\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"bindRef\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/components/input/input.tsx?");
|
|
42244
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InputValidators\", function() { return InputValidators; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Input\", function() { return Input; });\n/* harmony import */ var _input_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input.scss */ \"./src/renderer/components/input/input.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tooltip */ \"./src/renderer/components/tooltip/index.ts\");\n/* harmony import */ var _input_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./input_validators */ \"./src/renderer/components/input/input_validators.ts\");\n/* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\");\n/* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash/isBoolean */ \"./node_modules/lodash/isBoolean.js\");\n/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/uniqueId */ \"./node_modules/lodash/uniqueId.js\");\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\n\n\n\nconst { conditionalValidators } = _input_validators__WEBPACK_IMPORTED_MODULE_5__, InputValidators = __rest(_input_validators__WEBPACK_IMPORTED_MODULE_5__, [\"conditionalValidators\"]);\n\nconst defaultProps = {\n rows: 1,\n maxRows: 10000,\n showValidationLine: true,\n validators: [],\n};\nclass Input extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"input\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: null\n });\n Object.defineProperty(this, \"validators\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n Object.defineProperty(this, \"state\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n focused: false,\n valid: true,\n validating: false,\n dirty: !!this.props.dirty,\n errors: [],\n submitted: false,\n }\n });\n Object.defineProperty(this, \"validationId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"setDirtyOnChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"debounce\"])(() => this.setDirty(), 500)\n });\n }\n componentWillUnmount() {\n this.setDirtyOnChange.cancel();\n }\n setValue(value = \"\") {\n if (value !== this.getValue()) {\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(this.input.constructor.prototype, \"value\").set;\n nativeInputValueSetter.call(this.input, value);\n const evt = new Event(\"input\", { bubbles: true });\n this.input.dispatchEvent(evt);\n }\n }\n getValue() {\n var _a, _b, _c;\n const { trim, value, defaultValue } = this.props;\n const rawValue = (_c = (_b = value !== null && value !== void 0 ? value : (_a = this.input) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : defaultValue) !== null && _c !== void 0 ? _c : \"\";\n return trim ? rawValue.trim() : rawValue;\n }\n focus() {\n this.input.focus();\n }\n blur() {\n this.input.blur();\n }\n select() {\n this.input.select();\n }\n autoFitHeight() {\n const { multiLine, rows, maxRows } = this.props;\n if (!multiLine) {\n return;\n }\n const textArea = this.input;\n const lineHeight = parseFloat(window.getComputedStyle(textArea).lineHeight);\n const rowsCount = (this.getValue().match(/\\n/g) || []).length + 1;\n const height = lineHeight * Math.min(Math.max(rowsCount, rows), maxRows);\n textArea.style.height = `${height}px`;\n }\n async validate() {\n var _a;\n const value = this.getValue();\n let validationId = (this.validationId = \"\"); // reset every time for async validators\n const asyncValidators = [];\n const errors = [];\n // run validators\n for (const validator of this.validators) {\n if (errors.length) {\n // stop validation check if there is an error already\n break;\n }\n const result = validator.validate(value, this.props);\n if (lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default()(result) && !result) {\n errors.push(this.getValidatorError(value, validator));\n }\n else if (result instanceof Promise) {\n if (!validationId) {\n this.validationId = validationId = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default()(\"validation_id_\");\n }\n asyncValidators.push(result.then(() => null, // don't consider any valid result from promise since we interested in errors only\n // don't consider any valid result from promise since we interested in errors only\n error => this.getValidatorError(value, validator) || error));\n }\n }\n // save sync validators result first\n this.setValidation(errors);\n // handle async validators result\n if (asyncValidators.length > 0) {\n this.setState({ validating: true, valid: false });\n const asyncErrors = await Promise.all(asyncValidators);\n if (this.validationId === validationId) {\n this.setValidation(errors.concat(...asyncErrors.filter(err => err)));\n }\n }\n (_a = this.input) === null || _a === void 0 ? void 0 : _a.setCustomValidity(errors.length ? errors[0].toString() : \"\");\n }\n setValidation(errors) {\n this.setState({\n validating: false,\n valid: !errors.length,\n errors,\n });\n }\n getValidatorError(value, { message }) {\n if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(message))\n return message(value, this.props);\n return message || \"\";\n }\n setupValidators() {\n this.validators = conditionalValidators\n // add conditional validators if matches input props\n .filter(validator => validator.condition(this.props))\n // add custom validators\n .concat(this.props.validators)\n // debounce async validators\n .map((_a) => {\n var { debounce } = _a, validator = __rest(_a, [\"debounce\"]);\n if (debounce)\n validator.validate = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"debouncePromise\"])(validator.validate, debounce);\n return validator;\n });\n // run validation\n this.validate();\n }\n setDirty(dirty = true) {\n this.setState({ dirty });\n }\n onFocus(evt) {\n const { onFocus, autoSelectOnFocus } = this.props;\n onFocus === null || onFocus === void 0 ? void 0 : onFocus(evt);\n if (autoSelectOnFocus)\n this.select();\n this.setState({ focused: true });\n }\n onBlur(evt) {\n var _a, _b;\n (_b = (_a = this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n this.setState({ focused: false });\n }\n onChange(evt) {\n var _a, _b;\n (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, evt.currentTarget.value, evt);\n this.validate();\n this.autoFitHeight();\n this.setDirtyOnChange();\n // re-render component when used as uncontrolled input\n // when used @defaultValue instead of @value changing real input.value doesn't call render()\n if (this.isUncontrolled && this.showMaxLenIndicator) {\n this.forceUpdate();\n }\n }\n onKeyDown(evt) {\n var _a, _b, _c, _d;\n (_b = (_a = this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n if (evt.shiftKey || evt.metaKey || evt.altKey || evt.ctrlKey || evt.repeat) {\n return;\n }\n if (evt.key === \"Enter\") {\n if (this.state.valid) {\n (_d = (_c = this.props).onSubmit) === null || _d === void 0 ? void 0 : _d.call(_c, this.getValue(), evt);\n this.setDirtyOnChange.cancel();\n this.setState({ submitted: true });\n if (this.input && typeof this.props.value !== \"string\") {\n this.input.value = \"\";\n }\n }\n else {\n this.setDirty();\n }\n }\n }\n get showMaxLenIndicator() {\n const { maxLength, multiLine } = this.props;\n return maxLength && multiLine;\n }\n get isUncontrolled() {\n return this.props.value === undefined;\n }\n componentDidMount() {\n this.setupValidators();\n this.autoFitHeight();\n }\n componentDidUpdate(prevProps) {\n const { defaultValue, value, dirty, validators } = this.props;\n if (prevProps.value !== value || defaultValue !== prevProps.defaultValue) {\n if (!this.state.submitted) {\n this.validate();\n }\n else {\n this.setState({ submitted: false });\n }\n this.autoFitHeight();\n }\n if (prevProps.dirty !== dirty) {\n this.setDirty(dirty);\n }\n if (prevProps.validators !== validators) {\n this.setupValidators();\n }\n }\n get themeSelection() {\n const { theme } = this.props;\n if (!theme) {\n return {};\n }\n return {\n theme: true,\n round: true,\n black: theme === \"round-black\",\n };\n }\n bindRef(elem) {\n this.input = elem;\n }\n renderIcon(iconData) {\n if (typeof iconData === \"string\") {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_3__[\"Icon\"], { material: iconData });\n }\n if (typeof iconData === \"function\") {\n return iconData({\n isDirty: Boolean(this.getValue()),\n });\n }\n return iconData;\n }\n render() {\n const _a = this.props, { multiLine, showValidationLine, validators, theme, maxRows, children, showErrorsAsTooltip, maxLength, rows, disabled, autoSelectOnFocus, iconLeft, iconRight, contentRight, id, dirty: _dirty, // excluded from passing to input-element\n defaultValue, trim } = _a, inputProps = __rest(_a, [\"multiLine\", \"showValidationLine\", \"validators\", \"theme\", \"maxRows\", \"children\", \"showErrorsAsTooltip\", \"maxLength\", \"rows\", \"disabled\", \"autoSelectOnFocus\", \"iconLeft\", \"iconRight\", \"contentRight\", \"id\", \"dirty\", \"defaultValue\", \"trim\"]);\n const { focused, dirty, valid, validating, errors } = this.state;\n const className = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"cssNames\"])(\"Input\", this.props.className, Object.assign(Object.assign({}, this.themeSelection), { focused,\n disabled, invalid: !valid, dirty,\n validating, validatingLine: validating && showValidationLine }));\n // prepare input props\n Object.assign(inputProps, {\n className: \"input box grow\",\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n onChange: this.onChange,\n onKeyDown: this.onKeyDown,\n rows: multiLine ? (rows || 1) : null,\n ref: this.bindRef,\n spellCheck: \"false\",\n disabled,\n });\n const showErrors = errors.length > 0 && !valid && dirty;\n const errorsInfo = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"errors box grow\" }, errors.map((error, i) => react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"p\", { key: i }, error))));\n const componentId = id || showErrorsAsTooltip ? Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"getRandId\"])({ prefix: \"input_tooltip_id\" }) : undefined;\n let tooltipError;\n if (showErrorsAsTooltip && showErrors) {\n const tooltipProps = typeof showErrorsAsTooltip === \"object\" ? showErrorsAsTooltip : {};\n tooltipProps.className = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"cssNames\"])(\"InputTooltipError\", tooltipProps.className);\n tooltipError = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_4__[\"Tooltip\"], Object.assign({ targetId: componentId }, tooltipProps),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"flex gaps align-center\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_3__[\"Icon\"], { material: \"error_outline\" }),\n errorsInfo)));\n }\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { id: componentId, className: className },\n tooltipError,\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"label\", { className: \"input-area flex gaps align-center\", id: \"\" },\n this.renderIcon(iconLeft),\n multiLine ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"textarea\", Object.assign({}, inputProps)) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"input\", Object.assign({}, inputProps)),\n this.renderIcon(iconRight),\n contentRight),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"input-info flex gaps\" },\n !showErrorsAsTooltip && showErrors && errorsInfo,\n this.showMaxLenIndicator && (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"maxLengthIndicator box right\" },\n this.getValue().length,\n \" / \",\n maxLength)))));\n }\n}\nObject.defineProperty(Input, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultProps\n});\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onFocus\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onBlur\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onChange\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"onKeyDown\", null);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Input.prototype, \"bindRef\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/components/input/input.tsx?");
|
|
42339
42245
|
|
|
42340
42246
|
/***/ }),
|
|
42341
42247
|
|
|
@@ -42347,7 +42253,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
42347
42253
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42348
42254
|
|
|
42349
42255
|
"use strict";
|
|
42350
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isRequired\", function() { return isRequired; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isEmail\", function() { return isEmail; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isUrl\", function() { return isUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isExtensionNameInstallRegex\", function() { return isExtensionNameInstallRegex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isExtensionNameInstall\", function() { return isExtensionNameInstall; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPath\", function() { return isPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"minLength\", function() { return minLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"maxLength\", function() { return maxLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"systemName\", function() { return systemName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"accountId\", function() { return accountId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conditionalValidators\", function() { return conditionalValidators; });\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nconst isRequired = {\n condition: ({ required }) => required,\n message: () => `This field is required`,\n validate: value => !!value.trim(),\n};\nconst isEmail = {\n condition: ({ type }) => type === \"email\",\n message: () => `Wrong email format`,\n validate: value => !!value.match(/^(([^<>()
|
|
42256
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isRequired\", function() { return isRequired; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isEmail\", function() { return isEmail; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isUrl\", function() { return isUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isExtensionNameInstallRegex\", function() { return isExtensionNameInstallRegex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isExtensionNameInstall\", function() { return isExtensionNameInstall; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPath\", function() { return isPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"minLength\", function() { return minLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"maxLength\", function() { return maxLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"systemName\", function() { return systemName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"accountId\", function() { return accountId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conditionalValidators\", function() { return conditionalValidators; });\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nconst isRequired = {\n condition: ({ required }) => required,\n message: () => `This field is required`,\n validate: value => !!value.trim(),\n};\nconst isEmail = {\n condition: ({ type }) => type === \"email\",\n message: () => `Wrong email format`,\n validate: value => !!value.match(/^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/),\n};\nconst isNumber = {\n condition: ({ type }) => type === \"number\",\n message: () => `Invalid number`,\n validate: (value, { min, max }) => {\n const numVal = +value;\n return !(isNaN(numVal) ||\n (min != null && numVal < min) ||\n (max != null && numVal > max));\n },\n};\nconst isUrl = {\n condition: ({ type }) => type === \"url\",\n message: () => `Wrong url format`,\n validate: value => {\n try {\n return Boolean(new URL(value));\n }\n catch (err) {\n return false;\n }\n },\n};\nconst isExtensionNameInstallRegex = /^(?<name>(@[-\\w]+\\/)?[-\\w]+)(@(?<version>[a-z0-9-_.]+))?$/gi;\nconst isExtensionNameInstall = {\n condition: ({ type }) => type === \"text\",\n message: () => \"Not an extension name with optional version\",\n validate: value => value.match(isExtensionNameInstallRegex) !== null,\n};\nconst isPath = {\n condition: ({ type }) => type === \"text\",\n message: () => `This field must be a valid path`,\n validate: value => value && fs_extra__WEBPACK_IMPORTED_MODULE_0___default.a.pathExistsSync(value),\n};\nconst minLength = {\n condition: ({ minLength }) => !!minLength,\n message: (value, { minLength }) => `Minimum length is ${minLength}`,\n validate: (value, { minLength }) => value.length >= minLength,\n};\nconst maxLength = {\n condition: ({ maxLength }) => !!maxLength,\n message: (value, { maxLength }) => `Maximum length is ${maxLength}`,\n validate: (value, { maxLength }) => value.length <= maxLength,\n};\nconst systemNameMatcher = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/;\nconst systemName = {\n message: () => `A System Name must be lowercase DNS labels separated by dots. DNS labels are alphanumerics and dashes enclosed by alphanumerics.`,\n validate: value => !!value.match(systemNameMatcher),\n};\nconst accountId = {\n message: () => `Invalid account ID`,\n validate: value => (isEmail.validate(value) || systemName.validate(value)),\n};\nconst conditionalValidators = [\n isRequired, isEmail, isNumber, isUrl, minLength, maxLength,\n];\n\n\n//# sourceURL=webpack:///./src/renderer/components/input/input_validators.ts?");
|
|
42351
42257
|
|
|
42352
42258
|
/***/ }),
|
|
42353
42259
|
|
|
@@ -42515,7 +42421,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
42515
42421
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42516
42422
|
|
|
42517
42423
|
"use strict";
|
|
42518
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectDetails\", function() { return KubeObjectDetails; });\n/* harmony import */ var _kube_object_details_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./kube-object-details.scss */ \"./src/renderer/components/kube-object-details/kube-object-details.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _drawer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../drawer */ \"./src/renderer/components/drawer/index.ts\");\n/* harmony import */ var _spinner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../spinner */ \"./src/renderer/components/spinner/index.ts\");\n/* harmony import */ var _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/* harmony import */ var _custom_resources_crd_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../+custom-resources/crd.store */ \"./src/renderer/components/+custom-resources/crd.store.ts\");\n/* harmony import */ var _kube_object_menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../kube-object-menu */ \"./src/renderer/components/kube-object-menu/index.ts\");\n/* harmony import */ var _api_kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../api/kube-object-detail-registry */ \"./src/renderer/api/kube-object-detail-registry.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _custom_resources__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../+custom-resources */ \"./src/renderer/components/+custom-resources/index.ts\");\n/* harmony import */ var _kube_object_meta__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../kube-object-meta */ \"./src/renderer/components/kube-object-meta/index.ts\");\n/* harmony import */ var _kube_detail_params__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../kube-detail-params */ \"./src/renderer/components/kube-detail-params/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nlet KubeObjectDetails = class KubeObjectDetails extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"isLoading\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"loadingError\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"loader\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => [\n this.path,\n this.object,\n _custom_resources_crd_store__WEBPACK_IMPORTED_MODULE_7__[\"crdStore\"].items.length, // crd stores initialized after loading\n ], async () => {\n this.loadingError = \"\";\n const { path, object } = this;\n if (!object) {\n const store = _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_6__[\"apiManager\"].getStore(path);\n if (store) {\n this.isLoading = true;\n try {\n await store.loadFromPath(path);\n }\n catch (err) {\n this.loadingError = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n \"Resource loading has failed: \",\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"b\", null, err.toString()));\n }\n finally {\n this.isLoading = false;\n }\n }\n }\n })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"makeObservable\"])(this);\n }\n get path() {\n return _kube_detail_params__WEBPACK_IMPORTED_MODULE_13__[\"kubeDetailsUrlParam\"].get();\n }\n get object() {\n var _a;\n try {\n return (_a = _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_6__[\"apiManager\"]\n .getStore(this.path)) === null || _a === void 0 ? void 0 : _a.getByPath(this.path);\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_10__[\"default\"].error(`[KUBE-OBJECT-DETAILS]: failed to get store or object: ${error}`, { path: this.path });\n return undefined;\n }\n }\n render() {\n const { object, isLoading, loadingError } = this;\n const isOpen = !!(object || isLoading || loadingError);\n if (!object) {\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_drawer__WEBPACK_IMPORTED_MODULE_4__[\"Drawer\"], { className: \"KubeObjectDetails flex column\", open: isOpen, title: \"\", toolbar: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_kube_object_menu__WEBPACK_IMPORTED_MODULE_8__[\"KubeObjectMenu\"], { object: object, toolbar: true }), onClose: _kube_detail_params__WEBPACK_IMPORTED_MODULE_13__[\"hideDetails\"] },\n isLoading && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_spinner__WEBPACK_IMPORTED_MODULE_5__[\"Spinner\"], { center: true }),\n loadingError && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box center\" }, loadingError)));\n }\n const { kind, getName } = object;\n const title = `${kind}: ${getName()}`;\n const details = _api_kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_9__[\"KubeObjectDetailRegistry\"]\n .getInstance()\n .getItemsForKind(object.kind, object.apiVersion)\n .map((item, index) => (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(item.components.Details, { object: object, key: `object-details-${index}` })));\n if (details.length === 0) {\n const crd = _custom_resources_crd_store__WEBPACK_IMPORTED_MODULE_7__[\"crdStore\"].getByObject(object);\n /**\n * This is a fallback so that if a custom resource object doesn't have\n * any defined details we should try and display at least some details\n */\n if (crd) {\n details.push(react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_custom_resources__WEBPACK_IMPORTED_MODULE_11__[\"CrdResourceDetails\"], { key: object.getId(), object: object, crd: crd }));\n }\n }\n if (details.length === 0) {\n // if we still don't have any details to show, just show the standard object metadata\n details.push(react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_kube_object_meta__WEBPACK_IMPORTED_MODULE_12__[\"KubeObjectMeta\"], { key: object.getId(), object: object }));\n }\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_drawer__WEBPACK_IMPORTED_MODULE_4__[\"Drawer\"], { className: \"KubeObjectDetails flex column\", open: isOpen, title: title, toolbar: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_kube_object_menu__WEBPACK_IMPORTED_MODULE_8__[\"KubeObjectMenu\"], { object: object, toolbar: true }), onClose: _kube_detail_params__WEBPACK_IMPORTED_MODULE_13__[\"hideDetails\"] },\n isLoading && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_spinner__WEBPACK_IMPORTED_MODULE_5__[\"Spinner\"], { center: true }),\n loadingError && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box center\" }, loadingError),\n details));\n }\n};\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"],\n __metadata(\"design:type\", Object)\n], KubeObjectDetails.prototype, \"isLoading\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"].ref,\n __metadata(\"design:type\", Object)\n], KubeObjectDetails.prototype, \"loadingError\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], KubeObjectDetails.prototype, \"path\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], KubeObjectDetails.prototype, \"object\", null);\n__decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"disposeOnUnmount\"],\n __metadata(\"design:type\", Object)\n], KubeObjectDetails.prototype, \"loader\", void 0);\nKubeObjectDetails = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], KubeObjectDetails);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/kube-object-details/kube-object-details.tsx?");
|
|
42424
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KubeObjectDetails\", function() { return KubeObjectDetails; });\n/* harmony import */ var _kube_object_details_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./kube-object-details.scss */ \"./src/renderer/components/kube-object-details/kube-object-details.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _drawer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../drawer */ \"./src/renderer/components/drawer/index.ts\");\n/* harmony import */ var _spinner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../spinner */ \"./src/renderer/components/spinner/index.ts\");\n/* harmony import */ var _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/* harmony import */ var _custom_resources_crd_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../+custom-resources/crd.store */ \"./src/renderer/components/+custom-resources/crd.store.ts\");\n/* harmony import */ var _kube_object_menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../kube-object-menu */ \"./src/renderer/components/kube-object-menu/index.ts\");\n/* harmony import */ var _api_kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../api/kube-object-detail-registry */ \"./src/renderer/api/kube-object-detail-registry.ts\");\n/* harmony import */ var _custom_resources__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../+custom-resources */ \"./src/renderer/components/+custom-resources/index.ts\");\n/* harmony import */ var _kube_object_meta__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../kube-object-meta */ \"./src/renderer/components/kube-object-meta/index.ts\");\n/* harmony import */ var _kube_detail_params__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../kube-detail-params */ \"./src/renderer/components/kube-detail-params/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\nlet KubeObjectDetails = class KubeObjectDetails extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"isLoading\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"loadingError\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"loader\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => [\n this.path,\n this.object,\n _custom_resources_crd_store__WEBPACK_IMPORTED_MODULE_7__[\"crdStore\"].items.length, // crd stores initialized after loading\n ], async () => {\n this.loadingError = \"\";\n const { path, object } = this;\n if (!object) {\n const store = _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_6__[\"apiManager\"].getStore(path);\n if (store) {\n this.isLoading = true;\n try {\n await store.loadFromPath(path);\n }\n catch (err) {\n this.loadingError = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n \"Resource loading has failed: \",\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"b\", null, err.toString()));\n }\n finally {\n this.isLoading = false;\n }\n }\n }\n })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"makeObservable\"])(this);\n }\n get path() {\n return _kube_detail_params__WEBPACK_IMPORTED_MODULE_12__[\"kubeDetailsUrlParam\"].get();\n }\n get object() {\n var _a;\n try {\n return (_a = _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_6__[\"apiManager\"]\n .getStore(this.path)) === null || _a === void 0 ? void 0 : _a.getByPath(this.path);\n }\n catch (error) {\n console.error(`[KUBE-OBJECT-DETAILS]: failed to get store or object: ${error}`, { path: this.path });\n return undefined;\n }\n }\n render() {\n const { object, isLoading, loadingError } = this;\n const isOpen = !!(object || isLoading || loadingError);\n if (!object) {\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_drawer__WEBPACK_IMPORTED_MODULE_4__[\"Drawer\"], { className: \"KubeObjectDetails flex column\", open: isOpen, title: \"\", toolbar: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_kube_object_menu__WEBPACK_IMPORTED_MODULE_8__[\"KubeObjectMenu\"], { object: object, toolbar: true }), onClose: _kube_detail_params__WEBPACK_IMPORTED_MODULE_12__[\"hideDetails\"] },\n isLoading && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_spinner__WEBPACK_IMPORTED_MODULE_5__[\"Spinner\"], { center: true }),\n loadingError && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box center\" }, loadingError)));\n }\n const { kind, getName } = object;\n const title = `${kind}: ${getName()}`;\n const details = _api_kube_object_detail_registry__WEBPACK_IMPORTED_MODULE_9__[\"KubeObjectDetailRegistry\"]\n .getInstance()\n .getItemsForKind(object.kind, object.apiVersion)\n .map((item, index) => (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(item.components.Details, { object: object, key: `object-details-${index}` })));\n if (details.length === 0) {\n const crd = _custom_resources_crd_store__WEBPACK_IMPORTED_MODULE_7__[\"crdStore\"].getByObject(object);\n /**\n * This is a fallback so that if a custom resource object doesn't have\n * any defined details we should try and display at least some details\n */\n if (crd) {\n details.push(react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_custom_resources__WEBPACK_IMPORTED_MODULE_10__[\"CrdResourceDetails\"], { key: object.getId(), object: object, crd: crd }));\n }\n }\n if (details.length === 0) {\n // if we still don't have any details to show, just show the standard object metadata\n details.push(react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_kube_object_meta__WEBPACK_IMPORTED_MODULE_11__[\"KubeObjectMeta\"], { key: object.getId(), object: object }));\n }\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_drawer__WEBPACK_IMPORTED_MODULE_4__[\"Drawer\"], { className: \"KubeObjectDetails flex column\", open: isOpen, title: title, toolbar: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_kube_object_menu__WEBPACK_IMPORTED_MODULE_8__[\"KubeObjectMenu\"], { object: object, toolbar: true }), onClose: _kube_detail_params__WEBPACK_IMPORTED_MODULE_12__[\"hideDetails\"] },\n isLoading && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_spinner__WEBPACK_IMPORTED_MODULE_5__[\"Spinner\"], { center: true }),\n loadingError && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box center\" }, loadingError),\n details));\n }\n};\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"],\n __metadata(\"design:type\", Object)\n], KubeObjectDetails.prototype, \"isLoading\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"].ref,\n __metadata(\"design:type\", Object)\n], KubeObjectDetails.prototype, \"loadingError\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], KubeObjectDetails.prototype, \"path\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], KubeObjectDetails.prototype, \"object\", null);\n__decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"disposeOnUnmount\"],\n __metadata(\"design:type\", Object)\n], KubeObjectDetails.prototype, \"loader\", void 0);\nKubeObjectDetails = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], KubeObjectDetails);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/kube-object-details/kube-object-details.tsx?");
|
|
42519
42425
|
|
|
42520
42426
|
/***/ }),
|
|
42521
42427
|
|
|
@@ -42607,11 +42513,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _doc
|
|
|
42607
42513
|
/*!******************************************************************************************!*\
|
|
42608
42514
|
!*** ./src/renderer/components/kube-object-menu/dependencies/hide-details.injectable.ts ***!
|
|
42609
42515
|
\******************************************************************************************/
|
|
42610
|
-
/*! exports provided:
|
|
42516
|
+
/*! exports provided: default */
|
|
42611
42517
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42612
42518
|
|
|
42613
42519
|
"use strict";
|
|
42614
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony
|
|
42520
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _kube_detail_params__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../kube-detail-params */ \"./src/renderer/components/kube-detail-params/index.ts\");\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ogre-tools/injectable */ \"./node_modules/@ogre-tools/injectable/build/index.js\");\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\nconst hideDetailsInjectable = Object(_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_1__[\"getInjectable\"])({\n instantiate: () => _kube_detail_params__WEBPACK_IMPORTED_MODULE_0__[\"hideDetails\"],\n lifecycle: _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_1__[\"lifecycleEnum\"].singleton,\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (hideDetailsInjectable);\n\n\n//# sourceURL=webpack:///./src/renderer/components/kube-object-menu/dependencies/hide-details.injectable.ts?");
|
|
42615
42521
|
|
|
42616
42522
|
/***/ }),
|
|
42617
42523
|
|
|
@@ -42995,7 +42901,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
42995
42901
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
42996
42902
|
|
|
42997
42903
|
"use strict";
|
|
42998
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuActions\", function() { return MenuActions; });\n/* harmony import */ var _menu_actions_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./menu-actions.scss */ \"./src/renderer/components/menu/menu-actions.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _confirm_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../confirm-dialog */ \"./src/renderer/components/confirm-dialog/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../menu */ \"./src/renderer/components/menu/index.ts\");\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/uniqueId */ \"./node_modules/lodash/uniqueId.js\");\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash_isString__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash/isString */ \"./node_modules/lodash/isString.js\");\n/* harmony import */ var lodash_isString__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_isString__WEBPACK_IMPORTED_MODULE_9__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\n\n\n\nlet MenuActions = class MenuActions extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default()(\"menu_actions_\")\n });\n Object.defineProperty(this, \"isOpen\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: !!this.props.toolbar\n });\n Object.defineProperty(this, \"toggle\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.props.toolbar)\n return;\n this.isOpen = !this.isOpen;\n }\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_2__[\"makeObservable\"])(this);\n }\n remove() {\n const { removeAction } = this.props;\n let { removeConfirmationMessage } = this.props;\n if (typeof removeConfirmationMessage === \"function\") {\n removeConfirmationMessage = removeConfirmationMessage();\n }\n _confirm_dialog__WEBPACK_IMPORTED_MODULE_5__[\"ConfirmDialog\"].open({\n ok: removeAction,\n labelOk: `Remove`,\n message: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", null, removeConfirmationMessage),\n });\n }\n renderTriggerIcon() {\n if (this.props.toolbar)\n return null;\n const { triggerIcon = \"more_vert\" } = this.props;\n let className;\n if (Object(react__WEBPACK_IMPORTED_MODULE_1__[\"isValidElement\"])(triggerIcon)) {\n className = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"cssNames\"])(triggerIcon.props.className, { active: this.isOpen });\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(triggerIcon, { id: this.id, className });\n }\n const iconProps = Object.assign({ id: this.id, interactive: true, material: lodash_isString__WEBPACK_IMPORTED_MODULE_9___default()(triggerIcon) ? triggerIcon : undefined, active: this.isOpen }, (typeof triggerIcon === \"object\" ? triggerIcon : {}));\n if (this.props.onOpen) {\n iconProps.onClick = this.props.onOpen;\n }\n if (iconProps.tooltip && this.isOpen) {\n delete iconProps.tooltip; // don't show tooltip for icon when menu is open\n }\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__[\"Icon\"], Object.assign({}, iconProps)));\n }\n render() {\n const _a = this.props, { className, toolbar, autoCloseOnSelect, children, updateAction, removeAction, triggerIcon, removeConfirmationMessage } = _a, menuProps = __rest(_a, [\"className\", \"toolbar\", \"autoCloseOnSelect\", \"children\", \"updateAction\", \"removeAction\", \"triggerIcon\", \"removeConfirmationMessage\"]);\n const menuClassName = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"cssNames\"])(\"MenuActions flex\", className, {\n toolbar,\n gaps: toolbar, // add spacing for .flex\n });\n const autoClose = !toolbar;\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n this.renderTriggerIcon(),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_7__[\"Menu\"], Object.assign({ htmlFor: this.id, isOpen: this.isOpen, open: this.toggle, close: this.toggle, className: menuClassName, usePortal: autoClose, closeOnScroll: autoClose, closeOnClickItem: autoCloseOnSelect !== null && autoCloseOnSelect !== void 0 ? autoCloseOnSelect : autoClose, closeOnClickOutside: autoClose }, menuProps),\n children,\n updateAction && (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_7__[\"MenuItem\"], { onClick: updateAction },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__[\"Icon\"], { material: \"edit\", interactive: toolbar, tooltip: \"Edit\" }),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"title\" }, \"Edit\"))),\n removeAction && (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_7__[\"MenuItem\"], { onClick: this.remove, \"data-testid\": \"menu-action-remove\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__[\"Icon\"], { material: \"delete\", interactive: toolbar, tooltip: \"Delete\" }),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"title\" }, \"Delete\"))))));\n }\n};\nObject.defineProperty(MenuActions, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n get removeConfirmationMessage() {\n return `Remove item?`;\n },\n }\n});\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_2__[\"observable\"],\n __metadata(\"design:type\", Object)\n], MenuActions.prototype, \"isOpen\", void 0);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], MenuActions.prototype, \"remove\", null);\nMenuActions = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], MenuActions);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/menu/menu-actions.tsx?");
|
|
42904
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuActions\", function() { return MenuActions; });\n/* harmony import */ var _menu_actions_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./menu-actions.scss */ \"./src/renderer/components/menu/menu-actions.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _confirm_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../confirm-dialog */ \"./src/renderer/components/confirm-dialog/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./menu */ \"./src/renderer/components/menu/menu.tsx\");\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/uniqueId */ \"./node_modules/lodash/uniqueId.js\");\n/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash_isString__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash/isString */ \"./node_modules/lodash/isString.js\");\n/* harmony import */ var lodash_isString__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_isString__WEBPACK_IMPORTED_MODULE_9__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\n\n\n\nlet MenuActions = class MenuActions extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: lodash_uniqueId__WEBPACK_IMPORTED_MODULE_8___default()(\"menu_actions_\")\n });\n Object.defineProperty(this, \"isOpen\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: !!this.props.toolbar\n });\n Object.defineProperty(this, \"toggle\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.props.toolbar)\n return;\n this.isOpen = !this.isOpen;\n }\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_2__[\"makeObservable\"])(this);\n }\n remove() {\n const { removeAction } = this.props;\n let { removeConfirmationMessage } = this.props;\n if (typeof removeConfirmationMessage === \"function\") {\n removeConfirmationMessage = removeConfirmationMessage();\n }\n _confirm_dialog__WEBPACK_IMPORTED_MODULE_5__[\"ConfirmDialog\"].open({\n ok: removeAction,\n labelOk: `Remove`,\n message: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", null, removeConfirmationMessage),\n });\n }\n renderTriggerIcon() {\n if (this.props.toolbar)\n return null;\n const { triggerIcon = \"more_vert\" } = this.props;\n let className;\n if (Object(react__WEBPACK_IMPORTED_MODULE_1__[\"isValidElement\"])(triggerIcon)) {\n className = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"cssNames\"])(triggerIcon.props.className, { active: this.isOpen });\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(triggerIcon, { id: this.id, className });\n }\n const iconProps = Object.assign({ id: this.id, interactive: true, material: lodash_isString__WEBPACK_IMPORTED_MODULE_9___default()(triggerIcon) ? triggerIcon : undefined, active: this.isOpen }, (typeof triggerIcon === \"object\" ? triggerIcon : {}));\n if (this.props.onOpen) {\n iconProps.onClick = this.props.onOpen;\n }\n if (iconProps.tooltip && this.isOpen) {\n delete iconProps.tooltip; // don't show tooltip for icon when menu is open\n }\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__[\"Icon\"], Object.assign({}, iconProps)));\n }\n render() {\n const _a = this.props, { className, toolbar, autoCloseOnSelect, children, updateAction, removeAction, triggerIcon, removeConfirmationMessage } = _a, menuProps = __rest(_a, [\"className\", \"toolbar\", \"autoCloseOnSelect\", \"children\", \"updateAction\", \"removeAction\", \"triggerIcon\", \"removeConfirmationMessage\"]);\n const menuClassName = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"cssNames\"])(\"MenuActions flex\", className, {\n toolbar,\n gaps: toolbar, // add spacing for .flex\n });\n const autoClose = !toolbar;\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n this.renderTriggerIcon(),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_7__[\"Menu\"], Object.assign({ htmlFor: this.id, isOpen: this.isOpen, open: this.toggle, close: this.toggle, className: menuClassName, usePortal: autoClose, closeOnScroll: autoClose, closeOnClickItem: autoCloseOnSelect !== null && autoCloseOnSelect !== void 0 ? autoCloseOnSelect : autoClose, closeOnClickOutside: autoClose }, menuProps),\n children,\n updateAction && (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_7__[\"MenuItem\"], { onClick: updateAction },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__[\"Icon\"], { material: \"edit\", interactive: toolbar, tooltip: \"Edit\" }),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"title\" }, \"Edit\"))),\n removeAction && (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_7__[\"MenuItem\"], { onClick: this.remove, \"data-testid\": \"menu-action-remove\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__[\"Icon\"], { material: \"delete\", interactive: toolbar, tooltip: \"Delete\" }),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"span\", { className: \"title\" }, \"Delete\"))))));\n }\n};\nObject.defineProperty(MenuActions, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n get removeConfirmationMessage() {\n return `Remove item?`;\n },\n }\n});\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_2__[\"observable\"],\n __metadata(\"design:type\", Object)\n], MenuActions.prototype, \"isOpen\", void 0);\n__decorate([\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"boundMethod\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], MenuActions.prototype, \"remove\", null);\nMenuActions = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], MenuActions);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/menu/menu-actions.tsx?");
|
|
42999
42905
|
|
|
43000
42906
|
/***/ }),
|
|
43001
42907
|
|
|
@@ -43019,7 +42925,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
43019
42925
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43020
42926
|
|
|
43021
42927
|
"use strict";
|
|
43022
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuContext\", function() { return MenuContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return Menu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SubMenu\", function() { return SubMenu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuItem\", function() { return MenuItem; });\n/* harmony import */ var _menu_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./menu.scss */ \"./src/renderer/components/menu/menu.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../animate */ \"./src/renderer/components/animate/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isEqual */ \"./node_modules/lodash/isEqual.js\");\n/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\nconst MenuContext = react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(null);\nconst defaultPropsMenu = {\n position: { right: true, bottom: true },\n autoFocus: false,\n usePortal: false,\n closeOnClickItem: true,\n closeOnClickOutside: true,\n closeOnScroll: false,\n toggleEvent: \"click\",\n};\nclass Menu extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"opener\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"items\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"state\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"refreshPosition\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (!this.props.usePortal || !this.opener || !this.elem) {\n return;\n }\n const openerClientRect = this.opener.getBoundingClientRect();\n let { left: openerLeft, top: openerTop, bottom: openerBottom, right: openerRight } = this.opener.getBoundingClientRect();\n const withScroll = window.getComputedStyle(this.elem).position !== \"fixed\";\n // window global scroll corrections\n if (withScroll) {\n openerLeft += window.pageXOffset;\n openerTop += window.pageYOffset;\n openerRight = openerLeft + openerClientRect.width;\n openerBottom = openerTop + openerClientRect.height;\n }\n const extraMargin = this.props.usePortal ? 8 : 0;\n const { width: menuWidth, height: menuHeight } = this.elem.getBoundingClientRect();\n const rightSideOfMenu = openerLeft + menuWidth;\n const renderMenuLeft = rightSideOfMenu > window.innerWidth;\n const menuOnLeftSidePosition = `${openerRight - this.elem.offsetWidth}px`;\n const menuOnRightSidePosition = `${openerLeft}px`;\n const bottomOfMenu = openerBottom + extraMargin + menuHeight;\n const renderMenuOnTop = bottomOfMenu > window.innerHeight;\n const menuOnTopPosition = `${openerTop - this.elem.offsetHeight - extraMargin}px`;\n const menuOnBottomPosition = `${openerBottom + extraMargin}px`;\n this.setState({\n position: {\n top: renderMenuOnTop,\n bottom: !renderMenuOnTop,\n left: renderMenuLeft,\n right: !renderMenuLeft,\n },\n menuStyle: {\n top: renderMenuOnTop ? menuOnTopPosition : menuOnBottomPosition,\n left: renderMenuLeft ? menuOnLeftSidePosition : menuOnRightSidePosition,\n },\n });\n }\n });\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"autoBind\"])(this);\n }\n get isOpen() {\n return !!this.props.isOpen;\n }\n get isClosed() {\n return !this.isOpen;\n }\n componentDidMount() {\n if (!this.props.usePortal) {\n const parent = this.elem.parentElement;\n const position = window.getComputedStyle(parent).position;\n if (position === \"static\")\n parent.style.position = \"relative\";\n }\n else if (this.isOpen) {\n this.refreshPosition();\n }\n this.opener = document.getElementById(this.props.htmlFor); // might not exist in sub-menus\n if (this.opener) {\n this.opener.addEventListener(this.props.toggleEvent, this.toggle);\n this.opener.addEventListener(\"keydown\", this.onKeyDown);\n }\n this.elem.addEventListener(\"keydown\", this.onKeyDown);\n window.addEventListener(\"resize\", this.onWindowResize);\n window.addEventListener(\"click\", this.onClickOutside, true);\n window.addEventListener(\"scroll\", this.onScrollOutside, true);\n window.addEventListener(\"contextmenu\", this.onContextMenu, true);\n window.addEventListener(\"blur\", this.onBlur, true);\n }\n componentWillUnmount() {\n if (this.opener) {\n this.opener.removeEventListener(this.props.toggleEvent, this.toggle);\n this.opener.removeEventListener(\"keydown\", this.onKeyDown);\n }\n this.elem.removeEventListener(\"keydown\", this.onKeyDown);\n window.removeEventListener(\"resize\", this.onWindowResize);\n window.removeEventListener(\"click\", this.onClickOutside, true);\n window.removeEventListener(\"scroll\", this.onScrollOutside, true);\n }\n componentDidUpdate(prevProps) {\n if (!lodash_isEqual__WEBPACK_IMPORTED_MODULE_6___default()(prevProps.children, this.props.children)) {\n this.refreshPosition();\n }\n }\n get focusableItems() {\n return Object.values(this.items).filter(item => item.isFocusable);\n }\n get focusedItem() {\n return this.focusableItems.find(item => item.elem === document.activeElement);\n }\n focusNextItem(reverse = false) {\n const items = this.focusableItems;\n const activeIndex = items.findIndex(item => item === this.focusedItem);\n if (!items.length) {\n return;\n }\n if (activeIndex > -1) {\n let nextItem = reverse ? items[activeIndex - 1] : items[activeIndex + 1];\n if (!nextItem)\n nextItem = items[activeIndex];\n nextItem.elem.focus();\n }\n else {\n items[0].elem.focus();\n }\n }\n open() {\n if (this.isOpen) {\n return;\n }\n this.props.open();\n this.refreshPosition();\n if (this.props.autoFocus) {\n this.focusNextItem();\n }\n }\n close() {\n if (this.isClosed) {\n return;\n }\n this.props.close();\n }\n toggle() {\n if (this.isOpen) {\n this.close();\n }\n else {\n this.open();\n }\n }\n onKeyDown(evt) {\n if (!this.isOpen)\n return;\n switch (evt.code) {\n case \"Escape\":\n this.close();\n break;\n case \"Space\":\n case \"Enter\":\n const focusedItem = this.focusedItem;\n if (focusedItem) {\n focusedItem.elem.click();\n evt.preventDefault();\n }\n break;\n case \"ArrowUp\":\n this.focusNextItem(true);\n break;\n case \"ArrowDown\":\n this.focusNextItem();\n break;\n }\n }\n onContextMenu() {\n this.close();\n }\n onWindowResize() {\n if (!this.isOpen)\n return;\n this.refreshPosition();\n }\n onScrollOutside(evt) {\n if (!this.isOpen)\n return;\n const target = evt.target;\n const { usePortal, closeOnScroll } = this.props;\n if (usePortal && closeOnScroll && !target.contains(this.elem)) {\n this.close();\n }\n }\n onClickOutside(evt) {\n if (!this.props.closeOnClickOutside)\n return;\n if (!this.isOpen || evt.target === document.body)\n return;\n const target = evt.target;\n const clickInsideMenu = this.elem.contains(target);\n const clickOnOpener = this.opener && this.opener.contains(target);\n if (!clickInsideMenu && !clickOnOpener) {\n this.close();\n }\n }\n onBlur() {\n var _a;\n if (!this.isOpen)\n return; // Prevents triggering document.activeElement for each <Menu/> instance\n if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) == \"IFRAME\") {\n this.close();\n }\n }\n bindRef(elem) {\n this.elem = elem;\n }\n bindItemRef(item, index) {\n this.items[index] = item;\n }\n render() {\n var _a, _b, _c, _d;\n const { position, id } = this.props;\n let { className, usePortal } = this.props;\n className = Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cssNames\"])(\"Menu\", className, this.state.position || position, {\n portal: usePortal,\n });\n let children = this.props.children;\n if (children.type === react__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"]) {\n children = children.props.children;\n }\n const menuItems = react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.toArray(children).map((item, index) => {\n if (item.type === MenuItem) {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(item, {\n ref: (item) => this.bindItemRef(item, index),\n });\n }\n return item;\n });\n const menu = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MenuContext.Provider, { value: this },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_4__[\"Animate\"], { enter: this.isOpen },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"ul\", { id: id, ref: this.bindRef, className: className, style: {\n left: (_b = (_a = this.state) === null || _a === void 0 ? void 0 : _a.menuStyle) === null || _b === void 0 ? void 0 : _b.left,\n top: (_d = (_c = this.state) === null || _c === void 0 ? void 0 : _c.menuStyle) === null || _d === void 0 ? void 0 : _d.top,\n } }, menuItems))));\n if (usePortal === true)\n usePortal = document.body;\n return usePortal instanceof HTMLElement ? Object(react_dom__WEBPACK_IMPORTED_MODULE_2__[\"createPortal\"])(menu, usePortal) : menu;\n }\n}\nObject.defineProperty(Menu, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultPropsMenu\n});\nfunction SubMenu(props) {\n const { className } = props, menuProps = __rest(props, [\"className\"]);\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Menu, Object.assign({ className: Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cssNames\"])(\"SubMenu\", className), isOpen: true, open: _utils__WEBPACK_IMPORTED_MODULE_3__[\"noop\"], close: _utils__WEBPACK_IMPORTED_MODULE_3__[\"noop\"], position: {}, closeOnClickOutside: false, closeOnClickItem: false }, menuProps)));\n}\nconst defaultPropsMenuItem = {\n onClick: _utils__WEBPACK_IMPORTED_MODULE_3__[\"noop\"],\n};\nclass MenuItem extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"autoBind\"])(this);\n }\n get isFocusable() {\n const { disabled, spacer } = this.props;\n return !(disabled || spacer);\n }\n get isLink() {\n return !!this.props.href;\n }\n onClick(evt) {\n const menu = this.context;\n const { spacer, onClick } = this.props;\n if (spacer)\n return;\n onClick(evt);\n if (menu.props.closeOnClickItem && !evt.defaultPrevented) {\n menu.close();\n }\n }\n bindRef(elem) {\n this.elem = elem;\n }\n render() {\n const _a = this.props, { className, disabled, active, spacer, icon, children } = _a, props = __rest(_a, [\"className\", \"disabled\", \"active\", \"spacer\", \"icon\", \"children\"]);\n let iconProps;\n if (icon) {\n iconProps = {};\n if (typeof icon === \"string\")\n iconProps.material = icon;\n else\n Object.assign(iconProps, icon);\n }\n const elemProps = Object.assign(Object.assign({ tabIndex: this.isFocusable ? 0 : -1 }, props), { className: Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cssNames\"])(\"MenuItem\", className, { disabled, active, spacer }), onClick: this.onClick, children: icon ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_5__[\"Icon\"], Object.assign({}, iconProps)),\n \" \",\n children) : children, ref: this.bindRef });\n if (this.isLink) {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"a\", Object.assign({}, elemProps));\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"li\", Object.assign({}, elemProps));\n }\n}\nObject.defineProperty(MenuItem, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultPropsMenuItem\n});\nObject.defineProperty(MenuItem, \"contextType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: MenuContext\n});\n\n\n//# sourceURL=webpack:///./src/renderer/components/menu/menu.tsx?");
|
|
42928
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuContext\", function() { return MenuContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return Menu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SubMenu\", function() { return SubMenu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuItem\", function() { return MenuItem; });\n/* harmony import */ var _menu_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./menu.scss */ \"./src/renderer/components/menu/menu.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../animate */ \"./src/renderer/components/animate/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isEqual */ \"./node_modules/lodash/isEqual.js\");\n/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\nconst MenuContext = react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(null);\nconst defaultPropsMenu = {\n position: { right: true, bottom: true },\n autoFocus: false,\n usePortal: false,\n closeOnClickItem: true,\n closeOnClickOutside: true,\n closeOnScroll: false,\n toggleEvent: \"click\",\n};\nclass Menu extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"opener\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"items\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"state\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"refreshPosition\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (!this.props.usePortal || !this.opener || !this.elem) {\n return;\n }\n const openerClientRect = this.opener.getBoundingClientRect();\n let { left: openerLeft, top: openerTop, bottom: openerBottom, right: openerRight } = this.opener.getBoundingClientRect();\n const withScroll = window.getComputedStyle(this.elem).position !== \"fixed\";\n // window global scroll corrections\n if (withScroll) {\n openerLeft += window.pageXOffset;\n openerTop += window.pageYOffset;\n openerRight = openerLeft + openerClientRect.width;\n openerBottom = openerTop + openerClientRect.height;\n }\n const extraMargin = this.props.usePortal ? 8 : 0;\n const { width: menuWidth, height: menuHeight } = this.elem.getBoundingClientRect();\n const rightSideOfMenu = openerLeft + menuWidth;\n const renderMenuLeft = rightSideOfMenu > window.innerWidth;\n const menuOnLeftSidePosition = `${openerRight - this.elem.offsetWidth}px`;\n const menuOnRightSidePosition = `${openerLeft}px`;\n const bottomOfMenu = openerBottom + extraMargin + menuHeight;\n const renderMenuOnTop = bottomOfMenu > window.innerHeight;\n const menuOnTopPosition = `${openerTop - this.elem.offsetHeight - extraMargin}px`;\n const menuOnBottomPosition = `${openerBottom + extraMargin}px`;\n this.setState({\n position: {\n top: renderMenuOnTop,\n bottom: !renderMenuOnTop,\n left: renderMenuLeft,\n right: !renderMenuLeft,\n },\n menuStyle: {\n top: renderMenuOnTop ? menuOnTopPosition : menuOnBottomPosition,\n left: renderMenuLeft ? menuOnLeftSidePosition : menuOnRightSidePosition,\n },\n });\n }\n });\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"autoBind\"])(this);\n }\n get isOpen() {\n return !!this.props.isOpen;\n }\n get isClosed() {\n return !this.isOpen;\n }\n componentDidMount() {\n if (!this.props.usePortal) {\n const parent = this.elem.parentElement;\n const position = window.getComputedStyle(parent).position;\n if (position === \"static\")\n parent.style.position = \"relative\";\n }\n else if (this.isOpen) {\n this.refreshPosition();\n }\n this.opener = document.getElementById(this.props.htmlFor); // might not exist in sub-menus\n if (this.opener) {\n this.opener.addEventListener(this.props.toggleEvent, this.toggle);\n this.opener.addEventListener(\"keydown\", this.onKeyDown);\n }\n this.elem.addEventListener(\"keydown\", this.onKeyDown);\n window.addEventListener(\"resize\", this.onWindowResize);\n window.addEventListener(\"click\", this.onClickOutside, true);\n window.addEventListener(\"scroll\", this.onScrollOutside, true);\n window.addEventListener(\"contextmenu\", this.onContextMenu, true);\n window.addEventListener(\"blur\", this.onBlur, true);\n }\n componentWillUnmount() {\n if (this.opener) {\n this.opener.removeEventListener(this.props.toggleEvent, this.toggle);\n this.opener.removeEventListener(\"keydown\", this.onKeyDown);\n }\n this.elem.removeEventListener(\"keydown\", this.onKeyDown);\n window.removeEventListener(\"resize\", this.onWindowResize);\n window.removeEventListener(\"click\", this.onClickOutside, true);\n window.removeEventListener(\"scroll\", this.onScrollOutside, true);\n }\n componentDidUpdate(prevProps) {\n if (!lodash_isEqual__WEBPACK_IMPORTED_MODULE_6___default()(prevProps.children, this.props.children)) {\n this.refreshPosition();\n }\n }\n get focusableItems() {\n return Object.values(this.items).filter(item => item.isFocusable);\n }\n get focusedItem() {\n return this.focusableItems.find(item => item.elem === document.activeElement);\n }\n focusNextItem(reverse = false) {\n const items = this.focusableItems;\n const activeIndex = items.findIndex(item => item === this.focusedItem);\n if (!items.length) {\n return;\n }\n if (activeIndex > -1) {\n let nextItem = reverse ? items[activeIndex - 1] : items[activeIndex + 1];\n if (!nextItem)\n nextItem = items[activeIndex];\n nextItem.elem.focus();\n }\n else {\n items[0].elem.focus();\n }\n }\n open() {\n if (this.isOpen) {\n return;\n }\n this.props.open();\n this.refreshPosition();\n if (this.props.autoFocus) {\n this.focusNextItem();\n }\n }\n close() {\n if (this.isClosed) {\n return;\n }\n this.props.close();\n }\n toggle() {\n if (this.isOpen) {\n this.close();\n }\n else {\n this.open();\n }\n }\n onKeyDown(evt) {\n if (!this.isOpen)\n return;\n switch (evt.code) {\n case \"Escape\":\n this.close();\n break;\n case \"Space\":\n // fallthrough\n case \"Enter\": {\n const focusedItem = this.focusedItem;\n if (focusedItem) {\n focusedItem.elem.click();\n evt.preventDefault();\n }\n break;\n }\n case \"ArrowUp\":\n this.focusNextItem(true);\n break;\n case \"ArrowDown\":\n this.focusNextItem();\n break;\n }\n }\n onContextMenu() {\n this.close();\n }\n onWindowResize() {\n if (!this.isOpen)\n return;\n this.refreshPosition();\n }\n onScrollOutside(evt) {\n if (!this.isOpen)\n return;\n const target = evt.target;\n const { usePortal, closeOnScroll } = this.props;\n if (usePortal && closeOnScroll && !target.contains(this.elem)) {\n this.close();\n }\n }\n onClickOutside(evt) {\n if (!this.props.closeOnClickOutside)\n return;\n if (!this.isOpen || evt.target === document.body)\n return;\n const target = evt.target;\n const clickInsideMenu = this.elem.contains(target);\n const clickOnOpener = this.opener && this.opener.contains(target);\n if (!clickInsideMenu && !clickOnOpener) {\n this.close();\n }\n }\n onBlur() {\n var _a;\n if (!this.isOpen)\n return; // Prevents triggering document.activeElement for each <Menu/> instance\n if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) == \"IFRAME\") {\n this.close();\n }\n }\n bindRef(elem) {\n this.elem = elem;\n }\n bindItemRef(item, index) {\n this.items[index] = item;\n }\n render() {\n var _a, _b, _c, _d;\n const { position, id } = this.props;\n let { className, usePortal } = this.props;\n className = Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cssNames\"])(\"Menu\", className, this.state.position || position, {\n portal: usePortal,\n });\n let children = this.props.children;\n if (children.type === react__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"]) {\n children = children.props.children;\n }\n const menuItems = react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.toArray(children).map((item, index) => {\n if (item.type === MenuItem) {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(item, {\n ref: (item) => this.bindItemRef(item, index),\n });\n }\n return item;\n });\n const menu = (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MenuContext.Provider, { value: this },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_4__[\"Animate\"], { enter: this.isOpen },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"ul\", { id: id, ref: this.bindRef, className: className, style: {\n left: (_b = (_a = this.state) === null || _a === void 0 ? void 0 : _a.menuStyle) === null || _b === void 0 ? void 0 : _b.left,\n top: (_d = (_c = this.state) === null || _c === void 0 ? void 0 : _c.menuStyle) === null || _d === void 0 ? void 0 : _d.top,\n } }, menuItems))));\n if (usePortal === true)\n usePortal = document.body;\n return usePortal instanceof HTMLElement ? Object(react_dom__WEBPACK_IMPORTED_MODULE_2__[\"createPortal\"])(menu, usePortal) : menu;\n }\n}\nObject.defineProperty(Menu, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultPropsMenu\n});\nfunction SubMenu(props) {\n const { className } = props, menuProps = __rest(props, [\"className\"]);\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Menu, Object.assign({ className: Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cssNames\"])(\"SubMenu\", className), isOpen: true, open: _utils__WEBPACK_IMPORTED_MODULE_3__[\"noop\"], close: _utils__WEBPACK_IMPORTED_MODULE_3__[\"noop\"], position: {}, closeOnClickOutside: false, closeOnClickItem: false }, menuProps)));\n}\nconst defaultPropsMenuItem = {\n onClick: _utils__WEBPACK_IMPORTED_MODULE_3__[\"noop\"],\n};\nclass MenuItem extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"autoBind\"])(this);\n }\n get isFocusable() {\n const { disabled, spacer } = this.props;\n return !(disabled || spacer);\n }\n get isLink() {\n return !!this.props.href;\n }\n onClick(evt) {\n const menu = this.context;\n const { spacer, onClick } = this.props;\n if (spacer)\n return;\n onClick(evt);\n if (menu.props.closeOnClickItem && !evt.defaultPrevented) {\n menu.close();\n }\n }\n bindRef(elem) {\n this.elem = elem;\n }\n render() {\n const _a = this.props, { className, disabled, active, spacer, icon, children } = _a, props = __rest(_a, [\"className\", \"disabled\", \"active\", \"spacer\", \"icon\", \"children\"]);\n let iconProps;\n if (icon) {\n iconProps = {};\n if (typeof icon === \"string\")\n iconProps.material = icon;\n else\n Object.assign(iconProps, icon);\n }\n const elemProps = Object.assign(Object.assign({ tabIndex: this.isFocusable ? 0 : -1 }, props), { className: Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cssNames\"])(\"MenuItem\", className, { disabled, active, spacer }), onClick: this.onClick, children: icon ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_5__[\"Icon\"], Object.assign({}, iconProps)),\n \" \",\n children) : children, ref: this.bindRef });\n if (this.isLink) {\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"a\", Object.assign({}, elemProps));\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"li\", Object.assign({}, elemProps));\n }\n}\nObject.defineProperty(MenuItem, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultPropsMenuItem\n});\nObject.defineProperty(MenuItem, \"contextType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: MenuContext\n});\n\n\n//# sourceURL=webpack:///./src/renderer/components/menu/menu.tsx?");
|
|
43023
42929
|
|
|
43024
42930
|
/***/ }),
|
|
43025
42931
|
|
|
@@ -43055,7 +42961,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
43055
42961
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43056
42962
|
|
|
43057
42963
|
"use strict";
|
|
43058
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultEditorProps\", function() { return defaultEditorProps; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MonacoEditor\", function() { return MonacoEditor; });\n/* harmony import */ var _monaco_editor_module_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./monaco-editor.module.scss */ \"./src/renderer/components/monaco-editor/monaco-editor.module.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var monaco_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! monaco-editor */ \"./node_modules/monaco-editor/esm/vs/editor/editor.main.js\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ \"./src/renderer/components/monaco-editor/index.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var _theme_store__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme.store */ \"./src/renderer/theme.store.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar MonacoEditor_1;\n\n\n\n\n\n\n\n\n\n\nconst defaultEditorProps = {\n language: \"yaml\",\n get theme() {\n // theme for monaco-editor defined in `src/renderer/themes/lens-*.json`\n return _theme_store__WEBPACK_IMPORTED_MODULE_9__[\"ThemeStore\"].getInstance().activeTheme.monacoTheme;\n },\n};\nlet MonacoEditor = MonacoEditor_1 = class MonacoEditor extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"staticId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: `editor-id#${Math.round(1e7 * Math.random())}`\n });\n Object.defineProperty(this, \"dispose\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_7__[\"disposer\"])()\n });\n // TODO: investigate how to replace with \"common/logger\"\n // currently leads for stucking UI forever & infinite loop.\n // e.g. happens on tab change/create, maybe some other cases too.\n Object.defineProperty(this, \"logger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: console\n });\n Object.defineProperty(this, \"containerElem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"editor\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"dimensions\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"unmounting\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"onModelChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (model, oldModel) => {\n var _a, _b, _c;\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(\"[MONACO]: model change\", { model, oldModel }, this.logMetadata);\n if (oldModel) {\n this.saveViewState(oldModel);\n }\n this.editor.setModel(model);\n this.restoreViewState(model);\n this.editor.layout();\n this.editor.focus(); // keep focus in editor, e.g. when clicking between dock-tabs\n (_c = (_b = this.props).onModelChange) === null || _c === void 0 ? void 0 : _c.call(_b, model, oldModel);\n this.validateLazy();\n }\n });\n Object.defineProperty(this, \"validate\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (value = this.getValue()) => {\n var _a, _b;\n const validators = [\n _index__WEBPACK_IMPORTED_MODULE_5__[\"monacoValidators\"][this.props.language], // parsing syntax check\n ].filter(Boolean);\n for (const validate of validators) {\n try {\n validate(value);\n }\n catch (error) {\n (_b = (_a = this.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error); // emit error outside\n }\n }\n }\n });\n // avoid excessive validations during typing\n Object.defineProperty(this, \"validateLazy\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"debounce\"])(this.validate, 250)\n });\n Object.defineProperty(this, \"bindRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (elem) => this.containerElem = elem\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"makeObservable\"])(this);\n }\n static createUri(id) {\n return monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"Uri\"].file(`/monaco-editor/${id}`);\n }\n get id() {\n var _a;\n return (_a = this.props.id) !== null && _a !== void 0 ? _a : this.staticId;\n }\n get model() {\n const uri = MonacoEditor_1.createUri(this.id);\n const model = monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].getModel(uri);\n if (model) {\n return model; // already exists\n }\n const { language, value } = this.props;\n return monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].createModel(value, language, uri);\n }\n get options() {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"merge\"])({}, _common_user_store__WEBPACK_IMPORTED_MODULE_8__[\"UserStore\"].getInstance().editorConfiguration, this.props.options);\n }\n get logMetadata() {\n return {\n editorId: this.id,\n model: this.model,\n };\n }\n /**\n * Monitor editor's dom container element box-size and sync with monaco's dimensions\n * @private\n */\n bindResizeObserver() {\n const resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n this.setDimensions(width, height);\n }\n });\n const containerElem = this.editor.getContainerDomNode();\n resizeObserver.observe(containerElem);\n return () => resizeObserver.unobserve(containerElem);\n }\n /**\n * Save current view-model state in the editor.\n * This will allow restore cursor position, selected text, etc.\n * @param {editor.ITextModel} model\n */\n saveViewState(model) {\n MonacoEditor_1.viewStates.set(model.uri, this.editor.saveViewState());\n }\n restoreViewState(model) {\n const viewState = MonacoEditor_1.viewStates.get(model.uri);\n if (viewState) {\n this.editor.restoreViewState(viewState);\n }\n }\n componentDidMount() {\n var _a, _b;\n try {\n this.createEditor();\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(`[MONACO]: editor did mount`, this.logMetadata);\n }\n catch (error) {\n (_b = this.logger) === null || _b === void 0 ? void 0 : _b.error(`[MONACO]: mounting failed: ${error}`, this.logMetadata);\n }\n }\n componentWillUnmount() {\n this.unmounting = true;\n this.saveViewState(this.model);\n this.destroy();\n }\n createEditor() {\n var _a;\n if (!this.containerElem || this.editor || this.unmounting) {\n return;\n }\n const { language, theme, readOnly, value: defaultValue } = this.props;\n this.editor = monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].create(this.containerElem, Object.assign({ model: this.model, detectIndentation: false, value: defaultValue, language,\n theme,\n readOnly }, this.options));\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(`[MONACO]: editor created for language=${language}, theme=${theme}`, this.logMetadata);\n this.validateLazy(); // validate initial value\n this.restoreViewState(this.model); // restore previous state if any\n if (this.props.autoFocus) {\n this.editor.focus();\n }\n const onDidLayoutChangeDisposer = this.editor.onDidLayoutChange(layoutInfo => {\n var _a, _b;\n (_b = (_a = this.props).onDidLayoutChange) === null || _b === void 0 ? void 0 : _b.call(_a, layoutInfo);\n });\n const onValueChangeDisposer = this.editor.onDidChangeModelContent(event => {\n var _a, _b;\n const value = this.editor.getValue();\n (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, value, event);\n this.validateLazy(value);\n });\n const onContentSizeChangeDisposer = this.editor.onDidContentSizeChange((params) => {\n var _a, _b;\n (_b = (_a = this.props).onDidContentSizeChange) === null || _b === void 0 ? void 0 : _b.call(_a, params);\n });\n this.dispose.push(Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.model, this.onModelChange), Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.props.theme, monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].setTheme), Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.props.value, value => this.setValue(value)), Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.options, opts => this.editor.updateOptions(opts)), () => onDidLayoutChangeDisposer.dispose(), () => onValueChangeDisposer.dispose(), () => onContentSizeChangeDisposer.dispose(), this.bindResizeObserver());\n }\n destroy() {\n if (!this.editor)\n return;\n this.dispose();\n this.editor.dispose();\n this.editor = null;\n }\n setDimensions(width, height) {\n var _a;\n this.dimensions.width = width;\n this.dimensions.height = height;\n (_a = this.editor) === null || _a === void 0 ? void 0 : _a.layout({ width, height });\n }\n setValue(value = \"\") {\n if (value == this.getValue())\n return;\n this.editor.setValue(value);\n this.validate(value);\n }\n getValue(opts) {\n var _a, _b;\n return (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue(opts)) !== null && _b !== void 0 ? _b : \"\";\n }\n focus() {\n var _a;\n (_a = this.editor) === null || _a === void 0 ? void 0 : _a.focus();\n }\n render() {\n const { className, style } = this.props;\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { \"data-test-component\": \"monaco-editor\", className: Object(_utils__WEBPACK_IMPORTED_MODULE_7__[\"cssNames\"])(_monaco_editor_module_scss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].MonacoEditor, className), style: style, ref: this.bindRef }));\n }\n};\nObject.defineProperty(MonacoEditor, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultEditorProps\n});\nObject.defineProperty(MonacoEditor, \"viewStates\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new WeakMap()\n});\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"].ref,\n __metadata(\"design:type\", HTMLElement)\n], MonacoEditor.prototype, \"containerElem\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"].ref,\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"editor\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"],\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"dimensions\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"],\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"unmounting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"id\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"model\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"options\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"logMetadata\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Number, Number]),\n __metadata(\"design:returntype\", void 0)\n], MonacoEditor.prototype, \"setDimensions\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"action\"],\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"validate\", void 0);\nMonacoEditor = MonacoEditor_1 = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], MonacoEditor);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/monaco-editor/monaco-editor.tsx?");
|
|
42964
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultEditorProps\", function() { return defaultEditorProps; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MonacoEditor\", function() { return MonacoEditor; });\n/* harmony import */ var _monaco_editor_module_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./monaco-editor.module.scss */ \"./src/renderer/components/monaco-editor/monaco-editor.module.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var monaco_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! monaco-editor */ \"./node_modules/monaco-editor/esm/vs/editor/editor.main.js\");\n/* harmony import */ var _monaco_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./monaco-validators */ \"./src/renderer/components/monaco-editor/monaco-validators.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var _theme_store__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme.store */ \"./src/renderer/theme.store.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar MonacoEditor_1;\n\n\n\n\n\n\n\n\n\n\nconst defaultEditorProps = {\n language: \"yaml\",\n get theme() {\n // theme for monaco-editor defined in `src/renderer/themes/lens-*.json`\n return _theme_store__WEBPACK_IMPORTED_MODULE_9__[\"ThemeStore\"].getInstance().activeTheme.monacoTheme;\n },\n};\nlet MonacoEditor = MonacoEditor_1 = class MonacoEditor extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"staticId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: `editor-id#${Math.round(1e7 * Math.random())}`\n });\n Object.defineProperty(this, \"dispose\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_7__[\"disposer\"])()\n });\n // TODO: investigate how to replace with \"common/logger\"\n // currently leads for stucking UI forever & infinite loop.\n // e.g. happens on tab change/create, maybe some other cases too.\n Object.defineProperty(this, \"logger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: console\n });\n Object.defineProperty(this, \"containerElem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"editor\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"dimensions\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"unmounting\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"onModelChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (model, oldModel) => {\n var _a, _b, _c;\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(\"[MONACO]: model change\", { model, oldModel }, this.logMetadata);\n if (oldModel) {\n this.saveViewState(oldModel);\n }\n this.editor.setModel(model);\n this.restoreViewState(model);\n this.editor.layout();\n this.editor.focus(); // keep focus in editor, e.g. when clicking between dock-tabs\n (_c = (_b = this.props).onModelChange) === null || _c === void 0 ? void 0 : _c.call(_b, model, oldModel);\n this.validateLazy();\n }\n });\n Object.defineProperty(this, \"validate\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (value = this.getValue()) => {\n var _a, _b;\n const validators = [\n _monaco_validators__WEBPACK_IMPORTED_MODULE_5__[\"monacoValidators\"][this.props.language], // parsing syntax check\n ].filter(Boolean);\n for (const validate of validators) {\n try {\n validate(value);\n }\n catch (error) {\n (_b = (_a = this.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error); // emit error outside\n }\n }\n }\n });\n // avoid excessive validations during typing\n Object.defineProperty(this, \"validateLazy\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"debounce\"])(this.validate, 250)\n });\n Object.defineProperty(this, \"bindRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (elem) => this.containerElem = elem\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"makeObservable\"])(this);\n }\n static createUri(id) {\n return monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"Uri\"].file(`/monaco-editor/${id}`);\n }\n get id() {\n var _a;\n return (_a = this.props.id) !== null && _a !== void 0 ? _a : this.staticId;\n }\n get model() {\n const uri = MonacoEditor_1.createUri(this.id);\n const model = monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].getModel(uri);\n if (model) {\n return model; // already exists\n }\n const { language, value } = this.props;\n return monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].createModel(value, language, uri);\n }\n get options() {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"merge\"])({}, _common_user_store__WEBPACK_IMPORTED_MODULE_8__[\"UserStore\"].getInstance().editorConfiguration, this.props.options);\n }\n get logMetadata() {\n return {\n editorId: this.id,\n model: this.model,\n };\n }\n /**\n * Monitor editor's dom container element box-size and sync with monaco's dimensions\n * @private\n */\n bindResizeObserver() {\n const resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n this.setDimensions(width, height);\n }\n });\n const containerElem = this.editor.getContainerDomNode();\n resizeObserver.observe(containerElem);\n return () => resizeObserver.unobserve(containerElem);\n }\n /**\n * Save current view-model state in the editor.\n * This will allow restore cursor position, selected text, etc.\n * @param {editor.ITextModel} model\n */\n saveViewState(model) {\n MonacoEditor_1.viewStates.set(model.uri, this.editor.saveViewState());\n }\n restoreViewState(model) {\n const viewState = MonacoEditor_1.viewStates.get(model.uri);\n if (viewState) {\n this.editor.restoreViewState(viewState);\n }\n }\n componentDidMount() {\n var _a, _b;\n try {\n this.createEditor();\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(`[MONACO]: editor did mount`, this.logMetadata);\n }\n catch (error) {\n (_b = this.logger) === null || _b === void 0 ? void 0 : _b.error(`[MONACO]: mounting failed: ${error}`, this.logMetadata);\n }\n }\n componentWillUnmount() {\n this.unmounting = true;\n this.saveViewState(this.model);\n this.destroy();\n }\n createEditor() {\n var _a;\n if (!this.containerElem || this.editor || this.unmounting) {\n return;\n }\n const { language, theme, readOnly, value: defaultValue } = this.props;\n this.editor = monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].create(this.containerElem, Object.assign({ model: this.model, detectIndentation: false, value: defaultValue, language,\n theme,\n readOnly }, this.options));\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(`[MONACO]: editor created for language=${language}, theme=${theme}`, this.logMetadata);\n this.validateLazy(); // validate initial value\n this.restoreViewState(this.model); // restore previous state if any\n if (this.props.autoFocus) {\n this.editor.focus();\n }\n const onDidLayoutChangeDisposer = this.editor.onDidLayoutChange(layoutInfo => {\n var _a, _b;\n (_b = (_a = this.props).onDidLayoutChange) === null || _b === void 0 ? void 0 : _b.call(_a, layoutInfo);\n });\n const onValueChangeDisposer = this.editor.onDidChangeModelContent(event => {\n var _a, _b;\n const value = this.editor.getValue();\n (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, value, event);\n this.validateLazy(value);\n });\n const onContentSizeChangeDisposer = this.editor.onDidContentSizeChange((params) => {\n var _a, _b;\n (_b = (_a = this.props).onDidContentSizeChange) === null || _b === void 0 ? void 0 : _b.call(_a, params);\n });\n this.dispose.push(Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.model, this.onModelChange), Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.props.theme, monaco_editor__WEBPACK_IMPORTED_MODULE_4__[\"editor\"].setTheme), Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.props.value, value => this.setValue(value)), Object(mobx__WEBPACK_IMPORTED_MODULE_3__[\"reaction\"])(() => this.options, opts => this.editor.updateOptions(opts)), () => onDidLayoutChangeDisposer.dispose(), () => onValueChangeDisposer.dispose(), () => onContentSizeChangeDisposer.dispose(), this.bindResizeObserver());\n }\n destroy() {\n if (!this.editor)\n return;\n this.dispose();\n this.editor.dispose();\n this.editor = null;\n }\n setDimensions(width, height) {\n var _a;\n this.dimensions.width = width;\n this.dimensions.height = height;\n (_a = this.editor) === null || _a === void 0 ? void 0 : _a.layout({ width, height });\n }\n setValue(value = \"\") {\n if (value == this.getValue())\n return;\n this.editor.setValue(value);\n this.validate(value);\n }\n getValue(opts) {\n var _a, _b;\n return (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue(opts)) !== null && _b !== void 0 ? _b : \"\";\n }\n focus() {\n var _a;\n (_a = this.editor) === null || _a === void 0 ? void 0 : _a.focus();\n }\n render() {\n const { className, style } = this.props;\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { \"data-test-component\": \"monaco-editor\", className: Object(_utils__WEBPACK_IMPORTED_MODULE_7__[\"cssNames\"])(_monaco_editor_module_scss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].MonacoEditor, className), style: style, ref: this.bindRef }));\n }\n};\nObject.defineProperty(MonacoEditor, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: defaultEditorProps\n});\nObject.defineProperty(MonacoEditor, \"viewStates\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new WeakMap()\n});\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"].ref,\n __metadata(\"design:type\", HTMLElement)\n], MonacoEditor.prototype, \"containerElem\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"].ref,\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"editor\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"],\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"dimensions\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"observable\"],\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"unmounting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"id\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"model\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"options\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], MonacoEditor.prototype, \"logMetadata\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Number, Number]),\n __metadata(\"design:returntype\", void 0)\n], MonacoEditor.prototype, \"setDimensions\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_3__[\"action\"],\n __metadata(\"design:type\", Object)\n], MonacoEditor.prototype, \"validate\", void 0);\nMonacoEditor = MonacoEditor_1 = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_2__[\"observer\"],\n __metadata(\"design:paramtypes\", [Object])\n], MonacoEditor);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/monaco-editor/monaco-editor.tsx?");
|
|
43059
42965
|
|
|
43060
42966
|
/***/ }),
|
|
43061
42967
|
|
|
@@ -43869,7 +43775,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
43869
43775
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43870
43776
|
|
|
43871
43777
|
"use strict";
|
|
43872
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ThemeStore\", function() { return ThemeStore; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _themes_lens_dark_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./themes/lens-dark.json */ \"./src/renderer/themes/lens-dark.json\");\nvar _themes_lens_dark_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./themes/lens-dark.json */ \"./src/renderer/themes/lens-dark.json\", 1);\n/* harmony import */ var _themes_lens_light_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./themes/lens-light.json */ \"./src/renderer/themes/lens-light.json\");\nvar _themes_lens_light_json__WEBPACK_IMPORTED_MODULE_5___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./themes/lens-light.json */ \"./src/renderer/themes/lens-light.json\", 1);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\nclass ThemeStore extends _utils__WEBPACK_IMPORTED_MODULE_1__[\"Singleton\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"styles\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n // bundled themes from `themes/${themeId}.json`\n Object.defineProperty(this, \"themes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map({\n \"lens-dark\": _themes_lens_dark_json__WEBPACK_IMPORTED_MODULE_4__,\n \"lens-light\": _themes_lens_light_json__WEBPACK_IMPORTED_MODULE_5__,\n })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n // auto-apply active theme\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.activeThemeId, themeId => {\n try {\n this.applyTheme(this.getThemeById(themeId));\n }\n catch (err) {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(err);\n _common_user_store__WEBPACK_IMPORTED_MODULE_2__[\"UserStore\"].getInstance().resetTheme();\n }\n }, {\n fireImmediately: true,\n });\n }\n get activeThemeId() {\n return _common_user_store__WEBPACK_IMPORTED_MODULE_2__[\"UserStore\"].getInstance().colorTheme;\n }\n get activeTheme() {\n var _a;\n return (_a = this.themes.get(this.activeThemeId)) !== null && _a !== void 0 ? _a : this.themes.get(
|
|
43778
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ThemeStore\", function() { return ThemeStore; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_user_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/user-store */ \"./src/common/user-store/index.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _themes_lens_dark_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./themes/lens-dark.json */ \"./src/renderer/themes/lens-dark.json\");\nvar _themes_lens_dark_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./themes/lens-dark.json */ \"./src/renderer/themes/lens-dark.json\", 1);\n/* harmony import */ var _themes_lens_light_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./themes/lens-light.json */ \"./src/renderer/themes/lens-light.json\");\nvar _themes_lens_light_json__WEBPACK_IMPORTED_MODULE_5___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./themes/lens-light.json */ \"./src/renderer/themes/lens-light.json\", 1);\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/vars */ \"./src/common/vars.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\nclass ThemeStore extends _utils__WEBPACK_IMPORTED_MODULE_1__[\"Singleton\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"styles\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n // bundled themes from `themes/${themeId}.json`\n Object.defineProperty(this, \"themes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map({\n \"lens-dark\": _themes_lens_dark_json__WEBPACK_IMPORTED_MODULE_4__,\n \"lens-light\": _themes_lens_light_json__WEBPACK_IMPORTED_MODULE_5__,\n })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n // auto-apply active theme\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.activeThemeId, themeId => {\n try {\n this.applyTheme(this.getThemeById(themeId));\n }\n catch (err) {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(err);\n _common_user_store__WEBPACK_IMPORTED_MODULE_2__[\"UserStore\"].getInstance().resetTheme();\n }\n }, {\n fireImmediately: true,\n });\n }\n get activeThemeId() {\n return _common_user_store__WEBPACK_IMPORTED_MODULE_2__[\"UserStore\"].getInstance().colorTheme;\n }\n get activeTheme() {\n var _a;\n return (_a = this.themes.get(this.activeThemeId)) !== null && _a !== void 0 ? _a : this.themes.get(_common_vars__WEBPACK_IMPORTED_MODULE_6__[\"defaultTheme\"]);\n }\n get themeOptions() {\n return Array.from(this.themes).map(([themeId, theme]) => ({\n label: theme.name,\n value: themeId,\n }));\n }\n getThemeById(themeId) {\n return this.themes.get(themeId);\n }\n applyTheme(theme) {\n if (!this.styles) {\n this.styles = document.createElement(\"style\");\n this.styles.id = \"lens-theme\";\n document.head.append(this.styles);\n }\n const cssVars = Object.entries(theme.colors).map(([cssName, color]) => {\n return `--${cssName}: ${color};`;\n });\n this.styles.textContent = `:root {\\n${cssVars.join(\"\\n\")}}`;\n // Adding universal theme flag which can be used in component styles\n const body = document.querySelector(\"body\");\n body.classList.toggle(\"theme-light\", theme.type === \"light\");\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], ThemeStore.prototype, \"activeThemeId\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], ThemeStore.prototype, \"activeTheme\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], ThemeStore.prototype, \"themeOptions\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/theme.store.ts?");
|
|
43873
43779
|
|
|
43874
43780
|
/***/ }),
|
|
43875
43781
|
|
|
@@ -43903,7 +43809,7 @@ eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"Light (Lens)\\\",\\\"type\
|
|
|
43903
43809
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43904
43810
|
|
|
43905
43811
|
"use strict";
|
|
43906
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createStorage\", function() { return createStorage; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _storageHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./storageHelper */ \"./src/renderer/utils/storageHelper.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/vars */ \"./src/common/vars.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Keeps window.localStorage state in external JSON-files.\n// Because app creates random port between restarts => storage session wiped out each time.\n\n\n\n\n\n\nconst storage = Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"])({\n initialized: false,\n loaded: false,\n data: {}, // json-serializable\n});\n/**\n * Creates a helper for saving data under the \"key\" intended for window.localStorage\n * @param key The descriptor of the data\n * @param defaultValue The default value of the data, must be JSON serializable\n */\nfunction createStorage(key, defaultValue) {\n const { logPrefix } = _storageHelper__WEBPACK_IMPORTED_MODULE_3__[\"StorageHelper\"];\n if (!storage.initialized) {\n storage.initialized = true;\n (async () => {\n const filePath = await _storageHelper__WEBPACK_IMPORTED_MODULE_3__[\"StorageHelper\"].getLocalStoragePath();\n try {\n storage.data = await fs_extra__WEBPACK_IMPORTED_MODULE_2___default.a.readJson(filePath);\n }\n catch (_a) { }\n finally {\n if (!_common_vars__WEBPACK_IMPORTED_MODULE_5__[\"isTestEnv\"]) {\n _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].info(`${logPrefix} loading finished for ${filePath}`);\n }\n storage.loaded = true;\n }\n // bind auto-saving data changes to %storage-file.json\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"toJS\"])(storage.data), saveFile, {\n delay: 250,\n equals: mobx__WEBPACK_IMPORTED_MODULE_1__[\"comparer\"].structural, // save only when something really changed\n });\n async function saveFile(state = {}) {\n _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].info(`${logPrefix} saving ${filePath}`);\n try {\n await fs_extra__WEBPACK_IMPORTED_MODULE_2___default.a.ensureDir(path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname(filePath), { mode: 0o755 });\n await fs_extra__WEBPACK_IMPORTED_MODULE_2___default.a.writeJson(filePath, state, { spaces: 2 });\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error(`${logPrefix} saving failed: ${error}`, {\n json: state, jsonFilePath: filePath,\n });\n }\n }\n })()\n .catch(error => _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error(`${logPrefix} Failed to initialize storage: ${error}`));\n }\n return new _storageHelper__WEBPACK_IMPORTED_MODULE_3__[\"StorageHelper\"](key, {\n autoInit: true,\n defaultValue,\n storage: {\n async getItem(key) {\n await Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"when\"])(() => storage.loaded);\n return storage.data[key];\n },\n setItem(key, value) {\n storage.data[key] = value;\n },\n removeItem(key) {\n delete storage.data[key];\n },\n },\n });\n}\n\n\n//# sourceURL=webpack:///./src/renderer/utils/createStorage.ts?");
|
|
43812
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createStorage\", function() { return createStorage; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fs-extra */ \"./node_modules/fs-extra/lib/index.js\");\n/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _storageHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./storageHelper */ \"./src/renderer/utils/storageHelper.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _common_vars__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/vars */ \"./src/common/vars.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n// Keeps window.localStorage state in external JSON-files.\n// Because app creates random port between restarts => storage session wiped out each time.\n\n\n\n\n\n\nconst storage = Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"])({\n initialized: false,\n loaded: false,\n data: {}, // json-serializable\n});\n/**\n * Creates a helper for saving data under the \"key\" intended for window.localStorage\n * @param key The descriptor of the data\n * @param defaultValue The default value of the data, must be JSON serializable\n */\nfunction createStorage(key, defaultValue) {\n const { logPrefix } = _storageHelper__WEBPACK_IMPORTED_MODULE_3__[\"StorageHelper\"];\n if (!storage.initialized) {\n storage.initialized = true;\n (async () => {\n const filePath = await _storageHelper__WEBPACK_IMPORTED_MODULE_3__[\"StorageHelper\"].getLocalStoragePath();\n try {\n storage.data = await fs_extra__WEBPACK_IMPORTED_MODULE_2___default.a.readJson(filePath);\n }\n catch (_a) {\n // ignore error\n }\n finally {\n if (!_common_vars__WEBPACK_IMPORTED_MODULE_5__[\"isTestEnv\"]) {\n _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].info(`${logPrefix} loading finished for ${filePath}`);\n }\n storage.loaded = true;\n }\n // bind auto-saving data changes to %storage-file.json\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"toJS\"])(storage.data), saveFile, {\n delay: 250,\n equals: mobx__WEBPACK_IMPORTED_MODULE_1__[\"comparer\"].structural, // save only when something really changed\n });\n async function saveFile(state = {}) {\n _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].info(`${logPrefix} saving ${filePath}`);\n try {\n await fs_extra__WEBPACK_IMPORTED_MODULE_2___default.a.ensureDir(path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname(filePath), { mode: 0o755 });\n await fs_extra__WEBPACK_IMPORTED_MODULE_2___default.a.writeJson(filePath, state, { spaces: 2 });\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error(`${logPrefix} saving failed: ${error}`, {\n json: state, jsonFilePath: filePath,\n });\n }\n }\n })()\n .catch(error => _main_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error(`${logPrefix} Failed to initialize storage: ${error}`));\n }\n return new _storageHelper__WEBPACK_IMPORTED_MODULE_3__[\"StorageHelper\"](key, {\n autoInit: true,\n defaultValue,\n storage: {\n async getItem(key) {\n await Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"when\"])(() => storage.loaded);\n return storage.data[key];\n },\n setItem(key, value) {\n storage.data[key] = value;\n },\n removeItem(key) {\n delete storage.data[key];\n },\n },\n });\n}\n\n\n//# sourceURL=webpack:///./src/renderer/utils/createStorage.ts?");
|
|
43907
43813
|
|
|
43908
43814
|
/***/ }),
|
|
43909
43815
|
|
|
@@ -44071,7 +43977,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
|
44071
43977
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
44072
43978
|
|
|
44073
43979
|
"use strict";
|
|
44074
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StorageHelper\", function() { return StorageHelper; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! immer */ \"./node_modules/immer/dist/immer.esm.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _common_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/app-paths */ \"./src/common/app-paths.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n// Helper for working with storages (e.g. window.localStorage, NodeJS/file-system, etc.)\n\n\n\n\n\n\n\nclass StorageHelper {\n constructor(key, options) {\n Object.defineProperty(this, \"key\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: key\n });\n Object.defineProperty(this, \"options\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: options\n });\n Object.defineProperty(this, \"storage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].box(undefined, {\n deep: true,\n equals: mobx__WEBPACK_IMPORTED_MODULE_0__[\"comparer\"].structural,\n })\n });\n Object.defineProperty(this, \"initialized\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"onData\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (data) => {\n const notEmpty = data != null;\n const notDefault = !this.isDefaultValue(data);\n if (notEmpty && notDefault) {\n this.set(data);\n }\n this.initialized = true;\n }\n });\n Object.defineProperty(this, \"onError\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (error) => {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`${StorageHelper.logPrefix} loading error: ${error}`, this);\n }\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n const { storage, autoInit = true } = options;\n this.storage = storage;\n this.data.observe_(({ newValue, oldValue }) => {\n this.onChange(newValue, oldValue);\n });\n if (autoInit) {\n this.init();\n }\n }\n static async getLocalStoragePath() {\n return path__WEBPACK_IMPORTED_MODULE_5___default.a.resolve(await _common_app_paths__WEBPACK_IMPORTED_MODULE_6__[\"AppPaths\"].getAsync(\"userData\"), \"lens-local-storage\", `${Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__[\"getHostedClusterId\"])() || \"app\"}.json`);\n }\n get whenReady() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"when\"])(() => this.initialized);\n }\n get defaultValue() {\n // return as-is since options.defaultValue might be a getter too\n return this.options.defaultValue;\n }\n init({ force = false } = {}) {\n if (this.initialized && !force) {\n return;\n }\n try {\n const data = this.storage.getItem(this.key);\n if (data instanceof Promise) {\n data.then(this.onData, this.onError);\n }\n else {\n this.onData(data);\n }\n }\n catch (error) {\n this.onError(error);\n }\n }\n isDefaultValue(value) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isEqual\"])(value, this.defaultValue);\n }\n onChange(value, oldValue) {\n var _a, _b;\n if (!this.initialized)\n return;\n try {\n if (value == null) {\n this.storage.removeItem(this.key);\n }\n else {\n this.storage.setItem(this.key, value);\n }\n (_b = (_a = this.storage).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, { value, oldValue, key: this.key });\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`${StorageHelper.logPrefix} updating storage: ${error}`, this, { value, oldValue });\n }\n }\n get() {\n var _a;\n return (_a = this.data.get()) !== null && _a !== void 0 ? _a : this.defaultValue;\n }\n set(value) {\n if (this.isDefaultValue(value)) {\n this.reset();\n }\n else {\n this.data.set(value);\n }\n }\n reset() {\n this.data.set(undefined);\n }\n merge(value) {\n const nextValue = Object(immer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.toJSON(), (draft) => {\n if (typeof value == \"function\") {\n const newValue = value(draft);\n // merge returned plain objects from `value-as-callback` usage\n // otherwise `draft` can be just modified inside a callback without returning any value (void)\n if (newValue && !Object(immer__WEBPACK_IMPORTED_MODULE_1__[\"isDraft\"])(newValue)) {\n Object.assign(draft, newValue);\n }\n }\n else if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isPlainObject\"])(value)) {\n Object.assign(draft, value);\n }\n return draft;\n });\n this.set(nextValue);\n }\n toJSON() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"toJS\"])(this.get());\n }\n}\nObject.defineProperty(StorageHelper, \"logPrefix\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"[StorageHelper]:\"\n});\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"],\n __metadata(\"design:type\", Object)\n], StorageHelper.prototype, \"initialized\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"init\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"set\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"reset\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"merge\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/utils/storageHelper.ts?");
|
|
43980
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StorageHelper\", function() { return StorageHelper; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! immer */ \"./node_modules/immer/dist/immer.esm.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _common_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/app-paths */ \"./src/common/app-paths.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n// Helper for working with storages (e.g. window.localStorage, NodeJS/file-system, etc.)\n\n\n\n\n\n\n\nclass StorageHelper {\n constructor(key, options) {\n Object.defineProperty(this, \"key\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: key\n });\n Object.defineProperty(this, \"options\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: options\n });\n Object.defineProperty(this, \"storage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].box(undefined, {\n deep: true,\n equals: mobx__WEBPACK_IMPORTED_MODULE_0__[\"comparer\"].structural,\n })\n });\n Object.defineProperty(this, \"initialized\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"onData\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (data) => {\n const notEmpty = data != null;\n const notDefault = !this.isDefaultValue(data);\n if (notEmpty && notDefault) {\n this.set(data);\n }\n this.initialized = true;\n }\n });\n Object.defineProperty(this, \"onError\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (error) => {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`${StorageHelper.logPrefix} loading error: ${error}`, this);\n }\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n const { storage, autoInit = true } = options;\n this.storage = storage;\n this.data.observe_(({ newValue, oldValue }) => {\n this.onChange(newValue, oldValue);\n });\n if (autoInit) {\n this.init();\n }\n }\n static async getLocalStoragePath() {\n return path__WEBPACK_IMPORTED_MODULE_5___default.a.resolve(await _common_app_paths__WEBPACK_IMPORTED_MODULE_6__[\"AppPaths\"].getAsync(\"userData\"), \"lens-local-storage\", `${Object(_common_utils__WEBPACK_IMPORTED_MODULE_4__[\"getHostedClusterId\"])() || \"app\"}.json`);\n }\n get whenReady() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"when\"])(() => this.initialized);\n }\n get defaultValue() {\n // return as-is since options.defaultValue might be a getter too\n return this.options.defaultValue;\n }\n init({ force = false } = {}) {\n if (this.initialized && !force) {\n return;\n }\n try {\n const data = this.storage.getItem(this.key);\n if (data instanceof Promise) {\n data.then(this.onData, this.onError);\n }\n else {\n this.onData(data);\n }\n }\n catch (error) {\n this.onError(error);\n }\n }\n isDefaultValue(value) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isEqual\"])(value, this.defaultValue);\n }\n onChange(value, oldValue) {\n var _a, _b;\n if (!this.initialized)\n return;\n try {\n if (value == null) {\n this.storage.removeItem(this.key);\n }\n else {\n this.storage.setItem(this.key, value);\n }\n (_b = (_a = this.storage).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, { value, oldValue, key: this.key });\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(`${StorageHelper.logPrefix} updating storage: ${error}`, this, { value, oldValue });\n }\n }\n get() {\n var _a;\n return (_a = this.data.get()) !== null && _a !== void 0 ? _a : this.defaultValue;\n }\n set(value) {\n if (this.isDefaultValue(value)) {\n this.reset();\n }\n else {\n this.data.set(value);\n }\n }\n reset() {\n this.data.set(undefined);\n }\n merge(value) {\n const nextValue = Object(immer__WEBPACK_IMPORTED_MODULE_1__[\"produce\"])(this.toJSON(), (draft) => {\n if (typeof value == \"function\") {\n const newValue = value(draft);\n // merge returned plain objects from `value-as-callback` usage\n // otherwise `draft` can be just modified inside a callback without returning any value (void)\n if (newValue && !Object(immer__WEBPACK_IMPORTED_MODULE_1__[\"isDraft\"])(newValue)) {\n Object.assign(draft, newValue);\n }\n }\n else if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isPlainObject\"])(value)) {\n Object.assign(draft, value);\n }\n return draft;\n });\n this.set(nextValue);\n }\n toJSON() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"toJS\"])(this.get());\n }\n}\nObject.defineProperty(StorageHelper, \"logPrefix\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"[StorageHelper]:\"\n});\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"],\n __metadata(\"design:type\", Object)\n], StorageHelper.prototype, \"initialized\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"init\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"set\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"reset\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], StorageHelper.prototype, \"merge\", null);\n\n\n//# sourceURL=webpack:///./src/renderer/utils/storageHelper.ts?");
|
|
44075
43981
|
|
|
44076
43982
|
/***/ }),
|
|
44077
43983
|
|
|
@@ -44240,6 +44146,17 @@ eval("module.exports = require(\"path\");\n\n//# sourceURL=webpack:///external_%
|
|
|
44240
44146
|
|
|
44241
44147
|
/***/ }),
|
|
44242
44148
|
|
|
44149
|
+
/***/ "process":
|
|
44150
|
+
/*!**************************!*\
|
|
44151
|
+
!*** external "process" ***!
|
|
44152
|
+
\**************************/
|
|
44153
|
+
/*! no static exports found */
|
|
44154
|
+
/***/ (function(module, exports) {
|
|
44155
|
+
|
|
44156
|
+
eval("module.exports = require(\"process\");\n\n//# sourceURL=webpack:///external_%22process%22?");
|
|
44157
|
+
|
|
44158
|
+
/***/ }),
|
|
44159
|
+
|
|
44243
44160
|
/***/ "punycode":
|
|
44244
44161
|
/*!***************************!*\
|
|
44245
44162
|
!*** external "punycode" ***!
|