cloudcmd 19.1.21 → 19.2.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.
@@ -26,7 +26,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
26
26
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
27
27
 
28
28
  "use strict";
29
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _css_main_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var wraptile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n/* harmony import */ var load_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n/* harmony import */ var _common_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #common/util */ \"./common/util.mjs\");\n/* harmony import */ var _common_cloudfunc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #common/cloudfunc */ \"./common/cloudfunc.mjs\");\n/* harmony import */ var _sw_register_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sw/register.mjs */ \"./client/sw/register.mjs\");\n/* harmony import */ var _sort_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sort.mjs */ \"./client/sort.mjs\");\n/* harmony import */ var _dom_index_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom/index.mjs */ \"./client/dom/index.mjs\");\n/* harmony import */ var _client_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./client.mjs */ \"./client/client.mjs\");\n/* harmony import */ var _listeners_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./listeners/index.mjs */ \"./client/listeners/index.mjs\");\n\n\n\n\n\n\n\n\n\n\n\nconst isDev = \"development\" === 'development';\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (init);\nglobalThis.CloudCmd = init;\nasync function init(config) {\n globalThis.CloudCmd = (0,_client_mjs__WEBPACK_IMPORTED_MODULE_9__.createCloudCmd)({\n DOM: _dom_index_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n Listeners: _listeners_index_mjs__WEBPACK_IMPORTED_MODULE_10__\n });\n globalThis.DOM = _dom_index_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n globalThis.Util = _common_util__WEBPACK_IMPORTED_MODULE_4__;\n globalThis.CloudFunc = _common_cloudfunc__WEBPACK_IMPORTED_MODULE_5__;\n await register(config);\n (0,_sort_mjs__WEBPACK_IMPORTED_MODULE_7__.initSortPanel)();\n globalThis.CloudCmd.sortPanel = _sort_mjs__WEBPACK_IMPORTED_MODULE_7__.sortPanel;\n const prefix = getPrefix(config.prefix);\n globalThis.CloudCmd.init(prefix, config);\n if (globalThis.CloudCmd.config('menu') === 'aleman') setTimeout(() => {\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! https://esm.sh/@putout/processor-html */ \"https://esm.sh/@putout/processor-html\"));\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! https://esm.sh/@putout/bundle */ \"https://esm.sh/@putout/bundle\"));\n }, 100);\n}\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile__WEBPACK_IMPORTED_MODULE_2__(async config => {\n if (isDev) return;\n const {\n DOM\n } = globalThis;\n const prefix = getPrefix(config.prefix);\n await load_js__WEBPACK_IMPORTED_MODULE_3__.js(`${prefix}/dist/cloudcmd.common.js`);\n await load_js__WEBPACK_IMPORTED_MODULE_3__.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n globalThis.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await (0,_sw_register_mjs__WEBPACK_IMPORTED_MODULE_6__.registerSW)(prefix);\n (0,_sw_register_mjs__WEBPACK_IMPORTED_MODULE_6__.listenSW)(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/cloudcmd.mjs\n}");
29
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _css_main_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var wraptile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n/* harmony import */ var load_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n/* harmony import */ var _common_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #common/util */ \"./common/util.mjs\");\n/* harmony import */ var _common_cloudfunc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #common/cloudfunc */ \"./common/cloudfunc.mjs\");\n/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! #dom */ \"./client/dom/index.mjs\");\n/* harmony import */ var _sw_register_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sw/register.mjs */ \"./client/sw/register.mjs\");\n/* harmony import */ var _sort_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./sort.mjs */ \"./client/sort.mjs\");\n/* harmony import */ var _client_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./client.mjs */ \"./client/client.mjs\");\n/* harmony import */ var _listeners_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./listeners/index.mjs */ \"./client/listeners/index.mjs\");\n\n\n\n\n\n\n\n\n\n\n\nconst isDev = \"development\" === 'development';\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (init);\nglobalThis.CloudCmd = init;\nasync function init(config) {\n globalThis.CloudCmd = (0,_client_mjs__WEBPACK_IMPORTED_MODULE_9__.createCloudCmd)({\n DOM: _dom__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n Listeners: _listeners_index_mjs__WEBPACK_IMPORTED_MODULE_10__\n });\n globalThis.DOM = _dom__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n globalThis.Util = _common_util__WEBPACK_IMPORTED_MODULE_4__;\n globalThis.CloudFunc = _common_cloudfunc__WEBPACK_IMPORTED_MODULE_5__;\n await register(config);\n (0,_sort_mjs__WEBPACK_IMPORTED_MODULE_8__.initSortPanel)();\n globalThis.CloudCmd.sortPanel = _sort_mjs__WEBPACK_IMPORTED_MODULE_8__.sortPanel;\n const prefix = getPrefix(config.prefix);\n globalThis.CloudCmd.init(prefix, config);\n if (globalThis.CloudCmd.config('menu') === 'aleman') setTimeout(() => {\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! https://esm.sh/@putout/processor-html */ \"https://esm.sh/@putout/processor-html\"));\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! https://esm.sh/@putout/bundle */ \"https://esm.sh/@putout/bundle\"));\n }, 100);\n}\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile__WEBPACK_IMPORTED_MODULE_2__(async config => {\n if (isDev) return;\n const {\n DOM\n } = globalThis;\n const prefix = getPrefix(config.prefix);\n await load_js__WEBPACK_IMPORTED_MODULE_3__.js(`${prefix}/dist/cloudcmd.common.js`);\n await load_js__WEBPACK_IMPORTED_MODULE_3__.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n globalThis.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await (0,_sw_register_mjs__WEBPACK_IMPORTED_MODULE_7__.registerSW)(prefix);\n (0,_sw_register_mjs__WEBPACK_IMPORTED_MODULE_7__.listenSW)(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/cloudcmd.mjs\n}");
30
30
 
31
31
  /***/ },
32
32
 
@@ -147,29 +147,29 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
147
147
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
148
148
 
149
149
  "use strict";
150
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CurrentInfo: () => (/* binding */ CurrentInfo),\n/* harmony export */ changePanel: () => (/* binding */ changePanel),\n/* harmony export */ checkStorageHash: () => (/* binding */ checkStorageHash),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ deleteCurrent: () => (/* binding */ deleteCurrent),\n/* harmony export */ deleteSelected: () => (/* binding */ deleteSelected),\n/* harmony export */ duplicatePanel: () => (/* binding */ duplicatePanel),\n/* harmony export */ expandSelection: () => (/* binding */ expandSelection),\n/* harmony export */ getActiveFiles: () => (/* binding */ getActiveFiles),\n/* harmony export */ getAllFiles: () => (/* binding */ getAllFiles),\n/* harmony export */ getCSSVar: () => (/* binding */ getCSSVar),\n/* harmony export */ getCurrentData: () => (/* binding */ getCurrentData),\n/* harmony export */ getCurrentDate: () => (/* binding */ getCurrentDate),\n/* harmony export */ getCurrentDirName: () => (/* binding */ getCurrentDirName),\n/* harmony export */ getCurrentLink: () => (/* binding */ getCurrentLink),\n/* harmony export */ getCurrentMode: () => (/* binding */ getCurrentMode),\n/* harmony export */ getCurrentOwner: () => (/* binding */ getCurrentOwner),\n/* harmony export */ getCurrentSize: () => (/* binding */ getCurrentSize),\n/* harmony export */ getFM: () => (/* binding */ getFM),\n/* harmony export */ getFilenames: () => (/* binding */ getFilenames),\n/* harmony export */ getFiles: () => (/* binding */ getFiles),\n/* harmony export */ getNotCurrentDirPath: () => (/* binding */ getNotCurrentDirPath),\n/* harmony export */ getPackerExt: () => (/* binding */ getPackerExt),\n/* harmony export */ getPanel: () => (/* binding */ getPanel),\n/* harmony export */ getPanelPosition: () => (/* binding */ getPanelPosition),\n/* harmony export */ getParentDirPath: () => (/* binding */ getParentDirPath),\n/* harmony export */ getRefreshButton: () => (/* binding */ getRefreshButton),\n/* harmony export */ goToDirectory: () => (/* binding */ goToDirectory),\n/* harmony export */ hidePanel: () => (/* binding */ hidePanel),\n/* harmony export */ loadCurrentHash: () => (/* binding */ loadCurrentHash),\n/* harmony export */ loadCurrentSize: () => (/* binding */ loadCurrentSize),\n/* harmony export */ loadRemote: () => (/* binding */ loadRemote),\n/* harmony export */ loadSocket: () => (/* binding */ loadSocket),\n/* harmony export */ promptNewDir: () => (/* binding */ promptNewDir),\n/* harmony export */ promptNewFile: () => (/* binding */ promptNewFile),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ saveDataToStorage: () => (/* binding */ saveDataToStorage),\n/* harmony export */ scrollByPages: () => (/* binding */ scrollByPages),\n/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),\n/* harmony export */ setCurrentSize: () => (/* binding */ setCurrentSize),\n/* harmony export */ setHistory: () => (/* binding */ setHistory),\n/* harmony export */ showPanel: () => (/* binding */ showPanel),\n/* harmony export */ shrinkSelection: () => (/* binding */ shrinkSelection),\n/* harmony export */ swapPanels: () => (/* binding */ swapPanels),\n/* harmony export */ unselectFiles: () => (/* binding */ unselectFiles),\n/* harmony export */ updateCurrentInfo: () => (/* binding */ updateCurrentInfo)\n/* harmony export */ });\n/* harmony import */ var _dom_load__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/load */ \"./client/dom/load.mjs\");\n/* harmony import */ var _dom_files__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/files */ \"./client/dom/files.mjs\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\n/* harmony import */ var _common_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #common/util */ \"./common/util.mjs\");\n/* harmony import */ var _dom_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #dom/storage */ \"./client/dom/storage.mjs\");\n/* harmony import */ var _dom_rest__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _operations_rename_current_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operations/rename-current.mjs */ \"./client/dom/operations/rename-current.mjs\");\n/* harmony import */ var _current_file_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./current-file.mjs */ \"./client/dom/current-file.mjs\");\n/* harmony import */ var _dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom-tree.mjs */ \"./client/dom/dom-tree.mjs\");\n/* harmony import */ var _cmd_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./cmd.mjs */ \"./client/dom/cmd.mjs\");\n/* harmony import */ var _io_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./io/index.js */ \"./client/dom/io/index.js\");\n/* harmony import */ var _directory_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./directory.mjs */ \"./client/dom/directory.mjs\");\n/* harmony import */ var _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./buffer.mjs */ \"./client/dom/buffer.mjs\");\n/* harmony import */ var _load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./load-remote.mjs */ \"./client/dom/load-remote.mjs\");\n/* harmony import */ var _select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./select-by-pattern.mjs */ \"./client/dom/select-by-pattern.mjs\");\n/* global CloudCmd */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n assign\n} = Object;\nconst DOM = {\n getCurrentDirName,\n getNotCurrentDirPath,\n getParentDirPath,\n loadRemote,\n loadSocket,\n promptNewDir,\n promptNewFile,\n unselectFiles,\n getActiveFiles,\n getCurrentDate,\n getCurrentSize,\n loadCurrentSize,\n loadCurrentHash,\n setCurrentSize,\n getCurrentMode,\n getCurrentOwner,\n getCurrentData,\n getRefreshButton,\n getAllFiles,\n expandSelection,\n shrinkSelection,\n setHistory,\n getCurrentLink,\n getFilenames,\n checkStorageHash,\n saveDataToStorage,\n getFM,\n getPanelPosition,\n getCSSVar,\n getPanel,\n getFiles,\n showPanel,\n hidePanel,\n remove,\n deleteCurrent,\n deleteSelected,\n renameCurrent: _operations_rename_current_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n scrollIntoViewIfNeeded,\n scrollByPages,\n changePanel,\n getPackerExt,\n goToDirectory,\n duplicatePanel,\n swapPanels,\n updateCurrentInfo\n};\nassign(DOM, {\n ..._dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__,\n ..._current_file_mjs__WEBPACK_IMPORTED_MODULE_9__,\n ..._cmd_mjs__WEBPACK_IMPORTED_MODULE_11__\n});\nconst CurrentInfo = {};\nDOM.Images = _dom_images__WEBPACK_IMPORTED_MODULE_7__;\nDOM.load = _dom_load__WEBPACK_IMPORTED_MODULE_0__;\nDOM.Files = _dom_files__WEBPACK_IMPORTED_MODULE_1__;\nDOM.RESTful = _dom_rest__WEBPACK_IMPORTED_MODULE_6__;\nDOM.IO = _io_index_js__WEBPACK_IMPORTED_MODULE_12__;\nDOM.Storage = _dom_storage__WEBPACK_IMPORTED_MODULE_5__;\nDOM.Dialog = _dom_dialog__WEBPACK_IMPORTED_MODULE_2__;\nDOM.CurrentInfo = CurrentInfo;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DOM);\nDOM.uploadDirectory = _directory_mjs__WEBPACK_IMPORTED_MODULE_13__.uploadDirectory;\nDOM.Buffer = _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__;\nDOM.Events = _dom_events__WEBPACK_IMPORTED_MODULE_3__;\nconst isString = a => typeof a === 'string';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\nfunction loadRemote(name, options, callback) {\n (0,_load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__.loadRemote)(name, options, callback);\n return DOM;\n}\nfunction loadSocket(callback) {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n}\n\n/**\n * create new folder\n *\n */\nasync function promptNewDir() {\n await promptNew('directory');\n}\n\n/**\n * create new file\n *\n * @typeName\n * @type\n */\nasync function promptNewFile() {\n await promptNew('file');\n}\nasync function promptNew(typeName) {\n const {\n Dialog\n } = DOM;\n const dir = DOM.getCurrentDirPath();\n const msg = `New ${typeName}` || 'File';\n const getName = () => {\n const name = DOM.getCurrentName();\n if (name === '..') return '';\n return name;\n };\n const name = getName();\n const [cancel, currentName] = await Dialog.prompt(msg, name);\n if (cancel) return;\n const path = `${dir}${currentName}`;\n if (typeName === 'directory') await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.createDirectory(path);else await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n\n/**\n * get current directory name\n */\nfunction getCurrentDirName() {\n const href = DOM.getCurrentDirPath().replace(/\\/$/, '');\n const substr = href.substr(href, href.lastIndexOf('/'));\n return href.replace(`${substr}/`, '') || '/';\n}\n\n/**\n * get current directory path\n */\nfunction getParentDirPath(panel) {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path !== '/') return path.slice(0, index);\n return path;\n}\n\n/**\n * get not current directory path\n */\nfunction getNotCurrentDirPath() {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n}\n\n/*\n * unselect all files\n */\nfunction unselectFiles(files) {\n files = files || DOM.getSelectedFiles();\n Array.from(files).forEach(DOM.toggleSelectedFile);\n}\n\n/**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\nfunction getActiveFiles() {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n if (!files.length && name !== '..') return [current];\n return files;\n}\nfunction getCurrentDate(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n return DOM.getByDataName('js-date', current).textContent;\n}\n\n/**\n * get size\n * @currentFile\n */\nfunction getCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n\n /* если это папка - возвращаем слово dir вместо размера*/\n const size = DOM.getByDataName('js-size', current).textContent.replace(/^<|>$/g, '');\n return size;\n}\n\n/**\n * get size\n * @currentFile\n */\nasync function loadCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n _dom_images__WEBPACK_IMPORTED_MODULE_7__.show.load();\n if (name === '..') return;\n const [, size] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n DOM.setCurrentSize(size, current);\n _dom_images__WEBPACK_IMPORTED_MODULE_7__.hide();\n return current;\n}\n\n/**\n * load hash\n * @callback\n * @currentFile\n */\nasync function loadCurrentHash(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n return data;\n}\n\n/**\n * set size\n * @currentFile\n */\nfunction setCurrentSize(size, currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n sizeElement.textContent = size;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentMode(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n return mode.textContent;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentOwner(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n return owner.textContent;\n}\n\n/**\n * unified way to get current file content\n *\n * @param currentFile\n */\nasync function getCurrentData(currentFile) {\n const {\n Dialog\n } = DOM;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n if (Info.name === '..') {\n Dialog.alert.noFiles();\n return [Error('No Files')];\n }\n if (isDir) return await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n const [hashNew, hash] = await DOM.checkStorageHash(path);\n if (!hashNew) return [Error(`Can't get hash of a file`)];\n if (hash === hashNew) return [null, await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(`${path}-data`)];\n const [e, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n if (e) return [e, null];\n const ONE_MEGABYTE = 1024 ** 2 * 1024;\n const {\n length\n } = data;\n if (hash && length < ONE_MEGABYTE) await DOM.saveDataToStorage(path, data, hashNew);\n return [null, data];\n}\n\n/**\n * unified way to get RefreshButton\n */\nfunction getRefreshButton(panel = DOM.getPanel()) {\n return DOM.getByDataName('js-refresh', panel);\n}\nfunction getAllFiles() {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n const from = a => a === '..' ? 1 : 0;\n const i = from(name);\n return Array.from(files).slice(i);\n}\n\n/**\n * open dialog with expand selection\n */\nasync function expandSelection() {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * open dialog with shrink selection\n */\nasync function shrinkSelection() {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * setting history wrapper\n */\nfunction setHistory(data, title, url) {\n const ret = globalThis.history;\n const {\n prefix\n } = CloudCmd;\n url = prefix + url;\n if (ret) history.pushState(data, title, url);\n return ret;\n}\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nfunction getCurrentLink(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n}\nfunction getFilenames(files) {\n if (!files) throw Error('AllFiles could not be empty');\n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n const allFiles = Array.from(files);\n if (name === '..') allFiles.shift();\n const names = allFiles.map(current => {\n return DOM.getCurrentName(current);\n });\n return names;\n}\n\n/**\n * check storage hash\n */\nasync function checkStorageHash(name) {\n const nameHash = `${name}-hash`;\n if (!isString(name)) throw Error('name should be a string!');\n const [loadHash, storeHash] = await Promise.all([DOM.loadCurrentHash(), _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(nameHash)]);\n return [loadHash, storeHash];\n}\n\n/**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n */\nasync function saveDataToStorage(name, data, hash) {\n const isDir = DOM.isCurrentIsDir();\n if (isDir) return;\n hash = hash || (await DOM.loadCurrentHash());\n const nameHash = `${name}-hash`;\n const nameData = `${name}-data`;\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameHash, hash);\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameData, data);\n return hash;\n}\nfunction getFM() {\n const {\n parentElement\n } = DOM.getPanel();\n return parentElement;\n}\nfunction getPanelPosition(panel) {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n}\nfunction getCSSVar(name, {\n body = document.body\n} = {}) {\n const bodyStyle = getComputedStyle(body);\n return bodyStyle.getPropertyValue(`--${name}`);\n}\n\n/** function getting panel active, or passive\n * @param options = {active: true}\n */\nfunction getPanel(options) {\n let files;\n let panel;\n let isLeft;\n let dataName = 'js-';\n const current = DOM.getCurrentFile();\n if (!current) {\n panel = DOM.getByDataName('js-left');\n } else {\n files = current.parentElement;\n panel = files.parentElement;\n isLeft = panel.getAttribute('data-name') === 'js-left';\n }\n\n /* if {active : false} getting passive panel */\n if (options && !options.active) {\n dataName += isLeft ? 'right' : 'left';\n panel = DOM.getByDataName(dataName);\n }\n\n /* if two panels showed\n * then always work with passive\n * panel\n */\n if (globalThis.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH) panel = DOM.getByDataName('js-left');\n if (!panel) throw Error('can not find Active Panel!');\n return panel;\n}\nfunction getFiles(element) {\n const files = DOM.getByDataName('js-files', element);\n return files.children || [];\n}\n\n/**\n * shows panel right or left (or active)\n */\nfunction showPanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n DOM.show(panel);\n return true;\n}\n\n/**\n * hides panel right or left (or active)\n */\nfunction hidePanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n return DOM.hide(panel);\n}\n\n/**\n * remove child of element\n * @param child\n * @param element\n */\nfunction remove(child, element) {\n const parent = element || document.body;\n parent.removeChild(child);\n return DOM;\n}\n\n/**\n * remove current file from file table\n * @param current\n *\n */\nfunction deleteCurrent(current) {\n if (!current) DOM.getCurrentFile();\n const parent = current === null || current === void 0 ? void 0 : current.parentElement;\n const name = DOM.getCurrentName(current);\n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n}\n\n/**\n * remove selected files from file table\n * @Selected\n */\nfunction deleteSelected(selected) {\n selected = selected || DOM.getSelectedFiles();\n if (!selected) return;\n selected.map(DOM.deleteCurrent);\n}\n\n/**\n * rename current file\n *\n * @currentFile\n */\nfunction scrollIntoViewIfNeeded(element, center = false) {\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n}\n\n/* scroll on one page */\nfunction scrollByPages(element, pPages) {\n const ret = (element === null || element === void 0 ? void 0 : element.scrollByPages) && pPages;\n if (ret) element.scrollByPages(pPages);\n return ret;\n}\nfunction changePanel() {\n const Info = CurrentInfo;\n let panel = DOM.getPanel();\n CloudCmd.emit('passive-dir', Info.dirPath);\n const panelPassive = DOM.getPanel({\n active: false\n });\n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n let dataName = panel.getAttribute('data-name');\n TabPanel[dataName] = name;\n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n name = TabPanel[dataName];\n let files;\n let current;\n if (name) {\n current = DOM.getCurrentByName(name, panel);\n if (current) files = current.parentElement;\n }\n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n if (!current) [current] = filesPassive;\n }\n DOM.setCurrentFile(current, {\n history: true\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n return DOM;\n}\nfunction getPackerExt(type) {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n}\nasync function goToDirectory(overrides = {}) {\n const {\n Dialog\n } = DOM;\n const {\n prompt = Dialog.prompt,\n changeDir = CloudCmd.changeDir\n } = overrides;\n const msg = 'Go to directory:';\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await prompt(msg, dirPath);\n if (cancel) return;\n await changeDir(path);\n}\nasync function duplicatePanel() {\n const Info = CurrentInfo;\n const {\n isDir\n } = Info;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n const getPath = isDir => {\n if (isDir) return Info.path;\n return Info.dirPath;\n };\n const path = getPath(isDir);\n await CloudCmd.changeDir(path, {\n panel,\n noCurrent\n });\n}\nasync function swapPanels() {\n const Info = CurrentInfo;\n const {\n panel,\n files,\n element,\n panelPassive\n } = Info;\n const path = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n let currentIndex = files.indexOf(element);\n await CloudCmd.changeDir(path, {\n panel: panelPassive,\n noCurrent: true\n });\n await CloudCmd.changeDir(dirPathPassive, {\n panel\n });\n const length = Info.files.length - 1;\n if (currentIndex > length) currentIndex = length;\n const el = Info.files[currentIndex];\n DOM.setCurrentFile(el);\n}\nfunction updateCurrentInfo(currentFile) {\n const info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const files = current.parentElement;\n const panelPassive = DOM.getPanel({\n active: false\n });\n const filesPassive = DOM.getFiles(panelPassive);\n const name = DOM.getCurrentName(current);\n info.dir = DOM.getCurrentDirName();\n info.dirPath = DOM.getCurrentDirPath();\n info.parentDirPath = DOM.getParentDirPath();\n info.element = current;\n info.ext = (0,_common_util__WEBPACK_IMPORTED_MODULE_4__.getExt)(name);\n info.files = Array.from(files.children);\n info.filesPassive = Array.from(filesPassive);\n info.first = files.firstChild;\n info.getData = DOM.getCurrentData;\n info.last = files.lastChild;\n info.link = DOM.getCurrentLink(current);\n info.mode = DOM.getCurrentMode(current);\n info.name = name;\n info.path = DOM.getCurrentPath(current);\n info.panel = files.parentElement || DOM.getPanel();\n info.panelPassive = panelPassive;\n info.size = DOM.getCurrentSize(current);\n info.isDir = DOM.isCurrentIsDir();\n info.isSelected = DOM.isSelected(current);\n info.panelPosition = DOM.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel = info.panel.getAttribute('data-name') === info.panelPassive.getAttribute('data-name');\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/index.mjs\n}");
150
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CurrentInfo: () => (/* binding */ CurrentInfo),\n/* harmony export */ changePanel: () => (/* binding */ changePanel),\n/* harmony export */ checkStorageHash: () => (/* binding */ checkStorageHash),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ deleteCurrent: () => (/* binding */ deleteCurrent),\n/* harmony export */ deleteSelected: () => (/* binding */ deleteSelected),\n/* harmony export */ duplicatePanel: () => (/* binding */ duplicatePanel),\n/* harmony export */ expandSelection: () => (/* binding */ expandSelection),\n/* harmony export */ getActiveFiles: () => (/* binding */ getActiveFiles),\n/* harmony export */ getAllFiles: () => (/* binding */ getAllFiles),\n/* harmony export */ getCSSVar: () => (/* binding */ getCSSVar),\n/* harmony export */ getCurrentData: () => (/* binding */ getCurrentData),\n/* harmony export */ getCurrentDate: () => (/* binding */ getCurrentDate),\n/* harmony export */ getCurrentDirName: () => (/* binding */ getCurrentDirName),\n/* harmony export */ getCurrentLink: () => (/* binding */ getCurrentLink),\n/* harmony export */ getCurrentMode: () => (/* binding */ getCurrentMode),\n/* harmony export */ getCurrentOwner: () => (/* binding */ getCurrentOwner),\n/* harmony export */ getCurrentSize: () => (/* binding */ getCurrentSize),\n/* harmony export */ getFM: () => (/* binding */ getFM),\n/* harmony export */ getFilenames: () => (/* binding */ getFilenames),\n/* harmony export */ getFiles: () => (/* binding */ getFiles),\n/* harmony export */ getNotCurrentDirPath: () => (/* binding */ getNotCurrentDirPath),\n/* harmony export */ getPackerExt: () => (/* binding */ getPackerExt),\n/* harmony export */ getPanel: () => (/* binding */ getPanel),\n/* harmony export */ getPanelPosition: () => (/* binding */ getPanelPosition),\n/* harmony export */ getParentDirPath: () => (/* binding */ getParentDirPath),\n/* harmony export */ getRefreshButton: () => (/* binding */ getRefreshButton),\n/* harmony export */ goToDirectory: () => (/* binding */ goToDirectory),\n/* harmony export */ hidePanel: () => (/* binding */ hidePanel),\n/* harmony export */ loadCurrentHash: () => (/* binding */ loadCurrentHash),\n/* harmony export */ loadCurrentSize: () => (/* binding */ loadCurrentSize),\n/* harmony export */ loadRemote: () => (/* binding */ loadRemote),\n/* harmony export */ loadSocket: () => (/* binding */ loadSocket),\n/* harmony export */ promptNewDir: () => (/* binding */ promptNewDir),\n/* harmony export */ promptNewFile: () => (/* binding */ promptNewFile),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ saveDataToStorage: () => (/* binding */ saveDataToStorage),\n/* harmony export */ scrollByPages: () => (/* binding */ scrollByPages),\n/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),\n/* harmony export */ setCurrentSize: () => (/* binding */ setCurrentSize),\n/* harmony export */ setHistory: () => (/* binding */ setHistory),\n/* harmony export */ showPanel: () => (/* binding */ showPanel),\n/* harmony export */ shrinkSelection: () => (/* binding */ shrinkSelection),\n/* harmony export */ swapPanels: () => (/* binding */ swapPanels),\n/* harmony export */ unselectFiles: () => (/* binding */ unselectFiles),\n/* harmony export */ updateCurrentInfo: () => (/* binding */ updateCurrentInfo)\n/* harmony export */ });\n/* harmony import */ var _dom_load__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/load */ \"./client/dom/load.mjs\");\n/* harmony import */ var _dom_files__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/files */ \"./client/dom/files.mjs\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\n/* harmony import */ var _common_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #common/util */ \"./common/util.mjs\");\n/* harmony import */ var _dom_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #dom/storage */ \"./client/dom/storage.mjs\");\n/* harmony import */ var _dom_rest__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _operations_rename_current_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operations/rename-current.mjs */ \"./client/dom/operations/rename-current.mjs\");\n/* harmony import */ var _current_file_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./current-file.mjs */ \"./client/dom/current-file.mjs\");\n/* harmony import */ var _dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom-tree.mjs */ \"./client/dom/dom-tree.mjs\");\n/* harmony import */ var _cmd_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./cmd.mjs */ \"./client/dom/cmd.mjs\");\n/* harmony import */ var _io_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./io/index.mjs */ \"./client/dom/io/index.mjs\");\n/* harmony import */ var _directory_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./directory.mjs */ \"./client/dom/directory.mjs\");\n/* harmony import */ var _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./buffer.mjs */ \"./client/dom/buffer.mjs\");\n/* harmony import */ var _load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./load-remote.mjs */ \"./client/dom/load-remote.mjs\");\n/* harmony import */ var _select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./select-by-pattern.mjs */ \"./client/dom/select-by-pattern.mjs\");\n/* global CloudCmd */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n assign\n} = Object;\nconst DOM = {\n getCurrentDirName,\n getNotCurrentDirPath,\n getParentDirPath,\n loadRemote,\n loadSocket,\n promptNewDir,\n promptNewFile,\n unselectFiles,\n getActiveFiles,\n getCurrentDate,\n getCurrentSize,\n loadCurrentSize,\n loadCurrentHash,\n setCurrentSize,\n getCurrentMode,\n getCurrentOwner,\n getCurrentData,\n getRefreshButton,\n getAllFiles,\n expandSelection,\n shrinkSelection,\n setHistory,\n getCurrentLink,\n getFilenames,\n checkStorageHash,\n saveDataToStorage,\n getFM,\n getPanelPosition,\n getCSSVar,\n getPanel,\n getFiles,\n showPanel,\n hidePanel,\n remove,\n deleteCurrent,\n deleteSelected,\n renameCurrent: _operations_rename_current_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n scrollIntoViewIfNeeded,\n scrollByPages,\n changePanel,\n getPackerExt,\n goToDirectory,\n duplicatePanel,\n swapPanels,\n updateCurrentInfo\n};\nassign(DOM, {\n ..._dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__,\n ..._current_file_mjs__WEBPACK_IMPORTED_MODULE_9__,\n ..._cmd_mjs__WEBPACK_IMPORTED_MODULE_11__\n});\nconst CurrentInfo = {};\nDOM.Images = _dom_images__WEBPACK_IMPORTED_MODULE_7__;\nDOM.load = _dom_load__WEBPACK_IMPORTED_MODULE_0__;\nDOM.Files = _dom_files__WEBPACK_IMPORTED_MODULE_1__;\nDOM.RESTful = _dom_rest__WEBPACK_IMPORTED_MODULE_6__;\nDOM.IO = _io_index_mjs__WEBPACK_IMPORTED_MODULE_12__;\nDOM.Storage = _dom_storage__WEBPACK_IMPORTED_MODULE_5__;\nDOM.Dialog = _dom_dialog__WEBPACK_IMPORTED_MODULE_2__;\nDOM.CurrentInfo = CurrentInfo;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DOM);\nDOM.uploadDirectory = _directory_mjs__WEBPACK_IMPORTED_MODULE_13__.uploadDirectory;\nDOM.Buffer = _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__;\nDOM.Events = _dom_events__WEBPACK_IMPORTED_MODULE_3__;\nconst isString = a => typeof a === 'string';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\nfunction loadRemote(name, options, callback) {\n (0,_load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__.loadRemote)(name, options, callback);\n return DOM;\n}\nfunction loadSocket(callback) {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n}\n\n/**\n * create new folder\n *\n */\nasync function promptNewDir() {\n await promptNew('directory');\n}\n\n/**\n * create new file\n *\n * @typeName\n * @type\n */\nasync function promptNewFile() {\n await promptNew('file');\n}\nasync function promptNew(typeName) {\n const {\n Dialog\n } = DOM;\n const dir = DOM.getCurrentDirPath();\n const msg = `New ${typeName}` || 'File';\n const getName = () => {\n const name = DOM.getCurrentName();\n if (name === '..') return '';\n return name;\n };\n const name = getName();\n const [cancel, currentName] = await Dialog.prompt(msg, name);\n if (cancel) return;\n const path = `${dir}${currentName}`;\n if (typeName === 'directory') await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.createDirectory(path);else await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n\n/**\n * get current directory name\n */\nfunction getCurrentDirName() {\n const href = DOM.getCurrentDirPath().replace(/\\/$/, '');\n const substr = href.substr(href, href.lastIndexOf('/'));\n return href.replace(`${substr}/`, '') || '/';\n}\n\n/**\n * get current directory path\n */\nfunction getParentDirPath(panel) {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path !== '/') return path.slice(0, index);\n return path;\n}\n\n/**\n * get not current directory path\n */\nfunction getNotCurrentDirPath() {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n}\n\n/*\n * unselect all files\n */\nfunction unselectFiles(files) {\n files = files || DOM.getSelectedFiles();\n Array.from(files).forEach(DOM.toggleSelectedFile);\n}\n\n/**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\nfunction getActiveFiles() {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n if (!files.length && name !== '..') return [current];\n return files;\n}\nfunction getCurrentDate(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n return DOM.getByDataName('js-date', current).textContent;\n}\n\n/**\n * get size\n * @currentFile\n */\nfunction getCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n\n /* если это папка - возвращаем слово dir вместо размера*/\n const size = DOM.getByDataName('js-size', current).textContent.replace(/^<|>$/g, '');\n return size;\n}\n\n/**\n * get size\n * @currentFile\n */\nasync function loadCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n _dom_images__WEBPACK_IMPORTED_MODULE_7__.show.load();\n if (name === '..') return;\n const [, size] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n DOM.setCurrentSize(size, current);\n _dom_images__WEBPACK_IMPORTED_MODULE_7__.hide();\n return current;\n}\n\n/**\n * load hash\n * @callback\n * @currentFile\n */\nasync function loadCurrentHash(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n return data;\n}\n\n/**\n * set size\n * @currentFile\n */\nfunction setCurrentSize(size, currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n sizeElement.textContent = size;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentMode(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n return mode.textContent;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentOwner(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n return owner.textContent;\n}\n\n/**\n * unified way to get current file content\n *\n * @param currentFile\n */\nasync function getCurrentData(currentFile) {\n const {\n Dialog\n } = DOM;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n if (Info.name === '..') {\n Dialog.alert.noFiles();\n return [Error('No Files')];\n }\n if (isDir) return await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n const [hashNew, hash] = await DOM.checkStorageHash(path);\n if (!hashNew) return [Error(`Can't get hash of a file`)];\n if (hash === hashNew) return [null, await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(`${path}-data`)];\n const [e, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n if (e) return [e, null];\n const ONE_MEGABYTE = 1024 ** 2 * 1024;\n const {\n length\n } = data;\n if (hash && length < ONE_MEGABYTE) await DOM.saveDataToStorage(path, data, hashNew);\n return [null, data];\n}\n\n/**\n * unified way to get RefreshButton\n */\nfunction getRefreshButton(panel = DOM.getPanel()) {\n return DOM.getByDataName('js-refresh', panel);\n}\nfunction getAllFiles() {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n const from = a => a === '..' ? 1 : 0;\n const i = from(name);\n return Array.from(files).slice(i);\n}\n\n/**\n * open dialog with expand selection\n */\nasync function expandSelection() {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * open dialog with shrink selection\n */\nasync function shrinkSelection() {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * setting history wrapper\n */\nfunction setHistory(data, title, url) {\n const ret = globalThis.history;\n const {\n prefix\n } = CloudCmd;\n url = prefix + url;\n if (ret) history.pushState(data, title, url);\n return ret;\n}\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nfunction getCurrentLink(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n}\nfunction getFilenames(files) {\n if (!files) throw Error('AllFiles could not be empty');\n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n const allFiles = Array.from(files);\n if (name === '..') allFiles.shift();\n const names = allFiles.map(current => {\n return DOM.getCurrentName(current);\n });\n return names;\n}\n\n/**\n * check storage hash\n */\nasync function checkStorageHash(name) {\n const nameHash = `${name}-hash`;\n if (!isString(name)) throw Error('name should be a string!');\n const [loadHash, storeHash] = await Promise.all([DOM.loadCurrentHash(), _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(nameHash)]);\n return [loadHash, storeHash];\n}\n\n/**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n */\nasync function saveDataToStorage(name, data, hash) {\n const isDir = DOM.isCurrentIsDir();\n if (isDir) return;\n hash = hash || (await DOM.loadCurrentHash());\n const nameHash = `${name}-hash`;\n const nameData = `${name}-data`;\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameHash, hash);\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameData, data);\n return hash;\n}\nfunction getFM() {\n const {\n parentElement\n } = DOM.getPanel();\n return parentElement;\n}\nfunction getPanelPosition(panel) {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n}\nfunction getCSSVar(name, {\n body = document.body\n} = {}) {\n const bodyStyle = getComputedStyle(body);\n return bodyStyle.getPropertyValue(`--${name}`);\n}\n\n/** function getting panel active, or passive\n * @param options = {active: true}\n */\nfunction getPanel(options) {\n let files;\n let panel;\n let isLeft;\n let dataName = 'js-';\n const current = DOM.getCurrentFile();\n if (!current) {\n panel = DOM.getByDataName('js-left');\n } else {\n files = current.parentElement;\n panel = files.parentElement;\n isLeft = panel.getAttribute('data-name') === 'js-left';\n }\n\n /* if {active : false} getting passive panel */\n if (options && !options.active) {\n dataName += isLeft ? 'right' : 'left';\n panel = DOM.getByDataName(dataName);\n }\n\n /* if two panels showed\n * then always work with passive\n * panel\n */\n if (globalThis.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH) panel = DOM.getByDataName('js-left');\n if (!panel) throw Error('can not find Active Panel!');\n return panel;\n}\nfunction getFiles(element) {\n const files = DOM.getByDataName('js-files', element);\n return files.children || [];\n}\n\n/**\n * shows panel right or left (or active)\n */\nfunction showPanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n DOM.show(panel);\n return true;\n}\n\n/**\n * hides panel right or left (or active)\n */\nfunction hidePanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n return DOM.hide(panel);\n}\n\n/**\n * remove child of element\n * @param child\n * @param element\n */\nfunction remove(child, element) {\n const parent = element || document.body;\n parent.removeChild(child);\n return DOM;\n}\n\n/**\n * remove current file from file table\n * @param current\n *\n */\nfunction deleteCurrent(current) {\n if (!current) DOM.getCurrentFile();\n const parent = current === null || current === void 0 ? void 0 : current.parentElement;\n const name = DOM.getCurrentName(current);\n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n}\n\n/**\n * remove selected files from file table\n * @Selected\n */\nfunction deleteSelected(selected) {\n selected = selected || DOM.getSelectedFiles();\n if (!selected) return;\n selected.map(DOM.deleteCurrent);\n}\n\n/**\n * rename current file\n *\n * @currentFile\n */\nfunction scrollIntoViewIfNeeded(element, center = false) {\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n}\n\n/* scroll on one page */\nfunction scrollByPages(element, pPages) {\n const ret = (element === null || element === void 0 ? void 0 : element.scrollByPages) && pPages;\n if (ret) element.scrollByPages(pPages);\n return ret;\n}\nfunction changePanel() {\n const Info = CurrentInfo;\n let panel = DOM.getPanel();\n CloudCmd.emit('passive-dir', Info.dirPath);\n const panelPassive = DOM.getPanel({\n active: false\n });\n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n let dataName = panel.getAttribute('data-name');\n TabPanel[dataName] = name;\n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n name = TabPanel[dataName];\n let files;\n let current;\n if (name) {\n current = DOM.getCurrentByName(name, panel);\n if (current) files = current.parentElement;\n }\n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n if (!current) [current] = filesPassive;\n }\n DOM.setCurrentFile(current, {\n history: true\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n return DOM;\n}\nfunction getPackerExt(type) {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n}\nasync function goToDirectory(overrides = {}) {\n const {\n Dialog\n } = DOM;\n const {\n prompt = Dialog.prompt,\n changeDir = CloudCmd.changeDir\n } = overrides;\n const msg = 'Go to directory:';\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await prompt(msg, dirPath);\n if (cancel) return;\n await changeDir(path);\n}\nasync function duplicatePanel() {\n const Info = CurrentInfo;\n const {\n isDir\n } = Info;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n const getPath = isDir => {\n if (isDir) return Info.path;\n return Info.dirPath;\n };\n const path = getPath(isDir);\n await CloudCmd.changeDir(path, {\n panel,\n noCurrent\n });\n}\nasync function swapPanels() {\n const Info = CurrentInfo;\n const {\n panel,\n files,\n element,\n panelPassive\n } = Info;\n const path = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n let currentIndex = files.indexOf(element);\n await CloudCmd.changeDir(path, {\n panel: panelPassive,\n noCurrent: true\n });\n await CloudCmd.changeDir(dirPathPassive, {\n panel\n });\n const length = Info.files.length - 1;\n if (currentIndex > length) currentIndex = length;\n const el = Info.files[currentIndex];\n DOM.setCurrentFile(el);\n}\nfunction updateCurrentInfo(currentFile) {\n const info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const files = current.parentElement;\n const panelPassive = DOM.getPanel({\n active: false\n });\n const filesPassive = DOM.getFiles(panelPassive);\n const name = DOM.getCurrentName(current);\n info.dir = DOM.getCurrentDirName();\n info.dirPath = DOM.getCurrentDirPath();\n info.parentDirPath = DOM.getParentDirPath();\n info.element = current;\n info.ext = (0,_common_util__WEBPACK_IMPORTED_MODULE_4__.getExt)(name);\n info.files = Array.from(files.children);\n info.filesPassive = Array.from(filesPassive);\n info.first = files.firstChild;\n info.getData = DOM.getCurrentData;\n info.last = files.lastChild;\n info.link = DOM.getCurrentLink(current);\n info.mode = DOM.getCurrentMode(current);\n info.name = name;\n info.path = DOM.getCurrentPath(current);\n info.panel = files.parentElement || DOM.getPanel();\n info.panelPassive = panelPassive;\n info.size = DOM.getCurrentSize(current);\n info.isDir = DOM.isCurrentIsDir();\n info.isSelected = DOM.isSelected(current);\n info.panelPosition = DOM.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel = info.panel.getAttribute('data-name') === info.panelPassive.getAttribute('data-name');\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/index.mjs\n}");
151
151
 
152
152
  /***/ },
153
153
 
154
- /***/ "./client/dom/io/index.js"
155
- /*!********************************!*\
156
- !*** ./client/dom/io/index.js ***!
157
- \********************************/
158
- (module, __unused_webpack_exports, __webpack_require__) {
154
+ /***/ "./client/dom/io/index.mjs"
155
+ /*!*********************************!*\
156
+ !*** ./client/dom/io/index.mjs ***!
157
+ \*********************************/
158
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
159
159
 
160
160
  "use strict";
161
- eval("{\n\nconst {\n FS\n} = __webpack_require__(/*! #common/cloudfunc */ \"./common/cloudfunc.mjs\");\nconst _sendRequest = __webpack_require__(/*! ./send-request */ \"./client/dom/io/send-request.js\");\nconst imgPosition = {\n top: true\n};\nmodule.exports[\"delete\"] = async (url, data) => {\n return await _sendRequest({\n method: 'DELETE',\n url: FS + url,\n data,\n imgPosition: {\n top: Boolean(data)\n }\n });\n};\nmodule.exports.patch = async (url, data) => {\n return await _sendRequest({\n method: 'PATCH',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.write = async (url, data) => {\n return await _sendRequest({\n method: 'PUT',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.createDirectory = async (url, overrides = {}) => {\n const {\n sendRequest = _sendRequest\n } = overrides;\n return await sendRequest({\n method: 'PUT',\n url: `${FS}${url}?dir`,\n imgPosition\n });\n};\nmodule.exports.read = async (url, dataType = 'text') => {\n const notLog = !url.includes('?');\n return await _sendRequest({\n method: 'GET',\n url: FS + url,\n notLog,\n dataType\n });\n};\nmodule.exports.copy = async (from, to, names) => {\n return await _sendRequest({\n method: 'PUT',\n url: '/copy',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.pack = async data => {\n return await _sendRequest({\n method: 'PUT',\n url: '/pack',\n data\n });\n};\nmodule.exports.extract = async data => {\n return await _sendRequest({\n method: 'PUT',\n url: '/extract',\n data\n });\n};\nmodule.exports.move = async (from, to, names) => {\n return await _sendRequest({\n method: 'PUT',\n url: '/move',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.rename = async (from, to) => {\n return await _sendRequest({\n method: 'PUT',\n url: '/rename',\n data: {\n from,\n to\n },\n imgPosition\n });\n};\nmodule.exports.Config = {\n read: async () => {\n return await _sendRequest({\n method: 'GET',\n url: '/config',\n imgPosition,\n notLog: true\n });\n },\n write: async data => {\n return await _sendRequest({\n method: 'PATCH',\n url: '/config',\n data,\n imgPosition\n });\n }\n};\nmodule.exports.Markdown = {\n read: async url => {\n return await _sendRequest({\n method: 'GET',\n url: `/markdown${url}`,\n imgPosition,\n notLog: true\n });\n },\n render: async data => {\n return await _sendRequest({\n method: 'PUT',\n url: '/markdown',\n data,\n imgPosition,\n notLog: true\n });\n }\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/io/index.js\n}");
161
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Config: () => (/* binding */ Config),\n/* harmony export */ Markdown: () => (/* binding */ Markdown),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ createDirectory: () => (/* binding */ createDirectory),\n/* harmony export */ extract: () => (/* binding */ extract),\n/* harmony export */ move: () => (/* binding */ move),\n/* harmony export */ pack: () => (/* binding */ pack),\n/* harmony export */ patch: () => (/* binding */ patch),\n/* harmony export */ read: () => (/* binding */ read),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ rename: () => (/* binding */ rename),\n/* harmony export */ write: () => (/* binding */ write)\n/* harmony export */ });\n/* harmony import */ var _common_cloudfunc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #common/cloudfunc */ \"./common/cloudfunc.mjs\");\n/* harmony import */ var _send_request_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./send-request.mjs */ \"./client/dom/io/send-request.mjs\");\n\n\nconst {\n assign\n} = Object;\nconst imgPosition = {\n top: true\n};\nconst remove = async (url, data, overrides = {}) => {\n const {\n sendRequest = _send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest\n } = overrides;\n const request = {\n method: 'DELETE',\n url: _common_cloudfunc__WEBPACK_IMPORTED_MODULE_0__.FS + url,\n imgPosition: {\n top: Boolean(data)\n }\n };\n if (data) assign(request, {\n data,\n url: `${request.url}?files`\n });\n return await sendRequest(request);\n};\nconst patch = async (url, data) => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PATCH',\n url: _common_cloudfunc__WEBPACK_IMPORTED_MODULE_0__.FS + url,\n data,\n imgPosition\n });\n};\nconst write = async (url, data) => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: _common_cloudfunc__WEBPACK_IMPORTED_MODULE_0__.FS + url,\n data,\n imgPosition\n });\n};\nconst createDirectory = async (url, overrides = {}) => {\n const {\n sendRequest = _send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest\n } = overrides;\n return await sendRequest({\n method: 'PUT',\n url: `${_common_cloudfunc__WEBPACK_IMPORTED_MODULE_0__.FS}${url}?dir`,\n imgPosition\n });\n};\nconst read = async (url, dataType = 'text') => {\n const notLog = !url.includes('?');\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'GET',\n url: _common_cloudfunc__WEBPACK_IMPORTED_MODULE_0__.FS + url,\n notLog,\n dataType\n });\n};\nconst copy = async (from, to, names) => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: '/copy',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nconst pack = async data => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: '/pack',\n data\n });\n};\nconst extract = async data => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: '/extract',\n data\n });\n};\nconst move = async (from, to, names) => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: '/move',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nconst rename = async (from, to) => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: '/rename',\n data: {\n from,\n to\n },\n imgPosition\n });\n};\nconst Config = {\n read: async () => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'GET',\n url: '/config',\n imgPosition,\n notLog: true\n });\n },\n write: async data => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PATCH',\n url: '/config',\n data,\n imgPosition\n });\n }\n};\nconst Markdown = {\n read: async url => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'GET',\n url: `/markdown${url}`,\n imgPosition,\n notLog: true\n });\n },\n render: async data => {\n return await (0,_send_request_mjs__WEBPACK_IMPORTED_MODULE_1__.sendRequest)({\n method: 'PUT',\n url: '/markdown',\n data,\n imgPosition,\n notLog: true\n });\n }\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/io/index.mjs\n}");
162
162
 
163
163
  /***/ },
164
164
 
165
- /***/ "./client/dom/io/send-request.js"
166
- /*!***************************************!*\
167
- !*** ./client/dom/io/send-request.js ***!
168
- \***************************************/
169
- (module, __unused_webpack_exports, __webpack_require__) {
165
+ /***/ "./client/dom/io/send-request.mjs"
166
+ /*!****************************************!*\
167
+ !*** ./client/dom/io/send-request.mjs ***!
168
+ \****************************************/
169
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
170
170
 
171
171
  "use strict";
172
- eval("{\n\n/* global CloudCmd */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst Images = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\nconst load = __webpack_require__(/*! #dom/load */ \"./client/dom/load.mjs\");\nmodule.exports = promisify((params, callback) => {\n const p = params;\n const {\n prefixURL\n } = CloudCmd;\n p.url = prefixURL + p.url;\n p.url = encodeURI(p.url);\n p.url = replaceHash(p.url);\n load.ajax({\n method: p.method,\n url: p.url,\n data: p.data,\n dataType: p.dataType,\n error: jqXHR => {\n const response = jqXHR.responseText;\n const {\n statusText,\n status\n } = jqXHR;\n const text = status === 404 ? response : statusText;\n callback(Error(text));\n },\n success: data => {\n Images.hide();\n if (!p.notLog) CloudCmd.log(data);\n callback(null, data);\n }\n });\n});\nmodule.exports._replaceHash = replaceHash;\nfunction replaceHash(url) {\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n */\n return url.replace(/#/g, '%23');\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/io/send-request.js\n}");
172
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _replaceHash: () => (/* binding */ _replaceHash),\n/* harmony export */ sendRequest: () => (/* binding */ sendRequest)\n/* harmony export */ });\n/* harmony import */ var es6_promisify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _dom_load__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/load */ \"./client/dom/load.mjs\");\n/* global CloudCmd */\n\n\n\nconst sendRequest = (0,es6_promisify__WEBPACK_IMPORTED_MODULE_0__.promisify)((params, callback) => {\n const p = params;\n const {\n prefixURL\n } = CloudCmd;\n p.url = prefixURL + p.url;\n p.url = encodeURI(p.url);\n p.url = replaceHash(p.url);\n _dom_load__WEBPACK_IMPORTED_MODULE_2__.ajax({\n method: p.method,\n url: p.url,\n data: p.data,\n dataType: p.dataType,\n error: jqXHR => {\n const response = jqXHR.responseText;\n const {\n statusText,\n status\n } = jqXHR;\n const text = status === 404 ? response : statusText;\n callback(Error(text));\n },\n success: data => {\n _dom_images__WEBPACK_IMPORTED_MODULE_1__.hide();\n if (!p.notLog) CloudCmd.log(data);\n callback(null, data);\n }\n });\n});\nconst _replaceHash = replaceHash;\nfunction replaceHash(url) {\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n */\n return url.replace(/#/g, '%23');\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/io/send-request.mjs\n}");
173
173
 
174
174
  /***/ },
175
175
 
@@ -213,7 +213,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
213
213
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
214
214
 
215
215
  "use strict";
216
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Config: () => (/* binding */ Config),\n/* harmony export */ Markdown: () => (/* binding */ Markdown),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ createDirectory: () => (/* binding */ createDirectory),\n/* harmony export */ extract: () => (/* binding */ extract),\n/* harmony export */ move: () => (/* binding */ move),\n/* harmony export */ pack: () => (/* binding */ pack),\n/* harmony export */ patch: () => (/* binding */ patch),\n/* harmony export */ read: () => (/* binding */ read),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ rename: () => (/* binding */ rename),\n/* harmony export */ write: () => (/* binding */ write)\n/* harmony export */ });\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _common_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #common/entity */ \"./common/entity.mjs\");\n/* harmony import */ var _io_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./io/index.js */ \"./client/dom/io/index.js\");\n\n\n\n\n\nconst handleError = promise => async (...args) => {\n const [e, data] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_0__.tryToCatch)(promise, ...args);\n if (!e) return [e, data];\n const encoded = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(e.message);\n _dom_images__WEBPACK_IMPORTED_MODULE_2__.show.error(encoded);\n _dom_dialog__WEBPACK_IMPORTED_MODULE_1__.alert(encoded);\n return [e, data];\n};\nconst remove = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__[\"delete\"]);\nconst patch = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.patch);\nconst write = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.write);\nconst createDirectory = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.createDirectory);\nconst read = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.read);\nconst copy = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.copy);\nconst pack = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.pack);\nconst extract = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.extract);\nconst move = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.move);\nconst rename = handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.rename);\nconst Config = {\n read: handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.Config.read),\n write: handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.Config.write)\n};\nconst Markdown = {\n read: handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.Markdown.read),\n render: handleError(_io_index_js__WEBPACK_IMPORTED_MODULE_4__.Markdown.render)\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/rest.mjs\n}");
216
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Config: () => (/* binding */ Config),\n/* harmony export */ Markdown: () => (/* binding */ Markdown),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ createDirectory: () => (/* binding */ createDirectory),\n/* harmony export */ extract: () => (/* binding */ extract),\n/* harmony export */ move: () => (/* binding */ move),\n/* harmony export */ pack: () => (/* binding */ pack),\n/* harmony export */ patch: () => (/* binding */ patch),\n/* harmony export */ read: () => (/* binding */ read),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ rename: () => (/* binding */ rename),\n/* harmony export */ write: () => (/* binding */ write)\n/* harmony export */ });\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _common_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #common/entity */ \"./common/entity.mjs\");\n/* harmony import */ var _io_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./io/index.mjs */ \"./client/dom/io/index.mjs\");\n\n\n\n\n\nconst handleError = promise => async (...args) => {\n const [e, data] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_0__.tryToCatch)(promise, ...args);\n if (!e) return [e, data];\n const encoded = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(e.message);\n _dom_images__WEBPACK_IMPORTED_MODULE_2__.show.error(encoded);\n _dom_dialog__WEBPACK_IMPORTED_MODULE_1__.alert(encoded);\n return [e, data];\n};\nconst remove = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.remove);\nconst patch = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.patch);\nconst write = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.write);\nconst createDirectory = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.createDirectory);\nconst read = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.read);\nconst copy = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.copy);\nconst pack = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.pack);\nconst extract = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.extract);\nconst move = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.move);\nconst rename = handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.rename);\nconst Config = {\n read: handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.Config.read),\n write: handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.Config.write)\n};\nconst Markdown = {\n read: handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.Markdown.read),\n render: handleError(_io_index_mjs__WEBPACK_IMPORTED_MODULE_4__.Markdown.render)\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/rest.mjs\n}");
217
217
 
218
218
  /***/ },
219
219
 
@@ -448,47 +448,47 @@ eval("{/* global CloudCmd */\n/* global DOM */\n\n\n\nCloudCmd.Contact = exports
448
448
 
449
449
  /***/ },
450
450
 
451
- /***/ "./client/modules/edit-file-vim.js"
452
- /*!*****************************************!*\
453
- !*** ./client/modules/edit-file-vim.js ***!
454
- \*****************************************/
455
- (module, exports, __webpack_require__) {
451
+ /***/ "./client/modules/edit-file-vim.mjs"
452
+ /*!******************************************!*\
453
+ !*** ./client/modules/edit-file-vim.mjs ***!
454
+ \******************************************/
455
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
456
456
 
457
457
  "use strict";
458
- eval("{\n\n/* global CloudCmd */\nCloudCmd.EditFileVim = exports;\nconst Events = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\nconst {\n Key\n} = CloudCmd;\nconst ConfigView = {\n bindKeys: false,\n beforeClose: () => {\n Events.rmKey(listener);\n CloudCmd.EditFile.isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.EditFile();\n};\nmodule.exports.show = async () => {\n Events.addKey(listener);\n const editFile = await CloudCmd.EditFile.show(ConfigView);\n editFile.getEditor().setKeyMap('vim');\n};\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction listener(event) {\n const {\n keyCode,\n shiftKey\n } = event;\n if (shiftKey && keyCode === Key.ESC) {\n event.preventDefault();\n hide();\n }\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-file-vim.js\n}");
458
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\n\nconst {\n CloudCmd\n} = globalThis;\nCloudCmd.EditFileVim = {\n init,\n show,\n hide\n};\nconst {\n Key\n} = CloudCmd;\nconst ConfigView = {\n bindKeys: false,\n beforeClose: () => {\n _dom_events__WEBPACK_IMPORTED_MODULE_0__.rmKey(listener);\n CloudCmd.EditFile.isChanged();\n }\n};\nasync function init() {\n await CloudCmd.EditFile();\n}\nasync function show() {\n _dom_events__WEBPACK_IMPORTED_MODULE_0__.addKey(listener);\n const editFile = await CloudCmd.EditFile.show(ConfigView);\n editFile.getEditor().setKeyMap('vim');\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction listener(event) {\n const {\n keyCode,\n shiftKey\n } = event;\n if (shiftKey && keyCode === Key.ESC) {\n event.preventDefault();\n hide();\n }\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-file-vim.mjs\n}");
459
459
 
460
460
  /***/ },
461
461
 
462
- /***/ "./client/modules/edit-file.js"
463
- /*!*************************************!*\
464
- !*** ./client/modules/edit-file.js ***!
465
- \*************************************/
466
- (module, exports, __webpack_require__) {
462
+ /***/ "./client/modules/edit-file.mjs"
463
+ /*!**************************************!*\
464
+ !*** ./client/modules/edit-file.mjs ***!
465
+ \**************************************/
466
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
467
467
 
468
468
  "use strict";
469
- eval("{\n\n/* global CloudCmd, DOM*/\nCloudCmd.EditFile = exports;\nconst Format = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst {\n fullstore\n} = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.cjs\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog,\n Images\n} = DOM;\nconst {\n config\n} = CloudCmd;\nlet Menu;\nlet MSG_CHANGED;\nconst isLoading = fullstore();\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n await isChanged();\n }\n};\nmodule.exports.init = async () => {\n isLoading(true);\n await CloudCmd.Edit();\n const editor = CloudCmd.Edit.getEditor();\n authCheck(editor);\n setListeners(editor);\n isLoading(false);\n};\nfunction getName() {\n const {\n name,\n isDir\n } = Info;\n if (isDir) return `${name}.json`;\n return name;\n}\nmodule.exports.show = async options => {\n if (isLoading()) return;\n const optionsEdit = {\n ...ConfigView,\n ...options\n };\n if (CloudCmd.config('showFileName')) optionsEdit.title = Info.name;\n Images.show.load();\n CloudCmd.Edit.getEditor().setOption('keyMap', 'default');\n const [error, data] = await Info.getData();\n if (error) {\n Images.hide();\n return CloudCmd.Edit;\n }\n const {\n path\n } = Info;\n const name = getName();\n setMsgChanged(name);\n CloudCmd.Edit.getEditor().setValueFirst(path, data).setModeForPath(name).enableKey();\n CloudCmd.Edit.show(optionsEdit);\n return CloudCmd.Edit;\n};\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners(editor) {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n editor.on('save', value => {\n DOM.setCurrentSize(Format.size(value));\n });\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n CloudCmd.Edit.getEditor().focus();\n }\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, getMenuData());\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nfunction getMenuData() {\n const editor = CloudCmd.Edit.getEditor();\n return {\n 'Save Ctrl+S': () => {\n editor.save();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n}\nfunction setMsgChanged(name) {\n MSG_CHANGED = `Do you want to save changes to ${name}?`;\n}\nmodule.exports.isChanged = isChanged;\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const is = editor.isChanged();\n if (!is) return;\n const [cancel] = await Dialog.confirm(MSG_CHANGED);\n if (cancel) return;\n editor.save();\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-file.js\n}");
469
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ isChanged: () => (/* binding */ isChanged),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var format_io__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n/* global CloudCmd, DOM*/\n\n\n\n\nCloudCmd.EditFile = {\n init,\n show,\n hide,\n isChanged\n};\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog,\n Images\n} = DOM;\nconst {\n config\n} = CloudCmd;\nlet Menu;\nlet MSG_CHANGED;\nconst isLoading = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__.fullstore)();\nconst ConfigView = {\n beforeClose: async () => {\n execon__WEBPACK_IMPORTED_MODULE_2__.ifExist(Menu, 'hide');\n await isChanged();\n }\n};\nasync function init() {\n isLoading(true);\n await CloudCmd.Edit();\n const editor = CloudCmd.Edit.getEditor();\n authCheck(editor);\n setListeners(editor);\n isLoading(false);\n}\nfunction getName() {\n const {\n name,\n isDir\n } = Info;\n if (isDir) return `${name}.json`;\n return name;\n}\nasync function show(options) {\n if (isLoading()) return;\n const optionsEdit = {\n ...ConfigView,\n ...options\n };\n if (CloudCmd.config('showFileName')) optionsEdit.title = Info.name;\n Images.show.load();\n CloudCmd.Edit.getEditor().setOption('keyMap', 'default');\n const [error, data] = await Info.getData();\n if (error) {\n Images.hide();\n return CloudCmd.Edit;\n }\n const {\n path\n } = Info;\n const name = getName();\n setMsgChanged(name);\n CloudCmd.Edit.getEditor().setValueFirst(path, data).setModeForPath(name).enableKey();\n CloudCmd.Edit.show(optionsEdit);\n return CloudCmd.Edit;\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners(editor) {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n editor.on('save', value => {\n DOM.setCurrentSize(format_io__WEBPACK_IMPORTED_MODULE_0__.size(value));\n });\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n CloudCmd.Edit.getEditor().focus();\n }\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu__WEBPACK_IMPORTED_MODULE_3__(element, options, getMenuData());\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nfunction getMenuData() {\n const editor = CloudCmd.Edit.getEditor();\n return {\n 'Save Ctrl+S': () => {\n editor.save();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n}\nfunction setMsgChanged(name) {\n MSG_CHANGED = `Do you want to save changes to ${name}?`;\n}\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const is = editor.isChanged();\n if (!is) return;\n const [cancel] = await Dialog.confirm(MSG_CHANGED);\n if (cancel) return;\n editor.save();\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-file.mjs\n}");
470
470
 
471
471
  /***/ },
472
472
 
473
- /***/ "./client/modules/edit-names-vim.js"
474
- /*!******************************************!*\
475
- !*** ./client/modules/edit-names-vim.js ***!
476
- \******************************************/
477
- (module, exports, __webpack_require__) {
473
+ /***/ "./client/modules/edit-names-vim.mjs"
474
+ /*!*******************************************!*\
475
+ !*** ./client/modules/edit-names-vim.mjs ***!
476
+ \*******************************************/
477
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
478
478
 
479
479
  "use strict";
480
- eval("{\n\n/* global CloudCmd */\nCloudCmd.EditNamesVim = exports;\nconst Events = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\nconst {\n Key\n} = CloudCmd;\nconst ConfigView = {\n bindKeys: false,\n beforeClose: () => {\n Events.rmKey(listener);\n CloudCmd.EditNames.isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.EditNames();\n};\nmodule.exports.show = () => {\n Events.addKey(listener);\n CloudCmd.EditNames.show(ConfigView).getEditor().setKeyMap('vim');\n};\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction listener(event) {\n const {\n keyCode,\n shiftKey\n } = event;\n if (shiftKey && keyCode === Key.ESC) {\n event.preventDefault();\n hide();\n }\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-names-vim.js\n}");
480
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\n\nconst {\n CloudCmd\n} = globalThis;\nCloudCmd.EditNamesVim = {\n init,\n show,\n hide\n};\nconst {\n Key\n} = CloudCmd;\nconst ConfigView = {\n bindKeys: false,\n beforeClose: () => {\n _dom_events__WEBPACK_IMPORTED_MODULE_0__.rmKey(listener);\n CloudCmd.EditNames.isChanged();\n }\n};\nasync function init() {\n await CloudCmd.EditNames();\n}\nfunction show() {\n _dom_events__WEBPACK_IMPORTED_MODULE_0__.addKey(listener);\n CloudCmd.EditNames.show(ConfigView).getEditor().setKeyMap('vim');\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction listener(event) {\n const {\n keyCode,\n shiftKey\n } = event;\n if (shiftKey && keyCode === Key.ESC) {\n event.preventDefault();\n hide();\n }\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-names-vim.mjs\n}");
481
481
 
482
482
  /***/ },
483
483
 
484
- /***/ "./client/modules/edit-names.js"
485
- /*!**************************************!*\
486
- !*** ./client/modules/edit-names.js ***!
487
- \**************************************/
488
- (module, exports, __webpack_require__) {
484
+ /***/ "./client/modules/edit-names.mjs"
485
+ /*!***************************************!*\
486
+ !*** ./client/modules/edit-names.mjs ***!
487
+ \***************************************/
488
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
489
489
 
490
490
  "use strict";
491
- eval("{\n\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\n/* global CloudCmd, DOM */\nCloudCmd.EditNames = exports;\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst {\n multiRename\n} = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.Edit();\n setListeners();\n};\nmodule.exports.show = options => {\n const names = getActiveNames().join('\\n');\n const config = {\n ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n};\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = multiRename(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nasync function applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n const response = rename(dir, from, to, root);\n const [error] = await tryToCatch(refresh, to, nameIndex, response);\n if (error) alert(error);\n}\nfunction refresh(to, nameIndex, res) {\n if (res.status === 404) {\n const error = res.text();\n throw error;\n }\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\nfunction rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': async () => {\n await applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nmodule.exports.isChanged = isChanged;\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [cancel] = await Dialog.confirm(msg);\n !cancel && (await applyNames());\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-names.js\n}");
491
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ isChanged: () => (/* binding */ isChanged),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n/* harmony import */ var multi_rename__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\n\n\n\n\nconst {\n CloudCmd,\n DOM\n} = globalThis;\nCloudCmd.EditNames = {\n init,\n show,\n hide,\n isChanged\n};\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n execon__WEBPACK_IMPORTED_MODULE_1__.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nasync function init() {\n await CloudCmd.Edit();\n setListeners();\n}\nfunction show(options) {\n const names = getActiveNames().join('\\n');\n const config = {\n ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n}\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = (0,multi_rename__WEBPACK_IMPORTED_MODULE_3__.multiRename)(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nasync function applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n const response = rename(dir, from, to, root);\n const [error] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_0__.tryToCatch)(refresh, to, nameIndex, response);\n if (error) alert(error);\n}\nfunction refresh(to, nameIndex, res) {\n if (res.status === 404) {\n const error = res.text();\n throw error;\n }\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\nfunction rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': async () => {\n await applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu__WEBPACK_IMPORTED_MODULE_2__(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [cancel] = await Dialog.confirm(msg);\n !cancel && (await applyNames());\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-names.mjs\n}");
492
492
 
493
493
  /***/ },
494
494
 
@@ -503,14 +503,14 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
503
503
 
504
504
  /***/ },
505
505
 
506
- /***/ "./client/modules/help.js"
507
- /*!********************************!*\
508
- !*** ./client/modules/help.js ***!
509
- \********************************/
510
- (module, exports, __webpack_require__) {
506
+ /***/ "./client/modules/help.mjs"
507
+ /*!*********************************!*\
508
+ !*** ./client/modules/help.mjs ***!
509
+ \*********************************/
510
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
511
511
 
512
512
  "use strict";
513
- eval("{\n\n/* global CloudCmd */\nCloudCmd.Help = exports;\nconst Images = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\nmodule.exports.init = () => {\n Images.show.load('top');\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nfunction show() {\n const positionLoad = 'top';\n const relative = true;\n CloudCmd.Markdown.show('/HELP.md', {\n positionLoad,\n relative\n });\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/help.js\n}");
513
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n\nconst {\n CloudCmd\n} = globalThis;\nCloudCmd.Help = {\n init,\n show,\n hide\n};\nfunction init() {\n _dom_images__WEBPACK_IMPORTED_MODULE_0__.show.load('top');\n}\nfunction show() {\n const positionLoad = 'top';\n const relative = true;\n CloudCmd.Markdown.show('/HELP.md', {\n positionLoad,\n relative\n });\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/help.mjs\n}");
514
514
 
515
515
  /***/ },
516
516
 
@@ -525,14 +525,14 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
525
525
 
526
526
  /***/ },
527
527
 
528
- /***/ "./client/modules/markdown.js"
529
- /*!************************************!*\
530
- !*** ./client/modules/markdown.js ***!
531
- \************************************/
532
- (module, exports, __webpack_require__) {
528
+ /***/ "./client/modules/markdown.mjs"
529
+ /*!*************************************!*\
530
+ !*** ./client/modules/markdown.mjs ***!
531
+ \*************************************/
532
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
533
533
 
534
534
  "use strict";
535
- eval("{\n\n/* global CloudCmd */\nCloudCmd.Markdown = exports;\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Images = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\nconst {\n Markdown\n} = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\nconst {\n alert\n} = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\nmodule.exports.show = show;\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nasync function show(name, options = {}) {\n const {\n positionLoad,\n relative\n } = options;\n Images.show.load(positionLoad);\n if (relative) name += '?relative';\n const [error, innerHTML] = await Markdown.read(name);\n Images.hide();\n if (error) return alert(error.message, {\n cancel: false\n });\n const className = 'help';\n const div = createElement('div', {\n className,\n innerHTML\n });\n CloudCmd.View.show(div);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/markdown.js\n}");
535
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _dom_rest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n\n\n\n\nconst {\n CloudCmd\n} = globalThis;\nCloudCmd.Markdown = {\n init,\n show,\n hide\n};\nasync function init() {\n _dom_images__WEBPACK_IMPORTED_MODULE_1__.show.load('top');\n await CloudCmd.View();\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function show(name, options = {}) {\n const {\n positionLoad,\n relative\n } = options;\n _dom_images__WEBPACK_IMPORTED_MODULE_1__.show.load(positionLoad);\n if (relative) name += '?relative';\n const [error, innerHTML] = await _dom_rest__WEBPACK_IMPORTED_MODULE_2__.Markdown.read(name);\n _dom_images__WEBPACK_IMPORTED_MODULE_1__.hide();\n if (error) return (0,_dom_dialog__WEBPACK_IMPORTED_MODULE_3__.alert)(error.message, {\n cancel: false\n });\n const className = 'help';\n const div = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_0__('div', {\n className,\n innerHTML\n });\n CloudCmd.View.show(div);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/markdown.mjs\n}");
536
536
 
537
537
  /***/ },
538
538
 
@@ -613,14 +613,14 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
613
613
 
614
614
  /***/ },
615
615
 
616
- /***/ "./client/modules/polyfill.js"
617
- /*!************************************!*\
618
- !*** ./client/modules/polyfill.js ***!
619
- \************************************/
620
- (module, __unused_webpack_exports, __webpack_require__) {
616
+ /***/ "./client/modules/polyfill.mjs"
617
+ /*!*************************************!*\
618
+ !*** ./client/modules/polyfill.mjs ***!
619
+ \*************************************/
620
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
621
621
 
622
622
  "use strict";
623
- eval("{\n\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtokenlist-shim/dist/domtokenlist.js\");\nconst _scrollIntoViewIfNeeded = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/dist/index.cjs\");\nglobalThis.DOM = globalThis.DOM || {};\nconst scrollIntoViewIfNeeded = (el, overrides = {}) => {\n const {\n scroll = _scrollIntoViewIfNeeded\n } = overrides;\n return scroll(el, {\n block: 'nearest'\n });\n};\nglobalThis.DOM.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\nmodule.exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/polyfill.js\n}");
623
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded)\n/* harmony export */ });\n/* harmony import */ var scroll_into_view_if_needed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/dist/index.js\");\n\nglobalThis.DOM = globalThis.DOM || {};\nconst scrollIntoViewIfNeeded = (el, overrides = {}) => {\n const {\n scroll = scroll_into_view_if_needed__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n } = overrides;\n return scroll(el, {\n block: 'nearest'\n });\n};\nglobalThis.DOM.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/polyfill.mjs\n}");
624
624
 
625
625
  /***/ },
626
626
 
@@ -631,18 +631,18 @@ eval("{\n\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtoke
631
631
  (module, exports, __webpack_require__) {
632
632
 
633
633
  "use strict";
634
- eval("{\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n fullstore\n} = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.cjs\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom/index.mjs */ \"./client/dom/index.mjs\");\nconst Images = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(globalThis.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\nmodule.exports.show = promisify((options = {}, fn) => {\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: (/* exec.series args */\n ) => {\n fn(null, exitCodeStore());\n }\n });\n});\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst getPrefix = () => CloudCmd.prefix + '/gritty';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n});\nfunction create(createOptions) {\n const {\n cwd = DOM.getCurrentDirPath(),\n command,\n autoClose,\n closeMessage = 'Press any key to close Terminal...'\n } = createOptions;\n const options = {\n cwd,\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono',\n command,\n autoRestart: false\n };\n let commandExit = false;\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (commandExit) hide();\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('exit', code => {\n exitCodeStore(code);\n if (autoClose) return hide();\n terminal.write(`\\n${closeMessage}`);\n commandExit = true;\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/terminal-run.js\n}");
634
+ eval("{\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n fullstore\n} = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.cjs\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! #dom */ \"./client/dom/index.mjs\");\nconst Images = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(globalThis.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\nmodule.exports.show = promisify((options = {}, fn) => {\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: (/* exec.series args */\n ) => {\n fn(null, exitCodeStore());\n }\n });\n});\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst getPrefix = () => CloudCmd.prefix + '/gritty';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n});\nfunction create(createOptions) {\n const {\n cwd = DOM.getCurrentDirPath(),\n command,\n autoClose,\n closeMessage = 'Press any key to close Terminal...'\n } = createOptions;\n const options = {\n cwd,\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono',\n command,\n autoRestart: false\n };\n let commandExit = false;\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (commandExit) hide();\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('exit', code => {\n exitCodeStore(code);\n if (autoClose) return hide();\n terminal.write(`\\n${closeMessage}`);\n commandExit = true;\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/terminal-run.js\n}");
635
635
 
636
636
  /***/ },
637
637
 
638
- /***/ "./client/modules/terminal.js"
639
- /*!************************************!*\
640
- !*** ./client/modules/terminal.js ***!
641
- \************************************/
642
- (module, exports, __webpack_require__) {
638
+ /***/ "./client/modules/terminal.mjs"
639
+ /*!*************************************!*\
640
+ !*** ./client/modules/terminal.mjs ***!
641
+ \*************************************/
642
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
643
643
 
644
644
  "use strict";
645
- eval("{\n\n/* global CloudCmd */\n/* global gritty */\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom/index.mjs */ \"./client/dom/index.mjs\");\nconst Images = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\nconst loadParallel = load.parallel;\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.Terminal = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(loadParallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(globalThis.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n create();\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst getPrefix = () => CloudCmd.prefix + '/gritty';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n});\nfunction create() {\n const options = {\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono'\n };\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction show() {\n if (!Loaded) return;\n if (!config('terminal')) return;\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n }\n });\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/terminal.js\n}");
645
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _css_terminal_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #css/terminal.css */ \"./css/terminal.css\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var load_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.mjs\");\n/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #dom */ \"./client/dom/index.mjs\");\n\n\n\n\n\n\nconst loadParallel = load_js__WEBPACK_IMPORTED_MODULE_3__.parallel;\nconst {\n CloudCmd\n} = globalThis;\nconst {\n Dialog\n} = _dom__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\nconst {\n Key,\n config\n} = globalThis.CloudCmd;\nCloudCmd.Terminal = {\n init,\n show,\n hide\n};\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(loadParallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(globalThis.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nasync function init() {\n if (!config('terminal')) return;\n _dom_images__WEBPACK_IMPORTED_MODULE_4__.show.load('top');\n await CloudCmd.View();\n await loadAll();\n create();\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst getPrefix = () => CloudCmd.prefix + '/gritty';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: _dom__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getCurrentDirPath,\n PASSIVE_DIR: _dom__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getNotCurrentDirPath,\n CURRENT_NAME: _dom__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getCurrentName,\n CURRENT_PATH: _dom__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getCurrentPath\n});\nfunction create() {\n const options = {\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono'\n };\n const {\n socket,\n terminal\n } = globalThis.gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('connect', execon__WEBPACK_IMPORTED_MODULE_2__[\"with\"](authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction show() {\n if (!Loaded) return;\n if (!config('terminal')) return;\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n }\n });\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/terminal.mjs\n}");
646
646
 
647
647
  /***/ },
648
648
 
@@ -752,7 +752,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
752
752
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
753
753
 
754
754
  "use strict";
755
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initSortPanel: () => (/* binding */ initSortPanel),\n/* harmony export */ sortPanel: () => (/* binding */ sortPanel)\n/* harmony export */ });\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _dom_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom/index.mjs */ \"./client/dom/index.mjs\");\n/* global CloudCmd */\n\n\nconst sortPrevious = (0,fullstore__WEBPACK_IMPORTED_MODULE_0__.fullstore)();\nconst {\n getPanel\n} = _dom_index_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst initSortPanel = () => {\n const {\n sort\n } = CloudCmd;\n const position = _dom_index_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getPanelPosition();\n sortPrevious(sort[position]);\n};\nconst sortPanel = (name, panel = getPanel()) => {\n const {\n sort,\n order\n } = CloudCmd;\n const Info = _dom_index_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CurrentInfo;\n const position = panel.dataset.name.replace('js-', '');\n if (name !== sortPrevious()) order[position] = 'asc';else if (order[position] === 'asc') order[position] = 'desc';else order[position] = 'asc';\n sortPrevious(name);\n sort[position] = name;\n const noCurrent = position !== Info.panelPosition;\n CloudCmd.refresh({\n panel,\n noCurrent\n });\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sort.mjs\n}");
755
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initSortPanel: () => (/* binding */ initSortPanel),\n/* harmony export */ sortPanel: () => (/* binding */ sortPanel)\n/* harmony export */ });\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom */ \"./client/dom/index.mjs\");\n/* global CloudCmd */\n\n\nconst sortPrevious = (0,fullstore__WEBPACK_IMPORTED_MODULE_0__.fullstore)();\nconst {\n getPanel\n} = _dom__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst initSortPanel = () => {\n const {\n sort\n } = CloudCmd;\n const position = _dom__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getPanelPosition();\n sortPrevious(sort[position]);\n};\nconst sortPanel = (name, panel = getPanel()) => {\n const {\n sort,\n order\n } = CloudCmd;\n const Info = _dom__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CurrentInfo;\n const position = panel.dataset.name.replace('js-', '');\n if (name !== sortPrevious()) order[position] = 'asc';else if (order[position] === 'asc') order[position] = 'desc';else order[position] = 'asc';\n sortPrevious(name);\n sort[position] = name;\n const noCurrent = position !== Info.panelPosition;\n CloudCmd.refresh({\n panel,\n noCurrent\n });\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sort.mjs\n}");
756
756
 
757
757
  /***/ },
758
758
 
@@ -1119,14 +1119,14 @@ eval("{\n\nvar GetIntrinsic = __webpack_require__(/*! get-intrinsic */ \"./node_
1119
1119
 
1120
1120
  /***/ },
1121
1121
 
1122
- /***/ "./node_modules/compute-scroll-into-view/dist/index.cjs"
1123
- /*!**************************************************************!*\
1124
- !*** ./node_modules/compute-scroll-into-view/dist/index.cjs ***!
1125
- \**************************************************************/
1126
- (__unused_webpack_module, exports) {
1122
+ /***/ "./node_modules/compute-scroll-into-view/dist/index.js"
1123
+ /*!*************************************************************!*\
1124
+ !*** ./node_modules/compute-scroll-into-view/dist/index.js ***!
1125
+ \*************************************************************/
1126
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1127
1127
 
1128
1128
  "use strict";
1129
- eval("{Object.defineProperty(exports, \"__esModule\", ({value:!0}));const t=t=>\"object\"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||\"hidden\"!==t)&&(\"visible\"!==t&&\"clip\"!==t),o=(t,o)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return e(n.overflowY,o)||e(n.overflowX,o)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},n=(t,e,o,n,l,r,i,s)=>r<t&&i>e||r>t&&i<e?0:r<=t&&s<=o||i>=e&&s>=o?r-t-n:i>e&&s<o||r<t&&s>o?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e};exports.compute=(e,r)=>{var i,s,d,c;if(\"undefined\"==typeof document)return[];const{scrollMode:h,block:u,inline:f,boundary:a,skipOverflowHiddenElements:g}=r,p=\"function\"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError(\"Invalid target\");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&o(W)&&!o(document.documentElement)||null!=W&&o(W,g)&&w.push(W)}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(c=null==(d=window.visualViewport)?void 0:d.height)?c:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k=\"start\"===u||\"nearest\"===u?x-T:\"end\"===u?I+F:x+v/2-T+F,D=\"center\"===f?R+E/2-V+B:\"end\"===f?C+B:R-V;const L=[];for(let t=0;t<w.length;t++){const e=w[t],{height:l,width:r,top:i,right:s,bottom:d,left:c}=e.getBoundingClientRect();if(\"if-needed\"===h&&x>=0&&R>=0&&I<=H&&C<=b&&(e===m&&!o(e)||x>=i&&I<=d&&R>=c&&C<=s))return L;const a=getComputedStyle(e),g=parseInt(a.borderLeftWidth,10),p=parseInt(a.borderTopWidth,10),W=parseInt(a.borderRightWidth,10),T=parseInt(a.borderBottomWidth,10);let B=0,F=0;const V=\"offsetWidth\"in e?e.offsetWidth-e.clientWidth-g-W:0,S=\"offsetHeight\"in e?e.offsetHeight-e.clientHeight-p-T:0,j=\"offsetWidth\"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,O=\"offsetHeight\"in e?0===e.offsetHeight?0:l/e.offsetHeight:0;if(m===e)B=\"start\"===u?k:\"end\"===u?k-H:\"nearest\"===u?n(M,M+H,H,p,T,M+k,M+k+v,v):k-H/2,F=\"start\"===f?D:\"center\"===f?D-b/2:\"end\"===f?D-b:n(y,y+b,b,g,W,y+D,y+D+E,E),B=Math.max(0,B+M),F=Math.max(0,F+y);else{B=\"start\"===u?k-i-p:\"end\"===u?k-d+T+S:\"nearest\"===u?n(i,d,l,p,T+S,k,k+v,v):k-(i+l/2)+S/2,F=\"start\"===f?D-c-g:\"center\"===f?D-(c+r/2)+V/2:\"end\"===f?D-s+W+V:n(c,s,r,g,W+V,D,D+E,E);const{scrollLeft:t,scrollTop:o}=e;B=0===O?0:Math.max(0,Math.min(o+B/O,e.scrollHeight-l/O+S)),F=0===j?0:Math.max(0,Math.min(t+F/j,e.scrollWidth-r/j+V)),k+=o-B,D+=t-F}L.push({el:e,top:B,left:F})}return L};//# sourceMappingURL=index.cjs.map\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/compute-scroll-into-view/dist/index.cjs\n}");
1129
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compute: () => (/* binding */ r)\n/* harmony export */ });\nconst t=t=>\"object\"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||\"hidden\"!==t)&&(\"visible\"!==t&&\"clip\"!==t),n=(t,n)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const o=getComputedStyle(t,null);return e(o.overflowY,n)||e(o.overflowX,n)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},o=(t,e,n,o,l,r,i,s)=>r<t&&i>e||r>t&&i<e?0:r<=t&&s<=n||i>=e&&s>=n?r-t-o:i>e&&s<n||r<t&&s>n?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},r=(e,r)=>{var i,s,d,h;if(\"undefined\"==typeof document)return[];const{scrollMode:c,block:f,inline:u,boundary:a,skipOverflowHiddenElements:g}=r,p=\"function\"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError(\"Invalid target\");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W)}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(h=null==(d=window.visualViewport)?void 0:d.height)?h:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k=\"start\"===f||\"nearest\"===f?x-T:\"end\"===f?I+F:x+v/2-T+F,D=\"center\"===u?R+E/2-V+B:\"end\"===u?C+B:R-V;const L=[];for(let t=0;t<w.length;t++){const e=w[t],{height:l,width:r,top:i,right:s,bottom:d,left:h}=e.getBoundingClientRect();if(\"if-needed\"===c&&x>=0&&R>=0&&I<=H&&C<=b&&(e===m&&!n(e)||x>=i&&I<=d&&R>=h&&C<=s))return L;const a=getComputedStyle(e),g=parseInt(a.borderLeftWidth,10),p=parseInt(a.borderTopWidth,10),W=parseInt(a.borderRightWidth,10),T=parseInt(a.borderBottomWidth,10);let B=0,F=0;const V=\"offsetWidth\"in e?e.offsetWidth-e.clientWidth-g-W:0,S=\"offsetHeight\"in e?e.offsetHeight-e.clientHeight-p-T:0,X=\"offsetWidth\"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,Y=\"offsetHeight\"in e?0===e.offsetHeight?0:l/e.offsetHeight:0;if(m===e)B=\"start\"===f?k:\"end\"===f?k-H:\"nearest\"===f?o(M,M+H,H,p,T,M+k,M+k+v,v):k-H/2,F=\"start\"===u?D:\"center\"===u?D-b/2:\"end\"===u?D-b:o(y,y+b,b,g,W,y+D,y+D+E,E),B=Math.max(0,B+M),F=Math.max(0,F+y);else{B=\"start\"===f?k-i-p:\"end\"===f?k-d+T+S:\"nearest\"===f?o(i,d,l,p,T+S,k,k+v,v):k-(i+l/2)+S/2,F=\"start\"===u?D-h-g:\"center\"===u?D-(h+r/2)+V/2:\"end\"===u?D-s+W+V:o(h,s,r,g,W+V,D,D+E,E);const{scrollLeft:t,scrollTop:n}=e;B=0===Y?0:Math.max(0,Math.min(n+B/Y,e.scrollHeight-l/Y+S)),F=0===X?0:Math.max(0,Math.min(t+F/X,e.scrollWidth-r/X+V)),k+=n-B,D+=t-F}L.push({el:e,top:B,left:F})}return L};//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/compute-scroll-into-view/dist/index.js\n}");
1130
1130
 
1131
1131
  /***/ },
1132
1132
 
@@ -1184,16 +1184,6 @@ eval("{\n\nmodule.exports = Emitify;\n\nfunction Emitify() {\n if (!(this ins
1184
1184
 
1185
1185
  /***/ },
1186
1186
 
1187
- /***/ "./node_modules/domtokenlist-shim/dist/domtokenlist.js"
1188
- /*!*************************************************************!*\
1189
- !*** ./node_modules/domtokenlist-shim/dist/domtokenlist.js ***!
1190
- \*************************************************************/
1191
- () {
1192
-
1193
- eval("{/*! DOMTokenlist shim | Copyright 2016 Jonathan Wilsson and Bogdan Chadkin. */\n;typeof window !== 'undefined' && (function (window) {\n 'use strict';\n\n if (!window.DOMTokenList) {\n return;\n }\n\n var el = document.createElement('a').classList;\n var dtp = DOMTokenList.prototype;\n var add = dtp.add;\n var remove = dtp.remove;\n var toggle = dtp.toggle;\n\n el.add('c1', 'c2');\n\n // Older versions of the HTMLElement.classList spec didn't allow multiple\n // arguments, easy to test for\n var iterateArg = function (fn) {\n return function () {\n var tokens = arguments;\n var i;\n\n for (i = 0; i < tokens.length; i += 1) {\n fn.call(this, tokens[i]);\n }\n };\n };\n\n if (!el.contains('c2')) {\n dtp.add = iterateArg(add);\n dtp.remove = iterateArg(remove);\n }\n\n // Older versions of the spec didn't have a forcedState argument for\n // `toggle` either, test by checking the return value after forcing\n if (!el.toggle('c1', true)) {\n dtp.toggle = function (cls, force) {\n if (force === undefined) {\n return toggle.call(this, cls);\n }\n\n (force ? add : remove).call(this, cls);\n return !!force;\n };\n }\n}(window));\n\n;typeof window !== 'undefined' && (function (window) {\n 'use strict';\n\n var arr = [];\n\n var inArray = function (array, value) {\n var i;\n\n if (arr.indexOf) {\n return arr.indexOf.call(array, value);\n }\n\n for (i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n\n return -1;\n };\n\n var validateToken = function (token) {\n var whitespace = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/;\n\n if (token === '' || whitespace.test(token)) {\n throw new Error('Token must not be empty or contain whitespace.');\n }\n };\n\n var DOMTokenList = function (element, prop) {\n var inst = this;\n var i;\n var values = [];\n\n if (element && prop) {\n inst.element = element;\n inst.prop = prop;\n\n if (element[prop]) {\n values = element[prop].replace(/^\\s+|\\s+$/g, '').split(/\\s+/);\n\n for (i = 0; i < values.length; i++) {\n inst[i] = values[i];\n }\n }\n }\n\n inst.length = values.length;\n };\n\n DOMTokenList.prototype = {\n add: function () {\n var inst = this;\n var i;\n var tokens = arguments;\n\n for (i = 0; i < tokens.length; i++) {\n validateToken(tokens[i]);\n\n if (!inst.contains(tokens[i])) {\n arr.push.call(inst, tokens[i]);\n }\n }\n\n if (inst.element) {\n inst.element[inst.prop] = inst;\n }\n },\n\n contains: function (token) {\n validateToken(token);\n\n return inArray(this, token) !== -1;\n },\n\n item: function (index) {\n return this[index] || null;\n },\n\n remove: function () {\n var tokens = arguments;\n var inst = this;\n var key;\n var i;\n\n for (i = 0; i < tokens.length; i++) {\n validateToken(tokens[i]);\n\n key = inArray(inst, tokens[i]);\n\n if (key !== -1) {\n arr.splice.call(inst, key, 1);\n }\n }\n\n if (inst.element) {\n inst.element[inst.prop] = inst;\n }\n },\n\n toggle: function (token, force) {\n var inst = this;\n\n if (inst.contains(token)) {\n if (force) {\n return true;\n }\n\n inst.remove(token);\n\n return false;\n } else {\n if (force === false) {\n return false;\n }\n\n inst.add(token);\n\n return true;\n }\n },\n\n toString: function () {\n return arr.join.call(this, ' ');\n }\n };\n\n window.DOMTokenList = DOMTokenList;\n}(window));\n\n;typeof window !== 'undefined' && (function () {\n 'use strict';\n\n if ('classList' in document.createElement('a')) {\n return;\n }\n\n Object.defineProperty(Element.prototype, 'classList', {\n get: function () {\n return new DOMTokenList(this, 'className');\n }\n });\n}());\n\n;typeof window !== 'undefined' && (function () {\n 'use strict';\n\n if ('relList' in document.createElement('a')) {\n return;\n }\n\n var i;\n var elements = [HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement];\n var getter = function () {\n return new DOMTokenList(this, 'rel');\n };\n\n for (i = 0; i < elements.length; i++) {\n Object.defineProperty(elements[i].prototype, 'relList', {\n get: getter\n });\n }\n}());\n\n;typeof window !== 'undefined' && (function () {\n 'use strict';\n\n if (typeof SVGElement === 'undefined') {\n // IE8 does not support SVG and would throw\n // \"Object doesn't support this method or property\"\n return;\n }\n\n // https://connect.microsoft.com/IE/feedback/details/1046039/classlist-not-working-on-svg-elements\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n if ('classList' in svg && !window.QUnit) {\n return;\n }\n\n Object.defineProperty(SVGElement.prototype, 'classList', {\n get: function () {\n if (typeof this.className === 'string') {\n return new DOMTokenList(this, 'className');\n }\n // in SVG world className may not be a DOMString, but a SVGAnimatedString\n // https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString\n if (typeof this.className.baseVal === 'string') {\n return new DOMTokenList(this.className, 'baseVal');\n }\n }\n });\n}());\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/domtokenlist-shim/dist/domtokenlist.js\n}");
1194
-
1195
- /***/ },
1196
-
1197
1187
  /***/ "./node_modules/dunder-proto/get.js"
1198
1188
  /*!******************************************!*\
1199
1189
  !*** ./node_modules/dunder-proto/get.js ***!
@@ -1925,14 +1915,14 @@ eval("{\n\nvar callBound = __webpack_require__(/*! call-bound */ \"./node_module
1925
1915
 
1926
1916
  /***/ },
1927
1917
 
1928
- /***/ "./node_modules/scroll-into-view-if-needed/dist/index.cjs"
1929
- /*!****************************************************************!*\
1930
- !*** ./node_modules/scroll-into-view-if-needed/dist/index.cjs ***!
1931
- \****************************************************************/
1932
- (module, __unused_webpack_exports, __webpack_require__) {
1918
+ /***/ "./node_modules/scroll-into-view-if-needed/dist/index.js"
1919
+ /*!***************************************************************!*\
1920
+ !*** ./node_modules/scroll-into-view-if-needed/dist/index.js ***!
1921
+ \***************************************************************/
1922
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1933
1923
 
1934
1924
  "use strict";
1935
- eval("{var t=__webpack_require__(/*! compute-scroll-into-view */ \"./node_modules/compute-scroll-into-view/dist/index.cjs\");const o=t=>!1===t?{block:\"end\",inline:\"nearest\"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:\"start\",inline:\"nearest\"};module.exports=function(e,r){if(!e.isConnected||!(t=>{let o=t;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(e))return;const n=(t=>{const o=window.getComputedStyle(t);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(e);if((t=>\"object\"==typeof t&&\"function\"==typeof t.behavior)(r))return r.behavior(t.compute(e,r));const l=\"boolean\"==typeof r||null==r?void 0:r.behavior;for(const{el:a,top:i,left:c}of t.compute(e,o(r))){const t=i-n.top+n.bottom,o=c-n.left+n.right;a.scroll({top:t,left:o,behavior:l})}};//# sourceMappingURL=index.cjs.map\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/scroll-into-view-if-needed/dist/index.cjs\n}");
1925
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ e)\n/* harmony export */ });\n/* harmony import */ var compute_scroll_into_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! compute-scroll-into-view */ \"./node_modules/compute-scroll-into-view/dist/index.js\");\nconst o=t=>!1===t?{block:\"end\",inline:\"nearest\"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:\"start\",inline:\"nearest\"};function e(e,r){if(!e.isConnected||!(t=>{let o=t;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(e))return;const n=(t=>{const o=window.getComputedStyle(t);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(e);if((t=>\"object\"==typeof t&&\"function\"==typeof t.behavior)(r))return r.behavior((0,compute_scroll_into_view__WEBPACK_IMPORTED_MODULE_0__.compute)(e,r));const l=\"boolean\"==typeof r||null==r?void 0:r.behavior;for(const{el:a,top:i,left:s}of (0,compute_scroll_into_view__WEBPACK_IMPORTED_MODULE_0__.compute)(e,o(r))){const t=i-n.top+n.bottom,o=s-n.left+n.right;a.scroll({top:t,left:o,behavior:l})}}//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/scroll-into-view-if-needed/dist/index.js\n}");
1936
1926
 
1937
1927
  /***/ },
1938
1928