jodit-pro 1.3.37 → 1.3.39

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.
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[524],{18574:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileBrowserPro=void 0;var n=o(70655);o(87989),o(76973);var r=o(27830),i=o(98498),s=o(29653),a=o(47643),c=o(11975),l=o(36257),u=o(34522),h=o(64614),d=o(68725),p=o(43854),f=o(37538),v=o(75164),m=o(4051),g=o(28544),_=o(61104),y=o(58866),w=o(30332),b=o(97029),I=o(85475),C=o(5662),S=o(34653),P=function(e){function t(t){var o=e.call(this,(0,a.ConfigProto)(Object.assign(t||{},{resizable:!0,draggable:!0,toolbarButtons:(null==t?void 0:t.toolbarButtons)||p.Config.defaultOptions.filebrowser.buttons,buttons:b.Jodit.atom(["filebrowser.settings","fullsize","dialog.close"])}),p.Config.defaultOptions.filebrowser))||this;return o.dataProvider=(0,v.makeDataProvider)(o,o.options),o.state=(0,r.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1}),o.persistent=new g.PersistentStore(o,o.state),o.loadingManager=new S.LoadingManager(o,o.state),o.stateManager=new u.StateManager(o.state),o.historyManager=new _.HistoryManager(o,o.state),o.contextMenuManager=new y.ContextMenuManager(o),o.header=new h.UIBrowserHeader(o,o.options,o.stateManager),o.panel=new s.UIBrowserPanel(o,o.stateManager),o.files=o.panel,o.tree=o.panel,o.progressbar=new f.UIProgress(o,o.stateManager.state),I.license.make(o),!o.persistent.theme&&o.options.theme&&(o.persistent.theme=o.options.theme),o.panel.append(o.progressbar),o.toolbar.setMod("mode","header"),o.setSize(Math.min(o.options.width,screen.width),Math.min(o.options.height,screen.height)).setHeader(o.header),o.onResizeWindow(),o.initUploader(),o.onChangeTheme(),o.fullFillOptions(),o.dataProvider.onProgress((function(e){0===e&&(e=30),o.state.progress=e})),o.e.on("beforeClose",o.removeGlobalListeners),o.e.fire("afterInit"),b.Jodit.prototype.afterInitHook.call(o),o}return n.__extends(t,e),t.prototype.className=function(){return"FileBrowserPro"},t.prototype.lock=function(t){return void 0===t&&(t="any"),this.container.classList.add("jodit_disabled"),e.prototype.lock.call(this,t)},t.prototype.unlock=function(){return this.container.classList.remove("jodit_disabled"),e.prototype.unlock.call(this)},t.prototype.status=function(e,t){void 0===t&&(t=!(e instanceof Error)),(0,a.isAbort)(e)||this.message.message((0,a.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg)},t.prototype.addDisclaimer=function(e){this.dialog.appendChild(e)},t.prototype.open=function(t,o){return void 0===t&&(t=this.o.defaultCallback),n.__awaiter(this,void 0,Promise,(function(){return n.__generator(this,(function(n){return this.state.onlyImages=Boolean(o),this.prepareOpening(t),e.prototype.open.call(this,this.panel.container),[2,this.e.fire("update.filebrowser")]}))}))},t.prototype.onResizeWindow=function(){(0,a.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})},t.prototype.onChangePath=function(){var e=this.state,t=e.currentSource;this.uploader.setPath(e.currentPath),this.uploader.setSource(t)},t.prototype.onChangeTheme=function(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme},t.prototype.onToggleSettings=function(){this.state.showSettings=!this.state.showSettings},t.prototype.prepareOpening=function(e){var t=this;this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=function(o){t.close(),e(o)}),this.persistent.syncWithState()},t.prototype.registerGlobalListeners=function(){this.e.on(this.ow,"keydown",this.onKeyPress)},t.prototype.onKeyPress=function(e){var t=this.od.activeElement;if(this.state.activeElements.length&&t&&r.Dom.isOrContains(this.panel.items.container,t)){var o=this.state.elements;switch(e.key){case l.KEY_ENTER:return this.onChooseItems();case l.KEY_DELETE:return this.onFileRemove();case l.KEY_RIGHT:case l.KEY_LEFT:case l.KEY_DOWN:case l.KEY_UP:var n=e.key===l.KEY_RIGHT||e.key===l.KEY_DOWN,i=this.state.lastSelectedIndex,s=void 0;if([l.KEY_RIGHT,l.KEY_LEFT].includes(e.key))s=n?o[i+1]?i+1:0:o[i-1]?i-1:o.length-1;else{var a=this.panel.countInRow;s=Math.round(((i+1)/a+(n?1:-1))*a-1)}return o[s]&&this.stateManager.addActive(o[s],e.shiftKey),!1}}},t.prototype.removeGlobalListeners=function(){this.e.off(this.ow,"keydown",this.onKeyPress)},t.prototype.onFileRemove=function(){var e=this;this.state.activeElements.length&&this.confirm("Are you sure?","Delete",(function(t){t&&e.__itemsRemove(e.state.activeElements)})).bindDestruct(this)},t.prototype.__itemsRemove=function(e){var t=this;if(!e.length)return Promise.resolve();var o=[];return e.forEach((function(e){o.push("folder"===e.type?t.__folderRemove((0,w.parentPath)(e.path),e.name,e.sourceName):t.__removeFile(e.file||e.name||"",e.sourceName))})),this.state.activeElements.forEach((function(e){t.stateManager.isFavorite(e)&&t.stateManager.toggleFavorite(e)})),this.state.activeElements=[],Promise.allSettled(o).then((function(){return Promise.allSettled([t.loadingManager.loadItems(),t.loadingManager.loadFolders()])}))},t.prototype.__removeFile=function(e,t){var o=this;return this.dataProvider.fileRemove(this.state.currentPath,e,t).then((function(t){o.status(t||o.i18n('File "%s" was deleted',e),!0)})).catch(this.status)},t.prototype.__folderRemove=function(e,t,o){var n=this;return this.dataProvider.folderRemove(e,t,o).then((function(r){n.status(r||n.i18n('Folder "%s" was deleted',t),!0),n.state.currentPath===e&&(n.state.currentPath=(0,w.parentPath)(e),n.state.currentSource=o)})).catch(this.status)},t.prototype.onFileEdit=function(){if(1===this.state.activeElements.length){var e=n.__read(this.state.activeElements,1)[0];d.openImageEditor.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}},t.prototype.onFolderRename=function(e){var t=this;this.prompt("Enter new name","Rename",(function(o){if(!(0,a.isValidName)(o)||o===e.name)return t.status(t.i18n("Enter new name")),!1;t.dataProvider.folderRename((0,w.parentPath)(e.path),e.name,o,e.sourceName).then((function(n){t.state.activeElements=[],t.status(n,!0),t.state.currentPath=(0,w.parentPath)(e.path)+"/"+o,t.state.currentSource=e.sourceName,t.historyManager.updateCurrent(),t.loadingManager.loadFolders()})).catch(t.status)}),this.i18n("type name"),e.name).bindDestruct(this)},t.prototype.onFolderRemove=function(e){var t=this;this.confirm("Are you sure?","Delete",(function(o){o&&t.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])})).bindDestruct(this)},t.prototype.onFolderCreate=function(e){var t=this;this.prompt("Enter Directory name","Create directory",(function(o){var n=e.path||"/";t.dataProvider.createFolder(o,e.path||"/",e.sourceName).then((function(){t.state.currentSource===e.sourceName&&t.state.currentPath===n?t.e.fire("update.filebrowser"):(t.state.currentSource=e.sourceName,t.state.currentPath=n),t.historyManager.updateCurrent()}),t.status)}),this.i18n("type name")).bindDestruct(this)},t.prototype.onFileRename=function(e){var t=this,o=e.file||e.name||"";1===this.state.activeElements.length&&o&&this.prompt("Enter new name","Rename",(function(e){if(!(0,a.isValidName)(e))return t.status(t.i18n("Enter new name")),!1;t.dataProvider.fileRename(t.state.currentPath,o,e,t.state.currentSource).then((function(e){t.state.activeElements=[],t.status(e,!0),t.loadingManager.loadItems()})).catch(t.status)}),this.i18n("type name"),o).bindDestruct(this)},t.prototype.onChooseItems=function(){var e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type)return this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,void this.e.fire("afterOpenFolder.filebrowser");this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}},t.prototype.onOpenLightBox=function(e){C.UILightBox.open(this,e,this.state.elements)},t.prototype.initUploader=function(){var e=this,t=this,o=(0,a.ConfigProto)(t.o.uploader||{},p.Config.defaultOptions.uploader),n=function(){return e.loadingManager.loadItems()};t.uploader=t.getInstance("Uploader",o),t.uploader.bind(t.panel.container,n,t.status),t.e.on("bindUploader.filebrowser",(function(e){t.uploader.bind(e,n,t.status)}))},t.prototype.destruct=function(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),e.prototype.destruct.call(this)},t.prototype.fullFillOptions=function(){var e=this;["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach((function(t){null!=e.options[t]&&(e.options[t]=(0,a.ConfigProto)(e.options[t],e.o.ajax))}))},n.__decorate([c.autobind],t.prototype,"status",null),n.__decorate([(0,c.watch)(":resize",window)],t.prototype,"onResizeWindow",null),n.__decorate([(0,c.watch)(["state.currentPath","state.currentSource"])],t.prototype,"onChangePath",null),n.__decorate([(0,c.watch)("state.theme")],t.prototype,"onChangeTheme",null),n.__decorate([(0,c.watch)(":toggleSettings.filebrowser")],t.prototype,"onToggleSettings",null),n.__decorate([c.autobind],t.prototype,"onKeyPress",null),n.__decorate([c.autobind],t.prototype,"removeGlobalListeners",null),n.__decorate([(0,c.watch)(":fileRemove.filebrowser")],t.prototype,"onFileRemove",null),n.__decorate([(0,c.watch)(":edit.filebrowser")],t.prototype,"onFileEdit",null),n.__decorate([(0,c.watch)(":folderRename.filebrowser")],t.prototype,"onFolderRename",null),n.__decorate([(0,c.watch)(":folderRemove.filebrowser")],t.prototype,"onFolderRemove",null),n.__decorate([(0,c.watch)(":folderCreate.filebrowser")],t.prototype,"onFolderCreate",null),n.__decorate([(0,c.watch)(":fileRename.filebrowser")],t.prototype,"onFileRename",null),n.__decorate([(0,c.watch)(":select.filebrowser")],t.prototype,"onChooseItems",null),n.__decorate([(0,c.watch)(":openLightBox.filebrowser")],t.prototype,"onOpenLightBox",null),n.__decorate([c.component,(0,c.derive)(m.Dlgs)],t)}(i.Dialog);t.FileBrowserPro=P,Object.defineProperty(b.Jodit.modules,"FileBrowserPro",{value:P,writable:!1,enumerable:!0,configurable:!0})},12980:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(43854);(0,o(78855).extendLang)(o(91190));var r=n.Config.prototype.controls.filebrowser;r.settings={icon:"settings",tooltip:"Settings",exec:function(e){var t;(null!==(t=e.parent)&&void 0!==t?t:e).e.fire("toggleSettings.filebrowser")}},r.home={icon:"home",tooltip:"Home",exec:function(e){e.e.fire("goHome.filebrowser")}},r.preview={icon:"eye",tooltip:"Preview",isDisabled:function(e){return 0===e.state.activeElements.length},exec:function(e){e.e.fire("togglePreview.filebrowser")}},r.next={icon:"angle-right",tooltip:"History next",isDisabled:function(e){return!e.historyManager.canNext()},exec:function(e){e.historyManager.next()}},r.previous={icon:"angle-left",tooltip:"History previous",isDisabled:function(e){return!e.historyManager.canPrevious()},exec:function(e){e.historyManager.previous()}},r["new-folder"]={icon:"new-folder",exec:function(e){e.e.fire("folderCreate.filebrowser",{path:e.state.currentPath,sourceName:e.state.currentSource})},tooltip:"New folder"},Object.assign(n.Config.prototype.filebrowser,{buttons:["filebrowser.home","filebrowser.previous","filebrowser.next","|","filebrowser.upload","filebrowser.new-folder","filebrowser.remove","filebrowser.update","filebrowser.select","filebrowser.edit","|","filebrowser.preview","about"],sort:!1,pixelOffsetLoadNewChunk:300,width:800,height:400,previewOfficeURL:"https://view.officeapps.live.com/op/view.aspx?src="})},4312:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finder=void 0;var n=o(70655),r=o(10818),i=o(18574),s=o(97029);o(12980);var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.requires=["license"],t.hasStyle=!s.Jodit.fatMode,t}return n.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on("getInstanceFileBrowser",(function(e){return t.__instance||(t.__instance=new i.FileBrowserPro(e)),t.__instance}))},t.prototype.beforeDestruct=function(e){var t;e.e.off("getInstanceFileBrowser"),null===(t=this.__instance)||void 0===t||t.destruct()},t}(r.Plugin);t.finder=a,s.Jodit.plugins.add("finder",a)},58866:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuManager=void 0;var n=o(70655),r=o(75164),i=o(29377),s=o(11975),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.className=function(){return"ContextMenuManager"},t.prototype.onFolderContext=function(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1},t.prototype.onItemContext=function(e,t,o){return this.buildContextItemMenu(this.getItemContextActions(e),o),!1},t.prototype.onSourceContext=function(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1},t.prototype.buildContextItemMenu=function(e,t){if(this.j.o.contextMenu){var o=(0,r.makeContextMenu)(this.j).setMod("theme",this.j.state.theme);o.show(t.clientX,t.clientY,e.filter((function(e){return e&&!1!==e.enabled}))),this.j.e.on(this.j,"afterClose",(function(){o.isOpened&&o.close()}))}},t.prototype.getItemContextActions=function(e){var t=this;if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});var o=this.j.options,n=this.j.dataProvider,r=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:Boolean(e.isImage)&&o.editImage&&r&&(n.canI("ImageResize")||n.canI("ImageCrop")),exec:function(){t.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:n.canI("FileRename")&&r,exec:function(){return t.j.e.fire("fileRename.filebrowser",e)}},{icon:"bin",title:"Delete",enabled:n.canI("FileRemove"),exec:function(){return t.j.e.fire("fileRemove.filebrowser",e)}},{icon:"eye",title:"Preview",enabled:Boolean(e.isImage||"file"===e.type)&&o.preview&&r,exec:function(){return t.j.e.fire("openLightBox.filebrowser",e)}},{icon:"upload",title:"Download",exec:function(){e.fileURL&&t.j.ow.open(e.fileURL)}}]},t.prototype.getFolderContextActions=function(e){var t=this,o=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:function(){t.j.e.fire("folderRename.filebrowser",e)},enabled:o.canI("FolderRename")},{icon:"bin",title:"Delete",exec:function(){t.j.e.fire("folderRemove.filebrowser",e)},enabled:o.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:function(){t.j.e.fire("folderCreate.filebrowser",e)},enabled:o.canI("FolderCreate")}]},t.prototype.getSourceContextActions=function(e){var t=this;return[{icon:"plus",title:"Create folder",exec:function(){t.j.e.fire("folderCreate.filebrowser",e)}}]},n.__decorate([(0,s.watch)(":contextmenuFolder.filebrowser")],t.prototype,"onFolderContext",null),n.__decorate([(0,s.watch)(":contextmenuItem.filebrowser")],t.prototype,"onItemContext",null),n.__decorate([(0,s.watch)(":contextmenuSource.filebrowser")],t.prototype,"onSourceContext",null),n.__decorate([s.component],t)}(i.ViewComponent);t.ContextMenuManager=a},30332:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parentPath=void 0,t.parentPath=function(e){var t=e.split("/").filter((function(e){return e.length}));return t.pop(),t.join("/")||"/"}},61104:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryManager=void 0;var n=o(70655),r=o(47643),i=o(29377),s=o(11975),a=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.history=[],n.historyIndex=0,n}return n.__extends(t,e),t.prototype.className=function(){return"HistoryManager"},t.prototype.canNext=function(){return this.history.length-1>this.historyIndex},t.prototype.canPrevious=function(){return this.historyIndex>0},t.prototype.push=function(e){var t=this.historyIndex,o=this.history[t];if(!o||o.currentSource!==e.currentSource||o.currentPath!==e.currentPath){var r=n.__spreadArray([],n.__read(this.history),!1);r.length-1!==t&&(r=r.slice(0,t+1)),r.push(e),o&&(t+=1),this.history=r,this.historyIndex=t}},t.prototype.next=function(){this.canNext()&&(this.historyIndex+=1,this.updateState())},t.prototype.previous=function(){this.canPrevious()&&(this.historyIndex-=1,this.updateState())},t.prototype.updateCurrent=function(){this.history[this.historyIndex]={currentSource:this.state.currentSource,currentPath:this.state.currentPath,tree:(0,r.fastClone)(this.state.tree),elements:n.__spreadArray([],n.__read(this.state.elements),!1)}},t.prototype.onHome=function(){this.state.currentPath="",this.state.currentSource="",this.j.e.fire("afterOpenFolder.filebrowser update.filebrowser")},t.prototype.onOpenFolder=function(){this.push({tree:[],elements:[],currentPath:this.state.currentPath,currentSource:this.state.currentSource}),this.j.e.fire("changeSelection")},t.prototype.updateState=function(){var e=this.history[this.historyIndex],t=e.tree,o=e.elements,r=e.currentSource,i=e.currentPath;this.state.activeElements=[],this.state.elements=n.__spreadArray([],n.__read(o),!1),this.state.tree=n.__spreadArray([],n.__read(t),!1),this.state.currentSource=r,this.state.currentPath=i,this.j.e.fire("changeSelection")},n.__decorate([(0,s.watch)(["state.elements","state.tree"])],t.prototype,"updateCurrent",null),n.__decorate([(0,s.watch)(":goHome.filebrowser")],t.prototype,"onHome",null),n.__decorate([(0,s.watch)(":afterOpenFolder.filebrowser")],t.prototype,"onOpenFolder",null),n.__decorate([s.component],t)}(i.ViewComponent);t.HistoryManager=a},34653:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoadingManager=void 0;var n=o(70655),r=o(29377),i=o(11975),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.__tick=0,n.offset=0,n.countInOneChunk=20,n.stopLoadingParts=!1,n.__isLoadingPart=!1,n.__callQueueCount=0,n}return n.__extends(t,e),t.prototype.className=function(){return"LoadingManager"},t.prototype.onUpdateFileBrowser=function(){return n.__awaiter(this,void 0,Promise,(function(){return n.__generator(this,(function(e){switch(e.label){case 0:return this.state.activeElements=[],this.j.panel.setMod("loading",!0),[4,Promise.all([this.loadFolders(),this.loadItems()])];case 1:return e.sent(),this.j.panel.setMod("loading",!1),[2]}}))}))},t.prototype.loadFolders=function(){return n.__awaiter(this,void 0,Promise,(function(){var e,t,o,r,i;return n.__generator(this,(function(n){switch(n.label){case 0:if(!this.j.isOpened)return[2];t=(e=this.state).currentPath,o=e.currentSource,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.j.dataProvider.tree(t,o)];case 2:return r=n.sent(),this.j.stateManager.fillTreeForPath(r,t),this.state.sources=r,[3,4];case 3:return i=n.sent(),this.j.status(i),[3,4];case 4:return[2]}}))}))},t.prototype.loadItems=function(){return n.__awaiter(this,void 0,Promise,(function(){var e,t,o,r;return n.__generator(this,(function(n){switch(n.label){case 0:if(!this.j.isOpened)return[2];n.label=1;case 1:return n.trys.push([1,8,,9]),this.__tick+=1,e=this.__tick,this.offset=0,this.stopLoadingParts=!1,this.__callQueueCount=0,[4,a(this.state,this.j.dataProvider,this.offset,this.countInOneChunk)];case 2:return t=n.sent(),o=t.loadedTotal,this.state.elements=t.items,this.stopLoadingParts=this.countInOneChunk>o,[4,this.loadItemsChunk(e)];case 3:return n.sent(),[4,this.async.requestIdlePromise()];case 4:if(n.sent(),this.__tick!==e)return[2];n.label=5;case 5:return this.stopLoadingParts||this.state.elements.length>this.j.panel.countInColumn*this.j.panel.countInRow?[3,7]:[4,this.loadItemsChunk(e)];case 6:return n.sent(),this.__tick!==e?[2]:[3,5];case 7:return[3,9];case 8:return r=n.sent(),this.j.status(r),[3,9];case 9:return[2]}}))}))},t.prototype.__loadItemsChunk=function(e){return n.__awaiter(this,void 0,Promise,(function(){var t,o,r,i;return n.__generator(this,(function(n){switch(n.label){case 0:if(this.__isLoadingPart)return this.__callQueueCount+=1,[2];if(this.stopLoadingParts)return this.__callQueueCount=0,[2];this.__isLoadingPart=!0,this.j.panel.items.setMod("chunk-loading",!0),n.label=1;case 1:return n.trys.push([1,3,,4]),this.offset+=this.countInOneChunk,[4,a(this.state,this.j.dataProvider,this.offset,this.countInOneChunk)];case 2:return t=n.sent(),o=t.items,r=t.loadedTotal,this.__tick!==e?[2]:(this.stopLoadingParts=this.countInOneChunk>r,o.length&&(this.state.elements=this.state.elements.concat(o)),[3,4]);case 3:return i=n.sent(),this.j.status(i),[3,4];case 4:return this.j.panel.items.setMod("chunk-loading",!1),this.__isLoadingPart=!1,this.__callQueueCount>0?(this.__callQueueCount-=1,[2,this.__loadItemsChunk(e)]):[2]}}))}))},t.prototype.loadItemsChunk=function(e){return void 0===e&&(e=this.__tick),e!==this.__tick?Promise.resolve():this.__loadItemsChunk(e)},n.__decorate([(0,i.watch)(":update.filebrowser")],t.prototype,"onUpdateFileBrowser",null),n.__decorate([(0,i.watch)(["state.currentPath","state.currentSource"]),(0,i.debounce)((function(e){return{timeout:e.defaultTimeout,promisify:!0}}))],t.prototype,"loadFolders",null),n.__decorate([(0,i.watch)(["state.currentPath","state.currentSource","state.sortBy","state.onlyImages","state.foldersPosition","state.filterWord"]),(0,i.debounce)((function(e){return{timeout:e.defaultTimeout,promisify:!0}}))],t.prototype,"loadItems",null),n.__decorate([(0,i.debounce)((function(e){return{timeout:e.defaultTimeout,promisify:!0}}))],t.prototype,"loadItemsChunk",null),n.__decorate([i.component],t)}(r.ViewComponent);function a(e,t,o,n){return t.itemsEx(e.currentPath,e.currentSource,{offset:o,limit:n,sortBy:e.sortBy,withFolders:e.withFolders,foldersPosition:e.foldersPosition,onlyImages:e.onlyImages,filterWord:e.filterWord})}t.LoadingManager=s},28544:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PersistentStore=void 0;var n=o(70655),r=o(29377),i=o(11975),s=o(10115),a=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.sortBy="changed-desc",n.view="tiles",n.foldersPosition="top",n.tileSize="default",n.favorites=[],n.showSideBar=!0,n.showPreview=!1,n.showFavorites=!0,n}return n.__extends(t,e),t.prototype.className=function(){return"PersistentStore"},t.prototype.onChangeThemeSetField=function(){this.theme=this.state.theme},t.prototype.onChangeView=function(){this.view=this.state.view},t.prototype.onChangeSortBy=function(){this.sortBy=this.state.sortBy},t.prototype.onChangeTileSize=function(){this.tileSize=this.state.tileSize},t.prototype.onChangeFavorites=function(){this.favorites=this.state.favorites},t.prototype.onChangeShowSideBar=function(){this.showSideBar=this.state.showSideBar},t.prototype.onChangeShowPreview=function(){this.showPreview=this.state.showPreview},t.prototype.onChangeShowFavorites=function(){this.showFavorites=this.state.showFavorites},t.prototype.onChangeFoldersPosition=function(){this.foldersPosition=this.state.foldersPosition},t.prototype.syncWithState=function(){this.state.tileSize=this.tileSize,this.state.favorites=this.favorites.map((function(e){return e instanceof s.FileBrowserItem?e:s.FileBrowserItem.create(e)})),this.state.view=this.view,this.state.theme=this.theme,this.state.showSideBar=this.showSideBar,this.state.showPreview=this.showPreview,this.state.showFavorites=this.showFavorites,this.state.sortBy=this.sortBy,this.state.foldersPosition=this.foldersPosition},n.__decorate([i.persistent],t.prototype,"theme",void 0),n.__decorate([i.persistent],t.prototype,"sortBy",void 0),n.__decorate([i.persistent],t.prototype,"view",void 0),n.__decorate([i.persistent],t.prototype,"foldersPosition",void 0),n.__decorate([i.persistent],t.prototype,"tileSize",void 0),n.__decorate([i.persistent],t.prototype,"favorites",void 0),n.__decorate([i.persistent],t.prototype,"showSideBar",void 0),n.__decorate([i.persistent],t.prototype,"showPreview",void 0),n.__decorate([i.persistent],t.prototype,"showFavorites",void 0),n.__decorate([(0,i.watch)("state.theme")],t.prototype,"onChangeThemeSetField",null),n.__decorate([(0,i.watch)("state.view")],t.prototype,"onChangeView",null),n.__decorate([(0,i.watch)("state.sortBy")],t.prototype,"onChangeSortBy",null),n.__decorate([(0,i.watch)("state.tileSize")],t.prototype,"onChangeTileSize",null),n.__decorate([(0,i.watch)("state.favorites")],t.prototype,"onChangeFavorites",null),n.__decorate([(0,i.watch)("state.showSideBar")],t.prototype,"onChangeShowSideBar",null),n.__decorate([(0,i.watch)("state.showPreview")],t.prototype,"onChangeShowPreview",null),n.__decorate([(0,i.watch)("state.showFavorites")],t.prototype,"onChangeShowFavorites",null),n.__decorate([(0,i.watch)("state.foldersPosition")],t.prototype,"onChangeFoldersPosition",null),n.__decorate([i.component],t)}(r.ViewComponent);t.PersistentStore=a},34522:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateManager=void 0;var n=o(70655),r=o(11975),i=function(){function e(e){this.state=e}return e.prototype.getIndex=function(e,t){return void 0===t&&(t=this.state.elements),t.findIndex((function(t){return t.uniqueHashKey===e.uniqueHashKey}))},e.prototype.isActive=function(e){return Boolean(this.state.activeElements.find((function(t){return t.uniqueHashKey===e.uniqueHashKey})))},e.prototype.isFavorite=function(e){return Boolean(this.state.favorites.find((function(t){return t.uniqueHashKey===e.uniqueHashKey})))},e.prototype.addActive=function(e,t){var o;this.state.metaInfo=e,this.state.info=null!==(o=e.file)&&void 0!==o?o:"",this.state.lastSelectedIndex=this.getIndex(e),this.state.activeElements=t?n.__spreadArray(n.__spreadArray([],n.__read(this.state.activeElements),!1),[e],!1):[e]},e.prototype.callSelectHandler=function(){var e,t=this.state.activeElements;null===(e=this.state.onSelectCallBack)||void 0===e||e.call(this,{baseurl:"",files:t.map((function(e){return e.fileURL})),isImages:t.map((function(e){return Boolean(e.isImage)}))})},e.prototype.setFilter=function(e){this.state.filterWord=e},e.prototype.toggleFavorite=function(e){var t=this.getIndex(e,this.state.favorites),o=n.__spreadArray([],n.__read(this.state.favorites),!1);-1===t?o.push(e):o.splice(t,1),this.state.favorites=o},e.prototype.fillTreeForPath=function(e,t){var o=this;this.state.tree.length&&t&&"/"!==t?(this.removeActive(this.state.tree),e.forEach((function(e){var n=s(o.state.tree,e.name);n||(n=c(e),o.state.tree.push(n)),n.isActive=!0;var r=function(e,t){return e.split("/").reduce((function(e,t){return e&&s(e.children,t)}),t)}(t,n);r&&(r.isActive=!0,r.children=a(e.folders).map((function(o){return l(o,t+"/"+o,e.name)})))})),this.state.tree=n.__spreadArray([],n.__read(this.state.tree),!1)):this.state.tree=e.map(c)},e.prototype.removeActive=function(e){var t=this;e.forEach((function(e){e.isActive=!1,t.removeActive(e.children)}))},Object.defineProperty(e.prototype,"isFavoriteItems",{get:function(){return this.state.favorites===this.state.elements},enumerable:!1,configurable:!0}),n.__decorate([r.autobind],e.prototype,"getIndex",null),n.__decorate([r.autobind],e.prototype,"isActive",null),n.__decorate([r.autobind],e.prototype,"isFavorite",null),e}();function s(e,t){var o;return null!==(o=e.find((function(e){return e.name===t})))&&void 0!==o?o:null}function a(e){return e.filter((function(e){return"."!==e&&".."!==e}))}function c(e){return{type:"source",name:e.name,title:e.title,sourceName:e.name,path:"/",children:a(e.folders).map((function(t){return l(t,t,e.name)}))}}function l(e,t,o){return{type:"directory",name:e,path:t,sourceName:o,children:[]}}t.StateManager=i},91190:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ru=void 0;var n=o(99425);t.ru=n},76973:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(98813),r=o(21601),i=o(67101),s=o(34839);n.Icon.set("heart",String(r)),n.Icon.set("home",String(i)),n.Icon.set("new-folder",String(s))},89861:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserFolder=void 0;var n=o(70655);o(6337);var r=o(98813),i=o(11975),s=o(47643),a=function(e){function t(t,o){var n=e.call(this,t)||this;n.item=o,n.syncMod=!0;var r=n.getElm("name");return(0,s.assert)(null!=r,"name element does not exists"),r.innerText=o.name,t.e.on(n.container,"click",(function(){return n.getMod("active")||n.setMod("loading",!0),t.e.fire("openFolder",o)})).on(n.container,"contextmenu",(function(e){return t.e.fire("contextmenuFolder.filebrowser",o,e)})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserFolder"},t.prototype.render=function(){return'<div>\n\t\t\t<div class="&__icon">\n\t\t\t\t<div class=\'&__loader\'></div>\n\t\t\t\t<div class="&__icon-wrapper">\n\t\t\t\t\t*folder*\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__arrow">*angle-right*</div>\n\t\t</div>'},n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserFolder=a},64614:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserHeader=void 0;var n=o(70655);o(80355);var r=o(98813),i=o(11975),s=o(30446),a=function(e){function t(t,o,n){var i,a=this;return(a=e.call(this,t)||this).options=o,a.stateManager=n,a.syncMod=!0,a.toolbar=(0,s.makeCollection)(a.j),a.filter=new r.UIInput(a.j,{icon:"search",placeholder:"Filter",clearButton:!0,onChange:function(e){a.stateManager.setFilter(e)}}),a.append(a.toolbar).append(a.filter),a.filter.container.classList.add(a.getFullElName("filter")),a.toolbar.setMod("mode","header").build(null!==(i=a.options.toolbarButtons)&&void 0!==i?i:[]),a}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserHeader"},n.__decorate([i.component],t)}(r.UIGroup);t.UIBrowserHeader=a},17971:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserItem=void 0;var n=o(70655);o(80744);var r=o(98813),i=o(11975),s=o(10115),a=o(27830),c=o(47643),l=o(47643),u=function(e){function t(t,o){var n=e.call(this,t)||this;return n.item=s.FileBrowserItem.create(o),t.e.on(n.container,"click contextmenu dblclick",(function(e){return t.e.fire(e.type+"Item.filebrowser",n.item,(0,c.ctrlKey)(e)||e.shiftKey,e),!1})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserItem"},t.prototype.render=function(){return"<div tabindex='-1'>\n\t\t\t<div class='&__image'></div>\n\t\t\t<div class='&__info'></div>\n\t\t\t<div class='&__heart'>*heart*</div>\n\t\t</div>"},t.prototype.onClickFavorite=function(){var e=this;return this.bubble((function(t){e.jodit.e.fire(t,"toggleFavoriteItem",e.item)})),!1},t.prototype.onAction=function(e){return this.jodit.e.fire(e.type+"Item.filebrowser",this.item,(0,c.ctrlKey)(e)||e.shiftKey,e),!1},t.prototype.update=function(){var t=this.getElm("image");(0,l.assert)(null!=t,"image element does not exists"),(0,c.css)(t,"backgroundImage","url(".concat(encodeURI(this.item.imageURL),")"));var o=this.item,n=o.type,r=o.file,i=o.time,s=o.size;this.setMod("is-file",!1===this.item.isImage).setMod("type",null!=n?n:"file").setElementValue("name",r).setElementValue("time",i).setElementValue("filesize",s),(0,c.attr)(this.container,"title","folder"!==n?"".concat(r," ").concat(i," ").concat(s):r),e.prototype.update.call(this)},t.prototype.setElementValue=function(e,t){var o=this.getFullElName(e),n=this.getElm(e);if(!t)return n&&a.Dom.safeRemove(n),this;if(!n){var r=this.getElm("info");(0,l.assert)(null!=r,"wrapper element does not exist"),n=this.j.create.div(o),r.appendChild(n)}return n.innerText=t,this},n.__decorate([(0,i.watch)("heart:click")],t.prototype,"onClickFavorite",null),n.__decorate([(0,i.watch)(["container:click","container:contextmenu","container:dblclick"])],t.prototype,"onAction",null),n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserItem=u},5662:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UILightBox=void 0;var n=o(70655);o(35850);var r=o(27830),i=o(11975),s=o(47643),a=o(36257),c=o(47643),l=function(e){function t(t,o,n){var i=e.call(this,t)||this;i.current=o,i.elements=n,i.dialog=new r.Dialog;var s=i.dialog;return s.setMod("theme",t.state.theme).toolbar.setMod("mode","header"),s.open(i),i.elements=i.elements.filter((function(e){return e.isImage})),s.e.on(s,"afterClose",(function(){i.destruct()})),i.addGlobalListeners(),i.onChangeCurrent(),s.toolbar.build([{icon:"check",exec:function(){t.stateManager.addActive(i.current,!1),t.e.fire("select.filebrowser"),s.close()}},"dialog.close"]),i}var o;return n.__extends(t,e),o=t,t.prototype.className=function(){return"UILightBox"},t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__previous'>*angle-left*</div>\n\t\t\t<div class='&__preview'></div>\n\t\t\t<div class='&__loader'></div>\n\t\t\t<div class='&__next'>*angle-right*</div>\n\t\t</div>"},t.prototype.onChangeCurrent=function(){return n.__awaiter(this,void 0,Promise,(function(){var e,t,o,i;return n.__generator(this,(function(n){switch(n.label){case 0:return e=this.current,this.setMod("loading",!0),t=this.getElm("preview"),(0,c.assert)(null!=t,"preview element does not exist"),r.Dom.detach(t),(0,s.css)(t,{backgroundImage:null}),e.isImage?[4,(0,s.loadImage)(e.fileURL,this.j)]:[3,2];case 1:return o=n.sent(),this.dialog.setPosition(),(0,s.css)(t,{width:Math.min(this.jodit.ow.innerWidth,o.naturalWidth),height:Math.min(this.jodit.ow.innerHeight-100,o.naturalHeight),backgroundImage:"url(".concat(o.src,")")}),[3,4];case 2:return[4,this.makeIframe(e.fileURL)];case 3:i=n.sent(),t.appendChild(i),n.label=4;case 4:return this.dialog.setSize(),this.dialog.setPosition(),this.setMod("loading",!1),[2]}}))}))},t.prototype.makeIframe=function(e){var t=this.j.c.element("iframe");return t.classList.add(this.getFullElName("office-iframe")),t.src=/\.pdf/.test(e)?e:this.j.o.previewOfficeURL+encodeURIComponent(e),t},t.prototype.onPreviousClick=function(){var e=this.j.stateManager.getIndex(this.current,this.elements);e>0?e-=1:e=this.elements.length-1,this.current=this.elements[e]},t.prototype.onNextClick=function(){var e=this.j.stateManager.getIndex(this.current,this.elements);this.elements.length-1>e?e+=1:e=0,this.current=this.elements[e]},t.open=function(e,t,n){return new o(e,t,n)},t.prototype.addGlobalListeners=function(){this.j.e.on(this.j.od,"keydown",this.onKeyPress)},t.prototype.onKeyPress=function(e){if(e.key===a.KEY_LEFT||e.key===a.KEY_RIGHT||e.key===a.KEY_SPACE)return e.key===a.KEY_LEFT?this.onPreviousClick():this.onNextClick(),!1},t.prototype.removeGlobalListeners=function(){this.j.e.off(this.j.od,"keydown",this.onKeyPress)},t.prototype.destruct=function(){return this.removeGlobalListeners(),this.dialog.destruct(),e.prototype.destruct.call(this)},n.__decorate([(0,i.watch)("current")],t.prototype,"onChangeCurrent",null),n.__decorate([(0,i.watch)("previous:click")],t.prototype,"onPreviousClick",null),n.__decorate([(0,i.watch)("next:click")],t.prototype,"onNextClick",null),n.__decorate([i.autobind],t.prototype,"onKeyPress",null),o=n.__decorate([i.component],t)}(r.UIElement);t.UILightBox=l},29653:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserPanel=void 0;var n=o(70655);o(73570);var r=o(98813),i=o(53737),s=o(11975),a=o(10239),c=o(57187),l=o(47643),u=o(71584),h=o(19485),d=o(73347),p=function(e){function t(t,o){var n=e.call(this,t)||this;return n.stateManager=o,n.syncMod=!0,n.sources=new u.UIBrowserSources(n.j),n.sidebar=new a.UISidebar(n.jodit,[n.sources],n.stateManager.state),n.preview=new d.UIPreview(n.jodit,n.stateManager.state),n.statusbar=new h.UIBrowserStatusBar(n.j),n.items=new i.UIVirtualScroll(n.j,n.stateManager),n.settings=new c.UIBrowserSettings(n.jodit,n.stateManager.state),n.state=o.state,n.append(n.sidebar,"content"),n.append(n.items,"content"),n.append(n.settings,"content"),n.append(n.preview,"content"),n.append(n.statusbar,"footer"),n.onChangeElements(),n.onChangeSources(),n.onChangeView(),n.onChangeTileSize(),n.onChangeShowFavorites(),n.onChangeActiveElements(),n.onChangeFavorites(),n.onChangeShowSideBar(),n.onChangeShowSettings(),n.onChangeShowPreview(),n.onChangeTheme(),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserPanel"},Object.defineProperty(t.prototype,"countInRow",{get:function(){if("list"===this.state.view)return 1;if(!this.items.elements.length)return 1;var e=this.items.elements[0].container,t=(0,l.css)(e,"marginLeft");return Math.floor(this.items.container.offsetWidth/(e.offsetWidth+((0,l.isNumber)(t)?t:0)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"countInColumn",{get:function(){if(!this.items.elements.length)return 1;var e=this.items.elements[0].container,t=(0,l.css)(e,"marginTop");return Math.floor(this.items.container.offsetHeight/(e.offsetHeight+((0,l.isNumber)(t)?t:0)))},enumerable:!1,configurable:!0}),t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__content'></div>\n\t\t\t<div class='&__footer'></div>\n\t\t</div>"},t.prototype.onChangeTheme=function(){this.setMod("theme",this.stateManager.state.theme)},t.prototype.onChangeElements=function(){this.items.build(this.stateManager.state.elements)},t.prototype.onChangeActiveElements=function(){var e=this;this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach((function(t){t.setMod("active",Boolean(e.stateManager.isActive(t.item)))})),this.j.e.fire("changeSelection")},t.prototype.onChangeFavorites=function(){var e=this;this.items.elements.forEach((function(t){t.setMod("favorite",Boolean(e.stateManager.isFavorite(t.item)))}))},t.prototype.onChangeSources=function(){this.sources.build(this.stateManager.state.tree)},t.prototype.onChangeLastSelectedIndex=function(){var e,t=null===(e=this.items.elements[this.stateManager.state.lastSelectedIndex])||void 0===e?void 0:e.container;t&&((0,l.scrollIntoViewIfNeeded)(t,this.items.container,this.j.od),t.focus())},t.prototype.onChangeInfo=function(){this.statusbar.value(this.state.info,"center")},t.prototype.onChangePathOrSource=function(){this.statusbar.value(this.state.currentPath?"".concat(this.state.currentPath," (").concat(this.state.currentSource,")"):this.i18n("Home"),"left")},t.prototype.onChangeShowSettings=function(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)},t.prototype.onChangeShowPreview=function(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)},t.prototype.onChangeShowSideBar=function(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)},t.prototype.onChangeView=function(){this.items.setMod("view",this.stateManager.state.view)},t.prototype.onChangeTileSize=function(){this.items.setMod("size",this.stateManager.state.tileSize)},t.prototype.onChangeShowFavorites=function(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)},t.prototype.onItemDblClick=function(){return this.j.e.fire("select.filebrowser"),!1},t.prototype.onItemClick=function(e,t){this.stateManager.addActive(e,t)},t.prototype.onTogglePreview=function(){return this.state.showPreview=!this.state.showPreview,!1},t.prototype.onToggleFavoriteItem=function(e){this.stateManager.toggleFavorite(e)},t.prototype.onFolderClick=function(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")},n.__decorate([(0,s.watch)("state.theme")],t.prototype,"onChangeTheme",null),n.__decorate([(0,s.watch)("state.elements")],t.prototype,"onChangeElements",null),n.__decorate([(0,s.watch)("state.activeElements")],t.prototype,"onChangeActiveElements",null),n.__decorate([(0,s.watch)(["state.favorites","state.elements"])],t.prototype,"onChangeFavorites",null),n.__decorate([(0,s.watch)("state.sources")],t.prototype,"onChangeSources",null),n.__decorate([(0,s.watch)("state.lastSelectedIndex")],t.prototype,"onChangeLastSelectedIndex",null),n.__decorate([(0,s.watch)("state.info")],t.prototype,"onChangeInfo",null),n.__decorate([(0,s.watch)(["state.currentPath","state.currentSource"])],t.prototype,"onChangePathOrSource",null),n.__decorate([(0,s.watch)("state.showSettings")],t.prototype,"onChangeShowSettings",null),n.__decorate([(0,s.watch)("state.showPreview")],t.prototype,"onChangeShowPreview",null),n.__decorate([(0,s.watch)("state.showSideBar")],t.prototype,"onChangeShowSideBar",null),n.__decorate([(0,s.watch)("state.view")],t.prototype,"onChangeView",null),n.__decorate([(0,s.watch)("state.tileSize")],t.prototype,"onChangeTileSize",null),n.__decorate([(0,s.watch)("state.showFavorites")],t.prototype,"onChangeShowFavorites",null),n.__decorate([(0,s.watch)(":dblclickItem.filebrowser")],t.prototype,"onItemDblClick",null),n.__decorate([(0,s.watch)(":clickItem.filebrowser")],t.prototype,"onItemClick",null),n.__decorate([(0,s.watch)(":togglePreview.filebrowser")],t.prototype,"onTogglePreview",null),n.__decorate([(0,s.watch)(":toggleFavoriteItem")],t.prototype,"onToggleFavoriteItem",null),n.__decorate([(0,s.watch)(":openFolder")],t.prototype,"onFolderClick",null),n.__decorate([s.component],t)}(r.UIGroup);t.UIBrowserPanel=p},73347:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIPreview=void 0;var n=o(70655);o(6590);var r=o(98813),i=o(11975),s=o(64413),a=o(47643),c=o(97039),l=o(17971),u=o(47643),h=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.lastLoadPromise=null,n.onChangeMetaInfo(),n}return n.__extends(t,e),t.prototype.className=function(){return"UIPreview"},t.prototype.addResize=function(){s.UIResize.remove(this),s.UIResize.install(this,screen.width>450?"left":"top")},t.prototype.render=function(){return'<div>\n\t\t\t\t<div class="&__image"></div>\n\t\t\t\t<div class="&__info"></div>\n\t\t\t\t<div class="&__loader"></div>\n\t\t\t\t<div class="&__empty-message">~Select image~</div>\n\t\t\t</div>'},t.prototype.afterSetMod=function(t,o){"hidden"===t&&!1===o&&this.onChangeMetaInfo(),e.prototype.afterSetMod.call(this,t,o)},t.prototype.onChangeMetaInfo=function(){var e,t,o=this;if(!this.getMod("hidden")){var n=this.state.metaInfo;this.setMod("empty",!n);var r=this.getElm("info");(0,u.assert)(null!=r,"info element does not exists"),c.Dom.detach(r);var i=this.getElm("image");(0,u.assert)(null!=i,"image element does not exists"),(0,a.css)(i,{backgroundImage:null}),n&&(this.setMod("is-file",!1===n.isImage).setMod("type",null!==(e=n.type)&&void 0!==e?e:"file"),l.UIBrowserItem.prototype.setElementValue.call(this,"name",n.file),l.UIBrowserItem.prototype.setElementValue.call(this,"time",n.time),l.UIBrowserItem.prototype.setElementValue.call(this,"filesize",n.size),this.setMod("loading",!0),null===(t=this.lastLoadPromise)||void 0===t||t.rejectCallback(),this.lastLoadPromise=(0,a.loadImage)(n.isImage?n.fileURL:n.imageURL,this.j),this.lastLoadPromise.then((function(e){var t=o.getElm("image");(0,u.assert)(null!=t,"image element does not exist"),e&&(0,a.css)(t,{backgroundImage:"url(".concat(e.src,")")})})).finally((function(){o.setMod("loading",!1)})).catch((function(){})))}},n.__decorate([(0,i.hook)("ready"),(0,i.watch)(":resize",window),(0,i.debounce)()],t.prototype,"addResize",null),n.__decorate([(0,i.watch)("state.metaInfo")],t.prototype,"onChangeMetaInfo",null),n.__decorate([i.component],t)}(r.UIGroup);t.UIPreview=h},37538:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIProgress=void 0;var n=o(70655);o(49573);var r=o(98813),i=o(11975),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.onProgress(),n}return n.__extends(t,e),t.prototype.className=function(){return"UIProgress"},t.prototype.onProgress=function(){this.state.progress?this.show():this.hide(),this.progress(this.state.progress)},t.prototype.hide=function(){return this.setMod("hidden",!0),this},t.prototype.progress=function(e){var t=this;return this.container.style.width=e.toFixed(2)+"%",98>e||this.j.async.setTimeout((function(){t.hide()}),{label:"progress",timeout:300}),this},t.prototype.show=function(){return this.setMod("hidden",!1),this},n.__decorate([(0,i.watch)("state.progress")],t.prototype,"onProgress",null),n.__decorate([i.component],t)}(r.ProgressBar);t.UIProgress=s},57187:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserSettings=void 0;var n=o(70655);o(14001);var r=o(98813),i=o(11975),s=o(47643),a=function(e){function t(t,o){var n=e.call(this,t)||this;n.state=o;var r=n.getElm("close");return(0,s.assert)(null!=r,"close element does not exists"),t.e.on(r,"click",(function(){n.state.showSettings=!1})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserSettings"},t.prototype.render=function(){return'<div>\n\t\t\t<div class="'.concat(this.getFullElName("close"),'">').concat(r.Icon.get("cancel"),'</div>\n\t\t\t<div class="').concat(this.getFullElName("title"),'">').concat(this.j.i18n("Settings"),'</div>\n\t\t\t<div class="').concat(this.getFullElName("options"),'"></div>\n\t\t</div>')},t.prototype.appendChildToContainer=function(e){var t=this.getElm("options");(0,s.assert)(null!=t,"options element does not exists"),t.appendChild(e)},t.prototype.afterSetMod=function(t,o){"hidden"===t&&!1===o&&this.generateSettings(),e.prototype.afterSetMod.call(this,t,o)},t.prototype.onChangeView=function(){var e=this.getElm("tile-size");e&&(e.style.display="tiles"===this.state.view?"block":"none")},t.prototype.generateSettings=function(){var e=this;this.clear();var t=this.j;this.append([new r.UIButtonGroup(t,{label:"Theme",name:"theme",value:this.state.theme,radio:!0,options:[{value:"default",text:"Light"},{value:"dark",text:"Dark"}],onChange:function(t){e.state.theme="default"===e.state.theme||"dark"===e.state.theme?t[0].value:"default"}}),new r.UIButtonGroup(t,{label:"Show favorites",name:"showFavorites",value:this.state.showFavorites,radio:!0,options:[{value:!0,text:"Show"},{value:!1,text:"Hide"}],onChange:function(t){e.state.showFavorites=t[0].value}}),new r.UIButtonGroup(t,{label:"View",name:"view",value:this.state.view,radio:!0,options:[{value:"tiles",text:"Tiles"},{value:"list",text:"List"},{value:"compact",text:"Compact"}],onChange:function(t){e.state.view=t[0].value}}),new r.UIButtonGroup(t,{label:"Folders position",name:"foldersPosition",value:this.state.foldersPosition,radio:!0,options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"default",text:"Default"}],onChange:function(t){e.state.foldersPosition=t[0].value}}),new r.UISelect(t,{label:"Sort by",name:"sort-by",value:this.state.sortBy,options:[{value:"changed-asc",text:t.i18n("Sort by changed")+"(⬆)"},{value:"changed-desc",text:t.i18n("Sort by changed")+"(⬇)"},{value:"name-asc",text:t.i18n("Sort by name")+"(⬆)"},{value:"name-desc",text:t.i18n("Sort by name")+"(⬇)"},{value:"size-asc",text:t.i18n("Sort by size")+"(⬆)"},{value:"size-desc",text:t.i18n("Sort by size")+"(⬇)"}],onChange:function(t){e.state.sortBy=t}}),new r.UISelect(t,{label:"Tile size",name:"tile-size",value:this.state.tileSize,options:[{value:"xsmall",text:"Extra small"},{value:"small",text:"Small"},{value:"default",text:"Default"},{value:"large",text:"Large"},{value:"xlarge",text:"Extra large"}],onChange:function(t){e.state.tileSize=t}})]),this.onChangeView()},n.__decorate([(0,i.watch)("state.view")],t.prototype,"onChangeView",null),n.__decorate([i.component],t)}(r.UIGroup);t.UIBrowserSettings=a},10239:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UISidebar=void 0;var n=o(70655);o(11785);var r=o(98813),i=o(11975),s=o(64413),a=o(47643),c=function(e){function t(t,o,n){var r=e.call(this,t,o)||this;return r.state=n,r.onChangeFavorites(),r}return n.__extends(t,e),t.prototype.className=function(){return"UISidebar"},t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__hide-btn'>*angle-left*</div>\n\t\t\t<div class='&__favorites'>*heart* ~Favorites~</div>\n\t\t\t<div class='&__box'></div>\n\t\t</div>"},t.prototype.appendChildToContainer=function(e){var t=this.getElm("box");(0,a.assert)(null!=t,"box element does not exists"),t.appendChild(e)},t.prototype.addResize=function(){s.UIResize.remove(this),s.UIResize.install(this,screen.width>450?"right":"bottom")},t.prototype.onChangeFavorites=function(){this.setMod("has-favorites",Boolean(this.state.favorites.length))},t.prototype.onClickHideButton=function(){return this.state.showSideBar=!this.state.showSideBar,!1},t.prototype.onClickFavorites=function(){return this.state.elements=this.state.favorites,!1},n.__decorate([(0,i.hook)("ready"),(0,i.watch)(":resize",window),(0,i.debounce)()],t.prototype,"addResize",null),n.__decorate([(0,i.watch)("state.favorites")],t.prototype,"onChangeFavorites",null),n.__decorate([(0,i.watch)("hide-btn:click")],t.prototype,"onClickHideButton",null),n.__decorate([(0,i.watch)("favorites:click")],t.prototype,"onClickFavorites",null),n.__decorate([i.component],t)}(r.UIGroup);t.UISidebar=c},65104:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserSource=void 0;var n=o(70655);o(28389);var r=o(98813),i=o(11975),s=o(93659),a=o(47643),c=function(e){function t(t,o){var n=e.call(this,t,o)||this;n.data=o,n.tree=new s.UITree(n.j,n.data.children),n.syncMod=!0;var r=n.getElm("name");(0,a.assert)(null!=r,"name element does not exists"),r.innerText=o.title||o.name;var i=n.getElm("tree");return(0,a.assert)(null!=i,"tree element does not exists"),i.appendChild(n.tree.container),t.e.on(n.container,"contextmenu",(function(e){return t.e.fire("contextmenuSource.filebrowser",o,e)})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserSource"},t.prototype.render=function(){return'<div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__tree"></div>\n\t\t</div>'},n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserSource=c},71584:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserSources=void 0;var n=o(70655);o(31748);var r=o(98813),i=o(11975),s=o(65104),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syncMod=!0,t}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserSources"},t.prototype.build=function(e){var t=this;this.clear(),e.forEach((function(e){t.append(new s.UIBrowserSource(t.jodit,e))}))},n.__decorate([i.component],t)}(r.UIGroup);t.UIBrowserSources=a},19485:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserStatusBar=void 0;var n=o(70655);o(87249);var r=o(98813),i=o(11975),s=o(47643),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserStatusBar"},t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__slot-left'></div>\n\t\t\t<div class='&__slot-center'></div>\n\t\t\t<div class='&__slot-right'></div>\n\t\t</div>"},t.prototype.value=function(e,t){void 0===t&&(t="left");var o=this.getElm("slot-".concat(t));return(0,s.assert)(null!=o,"Slot does not exists"),o.innerText=e,this},n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserStatusBar=a},93659:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UITree=void 0;var n=o(70655);o(56952);var r=o(98813),i=o(11975),s=o(89861),a=function(e){function t(t,o){var n=e.call(this,t)||this;return n.syncMod=!0,n.build(o),n}var o;return n.__extends(t,e),o=t,t.prototype.className=function(){return"UITree"},t.prototype.build=function(e){var t=this;this.clear(),e.forEach((function(e){var n=new s.UIBrowserFolder(t.jodit,e);t.append(n),e.isActive&&n.setMod("active",!0),e.children.length&&t.append(new o(t.jodit,e.children))}))},o=n.__decorate([i.component],t)}(r.UIGroup);t.UITree=a},53737:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIVirtualScroll=void 0;var n=o(70655);o(63940);var r=o(98813),i=o(11975),s=o(17971),a=o(10115),c=o(72411),l=o(47643),u=function(e){function t(t,o){var n=e.call(this,t)||this;return n.stateManager=o,n.syncMod=!0,n.addItemsSelector(),n}var o;return n.__extends(t,e),o=t,t.prototype.className=function(){return"UIVirtualScroll"},t.prototype.render=function(){return"<div>\n\t\t\t\t<div class=\"&__empty-message\">~There are no files~</div>\n\t\t\t\t<div class='&__loader'></div>\n\t\t\t\t<div class='&__drag-area'>~Drop image~</div>\n\t\t\t</div>"},t.prototype.reconcile=function(e){var t=this.elements.findIndex((function(t,o){return!e[o]||t.item.uniqueHashKey!==a.FileBrowserItem.create(e[o]).uniqueHashKey}));if(t>-1){for(var o=t;this.elements.length>o;o+=1)this.elements[o].destruct();this.elements.length=t}return t},t.prototype.build=function(e){var t=this,o=this.reconcile(e);e.slice(o>-1?o:this.elements.length).forEach((function(e){var o=new s.UIBrowserItem(t.jodit,e);Object.keys(t.mods).forEach((function(e){o.setMod(e,t.mods[e])})),t.append(o)})),this.setMod("empty",!this.elements.length)},t.prototype.onScrollLoadChunk=function(){!this.stateManager.isFavoriteItems&&this.j.o.pixelOffsetLoadNewChunk>this.container.scrollHeight-(this.container.scrollTop+this.container.offsetHeight)&&this.j.loadingManager.loadItemsChunk()},t.prototype.onDragOver=function(e){e.preventDefault(),this.setMod("dragover",!0)},t.prototype.onDragLeave=function(e){e.preventDefault(),this.setMod("dragover",!1)},t.prototype.addItemsSelector=function(){c.UISelectItems.install(this)},t.intersectRect=function(e,t){return!(t.left>e.left+e.width||e.left>t.left+t.width||t.top>e.top+e.height||e.top>t.top+t.height)},t.prototype.onSelectItems=function(e){var t=[];this.elements.forEach((function(n){var r=(0,l.position)(n.container);o.intersectRect(r,e)&&t.push(n.item)})),this.stateManager.state.activeElements=t},n.__decorate([(0,i.watch)(":afterResize"),(0,i.watch)(":resize"),(0,i.watch)("container:scroll"),(0,i.throttle)()],t.prototype,"onScrollLoadChunk",null),n.__decorate([(0,i.watch)("container:dragover")],t.prototype,"onDragOver",null),n.__decorate([(0,i.watch)(["container:dragleave","container:drop"])],t.prototype,"onDragLeave",null),o=n.__decorate([i.component],t)}(r.UIGroup);t.UIVirtualScroll=u},64413:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIResize=void 0,o(8931);var n=o(47077),r=o(38886),i=function(){function e(){}return e.remove=function(e){(0,n.css)(e.container,{width:null,height:null}),e.container.classList.remove("jodit-ui-resize"),r.Dom.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))},e.install=function(e,t){e.container.classList.add("jodit-ui-resize"),"static"===(0,n.css)(e.container,"position")&&(0,n.css)(e.container,"position","relative");var o=e.j.c.div("jodit-ui-resize__handle");o.classList.add("jodit-ui-resize__handle_type_"+t),e.container.appendChild(o),e.j.e.on(o,"mousedown touchstart",this.onStartResize.bind(this,e,t))},e.onStartResize=function(e,t,o){var n=e.j.async.throttle(this.onResize.bind(this,e,{x:o.clientX,y:o.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t}),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",n).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,n))},e.onResize=function(e,t,o){var r=["left","right"].includes(t.direction),i=e.container.parentElement;i&&(0,n.css)(e.container,r?"width":"height",100*(r?(t.w+(o.clientX-t.x)*("right"===t.direction?1:-1))/i.offsetWidth:(t.h+(o.clientY-t.y)*("top"===t.direction?1:-1))/i.offsetHeight)+"%")},e.onEndResize=function(e,t,o){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()},e}();t.UIResize=i},72411:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UISelectItems=void 0,o(31277);var n=o(38886),r=o(47077),i=function(){function e(){}return e.remove=function(e){n.Dom.safeRemove(e.container.querySelector(".jodit-ui-select-items")),e.j.e.off(e.container,"mousedown.uiselectitems touchstart.uiselectitems")},e.install=function(e){var t=e.j.c.div("jodit-ui-select-items");e.j.e.on(e.container,"mousedown.uiselectitems touchstart.uiselectitems",this.onStartSelect.bind(this,e,t))},e.onStartSelect=function(e,t,o){if(o.target===e.container){(0,r.css)(t,{width:0,height:0}),e.container.appendChild(t);var n={x:o.clientX,y:o.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight},i=e.j.async.throttle(this.onSelect.bind(this,e,t,n),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",i).one(e.j.ow,"mouseup touchend",this.onEndSelect.bind(this,e,t,i)),e.onSelectItems({left:n.x,top:n.y,width:0,height:0})}},e.onSelect=function(e,t,o,n){var i={left:o.x>n.clientX?n.clientX:o.x,top:o.y>n.clientY?n.clientY:o.y,width:Math.abs(o.x-n.clientX),height:Math.abs(o.y-n.clientY)};(0,r.css)(t,i),e.onSelectItems(i)},e.onEndSelect=function(e,t,o,r){n.Dom.safeRemove(t),e.j.e.off(e.j.ow,"mousemove touchmove",o),e.j.unlock()},e}();t.UISelectItems=i},99425:function(e){e.exports={Favorites:"Избранное",Settings:"Настройки",Light:"Светлая",Dark:"Темная",Theme:"Тема",Show:"Показать",Hide:"Скрыть","Show favorites":"Показывать избранное",Tiles:"Плитка",List:"Список",Compact:"Компактный",View:"Отображение","Folders position":"Позиция папок","Sort by":"Сортировать по","Extra small":"Очень маленькие",Small:"Маленькие",Large:"Большие","Extra large":"Очень большие","Tile size":"Размер плитки"}},21601:function(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},67101:function(e){e.exports='<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M28.7,16.3l-12-13c-0.4-0.4-1.1-0.4-1.5,0l-12,13C3,16.6,2.9,17,3.1,17.4C3.2,17.8,3.6,18,4,18h3v10c0,0.6,0.4,1,1,1h16 c0.6,0,1-0.4,1-1V18h3c0.4,0,0.8-0.2,0.9-0.6C29.1,17,29,16.6,28.7,16.3z"/> </svg>'},34839:function(e){e.exports='<svg viewBox="0 0 252 252" xmlns="http://www.w3.org/2000/svg"> <path d="M0 16C0 7.16344 7.16344 0 16 0H85.6364C86.5205 0 87.3797 0.29288 88.0796 0.832871L120.92 26.1671C121.62 26.7071 122.48 27 123.364 27H227C235.837 27 243 34.1634 243 43V132.335C243 134.779 240.234 136.198 238.25 134.772L233 131L226.5 127L220 124L212.5 122L202.5 120L189 120.5L179.5 122.5L170.5 125.5L161.5 130.5L157 133.5L153 137L146.5 144L141 152L137 160L134 168L132.5 178L132 183.5V189.5L133 197.5L135 205.5L137.5 211.5L139.524 214.996C141.068 217.663 139.144 221 136.062 221H16C7.16344 221 0 213.837 0 205V16Z"/> <circle cx="197" cy="185" r="56"/> <path d="M188.364 215.955V151.591H204.636V215.955H188.364ZM164.318 191.909V175.636H228.682V191.909H164.318Z" fill="white"/> </svg>'},87989:function(e,t,o){"use strict";o.r(t)},6337:function(e,t,o){"use strict";o.r(t)},80355:function(e,t,o){"use strict";o.r(t)},80744:function(e,t,o){"use strict";o.r(t)},35850:function(e,t,o){"use strict";o.r(t)},73570:function(e,t,o){"use strict";o.r(t)},6590:function(e,t,o){"use strict";o.r(t)},49573:function(e,t,o){"use strict";o.r(t)},14001:function(e,t,o){"use strict";o.r(t)},11785:function(e,t,o){"use strict";o.r(t)},28389:function(e,t,o){"use strict";o.r(t)},31748:function(e,t,o){"use strict";o.r(t)},87249:function(e,t,o){"use strict";o.r(t)},56952:function(e,t,o){"use strict";o.r(t)},63940:function(e,t,o){"use strict";o.r(t)},8931:function(e,t,o){"use strict";o.r(t)},31277:function(e,t,o){"use strict";o.r(t)}},function(e){return e(e.s=4312)}])}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[524],{18574:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileBrowserPro=void 0;var n=o(70655);o(87989),o(76973);var r=o(27830),i=o(98498),s=o(29653),a=o(47643),c=o(11975),l=o(36257),u=o(34522),h=o(64614),d=o(68725),p=o(43854),f=o(37538),v=o(75164),m=o(4051),g=o(28544),_=o(61104),y=o(58866),w=o(30332),b=o(97029),I=o(85475),C=o(5662),S=o(34653),P=function(e){function t(t){var o=e.call(this,(0,a.ConfigProto)(Object.assign(t||{},{resizable:!0,draggable:!0,toolbarButtons:(null==t?void 0:t.toolbarButtons)||p.Config.defaultOptions.filebrowser.buttons,buttons:b.Jodit.atom(["filebrowser.settings","fullsize","dialog.close"])}),p.Config.defaultOptions.filebrowser))||this;return o.dataProvider=(0,v.makeDataProvider)(o,o.options),o.state=(0,r.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1}),o.persistent=new g.PersistentStore(o,o.state),o.loadingManager=new S.LoadingManager(o,o.state),o.stateManager=new u.StateManager(o.state),o.historyManager=new _.HistoryManager(o,o.state),o.contextMenuManager=new y.ContextMenuManager(o),o.header=new h.UIBrowserHeader(o,o.options,o.stateManager),o.panel=new s.UIBrowserPanel(o,o.stateManager),o.files=o.panel,o.tree=o.panel,o.progressbar=new f.UIProgress(o,o.stateManager.state),I.license.make(o),!o.persistent.theme&&o.options.theme&&(o.persistent.theme=o.options.theme),o.panel.append(o.progressbar),o.toolbar.setMod("mode","header"),o.setSize(Math.min(o.options.width,screen.width),Math.min(o.options.height,screen.height)).setHeader(o.header),o.onResizeWindow(),o.initUploader(),o.onChangeTheme(),o.fullFillOptions(),o.dataProvider.onProgress((function(e){0===e&&(e=30),o.state.progress=e})),o.e.on("beforeClose",o.removeGlobalListeners),o.e.fire("afterInit"),b.Jodit.prototype.afterInitHook.call(o),o}return n.__extends(t,e),t.prototype.className=function(){return"FileBrowserPro"},t.prototype.lock=function(t){return void 0===t&&(t="any"),this.container.classList.add("jodit_disabled"),e.prototype.lock.call(this,t)},t.prototype.unlock=function(){return this.container.classList.remove("jodit_disabled"),e.prototype.unlock.call(this)},t.prototype.status=function(e,t){void 0===t&&(t=!(e instanceof Error)),(0,a.isAbort)(e)||this.message.message((0,a.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg)},t.prototype.addDisclaimer=function(e){this.dialog.appendChild(e)},t.prototype.open=function(t,o){return void 0===t&&(t=this.o.defaultCallback),n.__awaiter(this,void 0,Promise,(function(){return n.__generator(this,(function(n){return this.state.onlyImages=Boolean(o),this.prepareOpening(t),e.prototype.open.call(this,this.panel.container),[2,this.e.fire("update.filebrowser")]}))}))},t.prototype.onResizeWindow=function(){(0,a.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})},t.prototype.onChangePath=function(){var e=this.state,t=e.currentSource;this.uploader.setPath(e.currentPath),this.uploader.setSource(t)},t.prototype.onChangeTheme=function(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme},t.prototype.onToggleSettings=function(){this.state.showSettings=!this.state.showSettings},t.prototype.prepareOpening=function(e){var t=this;this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=function(o){t.close(),e(o)}),this.persistent.syncWithState()},t.prototype.registerGlobalListeners=function(){this.e.on(this.ow,"keydown",this.onKeyPress)},t.prototype.onKeyPress=function(e){var t=this.od.activeElement;if(this.state.activeElements.length&&t&&r.Dom.isOrContains(this.panel.items.container,t)){var o=this.state.elements;switch(e.key){case l.KEY_ENTER:return this.onChooseItems();case l.KEY_DELETE:return this.onFileRemove();case l.KEY_RIGHT:case l.KEY_LEFT:case l.KEY_DOWN:case l.KEY_UP:var n=e.key===l.KEY_RIGHT||e.key===l.KEY_DOWN,i=this.state.lastSelectedIndex,s=void 0;if([l.KEY_RIGHT,l.KEY_LEFT].includes(e.key))s=n?o[i+1]?i+1:0:o[i-1]?i-1:o.length-1;else{var a=this.panel.countInRow;s=Math.round(((i+1)/a+(n?1:-1))*a-1)}return o[s]&&this.stateManager.addActive(o[s],e.shiftKey),!1}}},t.prototype.removeGlobalListeners=function(){this.e.off(this.ow,"keydown",this.onKeyPress)},t.prototype.onFileRemove=function(){var e=this;this.state.activeElements.length&&this.confirm("Are you sure?","Delete",(function(t){t&&e.__itemsRemove(e.state.activeElements)})).bindDestruct(this)},t.prototype.__itemsRemove=function(e){var t=this;if(!e.length)return Promise.resolve();var o=[];return e.forEach((function(e){o.push("folder"===e.type?t.__folderRemove((0,w.parentPath)(e.path),e.name,e.sourceName):t.__removeFile(e.file||e.name||"",e.sourceName))})),this.state.activeElements.forEach((function(e){t.stateManager.isFavorite(e)&&t.stateManager.toggleFavorite(e)})),this.state.activeElements=[],Promise.allSettled(o).then((function(){return Promise.allSettled([t.loadingManager.loadItems(),t.loadingManager.loadFolders()])}))},t.prototype.__removeFile=function(e,t){var o=this;return this.dataProvider.fileRemove(this.state.currentPath,e,t).then((function(t){o.status(t||o.i18n('File "%s" was deleted',e),!0)})).catch(this.status)},t.prototype.__folderRemove=function(e,t,o){var n=this;return this.dataProvider.folderRemove(e,t,o).then((function(r){n.status(r||n.i18n('Folder "%s" was deleted',t),!0),n.state.currentPath===e&&(n.state.currentPath=(0,w.parentPath)(e),n.state.currentSource=o)})).catch(this.status)},t.prototype.onFileEdit=function(){if(1===this.state.activeElements.length){var e=n.__read(this.state.activeElements,1)[0];d.openImageEditor.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}},t.prototype.onFolderRename=function(e){var t=this;this.prompt("Enter new name","Rename",(function(o){if(!(0,a.isValidName)(o)||o===e.name)return t.status(t.i18n("Enter new name")),!1;t.dataProvider.folderRename((0,w.parentPath)(e.path),e.name,o,e.sourceName).then((function(n){t.state.activeElements=[],t.status(n,!0),t.state.currentPath=(0,w.parentPath)(e.path)+"/"+o,t.state.currentSource=e.sourceName,t.historyManager.updateCurrent(),t.loadingManager.loadFolders()})).catch(t.status)}),this.i18n("type name"),e.name).bindDestruct(this)},t.prototype.onFolderRemove=function(e){var t=this;this.confirm("Are you sure?","Delete",(function(o){o&&t.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])})).bindDestruct(this)},t.prototype.onFolderCreate=function(e){var t=this;this.prompt("Enter Directory name","Create directory",(function(o){var n=e.path||"/";t.dataProvider.createFolder(o,e.path||"/",e.sourceName).then((function(){t.state.currentSource===e.sourceName&&t.state.currentPath===n?t.e.fire("update.filebrowser"):(t.state.currentSource=e.sourceName,t.state.currentPath=n),t.historyManager.updateCurrent()}),t.status)}),this.i18n("type name")).bindDestruct(this)},t.prototype.onFileRename=function(e){var t=this,o=e.file||e.name||"";1===this.state.activeElements.length&&o&&this.prompt("Enter new name","Rename",(function(e){if(!(0,a.isValidName)(e))return t.status(t.i18n("Enter new name")),!1;t.dataProvider.fileRename(t.state.currentPath,o,e,t.state.currentSource).then((function(e){t.state.activeElements=[],t.status(e,!0),t.loadingManager.loadItems()})).catch(t.status)}),this.i18n("type name"),o).bindDestruct(this)},t.prototype.onChooseItems=function(){var e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type)return this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,void this.e.fire("afterOpenFolder.filebrowser");this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}},t.prototype.onOpenLightBox=function(e){C.UILightBox.open(this,e,this.state.elements)},t.prototype.initUploader=function(){var e=this,t=this,o=(0,a.ConfigProto)(t.o.uploader||{},p.Config.defaultOptions.uploader),n=function(){return e.loadingManager.loadItems()};t.uploader=t.getInstance("Uploader",o),t.uploader.bind(t.panel.container,n,t.status),t.e.on("bindUploader.filebrowser",(function(e){t.uploader.bind(e,n,t.status)}))},t.prototype.destruct=function(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),e.prototype.destruct.call(this)},t.prototype.fullFillOptions=function(){var e=this;["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach((function(t){null!=e.options[t]&&(e.options[t]=(0,a.ConfigProto)(e.options[t],e.o.ajax))}))},n.__decorate([c.autobind],t.prototype,"status",null),n.__decorate([(0,c.watch)(":resize",window)],t.prototype,"onResizeWindow",null),n.__decorate([(0,c.watch)(["state.currentPath","state.currentSource"])],t.prototype,"onChangePath",null),n.__decorate([(0,c.watch)("state.theme")],t.prototype,"onChangeTheme",null),n.__decorate([(0,c.watch)(":toggleSettings.filebrowser")],t.prototype,"onToggleSettings",null),n.__decorate([c.autobind],t.prototype,"onKeyPress",null),n.__decorate([c.autobind],t.prototype,"removeGlobalListeners",null),n.__decorate([(0,c.watch)(":fileRemove.filebrowser")],t.prototype,"onFileRemove",null),n.__decorate([(0,c.watch)(":edit.filebrowser")],t.prototype,"onFileEdit",null),n.__decorate([(0,c.watch)(":folderRename.filebrowser")],t.prototype,"onFolderRename",null),n.__decorate([(0,c.watch)(":folderRemove.filebrowser")],t.prototype,"onFolderRemove",null),n.__decorate([(0,c.watch)(":folderCreate.filebrowser")],t.prototype,"onFolderCreate",null),n.__decorate([(0,c.watch)(":fileRename.filebrowser")],t.prototype,"onFileRename",null),n.__decorate([(0,c.watch)(":select.filebrowser")],t.prototype,"onChooseItems",null),n.__decorate([(0,c.watch)(":openLightBox.filebrowser")],t.prototype,"onOpenLightBox",null),n.__decorate([c.component,(0,c.derive)(m.Dlgs)],t)}(i.Dialog);t.FileBrowserPro=P,Object.defineProperty(b.Jodit.modules,"FileBrowserPro",{value:P,writable:!1,enumerable:!0,configurable:!0})},12980:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(43854);(0,o(78855).extendLang)(o(91190));var r=n.Config.prototype.controls.filebrowser;r.settings={icon:"settings",tooltip:"Settings",exec:function(e){var t;(null!==(t=e.parent)&&void 0!==t?t:e).e.fire("toggleSettings.filebrowser")}},r.home={icon:"home",tooltip:"Home",exec:function(e){e.e.fire("goHome.filebrowser")}},r.preview={icon:"eye",tooltip:"Preview",isDisabled:function(e){return 0===e.state.activeElements.length},exec:function(e){e.e.fire("togglePreview.filebrowser")}},r.next={icon:"angle-right",tooltip:"History next",isDisabled:function(e){return!e.historyManager.canNext()},exec:function(e){e.historyManager.next()}},r.previous={icon:"angle-left",tooltip:"History previous",isDisabled:function(e){return!e.historyManager.canPrevious()},exec:function(e){e.historyManager.previous()}},r["new-folder"]={icon:"new-folder",exec:function(e){e.e.fire("folderCreate.filebrowser",{path:e.state.currentPath,sourceName:e.state.currentSource})},tooltip:"New folder"},Object.assign(n.Config.prototype.filebrowser,{buttons:["filebrowser.home","filebrowser.previous","filebrowser.next","|","filebrowser.upload","filebrowser.new-folder","filebrowser.remove","filebrowser.update","filebrowser.select","filebrowser.edit","|","filebrowser.preview","about"],sort:!1,pixelOffsetLoadNewChunk:300,width:800,height:400,previewOfficeURL:"https://view.officeapps.live.com/op/view.aspx?src="})},4312:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finder=void 0;var n=o(70655),r=o(10818),i=o(18574),s=o(97029);o(12980);var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.requires=["license"],t.hasStyle=!s.Jodit.fatMode,t}return n.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on("getInstanceFileBrowser",(function(e){return t.__instance||(t.__instance=new i.FileBrowserPro(e)),t.__instance}))},t.prototype.beforeDestruct=function(e){var t;e.e.off("getInstanceFileBrowser"),null===(t=this.__instance)||void 0===t||t.destruct()},t}(r.Plugin);t.finder=a,s.Jodit.plugins.add("finder",a)},58866:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuManager=void 0;var n=o(70655),r=o(75164),i=o(29377),s=o(11975),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.className=function(){return"ContextMenuManager"},t.prototype.onFolderContext=function(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1},t.prototype.onItemContext=function(e,t,o){return this.buildContextItemMenu(this.getItemContextActions(e),o),!1},t.prototype.onSourceContext=function(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1},t.prototype.buildContextItemMenu=function(e,t){if(this.j.o.contextMenu){var o=(0,r.makeContextMenu)(this.j).setMod("theme",this.j.state.theme);o.show(t.clientX,t.clientY,e.filter((function(e){return e&&!1!==e.enabled}))),this.j.e.on(this.j,"afterClose",(function(){o.isOpened&&o.close()}))}},t.prototype.getItemContextActions=function(e){var t=this;if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});var o=this.j.options,n=this.j.dataProvider,r=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:Boolean(e.isImage)&&o.editImage&&r&&(n.canI("ImageResize")||n.canI("ImageCrop")),exec:function(){t.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:n.canI("FileRename")&&r,exec:function(){return t.j.e.fire("fileRename.filebrowser",e)}},{icon:"bin",title:"Delete",enabled:n.canI("FileRemove"),exec:function(){return t.j.e.fire("fileRemove.filebrowser",e)}},{icon:"eye",title:"Preview",enabled:Boolean(e.isImage||"file"===e.type)&&o.preview&&r,exec:function(){return t.j.e.fire("openLightBox.filebrowser",e)}},{icon:"upload",title:"Download",exec:function(){e.fileURL&&t.j.ow.open(e.fileURL)}}]},t.prototype.getFolderContextActions=function(e){var t=this,o=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:function(){t.j.e.fire("folderRename.filebrowser",e)},enabled:o.canI("FolderRename")},{icon:"bin",title:"Delete",exec:function(){t.j.e.fire("folderRemove.filebrowser",e)},enabled:o.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:function(){t.j.e.fire("folderCreate.filebrowser",e)},enabled:o.canI("FolderCreate")}]},t.prototype.getSourceContextActions=function(e){var t=this;return[{icon:"plus",title:"Create folder",exec:function(){t.j.e.fire("folderCreate.filebrowser",e)}}]},n.__decorate([(0,s.watch)(":contextmenuFolder.filebrowser")],t.prototype,"onFolderContext",null),n.__decorate([(0,s.watch)(":contextmenuItem.filebrowser")],t.prototype,"onItemContext",null),n.__decorate([(0,s.watch)(":contextmenuSource.filebrowser")],t.prototype,"onSourceContext",null),n.__decorate([s.component],t)}(i.ViewComponent);t.ContextMenuManager=a},30332:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parentPath=void 0,t.parentPath=function(e){var t=e.split("/").filter((function(e){return e.length}));return t.pop(),t.join("/")||"/"}},61104:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryManager=void 0;var n=o(70655),r=o(47643),i=o(29377),s=o(11975),a=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.history=[],n.historyIndex=0,n}return n.__extends(t,e),t.prototype.className=function(){return"HistoryManager"},t.prototype.canNext=function(){return this.history.length-1>this.historyIndex},t.prototype.canPrevious=function(){return this.historyIndex>0},t.prototype.push=function(e){var t=this.historyIndex,o=this.history[t];if(!o||o.currentSource!==e.currentSource||o.currentPath!==e.currentPath){var r=n.__spreadArray([],n.__read(this.history),!1);r.length-1!==t&&(r=r.slice(0,t+1)),r.push(e),o&&(t+=1),this.history=r,this.historyIndex=t}},t.prototype.next=function(){this.canNext()&&(this.historyIndex+=1,this.updateState())},t.prototype.previous=function(){this.canPrevious()&&(this.historyIndex-=1,this.updateState())},t.prototype.updateCurrent=function(){this.history[this.historyIndex]={currentSource:this.state.currentSource,currentPath:this.state.currentPath,tree:(0,r.fastClone)(this.state.tree),elements:n.__spreadArray([],n.__read(this.state.elements),!1)}},t.prototype.onHome=function(){this.state.currentPath="",this.state.currentSource="",this.j.e.fire("afterOpenFolder.filebrowser update.filebrowser")},t.prototype.onOpenFolder=function(){this.push({tree:[],elements:[],currentPath:this.state.currentPath,currentSource:this.state.currentSource}),this.j.e.fire("changeSelection")},t.prototype.updateState=function(){var e=this.history[this.historyIndex],t=e.tree,o=e.elements,r=e.currentSource,i=e.currentPath;this.state.activeElements=[],this.state.elements=n.__spreadArray([],n.__read(o),!1),this.state.tree=n.__spreadArray([],n.__read(t),!1),this.state.currentSource=r,this.state.currentPath=i,this.j.e.fire("changeSelection")},n.__decorate([(0,s.watch)(["state.elements","state.tree"])],t.prototype,"updateCurrent",null),n.__decorate([(0,s.watch)(":goHome.filebrowser")],t.prototype,"onHome",null),n.__decorate([(0,s.watch)(":afterOpenFolder.filebrowser")],t.prototype,"onOpenFolder",null),n.__decorate([s.component],t)}(i.ViewComponent);t.HistoryManager=a},34653:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoadingManager=void 0;var n=o(70655),r=o(29377),i=o(11975),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.__tick=0,n.offset=0,n.countInOneChunk=20,n.stopLoadingParts=!1,n.__isLoadingPart=!1,n.__callQueueCount=0,n}return n.__extends(t,e),t.prototype.className=function(){return"LoadingManager"},t.prototype.onUpdateFileBrowser=function(){return n.__awaiter(this,void 0,Promise,(function(){return n.__generator(this,(function(e){switch(e.label){case 0:return this.state.activeElements=[],this.j.panel.setMod("loading",!0),[4,Promise.all([this.loadFolders(),this.loadItems()])];case 1:return e.sent(),this.j.panel.setMod("loading",!1),[2]}}))}))},t.prototype.loadFolders=function(){return n.__awaiter(this,void 0,Promise,(function(){var e,t,o,r,i;return n.__generator(this,(function(n){switch(n.label){case 0:if(!this.j.isOpened)return[2];t=(e=this.state).currentPath,o=e.currentSource,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.j.dataProvider.tree(t,o)];case 2:return r=n.sent(),this.j.stateManager.fillTreeForPath(r,t),this.state.sources=r,[3,4];case 3:return i=n.sent(),this.j.status(i),[3,4];case 4:return[2]}}))}))},t.prototype.loadItems=function(){return n.__awaiter(this,void 0,Promise,(function(){var e,t,o,r;return n.__generator(this,(function(n){switch(n.label){case 0:if(!this.j.isOpened)return[2];n.label=1;case 1:return n.trys.push([1,8,,9]),this.__tick+=1,e=this.__tick,this.offset=0,this.stopLoadingParts=!1,this.__callQueueCount=0,[4,a(this.state,this.j.dataProvider,this.offset,this.countInOneChunk)];case 2:return t=n.sent(),o=t.loadedTotal,this.state.elements=t.items,this.stopLoadingParts=this.countInOneChunk>o,[4,this.loadItemsChunk(e)];case 3:return n.sent(),[4,this.async.requestIdlePromise()];case 4:if(n.sent(),this.__tick!==e)return[2];n.label=5;case 5:return this.stopLoadingParts||this.state.elements.length>this.j.panel.countInColumn*this.j.panel.countInRow?[3,7]:[4,this.loadItemsChunk(e)];case 6:return n.sent(),this.__tick!==e?[2]:[3,5];case 7:return[3,9];case 8:return r=n.sent(),this.j.status(r),[3,9];case 9:return[2]}}))}))},t.prototype.__loadItemsChunk=function(e){return n.__awaiter(this,void 0,Promise,(function(){var t,o,r,i;return n.__generator(this,(function(n){switch(n.label){case 0:if(this.__isLoadingPart)return this.__callQueueCount+=1,[2];if(this.stopLoadingParts)return this.__callQueueCount=0,[2];this.__isLoadingPart=!0,this.j.panel.items.setMod("chunk-loading",!0),n.label=1;case 1:return n.trys.push([1,3,,4]),this.offset+=this.countInOneChunk,[4,a(this.state,this.j.dataProvider,this.offset,this.countInOneChunk)];case 2:return t=n.sent(),o=t.items,r=t.loadedTotal,this.__tick!==e?[2]:(this.stopLoadingParts=this.countInOneChunk>r,o.length&&(this.state.elements=this.state.elements.concat(o)),[3,4]);case 3:return i=n.sent(),this.j.status(i),[3,4];case 4:return this.j.panel.items.setMod("chunk-loading",!1),this.__isLoadingPart=!1,this.__callQueueCount>0?(this.__callQueueCount-=1,[2,this.__loadItemsChunk(e)]):[2]}}))}))},t.prototype.loadItemsChunk=function(e){return void 0===e&&(e=this.__tick),e!==this.__tick?Promise.resolve():this.__loadItemsChunk(e)},n.__decorate([(0,i.watch)(":update.filebrowser")],t.prototype,"onUpdateFileBrowser",null),n.__decorate([(0,i.watch)(["state.currentPath","state.currentSource"]),(0,i.debounce)((function(e){return{timeout:e.defaultTimeout,promisify:!0}}))],t.prototype,"loadFolders",null),n.__decorate([(0,i.watch)(["state.currentPath","state.currentSource","state.sortBy","state.onlyImages","state.foldersPosition","state.filterWord"]),(0,i.debounce)((function(e){return{timeout:e.defaultTimeout,promisify:!0}}))],t.prototype,"loadItems",null),n.__decorate([(0,i.debounce)((function(e){return{timeout:e.defaultTimeout,promisify:!0}}))],t.prototype,"loadItemsChunk",null),n.__decorate([i.component],t)}(r.ViewComponent);function a(e,t,o,n){return t.itemsEx(e.currentPath,e.currentSource,{offset:o,limit:n,sortBy:e.sortBy,withFolders:e.withFolders,foldersPosition:e.foldersPosition,onlyImages:e.onlyImages,filterWord:e.filterWord})}t.LoadingManager=s},28544:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PersistentStore=void 0;var n=o(70655),r=o(29377),i=o(11975),s=o(10115),a=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.sortBy="changed-desc",n.view="tiles",n.foldersPosition="top",n.tileSize="default",n.favorites=[],n.showSideBar=!0,n.showPreview=!1,n.showFavorites=!0,n}return n.__extends(t,e),t.prototype.className=function(){return"PersistentStore"},t.prototype.onChangeThemeSetField=function(){this.theme=this.state.theme},t.prototype.onChangeView=function(){this.view=this.state.view},t.prototype.onChangeSortBy=function(){this.sortBy=this.state.sortBy},t.prototype.onChangeTileSize=function(){this.tileSize=this.state.tileSize},t.prototype.onChangeFavorites=function(){this.favorites=this.state.favorites},t.prototype.onChangeShowSideBar=function(){this.showSideBar=this.state.showSideBar},t.prototype.onChangeShowPreview=function(){this.showPreview=this.state.showPreview},t.prototype.onChangeShowFavorites=function(){this.showFavorites=this.state.showFavorites},t.prototype.onChangeFoldersPosition=function(){this.foldersPosition=this.state.foldersPosition},t.prototype.syncWithState=function(){this.state.tileSize=this.tileSize,this.state.favorites=this.favorites.map((function(e){return e instanceof s.FileBrowserItem?e:s.FileBrowserItem.create(e)})),this.state.view=this.view,this.state.theme=this.theme,this.state.showSideBar=this.showSideBar,this.state.showPreview=this.showPreview,this.state.showFavorites=this.showFavorites,this.state.sortBy=this.sortBy,this.state.foldersPosition=this.foldersPosition},n.__decorate([i.persistent],t.prototype,"theme",void 0),n.__decorate([i.persistent],t.prototype,"sortBy",void 0),n.__decorate([i.persistent],t.prototype,"view",void 0),n.__decorate([i.persistent],t.prototype,"foldersPosition",void 0),n.__decorate([i.persistent],t.prototype,"tileSize",void 0),n.__decorate([i.persistent],t.prototype,"favorites",void 0),n.__decorate([i.persistent],t.prototype,"showSideBar",void 0),n.__decorate([i.persistent],t.prototype,"showPreview",void 0),n.__decorate([i.persistent],t.prototype,"showFavorites",void 0),n.__decorate([(0,i.watch)("state.theme")],t.prototype,"onChangeThemeSetField",null),n.__decorate([(0,i.watch)("state.view")],t.prototype,"onChangeView",null),n.__decorate([(0,i.watch)("state.sortBy")],t.prototype,"onChangeSortBy",null),n.__decorate([(0,i.watch)("state.tileSize")],t.prototype,"onChangeTileSize",null),n.__decorate([(0,i.watch)("state.favorites")],t.prototype,"onChangeFavorites",null),n.__decorate([(0,i.watch)("state.showSideBar")],t.prototype,"onChangeShowSideBar",null),n.__decorate([(0,i.watch)("state.showPreview")],t.prototype,"onChangeShowPreview",null),n.__decorate([(0,i.watch)("state.showFavorites")],t.prototype,"onChangeShowFavorites",null),n.__decorate([(0,i.watch)("state.foldersPosition")],t.prototype,"onChangeFoldersPosition",null),n.__decorate([i.component],t)}(r.ViewComponent);t.PersistentStore=a},34522:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateManager=void 0;var n=o(70655),r=o(11975),i=function(){function e(e){this.state=e}return e.prototype.getIndex=function(e,t){return void 0===t&&(t=this.state.elements),t.findIndex((function(t){return t.uniqueHashKey===e.uniqueHashKey}))},e.prototype.isActive=function(e){return Boolean(this.state.activeElements.find((function(t){return t.uniqueHashKey===e.uniqueHashKey})))},e.prototype.isFavorite=function(e){return Boolean(this.state.favorites.find((function(t){return t.uniqueHashKey===e.uniqueHashKey})))},e.prototype.addActive=function(e,t){var o;this.state.metaInfo=e,this.state.info=null!==(o=e.file)&&void 0!==o?o:"",this.state.lastSelectedIndex=this.getIndex(e),this.state.activeElements=t?n.__spreadArray(n.__spreadArray([],n.__read(this.state.activeElements),!1),[e],!1):[e]},e.prototype.callSelectHandler=function(){var e,t=this.state.activeElements;null===(e=this.state.onSelectCallBack)||void 0===e||e.call(this,{baseurl:"",files:t.map((function(e){return e.fileURL})),isImages:t.map((function(e){return Boolean(e.isImage)}))})},e.prototype.setFilter=function(e){this.state.filterWord=e},e.prototype.toggleFavorite=function(e){var t=this.getIndex(e,this.state.favorites),o=n.__spreadArray([],n.__read(this.state.favorites),!1);-1===t?o.push(e):o.splice(t,1),this.state.favorites=o},e.prototype.fillTreeForPath=function(e,t){var o=this;this.state.tree.length&&t&&"/"!==t?(this.removeActive(this.state.tree),e.forEach((function(e){var n=s(o.state.tree,e.name);n||(n=c(e),o.state.tree.push(n)),n.isActive=!0;var r=function(e,t){return e.split("/").reduce((function(e,t){return e&&s(e.children,t)}),t)}(t,n);r&&(r.isActive=!0,r.children=a(e.folders).map((function(o){return l(o,t+"/"+o,e.name)})))})),this.state.tree=n.__spreadArray([],n.__read(this.state.tree),!1)):this.state.tree=e.map(c)},e.prototype.removeActive=function(e){var t=this;e.forEach((function(e){e.isActive=!1,t.removeActive(e.children)}))},Object.defineProperty(e.prototype,"isFavoriteItems",{get:function(){return this.state.favorites===this.state.elements},enumerable:!1,configurable:!0}),n.__decorate([r.autobind],e.prototype,"getIndex",null),n.__decorate([r.autobind],e.prototype,"isActive",null),n.__decorate([r.autobind],e.prototype,"isFavorite",null),e}();function s(e,t){var o;return null!==(o=e.find((function(e){return e.name===t})))&&void 0!==o?o:null}function a(e){return e.filter((function(e){return"."!==e&&".."!==e}))}function c(e){return{type:"source",name:e.name,title:e.title,sourceName:e.name,path:"/",children:a(e.folders).map((function(t){return l(t,t,e.name)}))}}function l(e,t,o){return{type:"directory",name:e,path:t,sourceName:o,children:[]}}t.StateManager=i},91190:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ru=void 0;var n=o(99425);t.ru=n},76973:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(98813),r=o(21601),i=o(67101),s=o(34839);n.Icon.set("heart",String(r)),n.Icon.set("home",String(i)),n.Icon.set("new-folder",String(s))},89861:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserFolder=void 0;var n=o(70655);o(6337);var r=o(98813),i=o(11975),s=o(47643),a=function(e){function t(t,o){var n=e.call(this,t)||this;n.item=o,n.syncMod=!0;var r=n.getElm("name");return(0,s.assert)(null!=r,"name element does not exists"),r.innerText=o.name,t.e.on(n.container,"click",(function(){return n.getMod("active")||n.setMod("loading",!0),t.e.fire("openFolder",o)})).on(n.container,"contextmenu",(function(e){return t.e.fire("contextmenuFolder.filebrowser",o,e)})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserFolder"},t.prototype.render=function(){return'<div>\n\t\t\t<div class="&__icon">\n\t\t\t\t<div class=\'&__loader\'></div>\n\t\t\t\t<div class="&__icon-wrapper">\n\t\t\t\t\t*folder*\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__arrow">*angle-right*</div>\n\t\t</div>'},n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserFolder=a},64614:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserHeader=void 0;var n=o(70655);o(80355);var r=o(98813),i=o(11975),s=o(30446),a=o(20405),c=function(e){function t(t,o,n){var i=e.call(this,t)||this;return i.options=o,i.stateManager=n,i.syncMod=!0,i.toolbar=(0,s.makeCollection)(i.j),i.filter=new r.UIInput(i.j,{icon:"search",placeholder:"Filter",clearButton:!0,onChange:function(e){i.stateManager.setFilter(e)}}),i.append(i.toolbar).append(i.filter),i.filter.container.classList.add(i.getFullElName("filter")),i.toolbar.setMod("mode","header").build(i.__getButtons()),i}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserHeader"},t.prototype.__getButtons=function(){var e,t=this;return(null!==(e=this.options.toolbarButtons)&&void 0!==e?e:[]).filter((function(e){if(!(0,a.isString)(e))return!0;switch(e){case"filebrowser.edit":return t.j.dataProvider.canI("ImageResize")||t.j.dataProvider.canI("ImageCrop");case"filebrowser.new-folder":return t.j.dataProvider.canI("FolderCreate");case"filebrowser.upload":return t.j.dataProvider.canI("FileUpload");case"filebrowser.remove":return t.j.dataProvider.canI("FileRemove")}return!0}))},n.__decorate([i.component],t)}(r.UIGroup);t.UIBrowserHeader=c},17971:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserItem=void 0;var n=o(70655);o(80744);var r=o(98813),i=o(11975),s=o(10115),a=o(27830),c=o(47643),l=o(47643),u=function(e){function t(t,o){var n=e.call(this,t)||this;return n.item=s.FileBrowserItem.create(o),t.e.on(n.container,"click contextmenu dblclick",(function(e){return t.e.fire(e.type+"Item.filebrowser",n.item,(0,c.ctrlKey)(e)||e.shiftKey,e),!1})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserItem"},t.prototype.render=function(){return"<div tabindex='-1'>\n\t\t\t<div class='&__image'></div>\n\t\t\t<div class='&__info'></div>\n\t\t\t<div class='&__heart'>*heart*</div>\n\t\t</div>"},t.prototype.onClickFavorite=function(){var e=this;return this.bubble((function(t){e.jodit.e.fire(t,"toggleFavoriteItem",e.item)})),!1},t.prototype.onAction=function(e){return this.jodit.e.fire(e.type+"Item.filebrowser",this.item,(0,c.ctrlKey)(e)||e.shiftKey,e),!1},t.prototype.update=function(){var t=this.getElm("image");(0,l.assert)(null!=t,"image element does not exists"),(0,c.css)(t,"backgroundImage","url(".concat(encodeURI(this.item.imageURL),")"));var o=this.item,n=o.type,r=o.file,i=o.time,s=o.size;this.setMod("is-file",!1===this.item.isImage).setMod("type",null!=n?n:"file").setElementValue("name",r).setElementValue("time",i).setElementValue("filesize",s),(0,c.attr)(this.container,"title","folder"!==n?"".concat(r," ").concat(i," ").concat(s):r),e.prototype.update.call(this)},t.prototype.setElementValue=function(e,t){var o=this.getFullElName(e),n=this.getElm(e);if(!t)return n&&a.Dom.safeRemove(n),this;if(!n){var r=this.getElm("info");(0,l.assert)(null!=r,"wrapper element does not exist"),n=this.j.create.div(o),r.appendChild(n)}return n.innerText=t,this},n.__decorate([(0,i.watch)("heart:click")],t.prototype,"onClickFavorite",null),n.__decorate([(0,i.watch)(["container:click","container:contextmenu","container:dblclick"])],t.prototype,"onAction",null),n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserItem=u},5662:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UILightBox=void 0;var n=o(70655);o(35850);var r=o(27830),i=o(11975),s=o(47643),a=o(36257),c=o(47643),l=function(e){function t(t,o,n){var i=e.call(this,t)||this;i.current=o,i.elements=n,i.dialog=new r.Dialog;var s=i.dialog;return s.setMod("theme",t.state.theme).toolbar.setMod("mode","header"),s.open(i),i.elements=i.elements.filter((function(e){return e.isImage})),s.e.on(s,"afterClose",(function(){i.destruct()})),i.addGlobalListeners(),i.onChangeCurrent(),s.toolbar.build([{icon:"check",exec:function(){t.stateManager.addActive(i.current,!1),t.e.fire("select.filebrowser"),s.close()}},"dialog.close"]),i}var o;return n.__extends(t,e),o=t,t.prototype.className=function(){return"UILightBox"},t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__previous'>*angle-left*</div>\n\t\t\t<div class='&__preview'></div>\n\t\t\t<div class='&__loader'></div>\n\t\t\t<div class='&__next'>*angle-right*</div>\n\t\t</div>"},t.prototype.onChangeCurrent=function(){return n.__awaiter(this,void 0,Promise,(function(){var e,t,o,i;return n.__generator(this,(function(n){switch(n.label){case 0:return e=this.current,this.setMod("loading",!0),t=this.getElm("preview"),(0,c.assert)(null!=t,"preview element does not exist"),r.Dom.detach(t),(0,s.css)(t,{backgroundImage:null}),e.isImage?[4,(0,s.loadImage)(e.fileURL,this.j)]:[3,2];case 1:return o=n.sent(),this.dialog.setPosition(),(0,s.css)(t,{width:Math.min(this.jodit.ow.innerWidth,o.naturalWidth),height:Math.min(this.jodit.ow.innerHeight-100,o.naturalHeight),backgroundImage:"url(".concat(o.src,")")}),[3,4];case 2:return[4,this.makeIframe(e.fileURL)];case 3:i=n.sent(),t.appendChild(i),n.label=4;case 4:return this.dialog.setSize(),this.dialog.setPosition(),this.setMod("loading",!1),[2]}}))}))},t.prototype.makeIframe=function(e){var t=this.j.c.element("iframe");return t.classList.add(this.getFullElName("office-iframe")),t.src=/\.pdf/.test(e)?e:this.j.o.previewOfficeURL+encodeURIComponent(e),t},t.prototype.onPreviousClick=function(){var e=this.j.stateManager.getIndex(this.current,this.elements);e>0?e-=1:e=this.elements.length-1,this.current=this.elements[e]},t.prototype.onNextClick=function(){var e=this.j.stateManager.getIndex(this.current,this.elements);this.elements.length-1>e?e+=1:e=0,this.current=this.elements[e]},t.open=function(e,t,n){return new o(e,t,n)},t.prototype.addGlobalListeners=function(){this.j.e.on(this.j.od,"keydown",this.onKeyPress)},t.prototype.onKeyPress=function(e){if(e.key===a.KEY_LEFT||e.key===a.KEY_RIGHT||e.key===a.KEY_SPACE)return e.key===a.KEY_LEFT?this.onPreviousClick():this.onNextClick(),!1},t.prototype.removeGlobalListeners=function(){this.j.e.off(this.j.od,"keydown",this.onKeyPress)},t.prototype.destruct=function(){return this.removeGlobalListeners(),this.dialog.destruct(),e.prototype.destruct.call(this)},n.__decorate([(0,i.watch)("current")],t.prototype,"onChangeCurrent",null),n.__decorate([(0,i.watch)("previous:click")],t.prototype,"onPreviousClick",null),n.__decorate([(0,i.watch)("next:click")],t.prototype,"onNextClick",null),n.__decorate([i.autobind],t.prototype,"onKeyPress",null),o=n.__decorate([i.component],t)}(r.UIElement);t.UILightBox=l},29653:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserPanel=void 0;var n=o(70655);o(73570);var r=o(98813),i=o(53737),s=o(11975),a=o(10239),c=o(57187),l=o(47643),u=o(71584),h=o(19485),d=o(73347),p=function(e){function t(t,o){var n=e.call(this,t)||this;return n.stateManager=o,n.syncMod=!0,n.sources=new u.UIBrowserSources(n.j),n.sidebar=new a.UISidebar(n.jodit,[n.sources],n.stateManager.state),n.preview=new d.UIPreview(n.jodit,n.stateManager.state),n.statusbar=new h.UIBrowserStatusBar(n.j),n.items=new i.UIVirtualScroll(n.j,n.stateManager),n.settings=new c.UIBrowserSettings(n.jodit,n.stateManager.state),n.state=o.state,n.append(n.sidebar,"content"),n.append(n.items,"content"),n.append(n.settings,"content"),n.append(n.preview,"content"),n.append(n.statusbar,"footer"),n.onChangeElements(),n.onChangeSources(),n.onChangeView(),n.onChangeTileSize(),n.onChangeShowFavorites(),n.onChangeActiveElements(),n.onChangeFavorites(),n.onChangeShowSideBar(),n.onChangeShowSettings(),n.onChangeShowPreview(),n.onChangeTheme(),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserPanel"},Object.defineProperty(t.prototype,"countInRow",{get:function(){if("list"===this.state.view)return 1;if(!this.items.elements.length)return 1;var e=this.items.elements[0].container,t=(0,l.css)(e,"marginLeft");return Math.floor(this.items.container.offsetWidth/(e.offsetWidth+((0,l.isNumber)(t)?t:0)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"countInColumn",{get:function(){if(!this.items.elements.length)return 1;var e=this.items.elements[0].container,t=(0,l.css)(e,"marginTop");return Math.floor(this.items.container.offsetHeight/(e.offsetHeight+((0,l.isNumber)(t)?t:0)))},enumerable:!1,configurable:!0}),t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__content'></div>\n\t\t\t<div class='&__footer'></div>\n\t\t</div>"},t.prototype.onChangeTheme=function(){this.setMod("theme",this.stateManager.state.theme)},t.prototype.onChangeElements=function(){this.items.build(this.stateManager.state.elements)},t.prototype.onChangeActiveElements=function(){var e=this;this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach((function(t){t.setMod("active",Boolean(e.stateManager.isActive(t.item)))})),this.j.e.fire("changeSelection")},t.prototype.onChangeFavorites=function(){var e=this;this.items.elements.forEach((function(t){t.setMod("favorite",Boolean(e.stateManager.isFavorite(t.item)))}))},t.prototype.onChangeSources=function(){this.sources.build(this.stateManager.state.tree)},t.prototype.onChangeLastSelectedIndex=function(){var e,t=null===(e=this.items.elements[this.stateManager.state.lastSelectedIndex])||void 0===e?void 0:e.container;t&&((0,l.scrollIntoViewIfNeeded)(t,this.items.container,this.j.od),t.focus())},t.prototype.onChangeInfo=function(){this.statusbar.value(this.state.info,"center")},t.prototype.onChangePathOrSource=function(){this.statusbar.value(this.state.currentPath?"".concat(this.state.currentPath," (").concat(this.state.currentSource,")"):this.i18n("Home"),"left")},t.prototype.onChangeShowSettings=function(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)},t.prototype.onChangeShowPreview=function(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)},t.prototype.onChangeShowSideBar=function(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)},t.prototype.onChangeView=function(){this.items.setMod("view",this.stateManager.state.view)},t.prototype.onChangeTileSize=function(){this.items.setMod("size",this.stateManager.state.tileSize)},t.prototype.onChangeShowFavorites=function(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)},t.prototype.onItemDblClick=function(){return this.j.e.fire("select.filebrowser"),!1},t.prototype.onItemClick=function(e,t){this.stateManager.addActive(e,t)},t.prototype.onTogglePreview=function(){return this.state.showPreview=!this.state.showPreview,!1},t.prototype.onToggleFavoriteItem=function(e){this.stateManager.toggleFavorite(e)},t.prototype.onFolderClick=function(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")},n.__decorate([(0,s.watch)("state.theme")],t.prototype,"onChangeTheme",null),n.__decorate([(0,s.watch)("state.elements")],t.prototype,"onChangeElements",null),n.__decorate([(0,s.watch)("state.activeElements")],t.prototype,"onChangeActiveElements",null),n.__decorate([(0,s.watch)(["state.favorites","state.elements"])],t.prototype,"onChangeFavorites",null),n.__decorate([(0,s.watch)("state.sources")],t.prototype,"onChangeSources",null),n.__decorate([(0,s.watch)("state.lastSelectedIndex")],t.prototype,"onChangeLastSelectedIndex",null),n.__decorate([(0,s.watch)("state.info")],t.prototype,"onChangeInfo",null),n.__decorate([(0,s.watch)(["state.currentPath","state.currentSource"])],t.prototype,"onChangePathOrSource",null),n.__decorate([(0,s.watch)("state.showSettings")],t.prototype,"onChangeShowSettings",null),n.__decorate([(0,s.watch)("state.showPreview")],t.prototype,"onChangeShowPreview",null),n.__decorate([(0,s.watch)("state.showSideBar")],t.prototype,"onChangeShowSideBar",null),n.__decorate([(0,s.watch)("state.view")],t.prototype,"onChangeView",null),n.__decorate([(0,s.watch)("state.tileSize")],t.prototype,"onChangeTileSize",null),n.__decorate([(0,s.watch)("state.showFavorites")],t.prototype,"onChangeShowFavorites",null),n.__decorate([(0,s.watch)(":dblclickItem.filebrowser")],t.prototype,"onItemDblClick",null),n.__decorate([(0,s.watch)(":clickItem.filebrowser")],t.prototype,"onItemClick",null),n.__decorate([(0,s.watch)(":togglePreview.filebrowser")],t.prototype,"onTogglePreview",null),n.__decorate([(0,s.watch)(":toggleFavoriteItem")],t.prototype,"onToggleFavoriteItem",null),n.__decorate([(0,s.watch)(":openFolder")],t.prototype,"onFolderClick",null),n.__decorate([s.component],t)}(r.UIGroup);t.UIBrowserPanel=p},73347:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIPreview=void 0;var n=o(70655);o(6590);var r=o(98813),i=o(11975),s=o(64413),a=o(47643),c=o(97039),l=o(17971),u=o(47643),h=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.lastLoadPromise=null,n.onChangeMetaInfo(),n}return n.__extends(t,e),t.prototype.className=function(){return"UIPreview"},t.prototype.addResize=function(){s.UIResize.remove(this),s.UIResize.install(this,screen.width>450?"left":"top")},t.prototype.render=function(){return'<div>\n\t\t\t\t<div class="&__image"></div>\n\t\t\t\t<div class="&__info"></div>\n\t\t\t\t<div class="&__loader"></div>\n\t\t\t\t<div class="&__empty-message">~Select image~</div>\n\t\t\t</div>'},t.prototype.afterSetMod=function(t,o){"hidden"===t&&!1===o&&this.onChangeMetaInfo(),e.prototype.afterSetMod.call(this,t,o)},t.prototype.onChangeMetaInfo=function(){var e,t,o=this;if(!this.getMod("hidden")){var n=this.state.metaInfo;this.setMod("empty",!n);var r=this.getElm("info");(0,u.assert)(null!=r,"info element does not exists"),c.Dom.detach(r);var i=this.getElm("image");(0,u.assert)(null!=i,"image element does not exists"),(0,a.css)(i,{backgroundImage:null}),n&&(this.setMod("is-file",!1===n.isImage).setMod("type",null!==(e=n.type)&&void 0!==e?e:"file"),l.UIBrowserItem.prototype.setElementValue.call(this,"name",n.file),l.UIBrowserItem.prototype.setElementValue.call(this,"time",n.time),l.UIBrowserItem.prototype.setElementValue.call(this,"filesize",n.size),this.setMod("loading",!0),null===(t=this.lastLoadPromise)||void 0===t||t.rejectCallback(),this.lastLoadPromise=(0,a.loadImage)(n.isImage?n.fileURL:n.imageURL,this.j),this.lastLoadPromise.then((function(e){var t=o.getElm("image");(0,u.assert)(null!=t,"image element does not exist"),e&&(0,a.css)(t,{backgroundImage:"url(".concat(e.src,")")})})).finally((function(){o.setMod("loading",!1)})).catch((function(){})))}},n.__decorate([(0,i.hook)("ready"),(0,i.watch)(":resize",window),(0,i.debounce)()],t.prototype,"addResize",null),n.__decorate([(0,i.watch)("state.metaInfo")],t.prototype,"onChangeMetaInfo",null),n.__decorate([i.component],t)}(r.UIGroup);t.UIPreview=h},37538:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIProgress=void 0;var n=o(70655);o(49573);var r=o(98813),i=o(11975),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.state=o,n.onProgress(),n}return n.__extends(t,e),t.prototype.className=function(){return"UIProgress"},t.prototype.onProgress=function(){this.state.progress?this.show():this.hide(),this.progress(this.state.progress)},t.prototype.hide=function(){return this.setMod("hidden",!0),this},t.prototype.progress=function(e){var t=this;return this.container.style.width=e.toFixed(2)+"%",98>e||this.j.async.setTimeout((function(){t.hide()}),{label:"progress",timeout:300}),this},t.prototype.show=function(){return this.setMod("hidden",!1),this},n.__decorate([(0,i.watch)("state.progress")],t.prototype,"onProgress",null),n.__decorate([i.component],t)}(r.ProgressBar);t.UIProgress=s},57187:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserSettings=void 0;var n=o(70655);o(14001);var r=o(98813),i=o(11975),s=o(47643),a=function(e){function t(t,o){var n=e.call(this,t)||this;n.state=o;var r=n.getElm("close");return(0,s.assert)(null!=r,"close element does not exists"),t.e.on(r,"click",(function(){n.state.showSettings=!1})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserSettings"},t.prototype.render=function(){return'<div>\n\t\t\t<div class="'.concat(this.getFullElName("close"),'">').concat(r.Icon.get("cancel"),'</div>\n\t\t\t<div class="').concat(this.getFullElName("title"),'">').concat(this.j.i18n("Settings"),'</div>\n\t\t\t<div class="').concat(this.getFullElName("options"),'"></div>\n\t\t</div>')},t.prototype.appendChildToContainer=function(e){var t=this.getElm("options");(0,s.assert)(null!=t,"options element does not exists"),t.appendChild(e)},t.prototype.afterSetMod=function(t,o){"hidden"===t&&!1===o&&this.generateSettings(),e.prototype.afterSetMod.call(this,t,o)},t.prototype.onChangeView=function(){var e=this.getElm("tile-size");e&&(e.style.display="tiles"===this.state.view?"block":"none")},t.prototype.generateSettings=function(){var e=this;this.clear();var t=this.j;this.append([new r.UIButtonGroup(t,{label:"Theme",name:"theme",value:this.state.theme,radio:!0,options:[{value:"default",text:"Light"},{value:"dark",text:"Dark"}],onChange:function(t){e.state.theme="default"===e.state.theme||"dark"===e.state.theme?t[0].value:"default"}}),new r.UIButtonGroup(t,{label:"Show favorites",name:"showFavorites",value:this.state.showFavorites,radio:!0,options:[{value:!0,text:"Show"},{value:!1,text:"Hide"}],onChange:function(t){e.state.showFavorites=t[0].value}}),new r.UIButtonGroup(t,{label:"View",name:"view",value:this.state.view,radio:!0,options:[{value:"tiles",text:"Tiles"},{value:"list",text:"List"},{value:"compact",text:"Compact"}],onChange:function(t){e.state.view=t[0].value}}),new r.UIButtonGroup(t,{label:"Folders position",name:"foldersPosition",value:this.state.foldersPosition,radio:!0,options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"default",text:"Default"}],onChange:function(t){e.state.foldersPosition=t[0].value}}),new r.UISelect(t,{label:"Sort by",name:"sort-by",value:this.state.sortBy,options:[{value:"changed-asc",text:t.i18n("Sort by changed")+"(⬆)"},{value:"changed-desc",text:t.i18n("Sort by changed")+"(⬇)"},{value:"name-asc",text:t.i18n("Sort by name")+"(⬆)"},{value:"name-desc",text:t.i18n("Sort by name")+"(⬇)"},{value:"size-asc",text:t.i18n("Sort by size")+"(⬆)"},{value:"size-desc",text:t.i18n("Sort by size")+"(⬇)"}],onChange:function(t){e.state.sortBy=t}}),new r.UISelect(t,{label:"Tile size",name:"tile-size",value:this.state.tileSize,options:[{value:"xsmall",text:"Extra small"},{value:"small",text:"Small"},{value:"default",text:"Default"},{value:"large",text:"Large"},{value:"xlarge",text:"Extra large"}],onChange:function(t){e.state.tileSize=t}})]),this.onChangeView()},n.__decorate([(0,i.watch)("state.view")],t.prototype,"onChangeView",null),n.__decorate([i.component],t)}(r.UIGroup);t.UIBrowserSettings=a},10239:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UISidebar=void 0;var n=o(70655);o(11785);var r=o(98813),i=o(11975),s=o(64413),a=o(47643),c=function(e){function t(t,o,n){var r=e.call(this,t,o)||this;return r.state=n,r.onChangeFavorites(),r}return n.__extends(t,e),t.prototype.className=function(){return"UISidebar"},t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__hide-btn'>*angle-left*</div>\n\t\t\t<div class='&__favorites'>*heart* ~Favorites~</div>\n\t\t\t<div class='&__box'></div>\n\t\t</div>"},t.prototype.appendChildToContainer=function(e){var t=this.getElm("box");(0,a.assert)(null!=t,"box element does not exists"),t.appendChild(e)},t.prototype.addResize=function(){s.UIResize.remove(this),s.UIResize.install(this,screen.width>450?"right":"bottom")},t.prototype.onChangeFavorites=function(){this.setMod("has-favorites",Boolean(this.state.favorites.length))},t.prototype.onClickHideButton=function(){return this.state.showSideBar=!this.state.showSideBar,!1},t.prototype.onClickFavorites=function(){return this.state.elements=this.state.favorites,!1},n.__decorate([(0,i.hook)("ready"),(0,i.watch)(":resize",window),(0,i.debounce)()],t.prototype,"addResize",null),n.__decorate([(0,i.watch)("state.favorites")],t.prototype,"onChangeFavorites",null),n.__decorate([(0,i.watch)("hide-btn:click")],t.prototype,"onClickHideButton",null),n.__decorate([(0,i.watch)("favorites:click")],t.prototype,"onClickFavorites",null),n.__decorate([i.component],t)}(r.UIGroup);t.UISidebar=c},65104:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserSource=void 0;var n=o(70655);o(28389);var r=o(98813),i=o(11975),s=o(93659),a=o(47643),c=function(e){function t(t,o){var n=e.call(this,t,o)||this;n.data=o,n.tree=new s.UITree(n.j,n.data.children),n.syncMod=!0;var r=n.getElm("name");(0,a.assert)(null!=r,"name element does not exists"),r.innerText=o.title||o.name;var i=n.getElm("tree");return(0,a.assert)(null!=i,"tree element does not exists"),i.appendChild(n.tree.container),t.e.on(n.container,"contextmenu",(function(e){return t.e.fire("contextmenuSource.filebrowser",o,e)})),n}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserSource"},t.prototype.render=function(){return'<div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__tree"></div>\n\t\t</div>'},n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserSource=c},71584:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserSources=void 0;var n=o(70655);o(31748);var r=o(98813),i=o(11975),s=o(65104),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syncMod=!0,t}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserSources"},t.prototype.build=function(e){var t=this;this.clear(),e.forEach((function(e){t.append(new s.UIBrowserSource(t.jodit,e))}))},n.__decorate([i.component],t)}(r.UIGroup);t.UIBrowserSources=a},19485:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBrowserStatusBar=void 0;var n=o(70655);o(87249);var r=o(98813),i=o(11975),s=o(47643),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.className=function(){return"UIBrowserStatusBar"},t.prototype.render=function(){return"<div>\n\t\t\t<div class='&__slot-left'></div>\n\t\t\t<div class='&__slot-center'></div>\n\t\t\t<div class='&__slot-right'></div>\n\t\t</div>"},t.prototype.value=function(e,t){void 0===t&&(t="left");var o=this.getElm("slot-".concat(t));return(0,s.assert)(null!=o,"Slot does not exists"),o.innerText=e,this},n.__decorate([i.component],t)}(r.UIElement);t.UIBrowserStatusBar=a},93659:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UITree=void 0;var n=o(70655);o(56952);var r=o(98813),i=o(11975),s=o(89861),a=function(e){function t(t,o){var n=e.call(this,t)||this;return n.syncMod=!0,n.build(o),n}var o;return n.__extends(t,e),o=t,t.prototype.className=function(){return"UITree"},t.prototype.build=function(e){var t=this;this.clear(),e.forEach((function(e){var n=new s.UIBrowserFolder(t.jodit,e);t.append(n),e.isActive&&n.setMod("active",!0),e.children.length&&t.append(new o(t.jodit,e.children))}))},o=n.__decorate([i.component],t)}(r.UIGroup);t.UITree=a},53737:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIVirtualScroll=void 0;var n=o(70655);o(63940);var r=o(98813),i=o(11975),s=o(17971),a=o(10115),c=o(72411),l=o(47643),u=function(e){function t(t,o){var n=e.call(this,t)||this;return n.stateManager=o,n.syncMod=!0,n.addItemsSelector(),n}var o;return n.__extends(t,e),o=t,t.prototype.className=function(){return"UIVirtualScroll"},t.prototype.render=function(){return"<div>\n\t\t\t\t<div class=\"&__empty-message\">~There are no files~</div>\n\t\t\t\t<div class='&__loader'></div>\n\t\t\t\t<div class='&__drag-area'>~Drop image~</div>\n\t\t\t</div>"},t.prototype.reconcile=function(e){var t=this.elements.findIndex((function(t,o){return!e[o]||t.item.uniqueHashKey!==a.FileBrowserItem.create(e[o]).uniqueHashKey}));if(t>-1){for(var o=t;this.elements.length>o;o+=1)this.elements[o].destruct();this.elements.length=t}return t},t.prototype.build=function(e){var t=this,o=this.reconcile(e);e.slice(o>-1?o:this.elements.length).forEach((function(e){var o=new s.UIBrowserItem(t.jodit,e);Object.keys(t.mods).forEach((function(e){o.setMod(e,t.mods[e])})),t.append(o)})),this.setMod("empty",!this.elements.length)},t.prototype.onScrollLoadChunk=function(){!this.stateManager.isFavoriteItems&&this.j.o.pixelOffsetLoadNewChunk>this.container.scrollHeight-(this.container.scrollTop+this.container.offsetHeight)&&this.j.loadingManager.loadItemsChunk()},t.prototype.onDragOver=function(e){e.preventDefault(),this.setMod("dragover",!0)},t.prototype.onDragLeave=function(e){e.preventDefault(),this.setMod("dragover",!1)},t.prototype.addItemsSelector=function(){c.UISelectItems.install(this)},t.intersectRect=function(e,t){return!(t.left>e.left+e.width||e.left>t.left+t.width||t.top>e.top+e.height||e.top>t.top+t.height)},t.prototype.onSelectItems=function(e){var t=[];this.elements.forEach((function(n){var r=(0,l.position)(n.container);o.intersectRect(r,e)&&t.push(n.item)})),this.stateManager.state.activeElements=t},n.__decorate([(0,i.watch)(":afterResize"),(0,i.watch)(":resize"),(0,i.watch)("container:scroll"),(0,i.throttle)()],t.prototype,"onScrollLoadChunk",null),n.__decorate([(0,i.watch)("container:dragover")],t.prototype,"onDragOver",null),n.__decorate([(0,i.watch)(["container:dragleave","container:drop"])],t.prototype,"onDragLeave",null),o=n.__decorate([i.component],t)}(r.UIGroup);t.UIVirtualScroll=u},64413:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIResize=void 0,o(8931);var n=o(47077),r=o(38886),i=function(){function e(){}return e.remove=function(e){(0,n.css)(e.container,{width:null,height:null}),e.container.classList.remove("jodit-ui-resize"),r.Dom.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))},e.install=function(e,t){e.container.classList.add("jodit-ui-resize"),"static"===(0,n.css)(e.container,"position")&&(0,n.css)(e.container,"position","relative");var o=e.j.c.div("jodit-ui-resize__handle");o.classList.add("jodit-ui-resize__handle_type_"+t),e.container.appendChild(o),e.j.e.on(o,"mousedown touchstart",this.onStartResize.bind(this,e,t))},e.onStartResize=function(e,t,o){var n=e.j.async.throttle(this.onResize.bind(this,e,{x:o.clientX,y:o.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t}),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",n).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,n))},e.onResize=function(e,t,o){var r=["left","right"].includes(t.direction),i=e.container.parentElement;i&&(0,n.css)(e.container,r?"width":"height",100*(r?(t.w+(o.clientX-t.x)*("right"===t.direction?1:-1))/i.offsetWidth:(t.h+(o.clientY-t.y)*("top"===t.direction?1:-1))/i.offsetHeight)+"%")},e.onEndResize=function(e,t,o){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()},e}();t.UIResize=i},72411:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UISelectItems=void 0,o(31277);var n=o(38886),r=o(47077),i=function(){function e(){}return e.remove=function(e){n.Dom.safeRemove(e.container.querySelector(".jodit-ui-select-items")),e.j.e.off(e.container,"mousedown.uiselectitems touchstart.uiselectitems")},e.install=function(e){var t=e.j.c.div("jodit-ui-select-items");e.j.e.on(e.container,"mousedown.uiselectitems touchstart.uiselectitems",this.onStartSelect.bind(this,e,t))},e.onStartSelect=function(e,t,o){if(o.target===e.container){(0,r.css)(t,{width:0,height:0}),e.container.appendChild(t);var n={x:o.clientX,y:o.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight},i=e.j.async.throttle(this.onSelect.bind(this,e,t,n),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",i).one(e.j.ow,"mouseup touchend",this.onEndSelect.bind(this,e,t,i)),e.onSelectItems({left:n.x,top:n.y,width:0,height:0})}},e.onSelect=function(e,t,o,n){var i={left:o.x>n.clientX?n.clientX:o.x,top:o.y>n.clientY?n.clientY:o.y,width:Math.abs(o.x-n.clientX),height:Math.abs(o.y-n.clientY)};(0,r.css)(t,i),e.onSelectItems(i)},e.onEndSelect=function(e,t,o,r){n.Dom.safeRemove(t),e.j.e.off(e.j.ow,"mousemove touchmove",o),e.j.unlock()},e}();t.UISelectItems=i},99425:function(e){e.exports={Favorites:"Избранное",Settings:"Настройки",Light:"Светлая",Dark:"Темная",Theme:"Тема",Show:"Показать",Hide:"Скрыть","Show favorites":"Показывать избранное",Tiles:"Плитка",List:"Список",Compact:"Компактный",View:"Отображение","Folders position":"Позиция папок","Sort by":"Сортировать по","Extra small":"Очень маленькие",Small:"Маленькие",Large:"Большие","Extra large":"Очень большие","Tile size":"Размер плитки"}},21601:function(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},67101:function(e){e.exports='<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M28.7,16.3l-12-13c-0.4-0.4-1.1-0.4-1.5,0l-12,13C3,16.6,2.9,17,3.1,17.4C3.2,17.8,3.6,18,4,18h3v10c0,0.6,0.4,1,1,1h16 c0.6,0,1-0.4,1-1V18h3c0.4,0,0.8-0.2,0.9-0.6C29.1,17,29,16.6,28.7,16.3z"/> </svg>'},34839:function(e){e.exports='<svg viewBox="0 0 252 252" xmlns="http://www.w3.org/2000/svg"> <path d="M0 16C0 7.16344 7.16344 0 16 0H85.6364C86.5205 0 87.3797 0.29288 88.0796 0.832871L120.92 26.1671C121.62 26.7071 122.48 27 123.364 27H227C235.837 27 243 34.1634 243 43V132.335C243 134.779 240.234 136.198 238.25 134.772L233 131L226.5 127L220 124L212.5 122L202.5 120L189 120.5L179.5 122.5L170.5 125.5L161.5 130.5L157 133.5L153 137L146.5 144L141 152L137 160L134 168L132.5 178L132 183.5V189.5L133 197.5L135 205.5L137.5 211.5L139.524 214.996C141.068 217.663 139.144 221 136.062 221H16C7.16344 221 0 213.837 0 205V16Z"/> <circle cx="197" cy="185" r="56"/> <path d="M188.364 215.955V151.591H204.636V215.955H188.364ZM164.318 191.909V175.636H228.682V191.909H164.318Z" fill="white"/> </svg>'},87989:function(e,t,o){"use strict";o.r(t)},6337:function(e,t,o){"use strict";o.r(t)},80355:function(e,t,o){"use strict";o.r(t)},80744:function(e,t,o){"use strict";o.r(t)},35850:function(e,t,o){"use strict";o.r(t)},73570:function(e,t,o){"use strict";o.r(t)},6590:function(e,t,o){"use strict";o.r(t)},49573:function(e,t,o){"use strict";o.r(t)},14001:function(e,t,o){"use strict";o.r(t)},11785:function(e,t,o){"use strict";o.r(t)},28389:function(e,t,o){"use strict";o.r(t)},31748:function(e,t,o){"use strict";o.r(t)},87249:function(e,t,o){"use strict";o.r(t)},56952:function(e,t,o){"use strict";o.r(t)},63940:function(e,t,o){"use strict";o.r(t)},8931:function(e,t,o){"use strict";o.r(t)},31277:function(e,t,o){"use strict";o.r(t)}},function(e){return e(e.s=4312)}])}));
@@ -1 +1 @@
1
- ((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[524],{30861(e,t,s){"use strict";s.r(t),s.d(t,{finder(){return ie}});var i=s(10818),n=s(70655),o=s(86673),a=s(21601),r=s(67101),l=s(34839);o.JO.set("heart",a+""),o.JO.set("home",r+""),o.JO.set("new-folder",l+"");var h=s(6293),c=s(96538),d=s(51663),u=s(10115),m=s(47643);let g=class e extends o.u1{className(){return"UIBrowserItem"}constructor(e,t){super(e),this.item=u.Z.create(t),e.e.on(this.container,"click contextmenu dblclick",(t=>(e.e.fire(t.type+"Item.filebrowser",this.item,(0,m.ctrlKey)(t)||t.shiftKey,t),!1)))}render(){return"<div tabindex='-1'>\n\t\t\t<div class='&__image'></div>\n\t\t\t<div class='&__info'></div>\n\t\t\t<div class='&__heart'>*heart*</div>\n\t\t</div>"}onClickFavorite(){return this.bubble((e=>{this.jodit.e.fire(e,"toggleFavoriteItem",this.item)})),!1}onAction(e){return this.jodit.e.fire(e.type+"Item.filebrowser",this.item,(0,m.ctrlKey)(e)||e.shiftKey,e),!1}update(){const e=this.getElm("image");(0,m.assert)(null!=e,"image element does not exists"),(0,m.css)(e,"backgroundImage",`url(${encodeURI(this.item.imageURL)})`);const{type:t,file:s,time:i,size:n}=this.item;this.setMod("is-file",!1===this.item.isImage).setMod("type",null!=t?t:"file").setElementValue("name",s).setElementValue("time",i).setElementValue("filesize",n),(0,m.attr)(this.container,"title","folder"!==t?`${s} ${i} ${n}`:s),super.update()}setElementValue(e,t){const s=this.getFullElName(e);let i=this.getElm(e);if(!t)return i&&h.Dom.safeRemove(i),this;if(!i){const e=this.getElm("info");(0,m.assert)(null!=e,"wrapper element does not exist"),i=this.j.create.div(s),e.appendChild(i)}return i.innerText=t,this}};(0,n.gn)([(0,d.watch)("heart:click")],g.prototype,"onClickFavorite",null),(0,n.gn)([(0,d.watch)(["container:click","container:contextmenu","container:dblclick"])],g.prototype,"onAction",null),g=(0,n.gn)([d.component],g);var p,f=s(38886),v=s(47077);let w=p=class e extends o.qe{className(){return"UIVirtualScroll"}render(){return"<div>\n\t\t\t\t<div class=\"&__empty-message\">~There are no files~</div>\n\t\t\t\t<div class='&__loader'></div>\n\t\t\t\t<div class='&__drag-area'>~Drop image~</div>\n\t\t\t</div>"}constructor(e,t){super(e),this.stateManager=t,this.syncMod=!0,this.addItemsSelector()}reconcile(e){const t=this.elements.findIndex(((t,s)=>!e[s]||t.item.uniqueHashKey!==u.Z.create(e[s]).uniqueHashKey));if(t>-1){for(let e=t;this.elements.length>e;e+=1)this.elements[e].destruct();this.elements.length=t}return t}build(e){const t=this.reconcile(e);e.slice(t>-1?t:this.elements.length).forEach((e=>{const t=new g(this.jodit,e);Object.keys(this.mods).forEach((e=>{t.setMod(e,this.mods[e])})),this.append(t)})),this.setMod("empty",!this.elements.length)}onScrollLoadChunk(){!this.stateManager.isFavoriteItems&&this.j.o.pixelOffsetLoadNewChunk>this.container.scrollHeight-(this.container.scrollTop+this.container.offsetHeight)&&this.j.loadingManager.loadItemsChunk()}onDragOver(e){e.preventDefault(),this.setMod("dragover",!0)}onDragLeave(e){e.preventDefault(),this.setMod("dragover",!1)}addItemsSelector(){(class e{static remove(e){f.i.safeRemove(e.container.querySelector(".jodit-ui-select-items")),e.j.e.off(e.container,"mousedown.uiselectitems touchstart.uiselectitems")}static install(e){const t=e.j.c.div("jodit-ui-select-items");e.j.e.on(e.container,"mousedown.uiselectitems touchstart.uiselectitems",this.onStartSelect.bind(this,e,t))}static onStartSelect(e,t,s){if(s.target!==e.container)return;(0,v.i)(t,{width:0,height:0}),e.container.appendChild(t);const i={x:s.clientX,y:s.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight},n=e.j.async.throttle(this.onSelect.bind(this,e,t,i),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",n).one(e.j.ow,"mouseup touchend",this.onEndSelect.bind(this,e,t,n)),e.onSelectItems({left:i.x,top:i.y,width:0,height:0})}static onSelect(e,t,s,i){const n={left:s.x>i.clientX?i.clientX:s.x,top:s.y>i.clientY?i.clientY:s.y,width:Math.abs(s.x-i.clientX),height:Math.abs(s.y-i.clientY)};(0,v.i)(t,n),e.onSelectItems(n)}static onEndSelect(e,t,s,i){f.i.safeRemove(t),e.j.e.off(e.j.ow,"mousemove touchmove",s),e.j.unlock()}}).install(this)}static intersectRect(e,t){return!(t.left>e.left+e.width||e.left>t.left+t.width||t.top>e.top+e.height||e.top>t.top+t.height)}onSelectItems(e){const t=[];this.elements.forEach((s=>{const i=(0,m.position)(s.container);p.intersectRect(i,e)&&t.push(s.item)})),this.stateManager.state.activeElements=t}};(0,n.gn)([(0,d.watch)(":afterResize"),(0,d.watch)(":resize"),(0,d.watch)("container:scroll"),(0,d.throttle)()],w.prototype,"onScrollLoadChunk",null),(0,n.gn)([(0,d.watch)("container:dragover")],w.prototype,"onDragOver",null),(0,n.gn)([(0,d.watch)(["container:dragleave","container:drop"])],w.prototype,"onDragLeave",null),w=p=(0,n.gn)([d.component],w);class y{static remove(e){(0,v.i)(e.container,{width:null,height:null}),e.container.classList.remove("jodit-ui-resize"),f.i.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))}static install(e,t){e.container.classList.add("jodit-ui-resize"),"static"===(0,v.i)(e.container,"position")&&(0,v.i)(e.container,"position","relative");const s=e.j.c.div("jodit-ui-resize__handle");s.classList.add("jodit-ui-resize__handle_type_"+t),e.container.appendChild(s),e.j.e.on(s,"mousedown touchstart",this.onStartResize.bind(this,e,t))}static onStartResize(e,t,s){const i=e.j.async.throttle(this.onResize.bind(this,e,{x:s.clientX,y:s.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t}),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",i).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,i))}static onResize(e,t,s){const i=["left","right"].includes(t.direction),n=e.container.parentElement;if(!n)return;let o;o=i?(t.w+(s.clientX-t.x)*("right"===t.direction?1:-1))/n.offsetWidth:(t.h+(s.clientY-t.y)*("top"===t.direction?1:-1))/n.offsetHeight,(0,v.i)(e.container,i?"width":"height",100*o+"%")}static onEndResize(e,t,s){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()}}let b=class e extends o.qe{className(){return"UISidebar"}render(){return"<div>\n\t\t\t<div class='&__hide-btn'>*angle-left*</div>\n\t\t\t<div class='&__favorites'>*heart* ~Favorites~</div>\n\t\t\t<div class='&__box'></div>\n\t\t</div>"}appendChildToContainer(e){const t=this.getElm("box");(0,m.assert)(null!=t,"box element does not exists"),t.appendChild(e)}addResize(){y.remove(this),y.install(this,screen.width>450?"right":"bottom")}constructor(e,t,s){super(e,t),this.state=s,this.onChangeFavorites()}onChangeFavorites(){this.setMod("has-favorites",!!this.state.favorites.length)}onClickHideButton(){return this.state.showSideBar=!this.state.showSideBar,!1}onClickFavorites(){return this.state.elements=this.state.favorites,!1}};(0,n.gn)([(0,d.hook)("ready"),(0,d.watch)(":resize",window),(0,d.debounce)()],b.prototype,"addResize",null),(0,n.gn)([(0,d.watch)("state.favorites")],b.prototype,"onChangeFavorites",null),(0,n.gn)([(0,d.watch)("hide-btn:click")],b.prototype,"onClickHideButton",null),(0,n.gn)([(0,d.watch)("favorites:click")],b.prototype,"onClickFavorites",null),b=(0,n.gn)([d.component],b);let C=class e extends o.qe{className(){return"UIBrowserSettings"}render(){return`<div>\n\t\t\t<div class="${this.getFullElName("close")}">${o.JO.get("cancel")}</div>\n\t\t\t<div class="${this.getFullElName("title")}">${this.j.i18n("Settings")}</div>\n\t\t\t<div class="${this.getFullElName("options")}"></div>\n\t\t</div>`}appendChildToContainer(e){const t=this.getElm("options");(0,m.assert)(null!=t,"options element does not exists"),t.appendChild(e)}afterSetMod(e,t){"hidden"===e&&!1===t&&this.generateSettings(),super.afterSetMod(e,t)}constructor(e,t){super(e),this.state=t;const s=this.getElm("close");(0,m.assert)(null!=s,"close element does not exists"),e.e.on(s,"click",(()=>{this.state.showSettings=!1}))}onChangeView(){const e=this.getElm("tile-size");e&&(e.style.display="tiles"===this.state.view?"block":"none")}generateSettings(){this.clear();const{j:e}=this;this.append([new o.BO(e,{label:"Theme",name:"theme",value:this.state.theme,radio:!0,options:[{value:"default",text:"Light"},{value:"dark",text:"Dark"}],onChange:e=>{this.state.theme="default"===this.state.theme||"dark"===this.state.theme?e[0].value:"default"}}),new o.BO(e,{label:"Show favorites",name:"showFavorites",value:this.state.showFavorites,radio:!0,options:[{value:!0,text:"Show"},{value:!1,text:"Hide"}],onChange:e=>{this.state.showFavorites=e[0].value}}),new o.BO(e,{label:"View",name:"view",value:this.state.view,radio:!0,options:[{value:"tiles",text:"Tiles"},{value:"list",text:"List"},{value:"compact",text:"Compact"}],onChange:e=>{this.state.view=e[0].value}}),new o.BO(e,{label:"Folders position",name:"foldersPosition",value:this.state.foldersPosition,radio:!0,options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"default",text:"Default"}],onChange:e=>{this.state.foldersPosition=e[0].value}}),new o.Cj(e,{label:"Sort by",name:"sort-by",value:this.state.sortBy,options:[{value:"changed-asc",text:e.i18n("Sort by changed")+"(⬆)"},{value:"changed-desc",text:e.i18n("Sort by changed")+"(⬇)"},{value:"name-asc",text:e.i18n("Sort by name")+"(⬆)"},{value:"name-desc",text:e.i18n("Sort by name")+"(⬇)"},{value:"size-asc",text:e.i18n("Sort by size")+"(⬆)"},{value:"size-desc",text:e.i18n("Sort by size")+"(⬇)"}],onChange:e=>{this.state.sortBy=e}}),new o.Cj(e,{label:"Tile size",name:"tile-size",value:this.state.tileSize,options:[{value:"xsmall",text:"Extra small"},{value:"small",text:"Small"},{value:"default",text:"Default"},{value:"large",text:"Large"},{value:"xlarge",text:"Extra large"}],onChange:e=>{this.state.tileSize=e}})]),this.onChangeView()}};(0,n.gn)([(0,d.watch)("state.view")],C.prototype,"onChangeView",null),C=(0,n.gn)([d.component],C);let S=class e extends o.u1{className(){return"UIBrowserFolder"}render(){return'<div>\n\t\t\t<div class="&__icon">\n\t\t\t\t<div class=\'&__loader\'></div>\n\t\t\t\t<div class="&__icon-wrapper">\n\t\t\t\t\t*folder*\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__arrow">*angle-right*</div>\n\t\t</div>'}constructor(e,t){super(e),this.item=t,this.syncMod=!0;const s=this.getElm("name");(0,m.assert)(null!=s,"name element does not exists"),s.innerText=t.name,e.e.on(this.container,"click",(()=>(this.getMod("active")||this.setMod("loading",!0),e.e.fire("openFolder",t)))).on(this.container,"contextmenu",(s=>e.e.fire("contextmenuFolder.filebrowser",t,s)))}};var x;S=(0,n.gn)([d.component],S);let I=x=class e extends o.qe{className(){return"UITree"}constructor(e,t){super(e),this.syncMod=!0,this.build(t)}build(e){this.clear(),e.forEach((e=>{const t=new S(this.jodit,e);this.append(t),e.isActive&&t.setMod("active",!0),e.children.length&&this.append(new x(this.jodit,e.children))}))}};I=x=(0,n.gn)([d.component],I);let _=class e extends o.u1{className(){return"UIBrowserSource"}render(){return'<div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__tree"></div>\n\t\t</div>'}constructor(e,t){super(e,t),this.data=t,this.tree=new I(this.j,this.data.children),this.syncMod=!0;const s=this.getElm("name");(0,m.assert)(null!=s,"name element does not exists"),s.innerText=t.title||t.name;const i=this.getElm("tree");(0,m.assert)(null!=i,"tree element does not exists"),i.appendChild(this.tree.container),e.e.on(this.container,"contextmenu",(s=>e.e.fire("contextmenuSource.filebrowser",t,s)))}};_=(0,n.gn)([d.component],_);let M=class e extends o.qe{constructor(){super(...arguments),this.syncMod=!0}className(){return"UIBrowserSources"}build(e){this.clear(),e.forEach((e=>{this.append(new _(this.jodit,e))}))}};M=(0,n.gn)([d.component],M);let P=class e extends o.u1{className(){return"UIBrowserStatusBar"}render(){return"<div>\n\t\t\t<div class='&__slot-left'></div>\n\t\t\t<div class='&__slot-center'></div>\n\t\t\t<div class='&__slot-right'></div>\n\t\t</div>"}value(e,t="left"){const s=this.getElm("slot-"+t);return(0,m.assert)(null!=s,"Slot does not exists"),s.innerText=e,this}};P=(0,n.gn)([d.component],P);var F=s(97039);let j=class e extends o.qe{className(){return"UIPreview"}addResize(){y.remove(this),y.install(this,screen.width>450?"left":"top")}render(){return'<div>\n\t\t\t\t<div class="&__image"></div>\n\t\t\t\t<div class="&__info"></div>\n\t\t\t\t<div class="&__loader"></div>\n\t\t\t\t<div class="&__empty-message">~Select image~</div>\n\t\t\t</div>'}constructor(e,t){super(e),this.state=t,this.lastLoadPromise=null,this.onChangeMetaInfo()}afterSetMod(e,t){"hidden"===e&&!1===t&&this.onChangeMetaInfo(),super.afterSetMod(e,t)}onChangeMetaInfo(){var e,t;if(this.getMod("hidden"))return;const{metaInfo:s}=this.state;this.setMod("empty",!s);const i=this.getElm("info");(0,m.assert)(null!=i,"info element does not exists"),F.i.detach(i);const n=this.getElm("image");(0,m.assert)(null!=n,"image element does not exists"),(0,m.css)(n,{backgroundImage:null}),s&&(this.setMod("is-file",!1===s.isImage).setMod("type",null!==(e=s.type)&&void 0!==e?e:"file"),g.prototype.setElementValue.call(this,"name",s.file),g.prototype.setElementValue.call(this,"time",s.time),g.prototype.setElementValue.call(this,"filesize",s.size),this.setMod("loading",!0),null===(t=this.lastLoadPromise)||void 0===t||t.rejectCallback(),this.lastLoadPromise=(0,m.loadImage)(s.isImage?s.fileURL:s.imageURL,this.j),this.lastLoadPromise.then((e=>{const t=this.getElm("image");(0,m.assert)(null!=t,"image element does not exist"),e&&(0,m.css)(t,{backgroundImage:`url(${e.src})`})})).finally((()=>{this.setMod("loading",!1)})).catch((()=>{})))}};(0,n.gn)([(0,d.hook)("ready"),(0,d.watch)(":resize",window),(0,d.debounce)()],j.prototype,"addResize",null),(0,n.gn)([(0,d.watch)("state.metaInfo")],j.prototype,"onChangeMetaInfo",null),j=(0,n.gn)([d.component],j);let E=class e extends o.qe{className(){return"UIBrowserPanel"}get countInRow(){if("list"===this.state.view)return 1;if(!this.items.elements.length)return 1;const{container:e}=this.items.elements[0],t=(0,m.css)(e,"marginLeft");return Math.floor(this.items.container.offsetWidth/(e.offsetWidth+((0,m.isNumber)(t)?t:0)))}get countInColumn(){if(!this.items.elements.length)return 1;const{container:e}=this.items.elements[0],t=(0,m.css)(e,"marginTop");return Math.floor(this.items.container.offsetHeight/(e.offsetHeight+((0,m.isNumber)(t)?t:0)))}render(){return"<div>\n\t\t\t<div class='&__content'></div>\n\t\t\t<div class='&__footer'></div>\n\t\t</div>"}constructor(e,t){super(e),this.stateManager=t,this.syncMod=!0,this.sources=new M(this.j),this.sidebar=new b(this.jodit,[this.sources],this.stateManager.state),this.preview=new j(this.jodit,this.stateManager.state),this.statusbar=new P(this.j),this.items=new w(this.j,this.stateManager),this.settings=new C(this.jodit,this.stateManager.state),this.state=t.state,this.append(this.sidebar,"content"),this.append(this.items,"content"),this.append(this.settings,"content"),this.append(this.preview,"content"),this.append(this.statusbar,"footer"),this.onChangeElements(),this.onChangeSources(),this.onChangeView(),this.onChangeTileSize(),this.onChangeShowFavorites(),this.onChangeActiveElements(),this.onChangeFavorites(),this.onChangeShowSideBar(),this.onChangeShowSettings(),this.onChangeShowPreview(),this.onChangeTheme()}onChangeTheme(){this.setMod("theme",this.stateManager.state.theme)}onChangeElements(){this.items.build(this.stateManager.state.elements)}onChangeActiveElements(){this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach((e=>{e.setMod("active",!!this.stateManager.isActive(e.item))})),this.j.e.fire("changeSelection")}onChangeFavorites(){this.items.elements.forEach((e=>{e.setMod("favorite",!!this.stateManager.isFavorite(e.item))}))}onChangeSources(){this.sources.build(this.stateManager.state.tree)}onChangeLastSelectedIndex(){var e;const t=null===(e=this.items.elements[this.stateManager.state.lastSelectedIndex])||void 0===e?void 0:e.container;t&&((0,m.scrollIntoViewIfNeeded)(t,this.items.container,this.j.od),t.focus())}onChangeInfo(){this.statusbar.value(this.state.info,"center")}onChangePathOrSource(){this.statusbar.value(this.state.currentPath?`${this.state.currentPath} (${this.state.currentSource})`:this.i18n("Home"),"left")}onChangeShowSettings(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)}onChangeShowPreview(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)}onChangeShowSideBar(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)}onChangeView(){this.items.setMod("view",this.stateManager.state.view)}onChangeTileSize(){this.items.setMod("size",this.stateManager.state.tileSize)}onChangeShowFavorites(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)}onItemDblClick(){return this.j.e.fire("select.filebrowser"),!1}onItemClick(e,t){this.stateManager.addActive(e,t)}onTogglePreview(){return this.state.showPreview=!this.state.showPreview,!1}onToggleFavoriteItem(e){this.stateManager.toggleFavorite(e)}onFolderClick(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")}};(0,n.gn)([(0,d.watch)("state.theme")],E.prototype,"onChangeTheme",null),(0,n.gn)([(0,d.watch)("state.elements")],E.prototype,"onChangeElements",null),(0,n.gn)([(0,d.watch)("state.activeElements")],E.prototype,"onChangeActiveElements",null),(0,n.gn)([(0,d.watch)(["state.favorites","state.elements"])],E.prototype,"onChangeFavorites",null),(0,n.gn)([(0,d.watch)("state.sources")],E.prototype,"onChangeSources",null),(0,n.gn)([(0,d.watch)("state.lastSelectedIndex")],E.prototype,"onChangeLastSelectedIndex",null),(0,n.gn)([(0,d.watch)("state.info")],E.prototype,"onChangeInfo",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource"])],E.prototype,"onChangePathOrSource",null),(0,n.gn)([(0,d.watch)("state.showSettings")],E.prototype,"onChangeShowSettings",null),(0,n.gn)([(0,d.watch)("state.showPreview")],E.prototype,"onChangeShowPreview",null),(0,n.gn)([(0,d.watch)("state.showSideBar")],E.prototype,"onChangeShowSideBar",null),(0,n.gn)([(0,d.watch)("state.view")],E.prototype,"onChangeView",null),(0,n.gn)([(0,d.watch)("state.tileSize")],E.prototype,"onChangeTileSize",null),(0,n.gn)([(0,d.watch)("state.showFavorites")],E.prototype,"onChangeShowFavorites",null),(0,n.gn)([(0,d.watch)(":dblclickItem.filebrowser")],E.prototype,"onItemDblClick",null),(0,n.gn)([(0,d.watch)(":clickItem.filebrowser")],E.prototype,"onItemClick",null),(0,n.gn)([(0,d.watch)(":togglePreview.filebrowser")],E.prototype,"onTogglePreview",null),(0,n.gn)([(0,d.watch)(":toggleFavoriteItem")],E.prototype,"onToggleFavoriteItem",null),(0,n.gn)([(0,d.watch)(":openFolder")],E.prototype,"onFolderClick",null),E=(0,n.gn)([d.component],E);var k=s(36257);class L{constructor(e){this.state=e}getIndex(e,t=this.state.elements){return t.findIndex((t=>t.uniqueHashKey===e.uniqueHashKey))}isActive(e){return!!this.state.activeElements.find((t=>t.uniqueHashKey===e.uniqueHashKey))}isFavorite(e){return!!this.state.favorites.find((t=>t.uniqueHashKey===e.uniqueHashKey))}addActive(e,t){var s;this.state.metaInfo=e,this.state.info=null!==(s=e.file)&&void 0!==s?s:"",this.state.lastSelectedIndex=this.getIndex(e),this.state.activeElements=t?[...this.state.activeElements,e]:[e]}callSelectHandler(){var e;const t=this.state.activeElements;null===(e=this.state.onSelectCallBack)||void 0===e||e.call(this,{baseurl:"",files:t.map((e=>e.fileURL)),isImages:t.map((e=>!!e.isImage))})}setFilter(e){this.state.filterWord=e}toggleFavorite(e){const t=this.getIndex(e,this.state.favorites),s=[...this.state.favorites];-1===t?s.push(e):s.splice(t,1),this.state.favorites=s}fillTreeForPath(e,t){this.state.tree.length&&t&&"/"!==t?(this.removeActive(this.state.tree),e.forEach((e=>{let s=R(this.state.tree,e.name);s||(s=z(e),this.state.tree.push(s)),s.isActive=!0;const i=((e,t)=>e.split("/").reduce(((e,t)=>e&&R(e.children,t)),t))(t,s);i&&(i.isActive=!0,i.children=B(e.folders).map((s=>N(s,t+"/"+s,e.name))))})),this.state.tree=[...this.state.tree]):this.state.tree=e.map(z)}removeActive(e){e.forEach((e=>{e.isActive=!1,this.removeActive(e.children)}))}get isFavoriteItems(){return this.state.favorites===this.state.elements}}function R(e,t){var s;return null!==(s=e.find((e=>e.name===t)))&&void 0!==s?s:null}function B(e){return e.filter((e=>"."!==e&&".."!==e))}function z(e){return{type:"source",name:e.name,title:e.title,sourceName:e.name,path:"/",children:B(e.folders).map((t=>N(t,t,e.name)))}}function N(e,t,s){return{type:"directory",name:e,path:t,sourceName:s,children:[]}}(0,n.gn)([d.autobind],L.prototype,"getIndex",null),(0,n.gn)([d.autobind],L.prototype,"isActive",null),(0,n.gn)([d.autobind],L.prototype,"isFavorite",null);var T=s(30446);let H=class e extends o.qe{className(){return"UIBrowserHeader"}constructor(e,t,s){var i;super(e),this.options=t,this.stateManager=s,this.syncMod=!0,this.toolbar=(0,T.R)(this.j),this.filter=new o.u3(this.j,{icon:"search",placeholder:"Filter",clearButton:!0,onChange:e=>{this.stateManager.setFilter(e)}}),this.append(this.toolbar).append(this.filter),this.filter.container.classList.add(this.getFullElName("filter")),this.toolbar.setMod("mode","header").build(null!==(i=this.options.toolbarButtons)&&void 0!==i?i:[])}};H=(0,n.gn)([d.component],H);var O=s(80266),D=s(43854);let U=class e extends o.ko{className(){return"UIProgress"}constructor(e,t){super(e),this.state=t,this.onProgress()}onProgress(){this.state.progress?this.show():this.hide(),this.progress(this.state.progress)}hide(){return this.setMod("hidden",!0),this}progress(e){return this.container.style.width=e.toFixed(2)+"%",98>e||this.j.async.setTimeout((()=>{this.hide()}),{label:"progress",timeout:300}),this}show(){return this.setMod("hidden",!1),this}};(0,n.gn)([(0,d.watch)("state.progress")],U.prototype,"onProgress",null),U=(0,n.gn)([d.component],U);var K=s(75164),A=s(78930),V=s(95950);let q=class e extends V.Hr{className(){return"PersistentStore"}constructor(e,t){super(e),this.state=t,this.sortBy="changed-desc",this.view="tiles",this.foldersPosition="top",this.tileSize="default",this.favorites=[],this.showSideBar=!0,this.showPreview=!1,this.showFavorites=!0}onChangeThemeSetField(){this.theme=this.state.theme}onChangeView(){this.view=this.state.view}onChangeSortBy(){this.sortBy=this.state.sortBy}onChangeTileSize(){this.tileSize=this.state.tileSize}onChangeFavorites(){this.favorites=this.state.favorites}onChangeShowSideBar(){this.showSideBar=this.state.showSideBar}onChangeShowPreview(){this.showPreview=this.state.showPreview}onChangeShowFavorites(){this.showFavorites=this.state.showFavorites}onChangeFoldersPosition(){this.foldersPosition=this.state.foldersPosition}syncWithState(){this.state.tileSize=this.tileSize,this.state.favorites=this.favorites.map((e=>e instanceof u.Z?e:u.Z.create(e))),this.state.view=this.view,this.state.theme=this.theme,this.state.showSideBar=this.showSideBar,this.state.showPreview=this.showPreview,this.state.showFavorites=this.showFavorites,this.state.sortBy=this.sortBy,this.state.foldersPosition=this.foldersPosition}};(0,n.gn)([d.persistent],q.prototype,"theme",void 0),(0,n.gn)([d.persistent],q.prototype,"sortBy",void 0),(0,n.gn)([d.persistent],q.prototype,"view",void 0),(0,n.gn)([d.persistent],q.prototype,"foldersPosition",void 0),(0,n.gn)([d.persistent],q.prototype,"tileSize",void 0),(0,n.gn)([d.persistent],q.prototype,"favorites",void 0),(0,n.gn)([d.persistent],q.prototype,"showSideBar",void 0),(0,n.gn)([d.persistent],q.prototype,"showPreview",void 0),(0,n.gn)([d.persistent],q.prototype,"showFavorites",void 0),(0,n.gn)([(0,d.watch)("state.theme")],q.prototype,"onChangeThemeSetField",null),(0,n.gn)([(0,d.watch)("state.view")],q.prototype,"onChangeView",null),(0,n.gn)([(0,d.watch)("state.sortBy")],q.prototype,"onChangeSortBy",null),(0,n.gn)([(0,d.watch)("state.tileSize")],q.prototype,"onChangeTileSize",null),(0,n.gn)([(0,d.watch)("state.favorites")],q.prototype,"onChangeFavorites",null),(0,n.gn)([(0,d.watch)("state.showSideBar")],q.prototype,"onChangeShowSideBar",null),(0,n.gn)([(0,d.watch)("state.showPreview")],q.prototype,"onChangeShowPreview",null),(0,n.gn)([(0,d.watch)("state.showFavorites")],q.prototype,"onChangeShowFavorites",null),(0,n.gn)([(0,d.watch)("state.foldersPosition")],q.prototype,"onChangeFoldersPosition",null),q=(0,n.gn)([d.component],q);let W=class e extends V.Hr{className(){return"HistoryManager"}constructor(e,t){super(e),this.state=t,this.history=[],this.historyIndex=0}canNext(){return this.history.length-1>this.historyIndex}canPrevious(){return this.historyIndex>0}push(e){let{historyIndex:t}=this;const s=this.history[t];if(s&&s.currentSource===e.currentSource&&s.currentPath===e.currentPath)return;let i=[...this.history];i.length-1!==t&&(i=i.slice(0,t+1)),i.push(e),s&&(t+=1),this.history=i,this.historyIndex=t}next(){this.canNext()&&(this.historyIndex+=1,this.updateState())}previous(){this.canPrevious()&&(this.historyIndex-=1,this.updateState())}updateCurrent(){this.history[this.historyIndex]={currentSource:this.state.currentSource,currentPath:this.state.currentPath,tree:(0,m.fastClone)(this.state.tree),elements:[...this.state.elements]}}onHome(){this.state.currentPath="",this.state.currentSource="",this.j.e.fire("afterOpenFolder.filebrowser update.filebrowser")}onOpenFolder(){this.push({tree:[],elements:[],currentPath:this.state.currentPath,currentSource:this.state.currentSource}),this.j.e.fire("changeSelection")}updateState(){const{tree:e,elements:t,currentSource:s,currentPath:i}=this.history[this.historyIndex];this.state.activeElements=[],this.state.elements=[...t],this.state.tree=[...e],this.state.currentSource=s,this.state.currentPath=i,this.j.e.fire("changeSelection")}};(0,n.gn)([(0,d.watch)(["state.elements","state.tree"])],W.prototype,"updateCurrent",null),(0,n.gn)([(0,d.watch)(":goHome.filebrowser")],W.prototype,"onHome",null),(0,n.gn)([(0,d.watch)(":afterOpenFolder.filebrowser")],W.prototype,"onOpenFolder",null),W=(0,n.gn)([d.component],W);let Y=class e extends V.Hr{className(){return"ContextMenuManager"}onFolderContext(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1}onItemContext(e,t,s){return this.buildContextItemMenu(this.getItemContextActions(e),s),!1}onSourceContext(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1}buildContextItemMenu(e,t){if(!this.j.o.contextMenu)return;const s=(0,K.L)(this.j).setMod("theme",this.j.state.theme);s.show(t.clientX,t.clientY,e.filter((e=>e&&!1!==e.enabled))),this.j.e.on(this.j,"afterClose",(()=>{s.isOpened&&s.close()}))}getItemContextActions(e){if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});const t=this.j.options,s=this.j.dataProvider,i=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:!!e.isImage&&t.editImage&&i&&(s.canI("ImageResize")||s.canI("ImageCrop")),exec:()=>{this.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:s.canI("FileRename")&&i,exec:()=>this.j.e.fire("fileRename.filebrowser",e)},{icon:"bin",title:"Delete",enabled:s.canI("FileRemove"),exec:()=>this.j.e.fire("fileRemove.filebrowser",e)},{icon:"eye",title:"Preview",enabled:!(!e.isImage&&"file"!==e.type)&&t.preview&&i,exec:()=>this.j.e.fire("openLightBox.filebrowser",e)},{icon:"upload",title:"Download",exec:()=>{e.fileURL&&this.j.ow.open(e.fileURL)}}]}getFolderContextActions(e){const t=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:()=>{this.j.e.fire("folderRename.filebrowser",e)},enabled:t.canI("FolderRename")},{icon:"bin",title:"Delete",exec:()=>{this.j.e.fire("folderRemove.filebrowser",e)},enabled:t.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)},enabled:t.canI("FolderCreate")}]}getSourceContextActions(e){return[{icon:"plus",title:"Create folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)}}]}};(0,n.gn)([(0,d.watch)(":contextmenuFolder.filebrowser")],Y.prototype,"onFolderContext",null),(0,n.gn)([(0,d.watch)(":contextmenuItem.filebrowser")],Y.prototype,"onItemContext",null),(0,n.gn)([(0,d.watch)(":contextmenuSource.filebrowser")],Y.prototype,"onSourceContext",null),Y=(0,n.gn)([d.component],Y);const G=e=>{const t=e.split("/").filter((e=>e.length));return t.pop(),t.join("/")||"/"};var $,J=s(1120),X=s(85475);let Z=$=class e extends h.UIElement{className(){return"UILightBox"}render(){return"<div>\n\t\t\t<div class='&__previous'>*angle-left*</div>\n\t\t\t<div class='&__preview'></div>\n\t\t\t<div class='&__loader'></div>\n\t\t\t<div class='&__next'>*angle-right*</div>\n\t\t</div>"}constructor(e,t,s){super(e),this.current=t,this.elements=s,this.dialog=new h.Dialog;const{dialog:i}=this;i.setMod("theme",e.state.theme).toolbar.setMod("mode","header"),i.open(this),this.elements=this.elements.filter((e=>e.isImage)),i.e.on(i,"afterClose",(()=>{this.destruct()})),this.addGlobalListeners(),this.onChangeCurrent(),i.toolbar.build([{icon:"check",exec:()=>{e.stateManager.addActive(this.current,!1),e.e.fire("select.filebrowser"),i.close()}},"dialog.close"])}async onChangeCurrent(){const{current:e}=this;this.setMod("loading",!0);const t=this.getElm("preview");if((0,m.assert)(null!=t,"preview element does not exist"),h.Dom.detach(t),(0,m.css)(t,{backgroundImage:null}),e.isImage){const s=await(0,m.loadImage)(e.fileURL,this.j);this.dialog.setPosition(),(0,m.css)(t,{width:Math.min(this.jodit.ow.innerWidth,s.naturalWidth),height:Math.min(this.jodit.ow.innerHeight-100,s.naturalHeight),backgroundImage:`url(${s.src})`})}else{const s=await this.makeIframe(e.fileURL);t.appendChild(s)}this.dialog.setSize(),this.dialog.setPosition(),this.setMod("loading",!1)}makeIframe(e){const t=this.j.c.element("iframe");return t.classList.add(this.getFullElName("office-iframe")),t.src=/\.pdf/.test(e)?e:this.j.o.previewOfficeURL+encodeURIComponent(e),t}onPreviousClick(){const{current:e}=this;let t=this.j.stateManager.getIndex(e,this.elements);t>0?t-=1:t=this.elements.length-1,this.current=this.elements[t]}onNextClick(){const{current:e}=this;let t=this.j.stateManager.getIndex(e,this.elements);this.elements.length-1>t?t+=1:t=0,this.current=this.elements[t]}static open(e,t,s){return new $(e,t,s)}addGlobalListeners(){this.j.e.on(this.j.od,"keydown",this.onKeyPress)}onKeyPress(e){if(e.key===k.KEY_LEFT||e.key===k.KEY_RIGHT||e.key===k.KEY_SPACE)return e.key===k.KEY_LEFT?this.onPreviousClick():this.onNextClick(),!1}removeGlobalListeners(){this.j.e.off(this.j.od,"keydown",this.onKeyPress)}destruct(){return this.removeGlobalListeners(),this.dialog.destruct(),super.destruct()}};(0,n.gn)([(0,d.watch)("current")],Z.prototype,"onChangeCurrent",null),(0,n.gn)([(0,d.watch)("previous:click")],Z.prototype,"onPreviousClick",null),(0,n.gn)([(0,d.watch)("next:click")],Z.prototype,"onNextClick",null),(0,n.gn)([d.autobind],Z.prototype,"onKeyPress",null),Z=$=(0,n.gn)([d.component],Z);let Q=class e extends V.Hr{className(){return"LoadingManager"}constructor(e,t){super(e),this.state=t,this.__tick=0,this.offset=0,this.countInOneChunk=20,this.stopLoadingParts=!1,this.__isLoadingPart=!1,this.__callQueueCount=0}async onUpdateFileBrowser(){this.state.activeElements=[],this.j.panel.setMod("loading",!0),await Promise.all([this.loadFolders(),this.loadItems()]),this.j.panel.setMod("loading",!1)}async loadFolders(){if(!this.j.isOpened)return;const{currentPath:e,currentSource:t}=this.state;try{const s=await this.j.dataProvider.tree(e,t);this.j.stateManager.fillTreeForPath(s,e),this.state.sources=s}catch(e){this.j.status(e)}}async loadItems(){if(this.j.isOpened)try{this.__tick+=1;const{__tick:e}=this;this.offset=0,this.stopLoadingParts=!1,this.__callQueueCount=0;const{items:t,loadedTotal:s}=await ee(this.state,this.j.dataProvider,this.offset,this.countInOneChunk);if(this.state.elements=t,this.stopLoadingParts=this.countInOneChunk>s,await this.loadItemsChunk(e),await this.async.requestIdlePromise(),this.__tick!==e)return;for(;!this.stopLoadingParts&&this.j.panel.countInColumn*this.j.panel.countInRow>=this.state.elements.length;)if(await this.loadItemsChunk(e),this.__tick!==e)return}catch(e){this.j.status(e)}}async __loadItemsChunk(e){if(this.__isLoadingPart)this.__callQueueCount+=1;else{if(!this.stopLoadingParts){this.__isLoadingPart=!0,this.j.panel.items.setMod("chunk-loading",!0);try{this.offset+=this.countInOneChunk;const{items:t,loadedTotal:s}=await ee(this.state,this.j.dataProvider,this.offset,this.countInOneChunk);if(this.__tick!==e)return;this.stopLoadingParts=this.countInOneChunk>s,t.length&&(this.state.elements=this.state.elements.concat(t))}catch(e){this.j.status(e)}return this.j.panel.items.setMod("chunk-loading",!1),this.__isLoadingPart=!1,this.__callQueueCount>0?(this.__callQueueCount-=1,this.__loadItemsChunk(e)):void 0}this.__callQueueCount=0}}loadItemsChunk(e=this.__tick){return e!==this.__tick?Promise.resolve():this.__loadItemsChunk(e)}};function ee(e,t,s,i){const{currentPath:n,currentSource:o,sortBy:a,withFolders:r,foldersPosition:l,onlyImages:h,filterWord:c}=e;return t.itemsEx(n,o,{offset:s,limit:i,sortBy:a,withFolders:r,foldersPosition:l,onlyImages:h,filterWord:c})}(0,n.gn)([(0,d.watch)(":update.filebrowser")],Q.prototype,"onUpdateFileBrowser",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource"]),(0,d.debounce)((e=>({timeout:e.defaultTimeout,promisify:!0})))],Q.prototype,"loadFolders",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource","state.sortBy","state.onlyImages","state.foldersPosition","state.filterWord"]),(0,d.debounce)((e=>({timeout:e.defaultTimeout,promisify:!0})))],Q.prototype,"loadItems",null),(0,n.gn)([(0,d.debounce)((e=>({timeout:e.defaultTimeout,promisify:!0})))],Q.prototype,"loadItemsChunk",null),Q=(0,n.gn)([d.component],Q);let te=class e extends c.Vq{className(){return"FileBrowserPro"}lock(e="any"){return this.container.classList.add("jodit_disabled"),super.lock(e)}unlock(){return this.container.classList.remove("jodit_disabled"),super.unlock()}status(e,t=!(e instanceof Error)){(0,m.isAbort)(e)||this.message.message((0,m.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg)}constructor(e){super((0,m.ConfigProto)(Object.assign(e||{},{resizable:!0,draggable:!0,toolbarButtons:(null==e?void 0:e.toolbarButtons)||D.D.defaultOptions.filebrowser.buttons,buttons:J.Jodit.atom(["filebrowser.settings","fullsize","dialog.close"])}),D.D.defaultOptions.filebrowser)),this.dataProvider=(0,K.S)(this,this.options),this.state=(0,h.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1}),this.persistent=new q(this,this.state),this.loadingManager=new Q(this,this.state),this.stateManager=new L(this.state),this.historyManager=new W(this,this.state),this.contextMenuManager=new Y(this),this.header=new H(this,this.options,this.stateManager),this.panel=new E(this,this.stateManager),this.files=this.panel,this.tree=this.panel,this.progressbar=new U(this,this.stateManager.state),X.V.make(this),!this.persistent.theme&&this.options.theme&&(this.persistent.theme=this.options.theme),this.panel.append(this.progressbar),this.toolbar.setMod("mode","header"),this.setSize(Math.min(this.options.width,screen.width),Math.min(this.options.height,screen.height)).setHeader(this.header),this.onResizeWindow(),this.initUploader(),this.onChangeTheme(),this.fullFillOptions(),this.dataProvider.onProgress((e=>{0===e&&(e=30),this.state.progress=e})),this.e.on("beforeClose",this.removeGlobalListeners),this.e.fire("afterInit"),J.Jodit.prototype.afterInitHook.call(this)}addDisclaimer(e){this.dialog.appendChild(e)}async open(e=this.o.defaultCallback,t){return this.state.onlyImages=!!t,this.prepareOpening(e),super.open(this.panel.container),this.e.fire("update.filebrowser")}onResizeWindow(){(0,m.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})}onChangePath(){const{currentPath:e,currentSource:t}=this.state;this.uploader.setPath(e),this.uploader.setSource(t)}onChangeTheme(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme}onToggleSettings(){this.state.showSettings=!this.state.showSettings}prepareOpening(e){this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=t=>{this.close(),e(t)}),this.persistent.syncWithState()}registerGlobalListeners(){this.e.on(this.ow,"keydown",this.onKeyPress)}onKeyPress(e){const{activeElement:t}=this.od;if(!this.state.activeElements.length||!t||!h.Dom.isOrContains(this.panel.items.container,t))return;const s=this.state.elements;switch(e.key){case k.KEY_ENTER:return this.onChooseItems();case k.KEY_DELETE:return this.onFileRemove();case k.KEY_RIGHT:case k.KEY_LEFT:case k.KEY_DOWN:case k.KEY_UP:{const t=e.key===k.KEY_RIGHT||e.key===k.KEY_DOWN,i=this.state.lastSelectedIndex;let n;if([k.KEY_RIGHT,k.KEY_LEFT].includes(e.key))n=t?s[i+1]?i+1:0:s[i-1]?i-1:s.length-1;else{const{countInRow:e}=this.panel;n=Math.round(((i+1)/e+(t?1:-1))*e-1)}return s[n]&&this.stateManager.addActive(s[n],e.shiftKey),!1}}}removeGlobalListeners(){this.e.off(this.ow,"keydown",this.onKeyPress)}onFileRemove(){this.state.activeElements.length&&this.confirm("Are you sure?","Delete",(e=>{e&&this.__itemsRemove(this.state.activeElements)})).bindDestruct(this)}__itemsRemove(e){if(!e.length)return Promise.resolve();const t=[];return e.forEach((e=>{t.push("folder"===e.type?this.__folderRemove(G(e.path),e.name,e.sourceName):this.__removeFile(e.file||e.name||"",e.sourceName))})),this.state.activeElements.forEach((e=>{this.stateManager.isFavorite(e)&&this.stateManager.toggleFavorite(e)})),this.state.activeElements=[],Promise.allSettled(t).then((()=>Promise.allSettled([this.loadingManager.loadItems(),this.loadingManager.loadFolders()])))}__removeFile(e,t){return this.dataProvider.fileRemove(this.state.currentPath,e,t).then((t=>{this.status(t||this.i18n('File "%s" was deleted',e),!0)})).catch(this.status)}__folderRemove(e,t,s){return this.dataProvider.folderRemove(e,t,s).then((i=>{this.status(i||this.i18n('Folder "%s" was deleted',t),!0),this.state.currentPath===e&&(this.state.currentPath=G(e),this.state.currentSource=s)})).catch(this.status)}onFileEdit(){if(1===this.state.activeElements.length){const[e]=this.state.activeElements;O.r.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}}onFolderRename(e){this.prompt("Enter new name","Rename",(t=>{if(!(0,m.isValidName)(t)||t===e.name)return this.status(this.i18n("Enter new name")),!1;this.dataProvider.folderRename(G(e.path),e.name,t,e.sourceName).then((s=>{this.state.activeElements=[],this.status(s,!0),this.state.currentPath=G(e.path)+"/"+t,this.state.currentSource=e.sourceName,this.historyManager.updateCurrent(),this.loadingManager.loadFolders()})).catch(this.status)}),this.i18n("type name"),e.name).bindDestruct(this)}onFolderRemove(e){this.confirm("Are you sure?","Delete",(t=>{t&&this.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])})).bindDestruct(this)}onFolderCreate(e){this.prompt("Enter Directory name","Create directory",(t=>{const s=e.path||"/";this.dataProvider.createFolder(t,e.path||"/",e.sourceName).then((()=>{this.state.currentSource===e.sourceName&&this.state.currentPath===s?this.e.fire("update.filebrowser"):(this.state.currentSource=e.sourceName,this.state.currentPath=s),this.historyManager.updateCurrent()}),this.status)}),this.i18n("type name")).bindDestruct(this)}onFileRename(e){const t=e.file||e.name||"";1===this.state.activeElements.length&&t&&this.prompt("Enter new name","Rename",(e=>{if(!(0,m.isValidName)(e))return this.status(this.i18n("Enter new name")),!1;this.dataProvider.fileRename(this.state.currentPath,t,e,this.state.currentSource).then((e=>{this.state.activeElements=[],this.status(e,!0),this.loadingManager.loadItems()})).catch(this.status)}),this.i18n("type name"),t).bindDestruct(this)}onChooseItems(){const e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type)return this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,void this.e.fire("afterOpenFolder.filebrowser");this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}}onOpenLightBox(e){Z.open(this,e,this.state.elements)}initUploader(){const e=this,t=(0,m.ConfigProto)(e.o.uploader||{},D.D.defaultOptions.uploader),s=()=>this.loadingManager.loadItems();e.uploader=e.getInstance("Uploader",t),e.uploader.bind(e.panel.container,s,e.status),e.e.on("bindUploader.filebrowser",(t=>{e.uploader.bind(t,s,e.status)}))}destruct(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),super.destruct()}fullFillOptions(){["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach((e=>{null!=this.options[e]&&(this.options[e]=(0,m.ConfigProto)(this.options[e],this.o.ajax))}))}};(0,n.gn)([d.autobind],te.prototype,"status",null),(0,n.gn)([(0,d.watch)(":resize",window)],te.prototype,"onResizeWindow",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource"])],te.prototype,"onChangePath",null),(0,n.gn)([(0,d.watch)("state.theme")],te.prototype,"onChangeTheme",null),(0,n.gn)([(0,d.watch)(":toggleSettings.filebrowser")],te.prototype,"onToggleSettings",null),(0,n.gn)([d.autobind],te.prototype,"onKeyPress",null),(0,n.gn)([d.autobind],te.prototype,"removeGlobalListeners",null),(0,n.gn)([(0,d.watch)(":fileRemove.filebrowser")],te.prototype,"onFileRemove",null),(0,n.gn)([(0,d.watch)(":edit.filebrowser")],te.prototype,"onFileEdit",null),(0,n.gn)([(0,d.watch)(":folderRename.filebrowser")],te.prototype,"onFolderRename",null),(0,n.gn)([(0,d.watch)(":folderRemove.filebrowser")],te.prototype,"onFolderRemove",null),(0,n.gn)([(0,d.watch)(":folderCreate.filebrowser")],te.prototype,"onFolderCreate",null),(0,n.gn)([(0,d.watch)(":fileRename.filebrowser")],te.prototype,"onFileRename",null),(0,n.gn)([(0,d.watch)(":select.filebrowser")],te.prototype,"onChooseItems",null),(0,n.gn)([(0,d.watch)(":openLightBox.filebrowser")],te.prototype,"onOpenLightBox",null),te=(0,n.gn)([d.component,(0,d.derive)(A.lf)],te),Object.defineProperty(J.Jodit.modules,"FileBrowserPro",{value:te,writable:!1,enumerable:!0,configurable:!0}),(0,s(78855).xl)(s(91190));const se=D.D.prototype.controls.filebrowser;se.settings={icon:"settings",tooltip:"Settings",exec(e){var t;(null!==(t=e.parent)&&void 0!==t?t:e).e.fire("toggleSettings.filebrowser")}},se.home={icon:"home",tooltip:"Home",exec(e){e.e.fire("goHome.filebrowser")}},se.preview={icon:"eye",tooltip:"Preview",isDisabled:e=>0===e.state.activeElements.length,exec(e){e.e.fire("togglePreview.filebrowser")}},se.next={icon:"angle-right",tooltip:"History next",isDisabled(e){return!e.historyManager.canNext()},exec(e){e.historyManager.next()}},se.previous={icon:"angle-left",tooltip:"History previous",isDisabled(e){return!e.historyManager.canPrevious()},exec(e){e.historyManager.previous()}},se["new-folder"]={icon:"new-folder",exec(e){e.e.fire("folderCreate.filebrowser",{path:e.state.currentPath,sourceName:e.state.currentSource})},tooltip:"New folder"},Object.assign(D.D.prototype.filebrowser,{buttons:["filebrowser.home","filebrowser.previous","filebrowser.next","|","filebrowser.upload","filebrowser.new-folder","filebrowser.remove","filebrowser.update","filebrowser.select","filebrowser.edit","|","filebrowser.preview","about"],sort:!1,pixelOffsetLoadNewChunk:300,width:800,height:400,previewOfficeURL:"https://view.officeapps.live.com/op/view.aspx?src="});class ie extends i.S{constructor(){super(...arguments),this.requires=["license"],this.hasStyle=!J.Jodit.fatMode}afterInit(e){e.e.on("getInstanceFileBrowser",(e=>(this.__instance||(this.__instance=new te(e)),this.__instance)))}beforeDestruct(e){var t;e.e.off("getInstanceFileBrowser"),null===(t=this.__instance)||void 0===t||t.destruct()}}J.Jodit.plugins.add("finder",ie)},91190(e,t,s){"use strict";s.r(t),s.d(t,{ru(){return i}});const i=s(99425)},70655(e,t,s){"use strict";function i(e,t,s,i){var n,o=arguments.length,a=3>o?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(a=(3>o?n(a):o>3?n(t,s,a):n(t,s))||a);return o>3&&a&&Object.defineProperty(t,s,a),a}s.d(t,{gn(){return i}})},99425(e){e.exports={Favorites:"Избранное",Settings:"Настройки",Light:"Светлая",Dark:"Темная",Theme:"Тема",Show:"Показать",Hide:"Скрыть","Show favorites":"Показывать избранное",Tiles:"Плитка",List:"Список",Compact:"Компактный",View:"Отображение","Folders position":"Позиция папок","Sort by":"Сортировать по","Extra small":"Очень маленькие",Small:"Маленькие",Large:"Большие","Extra large":"Очень большие","Tile size":"Размер плитки"}},21601(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},67101(e){e.exports='<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M28.7,16.3l-12-13c-0.4-0.4-1.1-0.4-1.5,0l-12,13C3,16.6,2.9,17,3.1,17.4C3.2,17.8,3.6,18,4,18h3v10c0,0.6,0.4,1,1,1h16 c0.6,0,1-0.4,1-1V18h3c0.4,0,0.8-0.2,0.9-0.6C29.1,17,29,16.6,28.7,16.3z"/> </svg>'},34839(e){e.exports='<svg viewBox="0 0 252 252" xmlns="http://www.w3.org/2000/svg"> <path d="M0 16C0 7.16344 7.16344 0 16 0H85.6364C86.5205 0 87.3797 0.29288 88.0796 0.832871L120.92 26.1671C121.62 26.7071 122.48 27 123.364 27H227C235.837 27 243 34.1634 243 43V132.335C243 134.779 240.234 136.198 238.25 134.772L233 131L226.5 127L220 124L212.5 122L202.5 120L189 120.5L179.5 122.5L170.5 125.5L161.5 130.5L157 133.5L153 137L146.5 144L141 152L137 160L134 168L132.5 178L132 183.5V189.5L133 197.5L135 205.5L137.5 211.5L139.524 214.996C141.068 217.663 139.144 221 136.062 221H16C7.16344 221 0 213.837 0 205V16Z"/> <circle cx="197" cy="185" r="56"/> <path d="M188.364 215.955V151.591H204.636V215.955H188.364ZM164.318 191.909V175.636H228.682V191.909H164.318Z" fill="white"/> </svg>'}},e=>e(e.s=30861)])}));
1
+ ((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[524],{30861(e,t,s){"use strict";s.r(t),s.d(t,{finder(){return ne}});var i=s(10818),n=s(70655),o=s(86673),r=s(21601),a=s(67101),l=s(34839);o.JO.set("heart",r+""),o.JO.set("home",a+""),o.JO.set("new-folder",l+"");var h=s(6293),c=s(96538),d=s(51663),u=s(10115),m=s(47643);let g=class e extends o.u1{className(){return"UIBrowserItem"}constructor(e,t){super(e),this.item=u.Z.create(t),e.e.on(this.container,"click contextmenu dblclick",(t=>(e.e.fire(t.type+"Item.filebrowser",this.item,(0,m.ctrlKey)(t)||t.shiftKey,t),!1)))}render(){return"<div tabindex='-1'>\n\t\t\t<div class='&__image'></div>\n\t\t\t<div class='&__info'></div>\n\t\t\t<div class='&__heart'>*heart*</div>\n\t\t</div>"}onClickFavorite(){return this.bubble((e=>{this.jodit.e.fire(e,"toggleFavoriteItem",this.item)})),!1}onAction(e){return this.jodit.e.fire(e.type+"Item.filebrowser",this.item,(0,m.ctrlKey)(e)||e.shiftKey,e),!1}update(){const e=this.getElm("image");(0,m.assert)(null!=e,"image element does not exists"),(0,m.css)(e,"backgroundImage",`url(${encodeURI(this.item.imageURL)})`);const{type:t,file:s,time:i,size:n}=this.item;this.setMod("is-file",!1===this.item.isImage).setMod("type",null!=t?t:"file").setElementValue("name",s).setElementValue("time",i).setElementValue("filesize",n),(0,m.attr)(this.container,"title","folder"!==t?`${s} ${i} ${n}`:s),super.update()}setElementValue(e,t){const s=this.getFullElName(e);let i=this.getElm(e);if(!t)return i&&h.Dom.safeRemove(i),this;if(!i){const e=this.getElm("info");(0,m.assert)(null!=e,"wrapper element does not exist"),i=this.j.create.div(s),e.appendChild(i)}return i.innerText=t,this}};(0,n.gn)([(0,d.watch)("heart:click")],g.prototype,"onClickFavorite",null),(0,n.gn)([(0,d.watch)(["container:click","container:contextmenu","container:dblclick"])],g.prototype,"onAction",null),g=(0,n.gn)([d.component],g);var p,f=s(38886),v=s(47077);let w=p=class e extends o.qe{className(){return"UIVirtualScroll"}render(){return"<div>\n\t\t\t\t<div class=\"&__empty-message\">~There are no files~</div>\n\t\t\t\t<div class='&__loader'></div>\n\t\t\t\t<div class='&__drag-area'>~Drop image~</div>\n\t\t\t</div>"}constructor(e,t){super(e),this.stateManager=t,this.syncMod=!0,this.addItemsSelector()}reconcile(e){const t=this.elements.findIndex(((t,s)=>!e[s]||t.item.uniqueHashKey!==u.Z.create(e[s]).uniqueHashKey));if(t>-1){for(let e=t;this.elements.length>e;e+=1)this.elements[e].destruct();this.elements.length=t}return t}build(e){const t=this.reconcile(e);e.slice(t>-1?t:this.elements.length).forEach((e=>{const t=new g(this.jodit,e);Object.keys(this.mods).forEach((e=>{t.setMod(e,this.mods[e])})),this.append(t)})),this.setMod("empty",!this.elements.length)}onScrollLoadChunk(){!this.stateManager.isFavoriteItems&&this.j.o.pixelOffsetLoadNewChunk>this.container.scrollHeight-(this.container.scrollTop+this.container.offsetHeight)&&this.j.loadingManager.loadItemsChunk()}onDragOver(e){e.preventDefault(),this.setMod("dragover",!0)}onDragLeave(e){e.preventDefault(),this.setMod("dragover",!1)}addItemsSelector(){(class e{static remove(e){f.i.safeRemove(e.container.querySelector(".jodit-ui-select-items")),e.j.e.off(e.container,"mousedown.uiselectitems touchstart.uiselectitems")}static install(e){const t=e.j.c.div("jodit-ui-select-items");e.j.e.on(e.container,"mousedown.uiselectitems touchstart.uiselectitems",this.onStartSelect.bind(this,e,t))}static onStartSelect(e,t,s){if(s.target!==e.container)return;(0,v.i)(t,{width:0,height:0}),e.container.appendChild(t);const i={x:s.clientX,y:s.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight},n=e.j.async.throttle(this.onSelect.bind(this,e,t,i),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",n).one(e.j.ow,"mouseup touchend",this.onEndSelect.bind(this,e,t,n)),e.onSelectItems({left:i.x,top:i.y,width:0,height:0})}static onSelect(e,t,s,i){const n={left:s.x>i.clientX?i.clientX:s.x,top:s.y>i.clientY?i.clientY:s.y,width:Math.abs(s.x-i.clientX),height:Math.abs(s.y-i.clientY)};(0,v.i)(t,n),e.onSelectItems(n)}static onEndSelect(e,t,s,i){f.i.safeRemove(t),e.j.e.off(e.j.ow,"mousemove touchmove",s),e.j.unlock()}}).install(this)}static intersectRect(e,t){return!(t.left>e.left+e.width||e.left>t.left+t.width||t.top>e.top+e.height||e.top>t.top+t.height)}onSelectItems(e){const t=[];this.elements.forEach((s=>{const i=(0,m.position)(s.container);p.intersectRect(i,e)&&t.push(s.item)})),this.stateManager.state.activeElements=t}};(0,n.gn)([(0,d.watch)(":afterResize"),(0,d.watch)(":resize"),(0,d.watch)("container:scroll"),(0,d.throttle)()],w.prototype,"onScrollLoadChunk",null),(0,n.gn)([(0,d.watch)("container:dragover")],w.prototype,"onDragOver",null),(0,n.gn)([(0,d.watch)(["container:dragleave","container:drop"])],w.prototype,"onDragLeave",null),w=p=(0,n.gn)([d.component],w);class y{static remove(e){(0,v.i)(e.container,{width:null,height:null}),e.container.classList.remove("jodit-ui-resize"),f.i.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))}static install(e,t){e.container.classList.add("jodit-ui-resize"),"static"===(0,v.i)(e.container,"position")&&(0,v.i)(e.container,"position","relative");const s=e.j.c.div("jodit-ui-resize__handle");s.classList.add("jodit-ui-resize__handle_type_"+t),e.container.appendChild(s),e.j.e.on(s,"mousedown touchstart",this.onStartResize.bind(this,e,t))}static onStartResize(e,t,s){const i=e.j.async.throttle(this.onResize.bind(this,e,{x:s.clientX,y:s.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t}),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",i).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,i))}static onResize(e,t,s){const i=["left","right"].includes(t.direction),n=e.container.parentElement;if(!n)return;let o;o=i?(t.w+(s.clientX-t.x)*("right"===t.direction?1:-1))/n.offsetWidth:(t.h+(s.clientY-t.y)*("top"===t.direction?1:-1))/n.offsetHeight,(0,v.i)(e.container,i?"width":"height",100*o+"%")}static onEndResize(e,t,s){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()}}let b=class e extends o.qe{className(){return"UISidebar"}render(){return"<div>\n\t\t\t<div class='&__hide-btn'>*angle-left*</div>\n\t\t\t<div class='&__favorites'>*heart* ~Favorites~</div>\n\t\t\t<div class='&__box'></div>\n\t\t</div>"}appendChildToContainer(e){const t=this.getElm("box");(0,m.assert)(null!=t,"box element does not exists"),t.appendChild(e)}addResize(){y.remove(this),y.install(this,screen.width>450?"right":"bottom")}constructor(e,t,s){super(e,t),this.state=s,this.onChangeFavorites()}onChangeFavorites(){this.setMod("has-favorites",!!this.state.favorites.length)}onClickHideButton(){return this.state.showSideBar=!this.state.showSideBar,!1}onClickFavorites(){return this.state.elements=this.state.favorites,!1}};(0,n.gn)([(0,d.hook)("ready"),(0,d.watch)(":resize",window),(0,d.debounce)()],b.prototype,"addResize",null),(0,n.gn)([(0,d.watch)("state.favorites")],b.prototype,"onChangeFavorites",null),(0,n.gn)([(0,d.watch)("hide-btn:click")],b.prototype,"onClickHideButton",null),(0,n.gn)([(0,d.watch)("favorites:click")],b.prototype,"onClickFavorites",null),b=(0,n.gn)([d.component],b);let C=class e extends o.qe{className(){return"UIBrowserSettings"}render(){return`<div>\n\t\t\t<div class="${this.getFullElName("close")}">${o.JO.get("cancel")}</div>\n\t\t\t<div class="${this.getFullElName("title")}">${this.j.i18n("Settings")}</div>\n\t\t\t<div class="${this.getFullElName("options")}"></div>\n\t\t</div>`}appendChildToContainer(e){const t=this.getElm("options");(0,m.assert)(null!=t,"options element does not exists"),t.appendChild(e)}afterSetMod(e,t){"hidden"===e&&!1===t&&this.generateSettings(),super.afterSetMod(e,t)}constructor(e,t){super(e),this.state=t;const s=this.getElm("close");(0,m.assert)(null!=s,"close element does not exists"),e.e.on(s,"click",(()=>{this.state.showSettings=!1}))}onChangeView(){const e=this.getElm("tile-size");e&&(e.style.display="tiles"===this.state.view?"block":"none")}generateSettings(){this.clear();const{j:e}=this;this.append([new o.BO(e,{label:"Theme",name:"theme",value:this.state.theme,radio:!0,options:[{value:"default",text:"Light"},{value:"dark",text:"Dark"}],onChange:e=>{this.state.theme="default"===this.state.theme||"dark"===this.state.theme?e[0].value:"default"}}),new o.BO(e,{label:"Show favorites",name:"showFavorites",value:this.state.showFavorites,radio:!0,options:[{value:!0,text:"Show"},{value:!1,text:"Hide"}],onChange:e=>{this.state.showFavorites=e[0].value}}),new o.BO(e,{label:"View",name:"view",value:this.state.view,radio:!0,options:[{value:"tiles",text:"Tiles"},{value:"list",text:"List"},{value:"compact",text:"Compact"}],onChange:e=>{this.state.view=e[0].value}}),new o.BO(e,{label:"Folders position",name:"foldersPosition",value:this.state.foldersPosition,radio:!0,options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"default",text:"Default"}],onChange:e=>{this.state.foldersPosition=e[0].value}}),new o.Cj(e,{label:"Sort by",name:"sort-by",value:this.state.sortBy,options:[{value:"changed-asc",text:e.i18n("Sort by changed")+"(⬆)"},{value:"changed-desc",text:e.i18n("Sort by changed")+"(⬇)"},{value:"name-asc",text:e.i18n("Sort by name")+"(⬆)"},{value:"name-desc",text:e.i18n("Sort by name")+"(⬇)"},{value:"size-asc",text:e.i18n("Sort by size")+"(⬆)"},{value:"size-desc",text:e.i18n("Sort by size")+"(⬇)"}],onChange:e=>{this.state.sortBy=e}}),new o.Cj(e,{label:"Tile size",name:"tile-size",value:this.state.tileSize,options:[{value:"xsmall",text:"Extra small"},{value:"small",text:"Small"},{value:"default",text:"Default"},{value:"large",text:"Large"},{value:"xlarge",text:"Extra large"}],onChange:e=>{this.state.tileSize=e}})]),this.onChangeView()}};(0,n.gn)([(0,d.watch)("state.view")],C.prototype,"onChangeView",null),C=(0,n.gn)([d.component],C);let S=class e extends o.u1{className(){return"UIBrowserFolder"}render(){return'<div>\n\t\t\t<div class="&__icon">\n\t\t\t\t<div class=\'&__loader\'></div>\n\t\t\t\t<div class="&__icon-wrapper">\n\t\t\t\t\t*folder*\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__arrow">*angle-right*</div>\n\t\t</div>'}constructor(e,t){super(e),this.item=t,this.syncMod=!0;const s=this.getElm("name");(0,m.assert)(null!=s,"name element does not exists"),s.innerText=t.name,e.e.on(this.container,"click",(()=>(this.getMod("active")||this.setMod("loading",!0),e.e.fire("openFolder",t)))).on(this.container,"contextmenu",(s=>e.e.fire("contextmenuFolder.filebrowser",t,s)))}};var x;S=(0,n.gn)([d.component],S);let I=x=class e extends o.qe{className(){return"UITree"}constructor(e,t){super(e),this.syncMod=!0,this.build(t)}build(e){this.clear(),e.forEach((e=>{const t=new S(this.jodit,e);this.append(t),e.isActive&&t.setMod("active",!0),e.children.length&&this.append(new x(this.jodit,e.children))}))}};I=x=(0,n.gn)([d.component],I);let _=class e extends o.u1{className(){return"UIBrowserSource"}render(){return'<div>\n\t\t\t<div class="&__name"></div>\n\t\t\t<div class="&__tree"></div>\n\t\t</div>'}constructor(e,t){super(e,t),this.data=t,this.tree=new I(this.j,this.data.children),this.syncMod=!0;const s=this.getElm("name");(0,m.assert)(null!=s,"name element does not exists"),s.innerText=t.title||t.name;const i=this.getElm("tree");(0,m.assert)(null!=i,"tree element does not exists"),i.appendChild(this.tree.container),e.e.on(this.container,"contextmenu",(s=>e.e.fire("contextmenuSource.filebrowser",t,s)))}};_=(0,n.gn)([d.component],_);let P=class e extends o.qe{constructor(){super(...arguments),this.syncMod=!0}className(){return"UIBrowserSources"}build(e){this.clear(),e.forEach((e=>{this.append(new _(this.jodit,e))}))}};P=(0,n.gn)([d.component],P);let M=class e extends o.u1{className(){return"UIBrowserStatusBar"}render(){return"<div>\n\t\t\t<div class='&__slot-left'></div>\n\t\t\t<div class='&__slot-center'></div>\n\t\t\t<div class='&__slot-right'></div>\n\t\t</div>"}value(e,t="left"){const s=this.getElm("slot-"+t);return(0,m.assert)(null!=s,"Slot does not exists"),s.innerText=e,this}};M=(0,n.gn)([d.component],M);var j=s(97039);let F=class e extends o.qe{className(){return"UIPreview"}addResize(){y.remove(this),y.install(this,screen.width>450?"left":"top")}render(){return'<div>\n\t\t\t\t<div class="&__image"></div>\n\t\t\t\t<div class="&__info"></div>\n\t\t\t\t<div class="&__loader"></div>\n\t\t\t\t<div class="&__empty-message">~Select image~</div>\n\t\t\t</div>'}constructor(e,t){super(e),this.state=t,this.lastLoadPromise=null,this.onChangeMetaInfo()}afterSetMod(e,t){"hidden"===e&&!1===t&&this.onChangeMetaInfo(),super.afterSetMod(e,t)}onChangeMetaInfo(){var e,t;if(this.getMod("hidden"))return;const{metaInfo:s}=this.state;this.setMod("empty",!s);const i=this.getElm("info");(0,m.assert)(null!=i,"info element does not exists"),j.i.detach(i);const n=this.getElm("image");(0,m.assert)(null!=n,"image element does not exists"),(0,m.css)(n,{backgroundImage:null}),s&&(this.setMod("is-file",!1===s.isImage).setMod("type",null!==(e=s.type)&&void 0!==e?e:"file"),g.prototype.setElementValue.call(this,"name",s.file),g.prototype.setElementValue.call(this,"time",s.time),g.prototype.setElementValue.call(this,"filesize",s.size),this.setMod("loading",!0),null===(t=this.lastLoadPromise)||void 0===t||t.rejectCallback(),this.lastLoadPromise=(0,m.loadImage)(s.isImage?s.fileURL:s.imageURL,this.j),this.lastLoadPromise.then((e=>{const t=this.getElm("image");(0,m.assert)(null!=t,"image element does not exist"),e&&(0,m.css)(t,{backgroundImage:`url(${e.src})`})})).finally((()=>{this.setMod("loading",!1)})).catch((()=>{})))}};(0,n.gn)([(0,d.hook)("ready"),(0,d.watch)(":resize",window),(0,d.debounce)()],F.prototype,"addResize",null),(0,n.gn)([(0,d.watch)("state.metaInfo")],F.prototype,"onChangeMetaInfo",null),F=(0,n.gn)([d.component],F);let E=class e extends o.qe{className(){return"UIBrowserPanel"}get countInRow(){if("list"===this.state.view)return 1;if(!this.items.elements.length)return 1;const{container:e}=this.items.elements[0],t=(0,m.css)(e,"marginLeft");return Math.floor(this.items.container.offsetWidth/(e.offsetWidth+((0,m.isNumber)(t)?t:0)))}get countInColumn(){if(!this.items.elements.length)return 1;const{container:e}=this.items.elements[0],t=(0,m.css)(e,"marginTop");return Math.floor(this.items.container.offsetHeight/(e.offsetHeight+((0,m.isNumber)(t)?t:0)))}render(){return"<div>\n\t\t\t<div class='&__content'></div>\n\t\t\t<div class='&__footer'></div>\n\t\t</div>"}constructor(e,t){super(e),this.stateManager=t,this.syncMod=!0,this.sources=new P(this.j),this.sidebar=new b(this.jodit,[this.sources],this.stateManager.state),this.preview=new F(this.jodit,this.stateManager.state),this.statusbar=new M(this.j),this.items=new w(this.j,this.stateManager),this.settings=new C(this.jodit,this.stateManager.state),this.state=t.state,this.append(this.sidebar,"content"),this.append(this.items,"content"),this.append(this.settings,"content"),this.append(this.preview,"content"),this.append(this.statusbar,"footer"),this.onChangeElements(),this.onChangeSources(),this.onChangeView(),this.onChangeTileSize(),this.onChangeShowFavorites(),this.onChangeActiveElements(),this.onChangeFavorites(),this.onChangeShowSideBar(),this.onChangeShowSettings(),this.onChangeShowPreview(),this.onChangeTheme()}onChangeTheme(){this.setMod("theme",this.stateManager.state.theme)}onChangeElements(){this.items.build(this.stateManager.state.elements)}onChangeActiveElements(){this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach((e=>{e.setMod("active",!!this.stateManager.isActive(e.item))})),this.j.e.fire("changeSelection")}onChangeFavorites(){this.items.elements.forEach((e=>{e.setMod("favorite",!!this.stateManager.isFavorite(e.item))}))}onChangeSources(){this.sources.build(this.stateManager.state.tree)}onChangeLastSelectedIndex(){var e;const t=null===(e=this.items.elements[this.stateManager.state.lastSelectedIndex])||void 0===e?void 0:e.container;t&&((0,m.scrollIntoViewIfNeeded)(t,this.items.container,this.j.od),t.focus())}onChangeInfo(){this.statusbar.value(this.state.info,"center")}onChangePathOrSource(){this.statusbar.value(this.state.currentPath?`${this.state.currentPath} (${this.state.currentSource})`:this.i18n("Home"),"left")}onChangeShowSettings(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)}onChangeShowPreview(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)}onChangeShowSideBar(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)}onChangeView(){this.items.setMod("view",this.stateManager.state.view)}onChangeTileSize(){this.items.setMod("size",this.stateManager.state.tileSize)}onChangeShowFavorites(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)}onItemDblClick(){return this.j.e.fire("select.filebrowser"),!1}onItemClick(e,t){this.stateManager.addActive(e,t)}onTogglePreview(){return this.state.showPreview=!this.state.showPreview,!1}onToggleFavoriteItem(e){this.stateManager.toggleFavorite(e)}onFolderClick(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")}};(0,n.gn)([(0,d.watch)("state.theme")],E.prototype,"onChangeTheme",null),(0,n.gn)([(0,d.watch)("state.elements")],E.prototype,"onChangeElements",null),(0,n.gn)([(0,d.watch)("state.activeElements")],E.prototype,"onChangeActiveElements",null),(0,n.gn)([(0,d.watch)(["state.favorites","state.elements"])],E.prototype,"onChangeFavorites",null),(0,n.gn)([(0,d.watch)("state.sources")],E.prototype,"onChangeSources",null),(0,n.gn)([(0,d.watch)("state.lastSelectedIndex")],E.prototype,"onChangeLastSelectedIndex",null),(0,n.gn)([(0,d.watch)("state.info")],E.prototype,"onChangeInfo",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource"])],E.prototype,"onChangePathOrSource",null),(0,n.gn)([(0,d.watch)("state.showSettings")],E.prototype,"onChangeShowSettings",null),(0,n.gn)([(0,d.watch)("state.showPreview")],E.prototype,"onChangeShowPreview",null),(0,n.gn)([(0,d.watch)("state.showSideBar")],E.prototype,"onChangeShowSideBar",null),(0,n.gn)([(0,d.watch)("state.view")],E.prototype,"onChangeView",null),(0,n.gn)([(0,d.watch)("state.tileSize")],E.prototype,"onChangeTileSize",null),(0,n.gn)([(0,d.watch)("state.showFavorites")],E.prototype,"onChangeShowFavorites",null),(0,n.gn)([(0,d.watch)(":dblclickItem.filebrowser")],E.prototype,"onItemDblClick",null),(0,n.gn)([(0,d.watch)(":clickItem.filebrowser")],E.prototype,"onItemClick",null),(0,n.gn)([(0,d.watch)(":togglePreview.filebrowser")],E.prototype,"onTogglePreview",null),(0,n.gn)([(0,d.watch)(":toggleFavoriteItem")],E.prototype,"onToggleFavoriteItem",null),(0,n.gn)([(0,d.watch)(":openFolder")],E.prototype,"onFolderClick",null),E=(0,n.gn)([d.component],E);var k=s(36257);class L{constructor(e){this.state=e}getIndex(e,t=this.state.elements){return t.findIndex((t=>t.uniqueHashKey===e.uniqueHashKey))}isActive(e){return!!this.state.activeElements.find((t=>t.uniqueHashKey===e.uniqueHashKey))}isFavorite(e){return!!this.state.favorites.find((t=>t.uniqueHashKey===e.uniqueHashKey))}addActive(e,t){var s;this.state.metaInfo=e,this.state.info=null!==(s=e.file)&&void 0!==s?s:"",this.state.lastSelectedIndex=this.getIndex(e),this.state.activeElements=t?[...this.state.activeElements,e]:[e]}callSelectHandler(){var e;const t=this.state.activeElements;null===(e=this.state.onSelectCallBack)||void 0===e||e.call(this,{baseurl:"",files:t.map((e=>e.fileURL)),isImages:t.map((e=>!!e.isImage))})}setFilter(e){this.state.filterWord=e}toggleFavorite(e){const t=this.getIndex(e,this.state.favorites),s=[...this.state.favorites];-1===t?s.push(e):s.splice(t,1),this.state.favorites=s}fillTreeForPath(e,t){this.state.tree.length&&t&&"/"!==t?(this.removeActive(this.state.tree),e.forEach((e=>{let s=R(this.state.tree,e.name);s||(s=z(e),this.state.tree.push(s)),s.isActive=!0;const i=((e,t)=>e.split("/").reduce(((e,t)=>e&&R(e.children,t)),t))(t,s);i&&(i.isActive=!0,i.children=B(e.folders).map((s=>N(s,t+"/"+s,e.name))))})),this.state.tree=[...this.state.tree]):this.state.tree=e.map(z)}removeActive(e){e.forEach((e=>{e.isActive=!1,this.removeActive(e.children)}))}get isFavoriteItems(){return this.state.favorites===this.state.elements}}function R(e,t){var s;return null!==(s=e.find((e=>e.name===t)))&&void 0!==s?s:null}function B(e){return e.filter((e=>"."!==e&&".."!==e))}function z(e){return{type:"source",name:e.name,title:e.title,sourceName:e.name,path:"/",children:B(e.folders).map((t=>N(t,t,e.name)))}}function N(e,t,s){return{type:"directory",name:e,path:t,sourceName:s,children:[]}}(0,n.gn)([d.autobind],L.prototype,"getIndex",null),(0,n.gn)([d.autobind],L.prototype,"isActive",null),(0,n.gn)([d.autobind],L.prototype,"isFavorite",null);var T=s(30446),H=s(20405);let O=class e extends o.qe{className(){return"UIBrowserHeader"}constructor(e,t,s){super(e),this.options=t,this.stateManager=s,this.syncMod=!0,this.toolbar=(0,T.R)(this.j),this.filter=new o.u3(this.j,{icon:"search",placeholder:"Filter",clearButton:!0,onChange:e=>{this.stateManager.setFilter(e)}}),this.append(this.toolbar).append(this.filter),this.filter.container.classList.add(this.getFullElName("filter")),this.toolbar.setMod("mode","header").build(this.__getButtons())}__getButtons(){var e;return(null!==(e=this.options.toolbarButtons)&&void 0!==e?e:[]).filter((e=>{if(!(0,H.H)(e))return!0;switch(e){case"filebrowser.edit":return this.j.dataProvider.canI("ImageResize")||this.j.dataProvider.canI("ImageCrop");case"filebrowser.new-folder":return this.j.dataProvider.canI("FolderCreate");case"filebrowser.upload":return this.j.dataProvider.canI("FileUpload");case"filebrowser.remove":return this.j.dataProvider.canI("FileRemove")}return!0}))}};O=(0,n.gn)([d.component],O);var D=s(80266),U=s(43854);let K=class e extends o.ko{className(){return"UIProgress"}constructor(e,t){super(e),this.state=t,this.onProgress()}onProgress(){this.state.progress?this.show():this.hide(),this.progress(this.state.progress)}hide(){return this.setMod("hidden",!0),this}progress(e){return this.container.style.width=e.toFixed(2)+"%",98>e||this.j.async.setTimeout((()=>{this.hide()}),{label:"progress",timeout:300}),this}show(){return this.setMod("hidden",!1),this}};(0,n.gn)([(0,d.watch)("state.progress")],K.prototype,"onProgress",null),K=(0,n.gn)([d.component],K);var A=s(75164),V=s(78930),q=s(95950);let W=class e extends q.Hr{className(){return"PersistentStore"}constructor(e,t){super(e),this.state=t,this.sortBy="changed-desc",this.view="tiles",this.foldersPosition="top",this.tileSize="default",this.favorites=[],this.showSideBar=!0,this.showPreview=!1,this.showFavorites=!0}onChangeThemeSetField(){this.theme=this.state.theme}onChangeView(){this.view=this.state.view}onChangeSortBy(){this.sortBy=this.state.sortBy}onChangeTileSize(){this.tileSize=this.state.tileSize}onChangeFavorites(){this.favorites=this.state.favorites}onChangeShowSideBar(){this.showSideBar=this.state.showSideBar}onChangeShowPreview(){this.showPreview=this.state.showPreview}onChangeShowFavorites(){this.showFavorites=this.state.showFavorites}onChangeFoldersPosition(){this.foldersPosition=this.state.foldersPosition}syncWithState(){this.state.tileSize=this.tileSize,this.state.favorites=this.favorites.map((e=>e instanceof u.Z?e:u.Z.create(e))),this.state.view=this.view,this.state.theme=this.theme,this.state.showSideBar=this.showSideBar,this.state.showPreview=this.showPreview,this.state.showFavorites=this.showFavorites,this.state.sortBy=this.sortBy,this.state.foldersPosition=this.foldersPosition}};(0,n.gn)([d.persistent],W.prototype,"theme",void 0),(0,n.gn)([d.persistent],W.prototype,"sortBy",void 0),(0,n.gn)([d.persistent],W.prototype,"view",void 0),(0,n.gn)([d.persistent],W.prototype,"foldersPosition",void 0),(0,n.gn)([d.persistent],W.prototype,"tileSize",void 0),(0,n.gn)([d.persistent],W.prototype,"favorites",void 0),(0,n.gn)([d.persistent],W.prototype,"showSideBar",void 0),(0,n.gn)([d.persistent],W.prototype,"showPreview",void 0),(0,n.gn)([d.persistent],W.prototype,"showFavorites",void 0),(0,n.gn)([(0,d.watch)("state.theme")],W.prototype,"onChangeThemeSetField",null),(0,n.gn)([(0,d.watch)("state.view")],W.prototype,"onChangeView",null),(0,n.gn)([(0,d.watch)("state.sortBy")],W.prototype,"onChangeSortBy",null),(0,n.gn)([(0,d.watch)("state.tileSize")],W.prototype,"onChangeTileSize",null),(0,n.gn)([(0,d.watch)("state.favorites")],W.prototype,"onChangeFavorites",null),(0,n.gn)([(0,d.watch)("state.showSideBar")],W.prototype,"onChangeShowSideBar",null),(0,n.gn)([(0,d.watch)("state.showPreview")],W.prototype,"onChangeShowPreview",null),(0,n.gn)([(0,d.watch)("state.showFavorites")],W.prototype,"onChangeShowFavorites",null),(0,n.gn)([(0,d.watch)("state.foldersPosition")],W.prototype,"onChangeFoldersPosition",null),W=(0,n.gn)([d.component],W);let Y=class e extends q.Hr{className(){return"HistoryManager"}constructor(e,t){super(e),this.state=t,this.history=[],this.historyIndex=0}canNext(){return this.history.length-1>this.historyIndex}canPrevious(){return this.historyIndex>0}push(e){let{historyIndex:t}=this;const s=this.history[t];if(s&&s.currentSource===e.currentSource&&s.currentPath===e.currentPath)return;let i=[...this.history];i.length-1!==t&&(i=i.slice(0,t+1)),i.push(e),s&&(t+=1),this.history=i,this.historyIndex=t}next(){this.canNext()&&(this.historyIndex+=1,this.updateState())}previous(){this.canPrevious()&&(this.historyIndex-=1,this.updateState())}updateCurrent(){this.history[this.historyIndex]={currentSource:this.state.currentSource,currentPath:this.state.currentPath,tree:(0,m.fastClone)(this.state.tree),elements:[...this.state.elements]}}onHome(){this.state.currentPath="",this.state.currentSource="",this.j.e.fire("afterOpenFolder.filebrowser update.filebrowser")}onOpenFolder(){this.push({tree:[],elements:[],currentPath:this.state.currentPath,currentSource:this.state.currentSource}),this.j.e.fire("changeSelection")}updateState(){const{tree:e,elements:t,currentSource:s,currentPath:i}=this.history[this.historyIndex];this.state.activeElements=[],this.state.elements=[...t],this.state.tree=[...e],this.state.currentSource=s,this.state.currentPath=i,this.j.e.fire("changeSelection")}};(0,n.gn)([(0,d.watch)(["state.elements","state.tree"])],Y.prototype,"updateCurrent",null),(0,n.gn)([(0,d.watch)(":goHome.filebrowser")],Y.prototype,"onHome",null),(0,n.gn)([(0,d.watch)(":afterOpenFolder.filebrowser")],Y.prototype,"onOpenFolder",null),Y=(0,n.gn)([d.component],Y);let G=class e extends q.Hr{className(){return"ContextMenuManager"}onFolderContext(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1}onItemContext(e,t,s){return this.buildContextItemMenu(this.getItemContextActions(e),s),!1}onSourceContext(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1}buildContextItemMenu(e,t){if(!this.j.o.contextMenu)return;const s=(0,A.L)(this.j).setMod("theme",this.j.state.theme);s.show(t.clientX,t.clientY,e.filter((e=>e&&!1!==e.enabled))),this.j.e.on(this.j,"afterClose",(()=>{s.isOpened&&s.close()}))}getItemContextActions(e){if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});const t=this.j.options,s=this.j.dataProvider,i=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:!!e.isImage&&t.editImage&&i&&(s.canI("ImageResize")||s.canI("ImageCrop")),exec:()=>{this.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:s.canI("FileRename")&&i,exec:()=>this.j.e.fire("fileRename.filebrowser",e)},{icon:"bin",title:"Delete",enabled:s.canI("FileRemove"),exec:()=>this.j.e.fire("fileRemove.filebrowser",e)},{icon:"eye",title:"Preview",enabled:!(!e.isImage&&"file"!==e.type)&&t.preview&&i,exec:()=>this.j.e.fire("openLightBox.filebrowser",e)},{icon:"upload",title:"Download",exec:()=>{e.fileURL&&this.j.ow.open(e.fileURL)}}]}getFolderContextActions(e){const t=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:()=>{this.j.e.fire("folderRename.filebrowser",e)},enabled:t.canI("FolderRename")},{icon:"bin",title:"Delete",exec:()=>{this.j.e.fire("folderRemove.filebrowser",e)},enabled:t.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)},enabled:t.canI("FolderCreate")}]}getSourceContextActions(e){return[{icon:"plus",title:"Create folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)}}]}};(0,n.gn)([(0,d.watch)(":contextmenuFolder.filebrowser")],G.prototype,"onFolderContext",null),(0,n.gn)([(0,d.watch)(":contextmenuItem.filebrowser")],G.prototype,"onItemContext",null),(0,n.gn)([(0,d.watch)(":contextmenuSource.filebrowser")],G.prototype,"onSourceContext",null),G=(0,n.gn)([d.component],G);const $=e=>{const t=e.split("/").filter((e=>e.length));return t.pop(),t.join("/")||"/"};var J,X=s(1120),Z=s(85475);let Q=J=class e extends h.UIElement{className(){return"UILightBox"}render(){return"<div>\n\t\t\t<div class='&__previous'>*angle-left*</div>\n\t\t\t<div class='&__preview'></div>\n\t\t\t<div class='&__loader'></div>\n\t\t\t<div class='&__next'>*angle-right*</div>\n\t\t</div>"}constructor(e,t,s){super(e),this.current=t,this.elements=s,this.dialog=new h.Dialog;const{dialog:i}=this;i.setMod("theme",e.state.theme).toolbar.setMod("mode","header"),i.open(this),this.elements=this.elements.filter((e=>e.isImage)),i.e.on(i,"afterClose",(()=>{this.destruct()})),this.addGlobalListeners(),this.onChangeCurrent(),i.toolbar.build([{icon:"check",exec:()=>{e.stateManager.addActive(this.current,!1),e.e.fire("select.filebrowser"),i.close()}},"dialog.close"])}async onChangeCurrent(){const{current:e}=this;this.setMod("loading",!0);const t=this.getElm("preview");if((0,m.assert)(null!=t,"preview element does not exist"),h.Dom.detach(t),(0,m.css)(t,{backgroundImage:null}),e.isImage){const s=await(0,m.loadImage)(e.fileURL,this.j);this.dialog.setPosition(),(0,m.css)(t,{width:Math.min(this.jodit.ow.innerWidth,s.naturalWidth),height:Math.min(this.jodit.ow.innerHeight-100,s.naturalHeight),backgroundImage:`url(${s.src})`})}else{const s=await this.makeIframe(e.fileURL);t.appendChild(s)}this.dialog.setSize(),this.dialog.setPosition(),this.setMod("loading",!1)}makeIframe(e){const t=this.j.c.element("iframe");return t.classList.add(this.getFullElName("office-iframe")),t.src=/\.pdf/.test(e)?e:this.j.o.previewOfficeURL+encodeURIComponent(e),t}onPreviousClick(){const{current:e}=this;let t=this.j.stateManager.getIndex(e,this.elements);t>0?t-=1:t=this.elements.length-1,this.current=this.elements[t]}onNextClick(){const{current:e}=this;let t=this.j.stateManager.getIndex(e,this.elements);this.elements.length-1>t?t+=1:t=0,this.current=this.elements[t]}static open(e,t,s){return new J(e,t,s)}addGlobalListeners(){this.j.e.on(this.j.od,"keydown",this.onKeyPress)}onKeyPress(e){if(e.key===k.KEY_LEFT||e.key===k.KEY_RIGHT||e.key===k.KEY_SPACE)return e.key===k.KEY_LEFT?this.onPreviousClick():this.onNextClick(),!1}removeGlobalListeners(){this.j.e.off(this.j.od,"keydown",this.onKeyPress)}destruct(){return this.removeGlobalListeners(),this.dialog.destruct(),super.destruct()}};(0,n.gn)([(0,d.watch)("current")],Q.prototype,"onChangeCurrent",null),(0,n.gn)([(0,d.watch)("previous:click")],Q.prototype,"onPreviousClick",null),(0,n.gn)([(0,d.watch)("next:click")],Q.prototype,"onNextClick",null),(0,n.gn)([d.autobind],Q.prototype,"onKeyPress",null),Q=J=(0,n.gn)([d.component],Q);let ee=class e extends q.Hr{className(){return"LoadingManager"}constructor(e,t){super(e),this.state=t,this.__tick=0,this.offset=0,this.countInOneChunk=20,this.stopLoadingParts=!1,this.__isLoadingPart=!1,this.__callQueueCount=0}async onUpdateFileBrowser(){this.state.activeElements=[],this.j.panel.setMod("loading",!0),await Promise.all([this.loadFolders(),this.loadItems()]),this.j.panel.setMod("loading",!1)}async loadFolders(){if(!this.j.isOpened)return;const{currentPath:e,currentSource:t}=this.state;try{const s=await this.j.dataProvider.tree(e,t);this.j.stateManager.fillTreeForPath(s,e),this.state.sources=s}catch(e){this.j.status(e)}}async loadItems(){if(this.j.isOpened)try{this.__tick+=1;const{__tick:e}=this;this.offset=0,this.stopLoadingParts=!1,this.__callQueueCount=0;const{items:t,loadedTotal:s}=await te(this.state,this.j.dataProvider,this.offset,this.countInOneChunk);if(this.state.elements=t,this.stopLoadingParts=this.countInOneChunk>s,await this.loadItemsChunk(e),await this.async.requestIdlePromise(),this.__tick!==e)return;for(;!this.stopLoadingParts&&this.j.panel.countInColumn*this.j.panel.countInRow>=this.state.elements.length;)if(await this.loadItemsChunk(e),this.__tick!==e)return}catch(e){this.j.status(e)}}async __loadItemsChunk(e){if(this.__isLoadingPart)this.__callQueueCount+=1;else{if(!this.stopLoadingParts){this.__isLoadingPart=!0,this.j.panel.items.setMod("chunk-loading",!0);try{this.offset+=this.countInOneChunk;const{items:t,loadedTotal:s}=await te(this.state,this.j.dataProvider,this.offset,this.countInOneChunk);if(this.__tick!==e)return;this.stopLoadingParts=this.countInOneChunk>s,t.length&&(this.state.elements=this.state.elements.concat(t))}catch(e){this.j.status(e)}return this.j.panel.items.setMod("chunk-loading",!1),this.__isLoadingPart=!1,this.__callQueueCount>0?(this.__callQueueCount-=1,this.__loadItemsChunk(e)):void 0}this.__callQueueCount=0}}loadItemsChunk(e=this.__tick){return e!==this.__tick?Promise.resolve():this.__loadItemsChunk(e)}};function te(e,t,s,i){const{currentPath:n,currentSource:o,sortBy:r,withFolders:a,foldersPosition:l,onlyImages:h,filterWord:c}=e;return t.itemsEx(n,o,{offset:s,limit:i,sortBy:r,withFolders:a,foldersPosition:l,onlyImages:h,filterWord:c})}(0,n.gn)([(0,d.watch)(":update.filebrowser")],ee.prototype,"onUpdateFileBrowser",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource"]),(0,d.debounce)((e=>({timeout:e.defaultTimeout,promisify:!0})))],ee.prototype,"loadFolders",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource","state.sortBy","state.onlyImages","state.foldersPosition","state.filterWord"]),(0,d.debounce)((e=>({timeout:e.defaultTimeout,promisify:!0})))],ee.prototype,"loadItems",null),(0,n.gn)([(0,d.debounce)((e=>({timeout:e.defaultTimeout,promisify:!0})))],ee.prototype,"loadItemsChunk",null),ee=(0,n.gn)([d.component],ee);let se=class e extends c.Vq{className(){return"FileBrowserPro"}lock(e="any"){return this.container.classList.add("jodit_disabled"),super.lock(e)}unlock(){return this.container.classList.remove("jodit_disabled"),super.unlock()}status(e,t=!(e instanceof Error)){(0,m.isAbort)(e)||this.message.message((0,m.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg)}constructor(e){super((0,m.ConfigProto)(Object.assign(e||{},{resizable:!0,draggable:!0,toolbarButtons:(null==e?void 0:e.toolbarButtons)||U.D.defaultOptions.filebrowser.buttons,buttons:X.Jodit.atom(["filebrowser.settings","fullsize","dialog.close"])}),U.D.defaultOptions.filebrowser)),this.dataProvider=(0,A.S)(this,this.options),this.state=(0,h.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1}),this.persistent=new W(this,this.state),this.loadingManager=new ee(this,this.state),this.stateManager=new L(this.state),this.historyManager=new Y(this,this.state),this.contextMenuManager=new G(this),this.header=new O(this,this.options,this.stateManager),this.panel=new E(this,this.stateManager),this.files=this.panel,this.tree=this.panel,this.progressbar=new K(this,this.stateManager.state),Z.V.make(this),!this.persistent.theme&&this.options.theme&&(this.persistent.theme=this.options.theme),this.panel.append(this.progressbar),this.toolbar.setMod("mode","header"),this.setSize(Math.min(this.options.width,screen.width),Math.min(this.options.height,screen.height)).setHeader(this.header),this.onResizeWindow(),this.initUploader(),this.onChangeTheme(),this.fullFillOptions(),this.dataProvider.onProgress((e=>{0===e&&(e=30),this.state.progress=e})),this.e.on("beforeClose",this.removeGlobalListeners),this.e.fire("afterInit"),X.Jodit.prototype.afterInitHook.call(this)}addDisclaimer(e){this.dialog.appendChild(e)}async open(e=this.o.defaultCallback,t){return this.state.onlyImages=!!t,this.prepareOpening(e),super.open(this.panel.container),this.e.fire("update.filebrowser")}onResizeWindow(){(0,m.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})}onChangePath(){const{currentPath:e,currentSource:t}=this.state;this.uploader.setPath(e),this.uploader.setSource(t)}onChangeTheme(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme}onToggleSettings(){this.state.showSettings=!this.state.showSettings}prepareOpening(e){this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=t=>{this.close(),e(t)}),this.persistent.syncWithState()}registerGlobalListeners(){this.e.on(this.ow,"keydown",this.onKeyPress)}onKeyPress(e){const{activeElement:t}=this.od;if(!this.state.activeElements.length||!t||!h.Dom.isOrContains(this.panel.items.container,t))return;const s=this.state.elements;switch(e.key){case k.KEY_ENTER:return this.onChooseItems();case k.KEY_DELETE:return this.onFileRemove();case k.KEY_RIGHT:case k.KEY_LEFT:case k.KEY_DOWN:case k.KEY_UP:{const t=e.key===k.KEY_RIGHT||e.key===k.KEY_DOWN,i=this.state.lastSelectedIndex;let n;if([k.KEY_RIGHT,k.KEY_LEFT].includes(e.key))n=t?s[i+1]?i+1:0:s[i-1]?i-1:s.length-1;else{const{countInRow:e}=this.panel;n=Math.round(((i+1)/e+(t?1:-1))*e-1)}return s[n]&&this.stateManager.addActive(s[n],e.shiftKey),!1}}}removeGlobalListeners(){this.e.off(this.ow,"keydown",this.onKeyPress)}onFileRemove(){this.state.activeElements.length&&this.confirm("Are you sure?","Delete",(e=>{e&&this.__itemsRemove(this.state.activeElements)})).bindDestruct(this)}__itemsRemove(e){if(!e.length)return Promise.resolve();const t=[];return e.forEach((e=>{t.push("folder"===e.type?this.__folderRemove($(e.path),e.name,e.sourceName):this.__removeFile(e.file||e.name||"",e.sourceName))})),this.state.activeElements.forEach((e=>{this.stateManager.isFavorite(e)&&this.stateManager.toggleFavorite(e)})),this.state.activeElements=[],Promise.allSettled(t).then((()=>Promise.allSettled([this.loadingManager.loadItems(),this.loadingManager.loadFolders()])))}__removeFile(e,t){return this.dataProvider.fileRemove(this.state.currentPath,e,t).then((t=>{this.status(t||this.i18n('File "%s" was deleted',e),!0)})).catch(this.status)}__folderRemove(e,t,s){return this.dataProvider.folderRemove(e,t,s).then((i=>{this.status(i||this.i18n('Folder "%s" was deleted',t),!0),this.state.currentPath===e&&(this.state.currentPath=$(e),this.state.currentSource=s)})).catch(this.status)}onFileEdit(){if(1===this.state.activeElements.length){const[e]=this.state.activeElements;D.r.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}}onFolderRename(e){this.prompt("Enter new name","Rename",(t=>{if(!(0,m.isValidName)(t)||t===e.name)return this.status(this.i18n("Enter new name")),!1;this.dataProvider.folderRename($(e.path),e.name,t,e.sourceName).then((s=>{this.state.activeElements=[],this.status(s,!0),this.state.currentPath=$(e.path)+"/"+t,this.state.currentSource=e.sourceName,this.historyManager.updateCurrent(),this.loadingManager.loadFolders()})).catch(this.status)}),this.i18n("type name"),e.name).bindDestruct(this)}onFolderRemove(e){this.confirm("Are you sure?","Delete",(t=>{t&&this.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])})).bindDestruct(this)}onFolderCreate(e){this.prompt("Enter Directory name","Create directory",(t=>{const s=e.path||"/";this.dataProvider.createFolder(t,e.path||"/",e.sourceName).then((()=>{this.state.currentSource===e.sourceName&&this.state.currentPath===s?this.e.fire("update.filebrowser"):(this.state.currentSource=e.sourceName,this.state.currentPath=s),this.historyManager.updateCurrent()}),this.status)}),this.i18n("type name")).bindDestruct(this)}onFileRename(e){const t=e.file||e.name||"";1===this.state.activeElements.length&&t&&this.prompt("Enter new name","Rename",(e=>{if(!(0,m.isValidName)(e))return this.status(this.i18n("Enter new name")),!1;this.dataProvider.fileRename(this.state.currentPath,t,e,this.state.currentSource).then((e=>{this.state.activeElements=[],this.status(e,!0),this.loadingManager.loadItems()})).catch(this.status)}),this.i18n("type name"),t).bindDestruct(this)}onChooseItems(){const e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type)return this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,void this.e.fire("afterOpenFolder.filebrowser");this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}}onOpenLightBox(e){Q.open(this,e,this.state.elements)}initUploader(){const e=this,t=(0,m.ConfigProto)(e.o.uploader||{},U.D.defaultOptions.uploader),s=()=>this.loadingManager.loadItems();e.uploader=e.getInstance("Uploader",t),e.uploader.bind(e.panel.container,s,e.status),e.e.on("bindUploader.filebrowser",(t=>{e.uploader.bind(t,s,e.status)}))}destruct(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),super.destruct()}fullFillOptions(){["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach((e=>{null!=this.options[e]&&(this.options[e]=(0,m.ConfigProto)(this.options[e],this.o.ajax))}))}};(0,n.gn)([d.autobind],se.prototype,"status",null),(0,n.gn)([(0,d.watch)(":resize",window)],se.prototype,"onResizeWindow",null),(0,n.gn)([(0,d.watch)(["state.currentPath","state.currentSource"])],se.prototype,"onChangePath",null),(0,n.gn)([(0,d.watch)("state.theme")],se.prototype,"onChangeTheme",null),(0,n.gn)([(0,d.watch)(":toggleSettings.filebrowser")],se.prototype,"onToggleSettings",null),(0,n.gn)([d.autobind],se.prototype,"onKeyPress",null),(0,n.gn)([d.autobind],se.prototype,"removeGlobalListeners",null),(0,n.gn)([(0,d.watch)(":fileRemove.filebrowser")],se.prototype,"onFileRemove",null),(0,n.gn)([(0,d.watch)(":edit.filebrowser")],se.prototype,"onFileEdit",null),(0,n.gn)([(0,d.watch)(":folderRename.filebrowser")],se.prototype,"onFolderRename",null),(0,n.gn)([(0,d.watch)(":folderRemove.filebrowser")],se.prototype,"onFolderRemove",null),(0,n.gn)([(0,d.watch)(":folderCreate.filebrowser")],se.prototype,"onFolderCreate",null),(0,n.gn)([(0,d.watch)(":fileRename.filebrowser")],se.prototype,"onFileRename",null),(0,n.gn)([(0,d.watch)(":select.filebrowser")],se.prototype,"onChooseItems",null),(0,n.gn)([(0,d.watch)(":openLightBox.filebrowser")],se.prototype,"onOpenLightBox",null),se=(0,n.gn)([d.component,(0,d.derive)(V.lf)],se),Object.defineProperty(X.Jodit.modules,"FileBrowserPro",{value:se,writable:!1,enumerable:!0,configurable:!0}),(0,s(78855).xl)(s(91190));const ie=U.D.prototype.controls.filebrowser;ie.settings={icon:"settings",tooltip:"Settings",exec(e){var t;(null!==(t=e.parent)&&void 0!==t?t:e).e.fire("toggleSettings.filebrowser")}},ie.home={icon:"home",tooltip:"Home",exec(e){e.e.fire("goHome.filebrowser")}},ie.preview={icon:"eye",tooltip:"Preview",isDisabled:e=>0===e.state.activeElements.length,exec(e){e.e.fire("togglePreview.filebrowser")}},ie.next={icon:"angle-right",tooltip:"History next",isDisabled(e){return!e.historyManager.canNext()},exec(e){e.historyManager.next()}},ie.previous={icon:"angle-left",tooltip:"History previous",isDisabled(e){return!e.historyManager.canPrevious()},exec(e){e.historyManager.previous()}},ie["new-folder"]={icon:"new-folder",exec(e){e.e.fire("folderCreate.filebrowser",{path:e.state.currentPath,sourceName:e.state.currentSource})},tooltip:"New folder"},Object.assign(U.D.prototype.filebrowser,{buttons:["filebrowser.home","filebrowser.previous","filebrowser.next","|","filebrowser.upload","filebrowser.new-folder","filebrowser.remove","filebrowser.update","filebrowser.select","filebrowser.edit","|","filebrowser.preview","about"],sort:!1,pixelOffsetLoadNewChunk:300,width:800,height:400,previewOfficeURL:"https://view.officeapps.live.com/op/view.aspx?src="});class ne extends i.S{constructor(){super(...arguments),this.requires=["license"],this.hasStyle=!X.Jodit.fatMode}afterInit(e){e.e.on("getInstanceFileBrowser",(e=>(this.__instance||(this.__instance=new se(e)),this.__instance)))}beforeDestruct(e){var t;e.e.off("getInstanceFileBrowser"),null===(t=this.__instance)||void 0===t||t.destruct()}}X.Jodit.plugins.add("finder",ne)},91190(e,t,s){"use strict";s.r(t),s.d(t,{ru(){return i}});const i=s(99425)},70655(e,t,s){"use strict";function i(e,t,s,i){var n,o=arguments.length,r=3>o?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(3>o?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r}s.d(t,{gn(){return i}})},99425(e){e.exports={Favorites:"Избранное",Settings:"Настройки",Light:"Светлая",Dark:"Темная",Theme:"Тема",Show:"Показать",Hide:"Скрыть","Show favorites":"Показывать избранное",Tiles:"Плитка",List:"Список",Compact:"Компактный",View:"Отображение","Folders position":"Позиция папок","Sort by":"Сортировать по","Extra small":"Очень маленькие",Small:"Маленькие",Large:"Большие","Extra large":"Очень большие","Tile size":"Размер плитки"}},21601(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},67101(e){e.exports='<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M28.7,16.3l-12-13c-0.4-0.4-1.1-0.4-1.5,0l-12,13C3,16.6,2.9,17,3.1,17.4C3.2,17.8,3.6,18,4,18h3v10c0,0.6,0.4,1,1,1h16 c0.6,0,1-0.4,1-1V18h3c0.4,0,0.8-0.2,0.9-0.6C29.1,17,29,16.6,28.7,16.3z"/> </svg>'},34839(e){e.exports='<svg viewBox="0 0 252 252" xmlns="http://www.w3.org/2000/svg"> <path d="M0 16C0 7.16344 7.16344 0 16 0H85.6364C86.5205 0 87.3797 0.29288 88.0796 0.832871L120.92 26.1671C121.62 26.7071 122.48 27 123.364 27H227C235.837 27 243 34.1634 243 43V132.335C243 134.779 240.234 136.198 238.25 134.772L233 131L226.5 127L220 124L212.5 122L202.5 120L189 120.5L179.5 122.5L170.5 125.5L161.5 130.5L157 133.5L153 137L146.5 144L141 152L137 160L134 168L132.5 178L132 183.5V189.5L133 197.5L135 205.5L137.5 211.5L139.524 214.996C141.068 217.663 139.144 221 136.062 221H16C7.16344 221 0 213.837 0 205V16Z"/> <circle cx="197" cy="185" r="56"/> <path d="M188.364 215.955V151.591H204.636V215.955H188.364ZM164.318 191.909V175.636H228.682V191.909H164.318Z" fill="white"/> </svg>'}},e=>e(e.s=30861)])}));