2025-09-18 09:54:53 -04:00
|
|
|
(()=>{"use strict";var e,t,r,n={21769:(e,t,r)=>{var n=r(35810),i=r(21777),a=r(85168),o=r(61338),s=r(53334),c=r(71225),l=r(63814),u=r(65043),d=r(85471),p=r(77764);const E=new n.VP({id:"files_trashbin--original-location",title:(0,s.t)("files_trashbin","Original location"),render(e){const t=m(e),r=document.createElement("span");return r.title=t,r.textContent=t,r},sort(e,t){const r=m(e),n=m(t);return r.localeCompare(n,[(0,s.Z0)(),(0,s.lO)()],{numeric:!0,usage:"sort"})}}),f=new n.VP({id:"files_trashbin--deleted-by",title:(0,s.t)("files_trashbin","Deleted by"),render(e){const{userId:t,displayName:r,label:n}=g(e);if(n){const e=document.createElement("span");return e.textContent=n,e}return new(d.Ay.extend(p.A))({propsData:{size:32,user:t??void 0,displayName:r??t}}).$mount().$el},sort(e,t){const r=g(e),n=r.label??r.displayName??r.userId,i=g(t),a=i.label??i.displayName??i.userId;return n.localeCompare(a,[(0,s.Z0)(),(0,s.lO)()],{numeric:!0,usage:"sort"})}}),h=new n.VP({id:"files_trashbin--deleted",title:(0,s.t)("files_trashbin","Deleted"),render(e){const t=e.attributes?.["trashbin-deletion-time"]||(e?.mtime?.getTime()??0)/1e3,r=document.createElement("span");if(t){const e=Intl.DateTimeFormat([(0,s.lO)()],{dateStyle:"long",timeStyle:"short"}),n=new Date(1e3*t);return r.title=e.format(n),r.textContent=(0,s.fw)(n,{ignoreSeconds:(0,s.t)("files","few seconds ago")}),r}return r.textContent=(0,s.t)("files_trashbin","A long time ago"),r},sort(e,t){const r=e.attributes?.["trashbin-deletion-time"]||(e?.mtime?.getTime()??0)/1e3;return(t.attributes?.["trashbin-deletion-time"]||(t?.mtime?.getTime()??0)/1e3)-r}});function m(e){const t=T(e.attributes?.["trashbin-original-location"]);if(!t)return(0,s.t)("files_trashbin","Unknown");const r=(0,c.pD)(t);return r===t?(0,s.t)("files_trashbin","All files"):r.replace(/^\//,"")}function g(e){const t=T(e.attributes?.["trashbin-deleted-by-id"]),r=T(e.attributes?.["trashbin-deleted-by-display-name"]);let n;const a=(0,i.HW)()?.uid;return t===a&&(n=(0,s.t)("files_trashbin","You")),t||r||(n=(0,s.t)("files_trashbin","Unknown")),{userId:t,displayName:r,label:n}}function T(e){return e?String(e):null}const I=`/trashbin/${(0,i.HW)()?.uid}/trash`,N=(0,n.H4)(),_=`<?xml version="1.0"?>\n<d:propfind ${(0,n.CP)()}>\n\t<d:prop>\n\t\t<nc:trashbin-deletion-time />\n\t\t<nc:trashbin-original-location />\n\t\t<nc:trashbin-title />\n\t\t<nc:trashbin-deleted-by-id />\n\t\t<nc:trashbin-deleted-by-display-name />\n\t\t${(0,n.VX)()}\n\t</d:prop>\n</d:propfind>`,w=e=>{const t=(0,n.Al)(e,I);return t.attributes.previewUrl=(0,l.Jv)("/apps/files_trashbin/preview?fileId={fileid}&x=32&y=32",{fileid:t.fileid}),t};var b=r(3153);const A="trashbin",v=new n.Ss({id:A,name:(0,s.t)("files_trashbin","Deleted files"),caption:(0,s.t)("files_trashbin","List of files that have been deleted."),emptyTitle:(0,s.t)("files_trashbin","No deleted files"),emptyCaption:(0,s.t)("files_trashbin","Files and folders you have deleted will show up here"),icon:b,order:50,sticky:!0,defaultSortKey:"deleted",columns:[E,f,h],getContents:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=(await N.getDirectoryContents(`${I}${e}`,{details:!0,data:_,includeSelf:!0})).data.map(w),[r]=t.splice(t.findIndex(t=>t.path===e),1);return{folder:r,contents:t}}});var y=r(35947);const O=(0,y.YK)().setApp("files").detectUser().build(),R=new n.hY({id:"restore",displayName:()=>(0,s.t)("files_trashbin","Restore"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-history" viewBox="0 0 24 24"><path d="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3" /></svg>',enabled:(e,t)=>t.id===A&&e.length>0&&e.map(e=>e.permissions).every(e=>Boolean(e&n.aX.READ)),async exec(e){try{const t=(0,l.dC)((0,c.O0)(`dav/trashbin/${(0,i.HW)().uid}/restore/${e.basename}`));return await u.Ay.request({method:"MOVE",url:e.encodedSource,headers:{destination:t}}),(0,o.Ic)("files:node:del
|