cloudcmd 19.8.1 → 19.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sw.js CHANGED
@@ -311,7 +311,7 @@ const respondWith = currify((f, e) => {
311
311
  e.respondWith(f(e));
312
312
  });
313
313
  const getPathName = url => new URL(url).pathname;
314
- const date = "Sun Mar 22 2026 01:41:13 GMT+0200 (Eastern European Standard Time)";
314
+ const date = "Sun Mar 22 2026 16:02:07 GMT+0200 (Eastern European Standard Time)";
315
315
  const NAME = `cloudcmd: ${date}`;
316
316
  const createRequest = a => new Request(a, {
317
317
  credentials: 'same-origin'
@@ -1096,7 +1096,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1096
1096
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1097
1097
 
1098
1098
  "use strict";
1099
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _onMainClick: () => (/* binding */ _onMainClick),\n/* harmony export */ _optionsStore: () => (/* binding */ _optionsStore),\n/* harmony export */ close: () => (/* binding */ close),\n/* harmony export */ open: () => (/* binding */ open)\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 currify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _css_modal_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../css/modal.css */ \"./node_modules/@cloudcmd/modal/css/modal.css\");\n/* harmony import */ var _parse_images_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parse-images.js */ \"./node_modules/@cloudcmd/modal/lib/parse-images.js\");\n/* harmony import */ var _show_title_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./show-title.js */ \"./node_modules/@cloudcmd/modal/lib/show-title.js\");\n/* harmony import */ var _query_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./query.js */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\n/* harmony import */ var _get_class_name_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-class-name.js */ \"./node_modules/@cloudcmd/modal/lib/get-class-name.js\");\n\n\n\n\n\n\n\n\n\nconst noop = () => {};\n\nconst optionsStore = (0,fullstore__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({});\n\nconst innerHTML = `\n <div class=\"modal-child\" data-name=\"modal-child\">\n <div class=\"modal-close\" data-name=\"modal-close\"></div>\n </div>\n`;\n\nconst addEvent = currify__WEBPACK_IMPORTED_MODULE_1__((el, fn, query, name) => query(el).addEventListener(name, fn));\nconst addAllEvents = (el, fn, query, names) => names.map(addEvent(el, fn, query));\n\nconst {isArray} = Array;\n\nconst open = (inner, options = {}) => {\n check(inner);\n \n const {\n beforeShow = noop,\n beforeClose = noop,\n afterShow = noop,\n afterClose = noop,\n onOverlayClick = noop,\n autoSize = false,\n index = 0,\n helpers = {},\n title = '',\n query = _query_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n showTitle = _show_title_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n parseImages = _parse_images_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n } = options;\n \n if (query('main'))\n return;\n \n optionsStore({\n beforeClose,\n afterClose,\n });\n \n beforeShow();\n \n const isImage = isArray(inner);\n const isTitle = helpers.title && title || isImage;\n \n const className = (0,_get_class_name_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n autoSize,\n isTitle,\n });\n \n const el = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__('div', {\n innerHTML,\n className,\n dataName: 'modal-main',\n });\n \n addAllEvents('main', onMainClick(onOverlayClick), query, ['click', 'contextmenu']);\n \n query('close').addEventListener('click', close);\n \n const child = query('child');\n \n if (isImage)\n return parseImages(child, inner, {\n index,\n afterShow,\n helpers,\n });\n \n child.appendChild(inner);\n \n if (isTitle)\n showTitle(title, child);\n \n afterShow();\n \n return el;\n};\n\nconst onMainClick = (overlayClick, overrides = {}) => (event) => {\n const {query = _query_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]} = overrides;\n \n if (event.target !== query('main'))\n return;\n \n close(event);\n overlayClick(event);\n};\n\nconst close = (event, overrides = {}) => {\n const {query = _query_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]} = overrides;\n \n if (event)\n event.stopPropagation();\n \n const el = query('main');\n \n const {\n beforeClose = noop,\n afterClose = noop,\n } = optionsStore();\n \n if (!el)\n return;\n \n beforeClose();\n \n document.body.removeChild(el);\n \n afterClose();\n};\n\nconst _optionsStore = optionsStore;\nconst _onMainClick = onMainClick;\n\nfunction check(inner) {\n if (!inner)\n throw Error('inner should be DOM-element!');\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/@cloudcmd/modal/lib/modal.js\n}");
1099
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _onMainClick: () => (/* binding */ _onMainClick),\n/* harmony export */ _optionsStore: () => (/* binding */ _optionsStore),\n/* harmony export */ close: () => (/* binding */ close),\n/* harmony export */ open: () => (/* binding */ open)\n/* harmony export */ });\n/* harmony import */ var _css_modal_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/modal.css */ \"./node_modules/@cloudcmd/modal/css/modal.css\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _parse_images_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parse-images.js */ \"./node_modules/@cloudcmd/modal/lib/parse-images.js\");\n/* harmony import */ var _show_title_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./show-title.js */ \"./node_modules/@cloudcmd/modal/lib/show-title.js\");\n/* harmony import */ var _query_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./query.js */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\n/* harmony import */ var _get_class_name_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-class-name.js */ \"./node_modules/@cloudcmd/modal/lib/get-class-name.js\");\n\n\n\n\n\n\n\n\n\nconst noop = () => {};\n\nconst optionsStore = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__.fullstore)({});\n\nconst innerHTML = `\n <div class=\"modal-child\" data-name=\"modal-child\">\n <div class=\"modal-close\" data-name=\"modal-close\"></div>\n </div>\n`;\n\nconst addEvent = currify__WEBPACK_IMPORTED_MODULE_2__((el, fn, query, name) => query(el).addEventListener(name, fn));\nconst addAllEvents = (el, fn, query, names) => names.map(addEvent(el, fn, query));\n\nconst {isArray} = Array;\n\nconst open = (inner, options = {}) => {\n check(inner);\n \n const {\n beforeShow = noop,\n beforeClose = noop,\n afterShow = noop,\n afterClose = noop,\n onOverlayClick = noop,\n autoSize = false,\n index = 0,\n helpers = {},\n title = '',\n query = _query_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n showTitle = _show_title_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n parseImages = _parse_images_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n } = options;\n \n if (query('main'))\n return;\n \n optionsStore({\n beforeClose,\n afterClose,\n });\n \n beforeShow();\n \n const isImage = isArray(inner);\n const isTitle = helpers.title && title || isImage;\n \n const className = (0,_get_class_name_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n autoSize,\n isTitle,\n });\n \n const el = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_3__('div', {\n innerHTML,\n className,\n dataName: 'modal-main',\n });\n \n addAllEvents('main', onMainClick(onOverlayClick), query, ['click', 'contextmenu']);\n \n query('close').addEventListener('click', close);\n \n const child = query('child');\n \n if (isImage)\n return parseImages(child, inner, {\n index,\n afterShow,\n helpers,\n });\n \n child.appendChild(inner);\n \n if (isTitle)\n showTitle(title, child);\n \n afterShow();\n \n return el;\n};\n\nconst onMainClick = (overlayClick, overrides = {}) => (event) => {\n const {query = _query_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]} = overrides;\n \n if (event.target !== query('main'))\n return;\n \n close(event);\n overlayClick(event);\n};\n\nconst close = (event, overrides = {}) => {\n const {query = _query_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]} = overrides;\n \n if (event)\n event.stopPropagation();\n \n const el = query('main');\n \n const {\n beforeClose = noop,\n afterClose = noop,\n } = optionsStore();\n \n if (!el)\n return;\n \n beforeClose();\n \n document.body.removeChild(el);\n \n afterClose();\n};\n\nconst _optionsStore = optionsStore;\nconst _onMainClick = onMainClick;\n\nfunction check(inner) {\n if (!inner)\n throw Error('inner should be DOM-element!');\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/@cloudcmd/modal/lib/modal.js\n}");
1100
1100
 
1101
1101
  /***/ },
1102
1102
 
@@ -1107,7 +1107,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1107
1107
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1108
1108
 
1109
1109
  "use strict";
1110
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _addListenerOnce: () => (/* binding */ _addListenerOnce),\n/* harmony export */ _helpersStore: () => (/* binding */ _helpersStore),\n/* harmony export */ _indexStore: () => (/* binding */ _indexStore),\n/* harmony export */ _onKeydown: () => (/* binding */ _onKeydown),\n/* harmony export */ _onload: () => (/* binding */ _onload),\n/* harmony export */ _rmListener: () => (/* binding */ _rmListener),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var wraptile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _show_title_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./show-title.js */ \"./node_modules/@cloudcmd/modal/lib/show-title.js\");\n/* harmony import */ var _query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./query.js */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\n\n\n\n\n\n\nconst indexStore = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\nconst helpersStore = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n\nconst next = wraptile__WEBPACK_IMPORTED_MODULE_0__((img, images) => setImage(indexStore() + 1, img, images));\nconst prev = wraptile__WEBPACK_IMPORTED_MODULE_0__((img, images) => setImage(indexStore() - 1, img, images));\n\nconst onload = wraptile__WEBPACK_IMPORTED_MODULE_0__((parent, afterShow) => {\n parent.hidden = false;\n afterShow();\n});\n\nconst onKeydown = (img, images, query) => function keydownListener(e) {\n let i = indexStore();\n \n const ArrowLeft = 37;\n const ArrowRight = 39;\n const Esc = 27;\n \n const {keyCode} = e;\n \n if (keyCode === ArrowLeft) {\n --i;\n } else if (keyCode === ArrowRight) {\n ++i;\n } else {\n if (keyCode === Esc)\n return document.body.removeEventListener('keydown', keydownListener);\n \n return;\n }\n \n setImage(i, img, images, {\n query,\n });\n};\n\nfunction setImage(i, img, images, {query, showTitle}) {\n const n = images.length - 1;\n \n if (i < 0 || i > n)\n return;\n \n indexStore(i);\n \n query('nav-left').hidden = !i;\n query('nav-right').hidden = i === n;\n \n const {href, title} = images[i];\n \n img.src = href;\n img.title = title;\n img.href = title;\n img.alt = title;\n \n if (helpersStore().title)\n showTitle(title, query('child'));\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parseImages);\n\nfunction parseImages(parent, images, overrides = {}) {\n const {\n afterShow,\n helpers,\n index,\n query = _query_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n createElement = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__,\n showTitle = _show_title_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n } = overrides;\n \n indexStore(index);\n helpersStore(helpers);\n \n const img = createImage();\n parent.appendChild(img);\n \n parent.hidden = true;\n \n parent.appendChild(createElement('div', {\n className: 'modal-nav modal-nav-left',\n dataName: 'modal-nav-left',\n innerHTML: '<span></span>',\n }));\n \n parent.appendChild(createElement('div', {\n className: 'modal-nav modal-nav-right',\n dataName: 'modal-nav-right',\n innerHTML: '<span data-name=\"modal-next\"></span>',\n }));\n \n setImage(index, img, images, {\n query,\n showTitle,\n });\n addListenerOnce(img, 'load', onload(parent, afterShow));\n \n query('nav-left').addEventListener('click', prev(img, images, query));\n \n query('nav-right').addEventListener('click', next(img, images, query));\n \n document.body.addEventListener('keydown', onKeydown(img, images, query));\n}\n\nfunction createImage() {\n const el = document.createElement('img');\n \n el.className = 'modal-image';\n \n return el;\n}\n\nconst _rmListener = rmListener;\nfunction rmListener(el, name, fn) {\n return function f(e) {\n fn(e);\n el.removeEventListener(name, f);\n };\n}\n\nconst _addListenerOnce = addListenerOnce;\nfunction addListenerOnce(el, name, fn) {\n el.addEventListener(name, rmListener(el, name, fn));\n}\n\nconst _onKeydown = onKeydown;\nconst _indexStore = indexStore;\nconst _helpersStore = helpersStore;\nconst _onload = onload;\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/@cloudcmd/modal/lib/parse-images.js\n}");
1110
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _addListenerOnce: () => (/* binding */ _addListenerOnce),\n/* harmony export */ _helpersStore: () => (/* binding */ _helpersStore),\n/* harmony export */ _indexStore: () => (/* binding */ _indexStore),\n/* harmony export */ _onKeydown: () => (/* binding */ _onKeydown),\n/* harmony export */ _onload: () => (/* binding */ _onload),\n/* harmony export */ _rmListener: () => (/* binding */ _rmListener),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var wraptile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _show_title_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./show-title.js */ \"./node_modules/@cloudcmd/modal/lib/show-title.js\");\n/* harmony import */ var _query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./query.js */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\n\n\n\n\n\n\nconst indexStore = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__.fullstore)();\nconst helpersStore = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__.fullstore)();\n\nconst next = wraptile__WEBPACK_IMPORTED_MODULE_0__((img, images) => setImage(indexStore() + 1, img, images));\nconst prev = wraptile__WEBPACK_IMPORTED_MODULE_0__((img, images) => setImage(indexStore() - 1, img, images));\n\nconst onload = wraptile__WEBPACK_IMPORTED_MODULE_0__((parent, afterShow) => {\n parent.hidden = false;\n afterShow();\n});\n\nconst onKeydown = (img, images, query) => function keydownListener(e) {\n let i = indexStore();\n \n const ArrowLeft = 37;\n const ArrowRight = 39;\n const Esc = 27;\n \n const {keyCode} = e;\n \n if (keyCode === ArrowLeft) {\n --i;\n } else if (keyCode === ArrowRight) {\n ++i;\n } else {\n if (keyCode === Esc)\n return document.body.removeEventListener('keydown', keydownListener);\n \n return;\n }\n \n setImage(i, img, images, {\n query,\n });\n};\n\nfunction setImage(i, img, images, {query, showTitle}) {\n const n = images.length - 1;\n \n if (i < 0 || i > n)\n return;\n \n indexStore(i);\n \n query('nav-left').hidden = !i;\n query('nav-right').hidden = i === n;\n \n const {href, title} = images[i];\n \n img.src = href;\n img.title = title;\n img.href = title;\n img.alt = title;\n \n if (helpersStore().title)\n showTitle(title, query('child'));\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parseImages);\n\nfunction parseImages(parent, images, overrides = {}) {\n const {\n afterShow,\n helpers,\n index,\n query = _query_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n createElement = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__,\n showTitle = _show_title_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n } = overrides;\n \n indexStore(index);\n helpersStore(helpers);\n \n const img = createImage();\n parent.appendChild(img);\n \n parent.hidden = true;\n \n parent.appendChild(createElement('div', {\n className: 'modal-nav modal-nav-left',\n dataName: 'modal-nav-left',\n innerHTML: '<span></span>',\n }));\n \n parent.appendChild(createElement('div', {\n className: 'modal-nav modal-nav-right',\n dataName: 'modal-nav-right',\n innerHTML: '<span data-name=\"modal-next\"></span>',\n }));\n \n setImage(index, img, images, {\n query,\n showTitle,\n });\n addListenerOnce(img, 'load', onload(parent, afterShow));\n \n query('nav-left').addEventListener('click', prev(img, images, query));\n \n query('nav-right').addEventListener('click', next(img, images, query));\n \n document.body.addEventListener('keydown', onKeydown(img, images, query));\n}\n\nfunction createImage() {\n const el = document.createElement('img');\n \n el.className = 'modal-image';\n \n return el;\n}\n\nconst _rmListener = rmListener;\n\nfunction rmListener(el, name, fn) {\n return function f(e) {\n fn(e);\n el.removeEventListener(name, f);\n };\n}\n\nconst _addListenerOnce = addListenerOnce;\n\nfunction addListenerOnce(el, name, fn) {\n el.addEventListener(name, rmListener(el, name, fn));\n}\n\nconst _onKeydown = onKeydown;\nconst _indexStore = indexStore;\nconst _helpersStore = helpersStore;\nconst _onload = onload;\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/@cloudcmd/modal/lib/parse-images.js\n}");
1111
1111
 
1112
1112
  /***/ },
1113
1113
 
@@ -1899,7 +1899,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1899
1899
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1900
1900
 
1901
1901
  "use strict";
1902
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FS: () => (/* binding */ FS),\n/* harmony export */ MAX_FILE_SIZE: () => (/* binding */ MAX_FILE_SIZE),\n/* harmony export */ _getDataName: () => (/* binding */ _getDataName),\n/* harmony export */ _getSize: () => (/* binding */ _getSize),\n/* harmony export */ apiURL: () => (/* binding */ apiURL),\n/* harmony export */ buildFromJSON: () => (/* binding */ buildFromJSON),\n/* harmony export */ dateFormatter: () => (/* binding */ dateFormatter),\n/* harmony export */ formatMsg: () => (/* binding */ formatMsg),\n/* harmony export */ getDotDot: () => (/* binding */ getDotDot),\n/* harmony export */ getHeaderField: () => (/* binding */ getHeaderField),\n/* harmony export */ getPathLink: () => (/* binding */ getPathLink),\n/* harmony export */ getTitle: () => (/* binding */ getTitle)\n/* harmony export */ });\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _common_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #common/entity */ \"./common/entity.js\");\n\n\n\n\nconst id = a => a;\nconst dateFormatter = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)(id);\nconst getHeaderField = currify__WEBPACK_IMPORTED_MODULE_1__(_getHeaderField);\nconst NAME = 'Cloud Commander';\nconst FS = '/fs';\nconst Path = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)();\nPath('/');\nconst filterOutDotFiles = ({\n showDotFiles\n}) => ({\n name\n}) => {\n if (showDotFiles) return true;\n return !name.startsWith('.');\n};\nconst apiURL = '/api/v1';\nconst MAX_FILE_SIZE = 500 * 1024;\nconst formatMsg = (msg, name, status) => {\n status = status || 'ok';\n name = name || '';\n if (name) name = `(\"${name}\")`;\n return `${msg}: ${status}${name}`;\n};\n\n/**\n * Функция возвращает заголовок веб страницы\n * @path\n */\nconst getTitle = options => {\n options = options || {};\n const {\n path = Path(),\n name\n } = options;\n const array = [name || NAME, path];\n return array.filter(Boolean).join(' - ');\n};\n\n/** Функция получает адреса каждого каталога в пути\n * возвращаеться массив каталогов\n * @param url - адрес каталога\n */\nfunction getPathLink(url, prefix, template) {\n if (!url) throw Error('url could not be empty!');\n if (!template) throw Error('template could not be empty!');\n const names = url.split('/').slice(1, -1);\n const allNames = ['/', ...names];\n const lines = [];\n const n = allNames.length;\n let path = '/';\n for (let i = 0; i < n; i++) {\n const name = allNames[i];\n const isLast = i === n - 1;\n if (i) path += `${name}/`;\n if (i && isLast) {\n lines.push(`${name}/`);\n continue;\n }\n const slash = i ? '/' : '';\n lines.push((0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template, {\n path,\n name,\n slash,\n prefix\n }));\n }\n return lines.join('');\n}\nfunction _getDataName(name) {\n const encoded = btoa(encodeURI(name));\n return `data-name=\"js-file-${encoded}\" `;\n}\n\n/**\n * Функция строит таблицу файлв из JSON-информации о файлах\n * @param params - информация о файлах\n *\n */\nconst buildFromJSON = params => {\n const {\n prefix,\n template,\n sort = 'name',\n order = 'asc',\n showDotFiles\n } = params;\n const formatDate = dateFormatter();\n const templateFile = template.file;\n const templateLink = template.link;\n const json = params.data;\n const path = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(json.path);\n const {\n files\n } = json;\n\n /*\n * Строим путь каталога в котором мы находимся\n * со всеми подкаталогами\n */\n const htmlPath = getPathLink(path, prefix, template.pathLink);\n let fileTable = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.path, {\n link: prefix + FS + path,\n fullPath: path,\n path: htmlPath\n });\n const owner = 'owner';\n const mode = 'mode';\n const getFieldName = getHeaderField(sort, order);\n const name = getFieldName('name');\n const size = getFieldName('size');\n const date = getFieldName('date');\n const time = getFieldName('time');\n const header = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'div',\n attribute: 'data-name=\"js-fm-header\" ',\n className: 'fm-header',\n type: '',\n name,\n size,\n date,\n time,\n owner,\n mode\n });\n\n /* сохраняем путь */\n Path(path);\n fileTable += `${header}<ul data-name=\"js-files\" class=\"files\">`;\n\n /* Если мы не в корне */\n if (path !== '/') {\n const dotDot = getDotDot(path);\n const link = prefix + FS + dotDot;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.link, {\n link,\n title: '..',\n name: '..'\n });\n const dataName = _getDataName('..');\n const attribute = `draggable=\"true\" ${dataName}`;\n\n /* Сохраняем путь к каталогу верхнего уровня*/\n fileTable += (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.file, {\n tag: 'li',\n attribute,\n className: '',\n type: 'directory',\n name: linkResult,\n size: '&lt;dir&gt;',\n date: '--.--.----',\n time: '--.--.----',\n owner: '.',\n mode: '--- --- ---'\n });\n }\n fileTable += files.filter(filterOutDotFiles({\n showDotFiles\n })).map(updateField).map(file => {\n const name = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(file.name);\n const link = prefix + FS + path + name;\n const {\n type,\n mode,\n date,\n time,\n owner,\n size\n } = file;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateLink, {\n link,\n title: name,\n name,\n attribute: getAttribute(file.type)\n });\n const dataName = _getDataName(file.name);\n const attribute = `draggable=\"true\" ${dataName}`;\n return (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'li',\n attribute,\n className: '',\n type,\n name: linkResult,\n size,\n date: formatDate(date),\n time,\n owner,\n mode\n });\n }).join('');\n fileTable += '</ul>';\n return fileTable;\n};\nconst updateField = file => ({\n ...file,\n date: file.date || '--.--.----',\n time: file.time || '--.--.----',\n owner: file.owner || 'root',\n size: getSize(file)\n});\nfunction getAttribute(type) {\n if (type === 'directory') return '';\n return 'target=\"_blank\" ';\n}\nconst _getSize = getSize;\nfunction getSize({\n size,\n type\n}) {\n if (type === 'directory') return '&lt;dir&gt;';\n if (/link/.test(type)) return '&lt;link&gt;';\n return size;\n}\nfunction _getHeaderField(sort, order, name) {\n const arrow = order === 'asc' ? '↑' : '↓';\n if (sort !== name) return name;\n if (sort === 'name' && order === 'asc') return name;\n return `${name}${arrow}`;\n}\nfunction getDotDot(path) {\n // убираем последний слеш и каталог в котором мы сейчас находимся\n const lastSlash = path.substr(path, path.lastIndexOf('/'));\n const dotDot = lastSlash.substr(lastSlash, lastSlash.lastIndexOf('/'));\n if (!dotDot) return '/';\n return dotDot;\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/common/cloudfunc.js\n}");
1902
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FS: () => (/* binding */ FS),\n/* harmony export */ MAX_FILE_SIZE: () => (/* binding */ MAX_FILE_SIZE),\n/* harmony export */ _getDataName: () => (/* binding */ _getDataName),\n/* harmony export */ _getSize: () => (/* binding */ _getSize),\n/* harmony export */ apiURL: () => (/* binding */ apiURL),\n/* harmony export */ buildFromJSON: () => (/* binding */ buildFromJSON),\n/* harmony export */ dateFormatter: () => (/* binding */ dateFormatter),\n/* harmony export */ formatMsg: () => (/* binding */ formatMsg),\n/* harmony export */ getDotDot: () => (/* binding */ getDotDot),\n/* harmony export */ getHeaderField: () => (/* binding */ getHeaderField),\n/* harmony export */ getPathLink: () => (/* binding */ getPathLink),\n/* harmony export */ getTitle: () => (/* binding */ getTitle)\n/* harmony export */ });\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _common_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #common/entity */ \"./common/entity.js\");\n\n\n\n\nconst id = a => a;\nconst NAME = 'Cloud Commander';\nconst dateFormatter = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)(id);\nconst getHeaderField = currify__WEBPACK_IMPORTED_MODULE_1__(_getHeaderField);\nconst FS = '/fs';\nconst Path = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)();\nPath('/');\nconst filterOutDotFiles = ({\n showDotFiles\n}) => ({\n name\n}) => {\n if (showDotFiles) return true;\n return !name.startsWith('.');\n};\nconst apiURL = '/api/v1';\nconst MAX_FILE_SIZE = 500 * 1024;\nconst formatMsg = (msg, name, status) => {\n status = status || 'ok';\n name = name || '';\n if (name) name = `(\"${name}\")`;\n return `${msg}: ${status}${name}`;\n};\n\n/**\n * Функция возвращает заголовок веб страницы\n * @path\n */\nconst getTitle = options => {\n options = options || {};\n const {\n path = Path(),\n name\n } = options;\n const array = [name || NAME, path];\n return array.filter(Boolean).join(' - ');\n};\n\n/** Функция получает адреса каждого каталога в пути\n * возвращаеться массив каталогов\n * @param url - адрес каталога\n */\nfunction getPathLink(url, prefix, template) {\n if (!url) throw Error('url could not be empty!');\n if (!template) throw Error('template could not be empty!');\n const names = url.split('/').slice(1, -1);\n const allNames = ['/', ...names];\n const lines = [];\n const n = allNames.length;\n let path = '/';\n for (let i = 0; i < n; i++) {\n const name = allNames[i];\n const isLast = i === n - 1;\n if (i) path += `${name}/`;\n if (i && isLast) {\n lines.push(`${name}/`);\n continue;\n }\n const slash = i ? '/' : '';\n lines.push((0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template, {\n path,\n name,\n slash,\n prefix\n }));\n }\n return lines.join('');\n}\nfunction _getDataName(name) {\n const encoded = btoa(encodeURI(name));\n return `data-name=\"js-file-${encoded}\" `;\n}\n\n/**\n * Функция строит таблицу файлв из JSON-информации о файлах\n * @param params - информация о файлах\n *\n */\nconst buildFromJSON = params => {\n const {\n prefix,\n template,\n sort = 'name',\n order = 'asc',\n showDotFiles\n } = params;\n const formatDate = dateFormatter();\n const templateFile = template.file;\n const templateLink = template.link;\n const json = params.data;\n const path = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(json.path);\n const {\n files\n } = json;\n\n /*\n * Строим путь каталога в котором мы находимся\n * со всеми подкаталогами\n */\n const htmlPath = getPathLink(path, prefix, template.pathLink);\n let fileTable = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.path, {\n link: prefix + FS + path,\n fullPath: path,\n path: htmlPath\n });\n const owner = 'owner';\n const mode = 'mode';\n const getFieldName = getHeaderField(sort, order);\n const name = getFieldName('name');\n const size = getFieldName('size');\n const date = getFieldName('date');\n const time = getFieldName('time');\n const header = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'div',\n attribute: 'data-name=\"js-fm-header\" ',\n className: 'fm-header',\n type: '',\n name,\n size,\n date,\n time,\n owner,\n mode\n });\n\n /* сохраняем путь */\n Path(path);\n fileTable += `${header}<ul data-name=\"js-files\" class=\"files\">`;\n\n /* Если мы не в корне */\n if (path !== '/') {\n const dotDot = getDotDot(path);\n const link = prefix + FS + dotDot;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.link, {\n link,\n title: '..',\n name: '..'\n });\n const dataName = _getDataName('..');\n const attribute = `draggable=\"true\" ${dataName}`;\n\n /* Сохраняем путь к каталогу верхнего уровня*/\n fileTable += (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.file, {\n tag: 'li',\n attribute,\n className: '',\n type: 'directory',\n name: linkResult,\n size: '&lt;dir&gt;',\n date: '--.--.----',\n time: '--.--.----',\n owner: '.',\n mode: '--- --- ---'\n });\n }\n fileTable += files.filter(filterOutDotFiles({\n showDotFiles\n })).map(updateField).map(file => {\n const name = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(file.name);\n const link = prefix + FS + path + name;\n const {\n type,\n mode,\n date,\n time,\n owner,\n size\n } = file;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateLink, {\n link,\n title: name,\n name,\n attribute: getAttribute(file.type)\n });\n const dataName = _getDataName(file.name);\n const attribute = `draggable=\"true\" ${dataName}`;\n return (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'li',\n attribute,\n className: '',\n type,\n name: linkResult,\n size,\n date: formatDate(date),\n time,\n owner,\n mode\n });\n }).join('');\n fileTable += '</ul>';\n return fileTable;\n};\nconst updateField = file => ({\n ...file,\n date: file.date || '--.--.----',\n time: file.time || '--.--.----',\n owner: file.owner || 'root',\n size: getSize(file)\n});\nfunction getAttribute(type) {\n if (type === 'directory') return '';\n return 'target=\"_blank\" ';\n}\nconst _getSize = getSize;\nfunction getSize({\n size,\n type\n}) {\n if (type === 'directory') return '&lt;dir&gt;';\n if (/link/.test(type)) return '&lt;link&gt;';\n return size;\n}\nfunction _getHeaderField(sort, order, name) {\n const arrow = order === 'asc' ? '↑' : '↓';\n if (sort !== name) return name;\n if (sort === 'name' && order === 'asc') return name;\n return `${name}${arrow}`;\n}\nfunction getDotDot(path) {\n // убираем последний слеш и каталог в котором мы сейчас находимся\n const lastSlash = path.substr(path, path.lastIndexOf('/'));\n const dotDot = lastSlash.substr(lastSlash, lastSlash.lastIndexOf('/'));\n if (!dotDot) return '/';\n return dotDot;\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/common/cloudfunc.js\n}");
1903
1903
 
1904
1904
  /***/ },
1905
1905
 
@@ -1965,7 +1965,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1965
1965
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1966
1966
 
1967
1967
  "use strict";
1968
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ fullstore: () => (/* binding */ fullstore)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fullstore);\n\nfunction fullstore(value) {\n const data = {\n value,\n };\n \n return (...args) => {\n const [value] = args;\n \n if (!args.length)\n return data.value;\n \n data.value = value;\n \n return value;\n };\n};\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/fullstore/lib/fullstore.js\n}");
1968
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fullstore: () => (/* binding */ fullstore)\n/* harmony export */ });\nfunction fullstore(value) {\n const data = {\n value,\n };\n \n return (...args) => {\n const [value] = args;\n \n if (!args.length)\n return data.value;\n \n data.value = value;\n \n return value;\n };\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/fullstore/lib/fullstore.js\n}");
1969
1969
 
1970
1970
  /***/ },
1971
1971
 
@@ -2031,7 +2031,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
2031
2031
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2032
2032
 
2033
2033
  "use strict";
2034
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ alert: () => (/* binding */ alert),\n/* harmony export */ confirm: () => (/* binding */ confirm),\n/* harmony export */ progress: () => (/* binding */ progress),\n/* harmony export */ prompt: () => (/* binding */ prompt)\n/* harmony export */ });\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _css_smalltalk_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../css/smalltalk.css */ \"./node_modules/smalltalk/css/smalltalk.css\");\n\n\n\n\n\nconst isBool = (a) => typeof a === 'boolean';\n\nconst keyDown = currify__WEBPACK_IMPORTED_MODULE_0__(keyDown_);\n\nconst BUTTON_OK = {\n ok: 'OK',\n};\n\nconst BUTTON_OK_CANCEL = {\n ok: 'OK',\n cancel: 'Cancel',\n};\n\nconst zIndex = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(100);\n\nconst alert = (title, msg, options) => {\n const buttons = getButtons(options) || BUTTON_OK;\n return showDialog(title, msg, '', buttons, options);\n};\n\nconst prompt = (title, msg, value = '', options) => {\n const type = getType(options);\n const val = String(value).replace(/\"/g, '&quot;');\n \n const valueStr = `<input type=\"${type}\" value=\"${val}\" data-name=\"js-input\">`;\n const buttons = getButtons(options) || BUTTON_OK_CANCEL;\n \n return showDialog(title, msg, valueStr, buttons, options);\n};\n\nconst confirm = (title, msg, options) => {\n const buttons = getButtons(options) || BUTTON_OK_CANCEL;\n \n return showDialog(title, msg, '', buttons, options);\n};\n\nconst progress = (title, message, options) => {\n const valueStr = `\n <progress value=\"0\" data-name=\"js-progress\" class=\"progress\" max=\"100\"></progress>\n <span data-name=\"js-counter\">0%</span>\n `;\n \n const buttons = {\n cancel: 'Abort',\n };\n \n const promise = showDialog(title, message, valueStr, buttons, options);\n const {ok, dialog} = promise;\n const resolve = ok();\n \n for (const el of find(dialog, ['cancel'])) {\n el.focus();\n }\n \n Object.assign(promise, {\n setProgress(count) {\n const [elProgress] = find(dialog, ['progress']);\n const [elCounter] = find(dialog, ['counter']);\n \n elProgress.value = count;\n elCounter.textContent = `${count}%`;\n \n if (count === 100) {\n remove(dialog);\n resolve();\n }\n },\n \n remove() {\n remove(dialog);\n },\n });\n \n return promise;\n};\n\nfunction getButtons(options = {}) {\n const {buttons} = options;\n \n if (!buttons)\n return null;\n \n return buttons;\n}\n\nfunction getType(options = {}) {\n const {type} = options;\n \n if (type === 'password')\n return 'password';\n \n return 'text';\n}\n\nfunction getTemplate(title, msg, value, buttons) {\n const encodedMsg = msg.replace(/\\n/g, '<br>');\n \n return `<div class=\"page\">\n <div data-name=\"js-close\" class=\"close-button\"></div>\n <header>${title}</header>\n <div class=\"content-area\">${encodedMsg}${value}</div>\n <div class=\"action-area\">\n <div class=\"button-strip\">\n ${parseButtons(buttons)}\n </div>\n </div>\n </div>`;\n}\n\nfunction parseButtons(buttons) {\n const names = Object.keys(buttons);\n const parse = currify__WEBPACK_IMPORTED_MODULE_0__((buttons, name, i) => `<button\n tabindex=${i}\n data-name=\"js-${name.toLowerCase()}\">\n ${buttons[name]}\n </button>`);\n \n return names\n .map(parse(buttons))\n .join('');\n}\n\nfunction showDialog(title, msg, value, buttons, options) {\n const ok = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n const cancel = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n \n const closeButtons = [\n 'cancel',\n 'close',\n 'ok',\n ];\n \n const promise = new Promise((resolve, reject) => {\n const noCancel = options && isBool(options.cancel) && !options.cancel;\n const empty = () => {};\n const rejectError = () => reject(Error());\n \n ok(resolve);\n cancel(noCancel ? empty : rejectError);\n });\n \n const innerHTML = getTemplate(title, msg, value, buttons);\n \n const dialog = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__('div', {\n innerHTML,\n className: 'smalltalk',\n style: `z-index: ${zIndex(zIndex() + 1)}`,\n });\n \n for (const el of find(dialog, ['ok', 'input']))\n el.focus();\n \n for (const el of find(dialog, ['input'])) {\n el.setSelectionRange(0, value.length);\n }\n \n addListenerAll('click', dialog, closeButtons, (event) => {\n closeDialog(event.target, dialog, ok(), cancel());\n });\n \n for (const event of ['click', 'contextmenu'])\n dialog.addEventListener(event, (e) => {\n e.stopPropagation();\n \n for (const el of find(dialog, ['ok', 'input']))\n el.focus();\n });\n \n dialog.addEventListener('keydown', keyDown(dialog, ok(), cancel()));\n \n return Object.assign(promise, {\n dialog,\n ok,\n });\n}\n\nfunction keyDown_(dialog, ok, cancel, event) {\n const KEY = {\n ENTER: 13,\n ESC: 27,\n TAB: 9,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n };\n \n const {keyCode} = event;\n const el = event.target;\n \n const namesAll = [\n 'ok',\n 'cancel',\n 'input',\n ];\n \n const names = find(dialog, namesAll).map(getDataName);\n \n switch(keyCode) {\n case KEY.ENTER:\n closeDialog(el, dialog, ok, cancel);\n event.preventDefault();\n break;\n \n case KEY.ESC:\n remove(dialog);\n cancel();\n break;\n \n case KEY.TAB:\n if (event.shiftKey)\n tab(dialog, names);\n \n tab(dialog, names);\n event.preventDefault();\n break;\n \n default:\n [\n 'left',\n 'right',\n 'up',\n 'down',\n ]\n .filter((name) => keyCode === KEY[name.toUpperCase()])\n .forEach(() => {\n changeButtonFocus(dialog, names);\n });\n \n break;\n }\n \n event.stopPropagation();\n}\n\nfunction getDataName(el) {\n return el\n .getAttribute('data-name')\n .replace('js-', '');\n}\n\nconst getName = (activeName) => {\n if (activeName === 'cancel')\n return 'ok';\n \n return 'cancel';\n};\n\nfunction changeButtonFocus(dialog, names) {\n const active = document.activeElement;\n const activeName = getDataName(active);\n const isButton = /ok|cancel/.test(activeName);\n const count = names.length - 1;\n \n if (activeName === 'input' || !count || !isButton)\n return;\n \n const name = getName(activeName);\n \n for (const el of find(dialog, [name])) {\n el.focus();\n }\n}\n\nconst getIndex = (count, index) => {\n if (index === count)\n return 0;\n \n return index + 1;\n};\n\nfunction tab(dialog, names) {\n const active = document.activeElement;\n const activeName = getDataName(active);\n const count = names.length - 1;\n \n const activeIndex = names.indexOf(activeName);\n const index = getIndex(count, activeIndex);\n \n const name = names[index];\n \n for (const el of find(dialog, [name]))\n el.focus();\n}\n\nfunction closeDialog(el, dialog, ok, cancel) {\n const name = el\n .getAttribute('data-name')\n .replace('js-', '');\n \n if (/close|cancel/.test(name)) {\n cancel();\n remove(dialog);\n \n return;\n }\n \n let value = null;\n \n for (const el of find(dialog, ['input'])) {\n ({value} = el);\n }\n \n ok(value);\n remove(dialog);\n}\n\nconst query = currify__WEBPACK_IMPORTED_MODULE_0__((element, name) => element.querySelector(`[data-name=\"js-${name}\"]`));\n\nfunction find(element, names) {\n const elements = names\n .map(query(element))\n .filter(Boolean);\n \n return elements;\n}\n\nfunction addListenerAll(event, parent, elements, fn) {\n for (const el of find(parent, elements)) {\n el.addEventListener(event, fn);\n }\n}\n\nfunction remove(dialog) {\n const {parentElement} = dialog;\n \n if (parentElement)\n parentElement.removeChild(dialog);\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/smalltalk/lib/smalltalk.js\n}");
2034
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ alert: () => (/* binding */ alert),\n/* harmony export */ confirm: () => (/* binding */ confirm),\n/* harmony export */ progress: () => (/* binding */ progress),\n/* harmony export */ prompt: () => (/* binding */ prompt)\n/* harmony export */ });\n/* harmony import */ var _css_smalltalk_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/smalltalk.css */ \"./node_modules/smalltalk/css/smalltalk.css\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n\n\n\n\n\nconst isBool = (a) => typeof a === 'boolean';\n\nconst keyDown = currify__WEBPACK_IMPORTED_MODULE_1__(keyDown_);\n\nconst BUTTON_OK = {\n ok: 'OK',\n};\n\nconst BUTTON_OK_CANCEL = {\n ok: 'OK',\n cancel: 'Cancel',\n};\n\nconst zIndex = (0,fullstore__WEBPACK_IMPORTED_MODULE_3__.fullstore)(100);\n\nconst alert = (title, msg, options) => {\n const buttons = getButtons(options) || BUTTON_OK;\n return showDialog(title, msg, '', buttons, options);\n};\n\nconst prompt = (title, msg, value = '', options) => {\n const type = getType(options);\n const val = String(value).replace(/\"/g, '&quot;');\n \n const valueStr = `<input type=\"${type}\" value=\"${val}\" data-name=\"js-input\">`;\n const buttons = getButtons(options) || BUTTON_OK_CANCEL;\n \n return showDialog(title, msg, valueStr, buttons, options);\n};\n\nconst confirm = (title, msg, options) => {\n const buttons = getButtons(options) || BUTTON_OK_CANCEL;\n \n return showDialog(title, msg, '', buttons, options);\n};\n\nconst progress = (title, message, options) => {\n const valueStr = `\n <progress value=\"0\" data-name=\"js-progress\" class=\"progress\" max=\"100\"></progress>\n <span data-name=\"js-counter\">0%</span>\n `;\n \n const buttons = {\n cancel: 'Abort',\n };\n \n const promise = showDialog(title, message, valueStr, buttons, options);\n const {ok, dialog} = promise;\n const resolve = ok();\n \n for (const el of find(dialog, ['cancel'])) {\n el.focus();\n }\n \n Object.assign(promise, {\n setProgress(count) {\n const [elProgress] = find(dialog, ['progress']);\n const [elCounter] = find(dialog, ['counter']);\n \n elProgress.value = count;\n elCounter.textContent = `${count}%`;\n \n if (count === 100) {\n remove(dialog);\n resolve();\n }\n },\n \n remove() {\n remove(dialog);\n },\n });\n \n return promise;\n};\n\nfunction getButtons(options = {}) {\n const {buttons} = options;\n \n if (!buttons)\n return null;\n \n return buttons;\n}\n\nfunction getType(options = {}) {\n const {type} = options;\n \n if (type === 'password')\n return 'password';\n \n return 'text';\n}\n\nfunction getTemplate(title, msg, value, buttons) {\n const encodedMsg = msg.replace(/\\n/g, '<br>');\n \n return `<div class=\"page\">\n <div data-name=\"js-close\" class=\"close-button\"></div>\n <header>${title}</header>\n <div class=\"content-area\">${encodedMsg}${value}</div>\n <div class=\"action-area\">\n <div class=\"button-strip\">\n ${parseButtons(buttons)}\n </div>\n </div>\n </div>`;\n}\n\nfunction parseButtons(buttons) {\n const names = Object.keys(buttons);\n const parse = currify__WEBPACK_IMPORTED_MODULE_1__((buttons, name, i) => `<button\n tabindex=${i}\n data-name=\"js-${name.toLowerCase()}\">\n ${buttons[name]}\n </button>`);\n \n return names\n .map(parse(buttons))\n .join('');\n}\n\nfunction showDialog(title, msg, value, buttons, options) {\n const ok = (0,fullstore__WEBPACK_IMPORTED_MODULE_3__.fullstore)();\n const cancel = (0,fullstore__WEBPACK_IMPORTED_MODULE_3__.fullstore)();\n \n const closeButtons = [\n 'cancel',\n 'close',\n 'ok',\n ];\n \n const promise = new Promise((resolve, reject) => {\n const noCancel = options && isBool(options.cancel) && !options.cancel;\n const empty = () => {};\n const rejectError = () => reject(Error());\n \n ok(resolve);\n cancel(noCancel ? empty : rejectError);\n });\n \n const innerHTML = getTemplate(title, msg, value, buttons);\n \n const dialog = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_2__('div', {\n innerHTML,\n className: 'smalltalk',\n style: `z-index: ${zIndex(zIndex() + 1)}`,\n });\n \n for (const el of find(dialog, ['ok', 'input']))\n el.focus();\n \n for (const el of find(dialog, ['input'])) {\n el.setSelectionRange(0, value.length);\n }\n \n addListenerAll('click', dialog, closeButtons, (event) => {\n closeDialog(event.target, dialog, ok(), cancel());\n });\n \n for (const event of ['click', 'contextmenu'])\n dialog.addEventListener(event, (e) => {\n e.stopPropagation();\n \n for (const el of find(dialog, ['ok', 'input']))\n el.focus();\n });\n \n dialog.addEventListener('keydown', keyDown(dialog, ok(), cancel()));\n \n return Object.assign(promise, {\n dialog,\n ok,\n });\n}\n\nfunction keyDown_(dialog, ok, cancel, event) {\n const KEY = {\n ENTER: 13,\n ESC: 27,\n TAB: 9,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n };\n \n const {keyCode} = event;\n const el = event.target;\n \n const namesAll = [\n 'ok',\n 'cancel',\n 'input',\n ];\n \n const names = find(dialog, namesAll).map(getDataName);\n \n switch(keyCode) {\n case KEY.ENTER:\n closeDialog(el, dialog, ok, cancel);\n event.preventDefault();\n break;\n \n case KEY.ESC:\n remove(dialog);\n cancel();\n break;\n \n case KEY.TAB:\n if (event.shiftKey)\n tab(dialog, names);\n \n tab(dialog, names);\n event.preventDefault();\n break;\n \n default:\n [\n 'left',\n 'right',\n 'up',\n 'down',\n ]\n .filter((name) => keyCode === KEY[name.toUpperCase()])\n .forEach(() => {\n changeButtonFocus(dialog, names);\n });\n \n break;\n }\n \n event.stopPropagation();\n}\n\nfunction getDataName(el) {\n return el\n .getAttribute('data-name')\n .replace('js-', '');\n}\n\nconst getName = (activeName) => {\n if (activeName === 'cancel')\n return 'ok';\n \n return 'cancel';\n};\n\nfunction changeButtonFocus(dialog, names) {\n const active = document.activeElement;\n const activeName = getDataName(active);\n const isButton = /ok|cancel/.test(activeName);\n const count = names.length - 1;\n \n if (activeName === 'input' || !count || !isButton)\n return;\n \n const name = getName(activeName);\n \n for (const el of find(dialog, [name])) {\n el.focus();\n }\n}\n\nconst getIndex = (count, index) => {\n if (index === count)\n return 0;\n \n return index + 1;\n};\n\nfunction tab(dialog, names) {\n const active = document.activeElement;\n const activeName = getDataName(active);\n const count = names.length - 1;\n \n const activeIndex = names.indexOf(activeName);\n const index = getIndex(count, activeIndex);\n \n const name = names[index];\n \n for (const el of find(dialog, [name]))\n el.focus();\n}\n\nfunction closeDialog(el, dialog, ok, cancel) {\n const name = el\n .getAttribute('data-name')\n .replace('js-', '');\n \n if (/close|cancel/.test(name)) {\n cancel();\n remove(dialog);\n \n return;\n }\n \n let value = null;\n \n for (const el of find(dialog, ['input'])) {\n ({value} = el);\n }\n \n ok(value);\n remove(dialog);\n}\n\nconst query = currify__WEBPACK_IMPORTED_MODULE_1__((element, name) => element.querySelector(`[data-name=\"js-${name}\"]`));\n\nfunction find(element, names) {\n const elements = names\n .map(query(element))\n .filter(Boolean);\n \n return elements;\n}\n\nfunction addListenerAll(event, parent, elements, fn) {\n for (const el of find(parent, elements)) {\n el.addEventListener(event, fn);\n }\n}\n\nfunction remove(dialog) {\n const {parentElement} = dialog;\n \n if (parentElement)\n parentElement.removeChild(dialog);\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/smalltalk/lib/smalltalk.js\n}");
2035
2035
 
2036
2036
  /***/ },
2037
2037
 
package/dist-dev/sw.js CHANGED
@@ -37,7 +37,7 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
37
37
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
38
38
 
39
39
  "use strict";
40
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\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 currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sun Mar 22 2026 01:41:15 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
40
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\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 currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sun Mar 22 2026 16:02:09 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
41
41
 
42
42
  /***/ },
43
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.8.1",
3
+ "version": "19.8.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",