OCA.Trashbin={},OCA.Trashbin.App={_initialized:!1,client:null,initialize(e){if(this._initialized)return;this._initialized=!0,this.client=newOC.Files.Client({host:OC.getHost(),port:OC.getPort(),root:OC.linkToRemoteBase("dav")+"/trashbin/"+OC.getCurrentUser().uid,useHTTPS:"https"===OC.getProtocol()});constn=OC.Util.History.parseUrlQuery();this.fileList=newOCA.Trashbin.FileList($("#app-content-trashbin"),{fileActions:this._createFileActions(),detailsViewEnabled:!1,scrollTo:n.scrollto,config:OCA.Files.App.getFilesConfig(),multiSelectMenu:[{name:"restore",displayName:t("files_trashbin","Restore"),iconClass:"icon-history"},{name:"delete",displayName:t("files_trashbin","Delete permanently"),iconClass:"icon-delete"}],client:this.client,shown:!0})},_createFileActions(){conste=this.client,n=newOCA.Files.FileActions;returnn.register("dir","Open",OC.PERMISSION_READ,"",(function(e,t){constn=t.fileList.getCurrentDirectory();t.fileList.changeDirectory(OC.joinPaths(n,e))})),n.setDefault("dir","Open"),n.registerAction({name:"Restore",displayName:t("files_trashbin","Restore"),type:OCA.Files.FileActions.TYPE_INLINE,mime:"all",permissions:OC.PERMISSION_READ,iconClass:"icon-history",actionHandler(n,i){constr=i.fileList,o=r.findFileEl(n);r.showFileBusyState(o,!0);consta=i.fileList.getCurrentDirectory();e.move(OC.joinPaths("trash",a,n),OC.joinPaths("restore",n),!0).then(r._removeCallback.bind(r,[n]),(function(){r.showFileBusyState(o,!1),OC.Notification.show(t("files_trashbin","Error while restoring file from trashbin"))}))}}),n.registerAction({name:"Delete",displayName:t("files_trashbin","Delete permanently"),mime:"all",permissions:OC.PERMISSION_READ,iconClass:"icon-delete",render(e,i,r){consto=n._makeActionLink(e,r);returno.attr("original-title",t("files_trashbin","Delete permanently")),o.children("img").attr("alt",t("files_trashbin","Delete permanently")),r.$file.find("td:last").append(o),o},actionHandler(n,i){constr=i.fileList;$(".tipsy").remove();consto=r.findFileEl(n);r.showFileBusyState(o,!0);consta=i.fileList.getCurrentDirectory();e.remove(OC.joinPaths("trash",a,n)).then(r._removeCallback.bind(r,[n]),(function(){r.showFileBusyState(o,!1),OC.Notification.show(t("files_trashbin","Error while removing file from trashbin"))}))}}),n}},window.addEventListener("DOMContentLoaded",(function(){$("#app-content-trashbin").one("show",(function(){OCA.Trashbin.App.initialize($("#app-content-trashbin"))}))}))},function(e,n){
!function(){vare=newRegExp(/^(.+)\.d[0-9]+$/),n="{http://nextcloud.org/ns}trashbin-filename",i="{http://nextcloud.org/ns}trashbin-deletion-time",r="{http://nextcloud.org/ns}trashbin-original-location",o="{http://nextcloud.org/ns}trashbin-title";functiona(t){t=OC.basename(t);varn=e.exec(t);returnn&&n.length>1&&(t=n[1]),t}vars=function(e,t){this.client=t.client,this.initialize(e,t)};s.prototype=_.extend({},OCA.Files.FileList.prototype,{id:"trashbin",appName:t("files_trashbin","Deleted files"),client:null,initialize:function(){this.client.addFileInfoParser((function(e,t){vara=e.propStat[0].properties,s=a[r],l=a[o];return{displayName:a[n],mtime:1e3*parseInt(a[i],10),hasPreview:!0,path:s,extraData:l}}));vare=OCA.Files.FileList.prototype.initialize.apply(this,arguments);returnthis.$el.find(".undelete").click("click",_.bind(this._onClickRestoreSelected,this)),this.setSort("mtime","asc"),this.breadcrumb._makeCrumbs=function(){for(vare=OCA.Files.BreadCrumb.prototype._makeCrumbs.apply(this,[...arguments,"icon-delete no-hover"]),t=1;t<e.length;t++)e[t].name=a(e[t].name);returne},OC.Plugins.attach("OCA.Trashbin.FileList",this),e},getDirectoryPermissions:function(){returnOC.PERMISSION_READ|OC.PERMISSION_DELETE},_setCurrentDir:function(e){OCA.Files.FileList.prototype._setCurrentDir.apply(this,arguments);vart=OC.basename(e);""!==t&&this.setPageTitle(a(t))},_createRow:function(){vare=OCA.Files.FileList.prototype._createRow.apply(this,arguments);returne.find("td.filesize").remove(),e},getAjaxUrl:function(e,t){varn="";returnt&&(n="?"+OC.buildQueryString(t)),OC.filePath("files_trashbin","ajax",e+".php")+n},setupUploadEvents:function(){},linkTo:function(e){returnOC.linkTo("files","index.php")+"?view=trashbin&dir="+encodeURIComponent(e).replace(/%2F/g,"/")},elementToFile:function(e){vart=OCA.Files.FileList.prototype.elementToFile(e);return"/"===this.getCurrentDirectory()&&(t.displayName=a(t.name)),deletet.size,t},updateEmptyContent:function(){vare=this.$fileList.find("tr:first").exists();this.$el.find("#emptycontent").toggleClass("hidden",e),this.$el.find("#filestable th").toggleClass("hidden",!e)},_removeCallback:function(e){for(vart,n=0;n<e.length;n++)t=this.remove(OC.basename(e[n]),{updateSummary:!1}),this.fileSummary.remove({type:t.attr("data-type"),size:t.attr("data-size")});this.fileSummary.update(),this.updateEmptyContent()},_onClickRestoreSelected:function(e){e.preventDefault();for(varn=this,i=_.pluck(this.getSelectedFiles(),"name"),r=0;r<i.length;r++){varo=this.findFileEl(i[r]);this.showFileBusyState(o,!0)}this.fileMultiSelectMenu.toggleLoading("restore",!0);vara=i.map((function(e){returnn.client.move(OC.joinPaths("trash",n.getCurrentDirectory(),e),OC.joinPaths("restore",e),!0).then((function(){n._removeCallback([e])}))}));returnPromise.all(a).then((function(){n.fileMultiSelectMenu.toggleLoading("restore",!1)}),(function(){OC.Notification.show(t("files_trashbin","Error while restoring files from trashbin"))}))},_onClickDeleteSelected:function(e){e.preventDefault();for(varn=this,i=this.$el.find(".select-all").is(":checked"),r=_.pluck(this.getSelectedFiles(),"name"),o=0;o<r.length;o++){vara=this.findFileEl(r[o]);this.showFileBusyState(a,!0)}if(i)returnthis.client.remove(OC.joinPaths("trash",this.getCurrentDirectory())).then((function(){n.hideMask(),n.setFiles([])}),(function(){OC.Notification.show(t("files_trashbin","Error while emptying trashbin"))}));this.fileMultiSelectMenu.toggleLoading("delete",!0);vars=r.map((function(e){returnn.client.remove(OC.joinPaths("trash",n.getCurrentDirectory(),e)).then((function(){n._removeCallback([e])}))}));returnPromise.all(s).then((function(){n.fileMultiSelectMenu.toggleLoading("delete",!1)}),(function(){OC.Notification.show(t("files_trashbin","Error while removing files from trashbin"))}))},_onClickFile:function(e){vart=$(this).parent().parent().data("mime");return"httpd/unix-directory"!==t&&e.preventDefault(),OCA.Files.FileList.prototype._onClickFile.apply(this,arguments)},generatePreviewUrl:function(e){returnOC.generateUrl("/apps/files_trashbin/preview?")+$.pa