/*! For license information please see files_trashbin-init.js.LICENSE.txt */
(()=>{"use strict";var e,t={29276:(e,t,n)=>{var i=n(85072),r=n.n(i),o=n(97825),l=n.n(o),s=n(77659),a=n.n(s),d=n(55056),c=n.n(d),u=n(10540),h=n.n(u),v=n(41113),f=n.n(v),p=n(98290),b={};b.styleTagTransform=f(),b.setAttributes=c(),b.insert=a().bind(null,"head"),b.domAPI=l(),b.insertStyleElement=h(),r()(p.A,b),p.A&&p.A.locals&&p.A.locals;var m,g=n(53334),w=n(19231),A=n(31346),y=n(21777);const x="/trashbin/".concat(null===(m=(0,y.HW)())||void 0===m?void 0:m.uid,"/trash"),_=(0,A.H4)();var T=n(63814);const C='\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t").concat((0,A.VX)(),"\n\t\n"),O=e=>{const t=(0,A.Al)(e,x);return t.attributes.previewUrl=(0,T.Jv)("/apps/files_trashbin/preview?fileId={fileid}&x=32&y=32",{fileid:t.fileid}),t};var H=n(61338),S=n(65043);const L=(0,n(35947).YK)().setApp("files").detectUser().build();var P=n(71225);(0,A.Gg)(new A.hY({id:"restore",displayName:()=>(0,g.Tl)("files_trashbin","Restore"),iconSvgInline:()=>'',enabled:(e,t)=>"trashbin"===t.id&&e.length>0&&e.map((e=>e.permissions)).every((e=>0!=(e&A.aX.READ))),async exec(e){try{var t;const n=(0,T.dC)((0,P.O0)("dav/trashbin/".concat(null===(t=(0,y.HW)())||void 0===t?void 0:t.uid,"/restore/").concat(e.basename)));return await(0,S.Ay)({method:"MOVE",url:e.encodedSource,headers:{destination:n}}),(0,H.Ic)("files:node:deleted",e),!0}catch(e){return L.error(e),!1}},async execBatch(e,t,n){return Promise.all(e.map((e=>this.exec(e,t,n))))},order:1,inline:()=>!0}));const j=e=>{var t,n;const i=void 0!==(null===(t=e.attributes)||void 0===t?void 0:t["trashbin-original-location"])?String(null===(n=e.attributes)||void 0===n?void 0:n["trashbin-original-location"]):null;if(!i)return(0,g.Tl)("files_trashbin","Unknown");const r=(0,P.pD)(i);return r===i?(0,g.Tl)("files_trashbin","All files"):(0,P.HS)((0,g.Tl)("files_trashbin","All files"),r)};(0,A.bh)().register(new A.Ss({id:"trashbin",name:(0,g.Tl)("files_trashbin","Deleted files"),caption:(0,g.Tl)("files_trashbin","List of files that have been deleted."),emptyTitle:(0,g.Tl)("files_trashbin","No deleted files"),emptyCaption:(0,g.Tl)("files_trashbin","Files and folders you have deleted will show up here"),icon:'',order:50,sticky:!0,defaultSortKey:"deleted",columns:[new A.VP({id:"original-location",title:(0,g.Tl)("files_trashbin","Original location"),render(e){const t=j(e),n=document.createElement("span");return n.title=t,n.textContent=t,n},sort(e,t){const n=j(e),i=j(t);return n.localeCompare(i)}}),new A.VP({id:"deleted",title:(0,g.Tl)("files_trashbin","Deleted"),render(e){var t;const n=null===(t=e.attributes)||void 0===t?void 0:t["trashbin-deletion-time"],i=document.createElement("span");return n?(i.title=w.A.unix(n).format("LLL"),i.textContent=w.A.unix(n).fromNow(),i):(i.textContent=(0,g.Tl)("files_trashbin","A long time ago"),i)},sort(e,t){var n,i;const r=(null===(n=e.attributes)||void 0===n?void 0:n["trashbin-deletion-time"])||(null==e?void 0:e.mtime)||0;return((null===(i=t.attributes)||void 0===i?void 0:i["trashbin-deletion-time"])||(null==t?void 0:t.mtime)||0)-r}})],getContents:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=(await _.getDirectoryContents("".concat(x).concat(e),{details:!0,data:C,includeSelf:!0})).data.map(O),[n]=t.splice(t.findIndex((t=>t.path===e)),1);return{folder:n,contents:t}}}))},98290:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(71354),r=n.n(i),o=n(76314),l=n.n(o)()(r());l.push([e.id,".files-list__row-trashbin-original-location{width:150px !important}","",{version:3,sources:["webpack://./apps/files_trashbin/src/trashbin.scss"],names:[],mappings:"AAAA,4CACE,sBAAA",sourcesContent:[".files-list__row-trashbin-original-location {\n width: 150px !important;\n}\n"],sourceRoot:""}]);const s=l}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=t,e=[],i.O=(t,n,r,o)=>{if(!n){var l=1/0;for(c=0;c=o)&&Object.keys(i.O).every((e=>i.O[e](n[a])))?n.splice(a--,1):(s=!1,o0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[n,r,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=2573,(()=>{i.b=document.baseURI||self.location.href;var e={2573:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,l=n[0],s=n[1],a=n[2],d=0;if(l.some((t=>0!==e[t]))){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);if(a)var c=a(i)}for(t&&t(n);di(29276)));r=i.O(r)})();
//# sourceMappingURL=files_trashbin-init.js.map?v=98df354b4a78ee94a3a3