/*! For license information please see files-init.js.LICENSE.txt */ (()=>{var e,s,t,n={9052:e=>{"use strict";var s=Object.prototype.hasOwnProperty,t="~";function n(){}function a(e,s,t){this.fn=e,this.context=s,this.once=t||!1}function i(e,s,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var r=new a(n,i||e,o),l=t?t+s:s;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],r]:e._events[l].push(r):(e._events[l]=r,e._eventsCount++),e}function o(e,s){0==--e._eventsCount?e._events=new n:delete e._events[s]}function r(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(t=!1)),r.prototype.eventNames=function(){var e,n,a=[];if(0===this._eventsCount)return a;for(n in e=this._events)s.call(e,n)&&a.push(t?n.slice(1):n);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},r.prototype.listeners=function(e){var s=t?t+e:e,n=this._events[s];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,i=n.length,o=new Array(i);a{"use strict";t.d(s,{A:()=>n});const n=(0,t(35947).YK)().setApp("files").detectUser().build()},33001:(e,s,t)=>{"use strict";var n=t(31346),a=t(85168),i=t(53334),o=t(49264),r=t(76150),l=t(61338),m=t(87485),d=t(65043);const g=()=>{var e;return!0===(null===(e=(0,m.F)())||void 0===e||null===(e=e.files)||void 0===e?void 0:e.undelete)},c=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"])),u=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"])),f=(e,s)=>c(e)?1===e.length?(0,i.t)("files","Leave this share"):(0,i.t)("files","Leave these shares"):u(e)?1===e.length?(0,i.t)("files","Disconnect storage"):(0,i.t)("files","Disconnect storages"):"trashbin"!==s.id&&g()?(e=>{if(1===e.length)return!1;const s=e.some((e=>c([e]))),t=e.some((e=>!c([e])));return s&&t})(e)?(0,i.t)("files","Delete and unshare"):(e=>!e.some((e=>e.type!==n.pt.File)))(e)?1===e.length?(0,i.t)("files","Delete file"):(0,i.t)("files","Delete files"):(e=>!e.some((e=>e.type!==n.pt.Folder)))(e)?1===e.length?(0,i.t)("files","Delete folder"):(0,i.t)("files","Delete folders"):(0,i.t)("files","Delete"):(0,i.t)("files","Delete permanently"),p=async(e,s)=>{const t="trashbin"!==s.id&&g()?(0,i.n)("files","You are about to delete {count} item","You are about to delete {count} items",e.length,{count:e.length}):(0,i.n)("files","You are about to permanently delete {count} item","You are about to permanently delete {count} items",e.length,{count:e.length});return new Promise((n=>{window.OC.dialogs.confirmDestructive(t,(0,i.t)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:f(e,s),confirmClasses:"error",cancel:(0,i.t)("files","Cancel")},(e=>{n(e)}))}))},h=async e=>{await d.Ay.delete(e.encodedSource),(0,l.Ic)("files:node:deleted",e)},w=new o.A({concurrency:5}),v=new n.hY({id:"delete",displayName:f,iconSvgInline:e=>c(e)?'':u(e)?'':'',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>Boolean(e&n.aX.DELETE))),async exec(e,s){try{let t=!0;return g()||(t=await p([e],s)),!1===t?((0,a.cf)((0,i.Tl)("files","Deletion cancelled")),null):(await h(e),!0)}catch(s){return r.A.error("Error while deleting a file",{error:s,source:e.source,node:e}),!1}},async execBatch(e,s){let t=!0;if(g()?e.length>=5&&!c(e)&&!u(e)&&(t=await p(e,s)):t=await p(e,s),!1===t)return(0,a.cf)((0,i.Tl)("files","Deletion cancelled")),Promise.all(e.map((()=>null)));const n=e.map((e=>new Promise((s=>{w.add((async()=>{try{await h(e),s(!0)}catch(t){r.A.error("Error while deleting a file",{error:t,source:e.source,node:e}),s(!1)}}))}))));return Promise.all(n)},order:100});var T=t(63814);const y=function(e){const s=document.createElement("a");s.download="",s.href=e,s.click()};function C(e,s){const t=e.split("/").filter(Boolean),n=s.split("/").filter(Boolean);let a="/";for(const[e,i]of t.entries()){if(e>=s.length)break;if(i!==n[e])break;const t="/"===a?"":"/";a="".concat(a).concat(t).concat(i)}return a}function x(e){const s=e.filter((s=>void 0===e.find((e=>e.type===n.pt.Folder&&s.path.startsWith("".concat(e.path,"/"))))));let t=s[0].dirname;for(const e of s.slice(1))t=C(t,e.dirname);t=t||"/";const a=s.map((e=>e.path.slice("/"===t?1:t.length+1))),i=Math.random().toString(36).substring(2),o=(0,T.Jv)("/apps/files/ajax/download.php?dir={base}&files={files}&downloadStartSecret={secret}",{base:t,secret:i,files:JSON.stringify(a)});y(o)}const k=function(e){if(0==(e.permissions&n.aX.READ))return!1;if("shared"===e.attributes["mount-type"]){var s,t;const n=JSON.parse(null!==(s=e.attributes["share-attributes"])&&void 0!==s?s:"null"),a=null==n||null===(t=n.find)||void 0===t?void 0:t.call(n,(e=>"permissions"===e.scope&&"download"===e.key));if(void 0!==a&&!1===a.enabled)return!1}return!0},b=new n.hY({id:"download",default:n.m9.DEFAULT,displayName:()=>(0,i.Tl)("files","Download"),iconSvgInline:()=>'',enabled:e=>0!==e.length&&(!e.some((e=>e.type===n.pt.Folder))||!e.some((e=>{var s;return!(null!==(s=e.root)&&void 0!==s&&s.startsWith("/files"))})))&&e.every(k),exec:async(e,s,t)=>e.type===n.pt.Folder?(x([e]),null):(y(e.encodedSource),null),async execBatch(e,s,t){return 1===e.length?(this.exec(e[0],s,t),[null]):(x(e),new Array(e.length).fill(null))},order:30});var L=t(71225),F=t(21777);const U=async function(e){const s=(0,T.KT)("apps/files/api/v1")+"/openlocaleditor?format=json";try{var t;const n=await d.Ay.post(s,{path:e}),a=null===(t=(0,F.HW)())||void 0===t?void 0:t.uid;let i="nc://open/".concat(a,"@")+window.location.host+(0,L.O0)(e);i+="?token="+n.data.ocs.data.token,window.location.href=i}catch(e){(0,a.Qg)((0,i.Tl)("files","Failed to redirect to client"))}},S=new n.hY({id:"edit-locally",displayName:()=>(0,i.Tl)("files","Edit locally"),iconSvgInline:()=>'',enabled:e=>1===e.length&&0!=(e[0].permissions&n.aX.UPDATE),exec:async e=>((async e=>{U(e),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},s=!1;(new a.ik).setName((0,i.Tl)("files","Edit file locally")).setText((0,i.Tl)("files","The file should now open on your device. If it doesn't, please check that you have the desktop app installed.")).setButtons([{label:(0,i.Tl)("files","Retry and close"),type:"secondary",callback:()=>{s=!0,e(!0)}},{label:(0,i.Tl)("files","Edit online"),icon:'',type:"primary",callback:()=>{s=!0,e(!1)}}]).build().show().then((()=>{s||e(!1)}))}((s=>{s?U(e):window.OCA.Viewer.open({path:e})}))})(e.path),null),order:25});var N=t(85471);const _='',P=e=>e.some((e=>1!==e.attributes.favorite)),A=async(e,s,t)=>{try{const n=(0,T.Jv)("/apps/files/api/v1/files")+(0,L.O0)(e.path);return await d.Ay.post(n,{tags:t?[window.OC.TAG_FAVORITE]:[]}),"favorites"!==s.id||t||"/"!==e.dirname||(0,l.Ic)("files:node:deleted",e),N.Ay.set(e.attributes,"favorite",t?1:0),t?(0,l.Ic)("files:favorites:added",e):(0,l.Ic)("files:favorites:removed",e),!0}catch(s){const n=t?"adding a file to favourites":"removing a file from favourites";return r.A.error("Error while "+n,{error:s,source:e.source,node:e}),!1}},z=new n.hY({id:"favorite",displayName:e=>P(e)?(0,i.Tl)("files","Add to favorites"):(0,i.Tl)("files","Remove from favorites"),iconSvgInline:e=>P(e)?'':_,enabled:e=>!e.some((e=>{var s,t;return!(null!==(s=e.root)&&void 0!==s&&null!==(t=s.startsWith)&&void 0!==t&&t.call(s,"/files"))}))&&e.every((e=>e.permissions!==n.aX.NONE)),async exec(e,s){const t=P([e]);return await A(e,s,t)},async execBatch(e,s){const t=P(e);return Promise.all(e.map((async e=>await A(e,s,t))))},order:-50});t(18205);var j=t(53110),M=t(43627),B=t(64852),E=t(36882),I=t(39285);let R;var D;!function(e){e.MOVE="Move",e.COPY="Copy",e.MOVE_OR_COPY="move-or-copy"}(D||(D={}));const H=e=>0!=(e.reduce(((e,s)=>Math.min(e,s.permissions)),n.aX.ALL)&n.aX.UPDATE),O=e=>(e=>e.every((e=>{var s,t;return!JSON.parse(null!==(s=null===(t=e.attributes)||void 0===t?void 0:t["share-attributes"])&&void 0!==s?s:"[]").some((e=>"permissions"===e.scope&&!1===e.enabled&&"download"===e.key))})))(e)&&!e.some((e=>e.permissions===n.aX.NONE));var V=t(36117);const W=e=>(0,n.Al)(e),q=(0,n.H4)(),Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";e="".concat(n.lJ).concat(e);const s=new AbortController,t=(0,n.VL)();return new V.CancelablePromise((async(n,a,i)=>{i((()=>s.abort()));try{const a=await q.getDirectoryContents(e,{details:!0,data:t,includeSelf:!0,signal:s.signal}),i=a.data[0],o=a.data.slice(1);if(i.filename!==e&&"".concat(i.filename,"/")!==e)throw new Error("Root node does not match requested path");n({folder:W(i),contents:o.map((e=>{try{return W(e)}catch(s){return r.A.error("Invalid node detected '".concat(e.basename,"'"),{error:s}),null}})).filter(Boolean)})}catch(e){a(e)}}))},J=e=>H(e)?O(e)?D.MOVE_OR_COPY:D.MOVE:D.COPY,K=async function(e,s,t){let m=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!s)return;if(s.type!==n.pt.Folder)throw new Error((0,i.Tl)("files","Destination is not a folder"));if(t===D.MOVE&&e.dirname===s.path)throw new Error((0,i.Tl)("files","This file/folder is already in that directory"));if("".concat(s.path,"/").startsWith("".concat(e.path,"/")))throw new Error((0,i.Tl)("files","You cannot move a file/folder onto itself or into a subfolder of itself"));N.Ay.set(e,"status",n.zI.LOADING);const d=function(e,s,t){const n=e===D.MOVE?(0,i.Tl)("files",'Moving "{source}" to "{destination}" …',{source:s,destination:t}):(0,i.Tl)("files",'Copying "{source}" to "{destination}" …',{source:s,destination:t});let o;return o=(0,a.cf)(' '.concat(n),{isHTML:!0,timeout:a.DH,onRemove:()=>{var e;null===(e=o)||void 0===e||e.hideToast(),o=void 0}}),()=>o&&o.hideToast()}(t,e.basename,s.path),g=(R||(R=new o.A({concurrency:5})),R);return await g.add((async()=>{const o=e=>1===e?(0,i.Tl)("files","(copy)"):(0,i.Tl)("files","(copy %n)",void 0,e);try{const r=(0,n.H4)(),d=(0,M.join)(n.lJ,e.path),g=(0,M.join)(n.lJ,s.path);if(t===D.COPY){let t=e.basename;if(!m){const s=await r.getDirectoryContents(g);t=(0,n.E6)(e.basename,s.map((e=>e.basename)),{suffix:o,ignoreFileExtension:e.type===n.pt.Folder})}if(await r.copyFile(d,(0,M.join)(g,t)),e.dirname===s.path){const{data:e}=await r.stat((0,M.join)(g,t),{details:!0,data:(0,n.VL)()});(0,l.Ic)("files:node:created",(0,n.Al)(e))}}else{if(!m){const t=await Y(s.path);if((0,B.h)([e],t.contents))try{const{selected:n,renamed:a}=await(0,B.o)(s.path,[e],t.contents);if(!n.length&&!a.length)return}catch(e){return void(0,a.Qg)((0,i.Tl)("files","Move cancelled"))}}await r.moveFile(d,(0,M.join)(g,e.basename)),(0,l.Ic)("files:node:deleted",e)}}catch(e){if(e instanceof j.pe){var g,c,u;if(412===(null==e||null===(g=e.response)||void 0===g?void 0:g.status))throw new Error((0,i.Tl)("files","A file or folder with that name already exists in this folder"));if(423===(null==e||null===(c=e.response)||void 0===c?void 0:c.status))throw new Error((0,i.Tl)("files","The files are locked"));if(404===(null==e||null===(u=e.response)||void 0===u?void 0:u.status))throw new Error((0,i.Tl)("files","The file does not exist anymore"));if(e.message)throw new Error(e.message)}throw r.A.debug(e),new Error}finally{N.Ay.set(e,"status",""),d()}}))};async function G(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",t=arguments.length>2?arguments[2]:void 0;const{resolve:n,reject:o,promise:l}=Promise.withResolvers(),m=t.map((e=>e.fileid)).filter(Boolean);return(0,a.a1)((0,i.Tl)("files","Choose destination")).allowDirectories(!0).setFilter((e=>!m.includes(e.fileid))).setMimeTypeFilter([]).setMultiSelect(!1).startAt(s).setButtonFactory(((s,a)=>{const o=[],r=(0,M.basename)(a),l=t.map((e=>e.dirname)),m=t.map((e=>e.path));return e!==D.COPY&&e!==D.MOVE_OR_COPY||o.push({label:r?(0,i.Tl)("files","Copy to {target}",{target:r},void 0,{escape:!1,sanitize:!1}):(0,i.Tl)("files","Copy"),type:"primary",icon:E,async callback(e){n({destination:e[0],action:D.COPY})}}),l.includes(a)||m.includes(a)||e!==D.MOVE&&e!==D.MOVE_OR_COPY||o.push({label:r?(0,i.Tl)("files","Move to {target}",{target:r},void 0,{escape:!1,sanitize:!1}):(0,i.Tl)("files","Move"),type:e===D.MOVE?"primary":"secondary",icon:I,async callback(e){n({destination:e[0],action:D.MOVE})}}),o})).build().pick().catch((e=>{r.A.debug(e),e instanceof a.vT?n(!1):o(new Error((0,i.Tl)("files","Move or copy operation failed")))})),l}const $=new n.hY({id:"move-copy",displayName(e){switch(J(e)){case D.MOVE:return(0,i.Tl)("files","Move");case D.COPY:return(0,i.Tl)("files","Copy");case D.MOVE_OR_COPY:return(0,i.Tl)("files","Move or copy")}},iconSvgInline:()=>I,enabled:e=>!!e.every((e=>{var s;return null===(s=e.root)||void 0===s?void 0:s.startsWith("/files/")}))&&e.length>0&&(H(e)||O(e)),async exec(e,s,t){const n=J([e]);let o;try{o=await G(n,t,[e])}catch(e){return r.A.error(e),!1}if(!1===o)return(0,a.cf)((0,i.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e.displayname})),null;try{return await K(e,o.destination,o.action),!0}catch(e){return!!(e instanceof Error&&e.message)&&((0,a.Qg)(e.message),null)}},async execBatch(e,s,t){const n=J(e),o=await G(n,t,e);if(!1===o)return(0,a.cf)(1===e.length?(0,i.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e[0].displayname}):(0,i.Tl)("files","Cancelled move or copy operation")),e.map((()=>null));const l=e.map((async e=>{try{return await K(e,o.destination,o.action),!0}catch(s){return r.A.error("Failed to ".concat(o.action," node"),{node:e,error:s}),!1}}));return await Promise.all(l)},order:15}),Z='',Q=new n.hY({id:"open-folder",displayName(e){const s=e[0].displayname;return(0,i.Tl)("files","Open folder {displayName}",{displayName:s})},iconSvgInline:()=>Z,enabled(e){if(1!==e.length)return!1;const s=e[0];return!!s.isDavRessource&&s.type===n.pt.Folder&&0!=(s.permissions&n.aX.READ)},exec:async(e,s)=>!(!e||e.type!==n.pt.Folder)&&(window.OCP.Files.Router.goToRoute(null,{view:s.id,fileid:e.fileid},{dir:e.path}),null),default:n.m9.HIDDEN,order:-100}),X=new n.hY({id:"open-in-files-recent",displayName:()=>(0,i.Tl)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,s)=>"recent"===s.id,async exec(e){let s=e.dirname;return e.type===n.pt.Folder&&(s=s+"/"+e.basename),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:s,openfile:"true"}),null},order:-1e3,default:n.m9.HIDDEN}),ee=new n.hY({id:"rename",displayName:()=>(0,i.Tl)("files","Rename"),iconSvgInline:()=>'',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>0!=(e&n.aX.UPDATE))),exec:async e=>((0,l.Ic)("files:node:rename",e),null),order:10});var se=t(49981);const te=new n.hY({id:"details",displayName:()=>(0,i.Tl)("files","Open details"),iconSvgInline:()=>se,enabled:e=>{var s,t,a;return 1===e.length&&!!e[0]&&!(null===(s=window)||void 0===s||null===(s=s.OCA)||void 0===s||null===(s=s.Files)||void 0===s||!s.Sidebar)&&null!==(t=(null===(a=e[0].root)||void 0===a?void 0:a.startsWith("/files/"))&&e[0].permissions!==n.aX.NONE)&&void 0!==t&&t},async exec(e,s,t){try{return await window.OCA.Files.Sidebar.open(e.path),window.OCP.Files.Router.goToRoute(null,{view:s.id,fileid:e.fileid},{...window.OCP.Files.Router.query,dir:t},!0),null}catch(e){return r.A.error("Error while opening sidebar",{error:e}),!1}},order:-50}),ne=new n.hY({id:"view-in-folder",displayName:()=>(0,i.Tl)("files","View in folder"),iconSvgInline:()=>I,enabled(e,s){var t;if("files"===s.id)return!1;if(1!==e.length)return!1;const a=e[0];return!(!a.isDavRessource||null===(t=a.root)||void 0===t||!t.startsWith("/files")||a.permissions===n.aX.NONE||a.type!==n.pt.File)},exec:async e=>!(!e||e.type!==n.pt.File)&&(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:e.dirname}),null),order:80});var ae=t(18740),ie=t(94219),oe=t(82182);const re=(0,N.pM)({__name:"NewNodeDialog",props:{defaultName:{type:String,default:(0,i.t)("files","New folder")},otherNames:{type:Array,default:()=>[]},open:{type:Boolean,default:!0},name:{type:String,default:(0,i.t)("files","Create new folder")},label:{type:String,default:(0,i.t)("files","Folder name")}},emits:["close"],setup(e,s){let{emit:t}=s;const a=e,o=(0,N.KR)(a.defaultName),r=(0,N.KR)(),l=(0,N.KR)(),m=(0,N.KR)("");function d(){(0,N.dY)((()=>{var e;const s=null===(e=r.value)||void 0===e?void 0:e.$el.querySelector("input");if(!a.open||!s)return;const t=o.value.length-(0,M.extname)(o.value).length;s.focus(),s.setSelectionRange(0,t)}))}return(0,N.wB)((()=>a.defaultName),(()=>{o.value=(0,n.E6)(a.defaultName,a.otherNames).trim()})),(0,N.nT)((()=>{var e;a.otherNames.includes(o.value.trim())?m.value=(0,i.t)("files","This name is already in use."):m.value=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(""===e.trim())return(0,i.t)("files","Filename must not be empty.");try{return(0,n.KT)(e),""}catch(e){if(!(e instanceof n.di))throw e;switch(e.reason){case n.nF.Character:return(0,i.t)("files",'"{char}" is not allowed inside a filename.',{char:e.segment},void 0,{escape:s});case n.nF.ReservedName:return(0,i.t)("files",'"{segment}" is a reserved name and not allowed for filenames.',{segment:e.segment},void 0,{escape:!1});case n.nF.Extension:return e.segment.match(/\.[a-z]/i)?(0,i.t)("files",'"{extension}" is not an allowed filetype.',{extension:e.segment},void 0,{escape:!1}):(0,i.t)("files",'Filenames must not end with "{extension}".',{extension:e.segment},void 0,{escape:!1});default:return(0,i.t)("files","Invalid filename.")}}}(o.value.trim());const s=null===(e=r.value)||void 0===e?void 0:e.$el.querySelector("input");s&&(s.setCustomValidity(m.value),s.reportValidity())})),(0,N.wB)((()=>a.open),(()=>{(0,N.dY)((()=>{d()}))})),(0,N.sV)((()=>{o.value=(0,n.E6)(o.value,a.otherNames).trim(),(0,N.dY)((()=>d()))})),{__sfc:!0,props:a,emit:t,localDefaultName:o,nameInput:r,formElement:l,validity:m,focusInput:d,submit:function(){var e;null===(e=l.value)||void 0===e||e.requestSubmit()},t:i.t,NcButton:ae.A,NcDialog:ie.A,NcTextField:oe.A}}});var le=t(85072),me=t.n(le),de=t(97825),ge=t.n(de),ce=t(77659),ue=t.n(ce),fe=t(55056),pe=t.n(fe),he=t(10540),we=t.n(he),ve=t(41113),Te=t.n(ve),ye=t(6058),Ce={};Ce.styleTagTransform=Te(),Ce.setAttributes=pe(),Ce.insert=ue().bind(null,"head"),Ce.domAPI=ge(),Ce.insertStyleElement=we(),me()(ye.A,Ce),ye.A&&ye.A.locals&&ye.A.locals;const xe=(0,t(14486).A)(re,(function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s(t.NcDialog,{attrs:{"data-cy-files-new-node-dialog":"",name:e.name,open:e.open,"close-on-click-outside":"","out-transition":""},on:{"update:open":function(e){return t.emit("close",null)}},scopedSlots:e._u([{key:"actions",fn:function(){return[s(t.NcButton,{attrs:{"data-cy-files-new-node-dialog-submit":"",type:"primary",disabled:""!==t.validity},on:{click:t.submit}},[e._v("\n\t\t\t"+e._s(t.t("files","Create"))+"\n\t\t")])]},proxy:!0}])},[e._v(" "),s("form",{ref:"formElement",staticClass:"new-node-dialog__form",on:{submit:function(e){return e.preventDefault(),t.emit("close",t.localDefaultName)}}},[s(t.NcTextField,{ref:"nameInput",attrs:{"data-cy-files-new-node-dialog-input":"",error:""!==t.validity,"helper-text":t.validity,label:e.label,value:t.localDefaultName},on:{"update:value":function(e){t.localDefaultName=e}}})],1)])}),[],!1,null,"242a2438",null).exports;function ke(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=s.map((e=>e.basename));return new Promise((s=>{(0,a.Ss)(xe,{...t,defaultName:e,otherNames:n},(e=>{s(e)}))}))}const be={id:"newFolder",displayName:(0,i.Tl)("files","New folder"),enabled:e=>0!=(e.permissions&n.aX.CREATE),iconSvgInline:'',order:0,async handler(e,s){const t=await ke((0,i.Tl)("files","New folder"),s);if(null!==t){var o,m,g,c,u;const{fileid:s,source:f}=await(async(e,s)=>{const t=e.source+"/"+s,n=e.encodedSource+"/"+encodeURIComponent(s),a=await(0,d.Ay)({method:"MKCOL",url:n,headers:{Overwrite:"F"}});return{fileid:parseInt(a.headers["oc-fileid"]),source:t}})(e,t.trim()),p=new n.vd({source:f,id:s,mtime:new Date,owner:(null===(o=(0,F.HW)())||void 0===o?void 0:o.uid)||null,permissions:n.aX.ALL,root:(null==e?void 0:e.root)||"/files/"+(null===(m=(0,F.HW)())||void 0===m?void 0:m.uid),attributes:{"mount-type":null===(g=e.attributes)||void 0===g?void 0:g["mount-type"],"owner-id":null===(c=e.attributes)||void 0===c?void 0:c["owner-id"],"owner-display-name":null===(u=e.attributes)||void 0===u?void 0:u["owner-display-name"]}});(0,l.Ic)("files:node:created",p),(0,a.Te)((0,i.Tl)("files",'Created new folder "{name}"',{name:(0,M.basename)(f)})),r.A.debug("Created new folder",{folder:p,source:f}),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:p.fileid},{dir:e.path})}}};var Le=t(32981);let Fe=(0,Le.C)("files","templates_path",!1);r.A.debug("Initial templates folder",{templatesPath:Fe});const Ue={id:"template-picker",displayName:(0,i.Tl)("files","Create new templates folder"),iconSvgInline:'',order:10,enabled(e){var s;return!Fe&&e.owner===(null===(s=(0,F.HW)())||void 0===s?void 0:s.uid)&&0!=(e.permissions&n.aX.CREATE)},async handler(e,s){const t=await ke((0,i.Tl)("files","Templates"),s,{name:(0,i.Tl)("files","New template folder")});null!==t&&(async function(e,s){const t=(0,M.join)(e.path,s);try{r.A.debug("Initializing the templates directory",{templatePath:t});const{data:e}=await d.Ay.post((0,T.KT)("apps/files/api/v1/templates/path"),{templatePath:t,copySystemTemplates:!0});window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:void 0},{dir:t}),r.A.info("Created new templates folder",{...e.ocs.data}),Fe=e.ocs.data.templates_path}catch(e){r.A.error("Unable to initialize the templates directory"),(0,a.Qg)((0,i.Tl)("files","Unable to initialize the templates directory"))}}(e,t),(0,n.gj)("template-picker"))}},Se=(0,N.$V)((()=>Promise.all([t.e(4208),t.e(5606)]).then(t.bind(t,15606))));let Ne=null;const _e=async e=>{if(null===Ne){const s=document.createElement("div");s.id="template-picker",document.body.appendChild(s),Ne=new N.Ay({render:s=>s(Se,{ref:"picker",props:{parent:e}}),methods:{open(){this.$refs.picker.open(...arguments)}},el:s})}return Ne};var Pe;const Ae="/files/".concat(null===(Pe=(0,F.HW)())||void 0===Pe?void 0:Pe.uid),ze=((0,T.dC)("dav"+Ae),(0,n.H4)()),je=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";return"/"!==e?Y(e):new V.CancelablePromise(((e,s,t)=>{const a=(0,n.Q$)(ze).catch(s).then((t=>{var a;t?e({contents:t,folder:new n.vd({id:0,source:"".concat(n.PY).concat(n.lJ),root:n.lJ,owner:(null===(a=(0,F.HW)())||void 0===a?void 0:a.uid)||null,permissions:n.aX.READ})}):s()}));t((()=>a.cancel()))}))},Me=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new n.Ss({id:Be(e.path),name:(0,M.basename)(e.path),icon:Z,order:s,params:{dir:e.path,fileid:e.fileid.toString(),view:"favorites"},parent:"favorites",columns:[],getContents:je})},Be=function(e){return"favorite-".concat(function(e){let s=0;for(let t=0;t>>0}(e))};var Ee=t(65899);const Ie=(0,Le.C)("files","config",{show_hidden:!1,crop_image_previews:!0,sort_favorites_first:!0,sort_folders_first:!0,grid_view:!1}),Re=(0,Ee.Ey)(),De=(0,n.H4)(),He=Math.round(Date.now()/1e3-1209600),Oe=e=>(0,n.Al)(e,n.lJ,(0,T.$_)());var Ve;const We=null===(Ve=(0,F.HW)())||void 0===Ve?void 0:Ve.uid,qe=function(e){const s=e.attributes["mount-type"];return!(We&&e.owner!==We||["group","shared"].includes(s))};(0,n.Gg)(v),(0,n.Gg)(b),(0,n.Gg)(S),(0,n.Gg)(z),(0,n.Gg)($),(0,n.Gg)(Q),(0,n.Gg)(X),(0,n.Gg)(ee),(0,n.Gg)(te),(0,n.Gg)(ne),(0,n.zj)(be),(0,n.zj)(Ue),(0,Le.C)("files","templates",[]).forEach(((e,s)=>{(0,n.zj)({id:"template-new-".concat(e.app,"-").concat(s),displayName:e.label,iconClass:e.iconClass||"icon-file",iconSvgInline:e.iconSvgInline,enabled:e=>0!=(e.permissions&n.aX.CREATE),order:11,async handler(s,t){const n=_e(s),a=await ke("".concat(e.label).concat(e.extension),t,{label:(0,i.Tl)("files","Filename"),name:e.label});null!==a&&(await n).open(a.trim(),e)}})})),(()=>{const e=(0,Le.C)("files","favoriteFolders",[]),s=e.map(((e,s)=>Me(e,s)));r.A.debug("Generating favorites view",{favoriteFolders:e});const t=(0,n.bh)();t.register(new n.Ss({id:"favorites",name:(0,i.Tl)("files","Favorites"),caption:(0,i.Tl)("files","List of favorites files and folders."),emptyTitle:(0,i.Tl)("files","No favorites yet"),emptyCaption:(0,i.Tl)("files","Files and folders you mark as favorite will show up here"),icon:_,order:15,columns:[],getContents:je})),s.forEach((e=>t.register(e))),(0,l.B1)("files:favorites:added",(e=>{var s;e.type===n.pt.Folder&&(null!==e.path&&null!==(s=e.root)&&void 0!==s&&s.startsWith("/files")?o(e):r.A.error("Favorite folder is not within user files root",{node:e}))})),(0,l.B1)("files:favorites:removed",(e=>{var s;e.type===n.pt.Folder&&(null!==e.path&&null!==(s=e.root)&&void 0!==s&&s.startsWith("/files")?m(e.path):r.A.error("Favorite folder is not within user files root",{node:e}))})),(0,l.B1)("files:node:renamed",(e=>{e.type===n.pt.Folder&&1===e.attributes.favorite&&d(e)}));const a=function(){e.sort(((e,s)=>e.path.localeCompare(s.path,(0,i.Z0)(),{ignorePunctuation:!0}))),e.forEach(((e,t)=>{const n=s.find((s=>s.id===Be(e.path)));n&&(n.order=t)}))},o=function(n){const i={path:n.path,fileid:n.fileid},o=Me(i);e.find((e=>e.path===n.path))||(e.push(i),s.push(o),a(),t.register(o))},m=function(n){const i=Be(n),o=e.findIndex((e=>e.path===n));-1!==o&&(e.splice(o,1),s.splice(o,1),t.remove(i),a())},d=function(s){const t=e.find((e=>e.fileid===s.fileid));void 0!==t&&(m(t.path),o(s))}})(),(0,n.bh)().register(new n.Ss({id:"files",name:(0,i.Tl)("files","All files"),caption:(0,i.Tl)("files","List of your files and folders."),icon:Z,order:0,getContents:Y})),(0,n.bh)().register(new n.Ss({id:"recent",name:(0,i.Tl)("files","Recent"),caption:(0,i.Tl)("files","List of recently modified files and folders."),emptyTitle:(0,i.Tl)("files","No recently modified files"),emptyCaption:(0,i.Tl)("files","Files and folders you recently modified will show up here."),icon:'',order:10,defaultSortKey:"mtime",getContents:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const s=function(){const e=(0,Ee.nY)("userconfig",{state:()=>({userConfig:Ie}),actions:{onUpdate(e,s){N.Ay.set(this.userConfig,e,s)},async update(e,s){await d.Ay.put((0,T.Jv)("/apps/files/api/v1/config/"+e),{value:s}),(0,l.Ic)("files:config:updated",{key:e,value:s})}}})(...arguments);return e._initialized||((0,l.B1)("files:config:updated",(function(s){let{key:t,value:n}=s;e.onUpdate(t,n)})),e._initialized=!0),e}(Re),t=t=>"/"!==e||s.userConfig.show_hidden||!t.dirname.split("/").some((e=>e.startsWith("."))),a=new AbortController;return new V.CancelablePromise((async(e,s,i)=>{var o;let r;i((()=>a.abort()));try{r=await De.search("/",{details:!0,data:(0,n.R3)(He),signal:a.signal})}catch(e){return void s(e)}a.signal.aborted?s():e({contents:r.data.results.map(Oe).filter(t),folder:new n.vd({id:0,source:"".concat(n.PY).concat(n.lJ),root:n.lJ,owner:(null===(o=(0,F.HW)())||void 0===o?void 0:o.uid)||null,permissions:n.aX.READ})})}))}})),(0,n.bh)().register(new n.Ss({id:"personal",name:(0,i.Tl)("files","Personal Files"),caption:(0,i.Tl)("files","List of your files and folders that are not shared."),emptyTitle:(0,i.Tl)("files","No personal files found"),emptyCaption:(0,i.Tl)("files","Files that are not shared will show up here."),icon:'',order:5,getContents:function(){return Y(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/").then((e=>(e.contents=e.contents.filter(qe),e)))}})),"serviceWorker"in navigator?window.addEventListener("load",(async()=>{try{const e=(0,T.Jv)("/apps/files/preview-service-worker.js",{},{noRewrite:!0}),s=await navigator.serviceWorker.register(e,{scope:"/"});r.A.debug("SW registered: ",{registration:s})}catch(e){r.A.error("SW registration failed: ",{error:e})}})):r.A.debug("Service Worker is not enabled on this browser."),(0,n.Yc)("nc:hidden",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:is-mount-root",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:is-federated",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:metadata-files-live-photo",{nc:"http://nextcloud.org/ns"})},96667:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});var n=t(71354),a=t.n(n),i=t(76314),o=t.n(i)()(a());o.push([e.id,".upload-picker[data-v-c5517ef8] {\n display: inline-flex;\n align-items: center;\n height: var(--default-clickable-area);\n}\n.upload-picker__progress[data-v-c5517ef8] {\n width: 200px;\n max-width: 0;\n transition: max-width var(--animation-quick) ease-in-out;\n margin-top: 8px;\n}\n.upload-picker__progress p[data-v-c5517ef8] {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.upload-picker--uploading .upload-picker__progress[data-v-c5517ef8] {\n max-width: 200px;\n margin-right: 20px;\n margin-left: 8px;\n}\n.upload-picker--paused .upload-picker__progress[data-v-c5517ef8] {\n animation: breathing-c5517ef8 3s ease-out infinite normal;\n}\n@keyframes breathing-c5517ef8 {\n0% {\n opacity: 0.5;\n}\n25% {\n opacity: 1;\n}\n60% {\n opacity: 0.5;\n}\n100% {\n opacity: 0.5;\n}\n}","",{version:3,sources:["webpack://./node_modules/@nextcloud/upload/dist/assets/index-7UBhRcxV.css"],names:[],mappings:"AAAA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,qCAAqC;AACvC;AACA;EACE,YAAY;EACZ,YAAY;EACZ,wDAAwD;EACxD,eAAe;AACjB;AACA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,yDAAyD;AAC3D;AACA;AACA;IACI,YAAY;AAChB;AACA;IACI,UAAU;AACd;AACA;IACI,YAAY;AAChB;AACA;IACI,YAAY;AAChB;AACA",sourcesContent:[".upload-picker[data-v-c5517ef8] {\n display: inline-flex;\n align-items: center;\n height: var(--default-clickable-area);\n}\n.upload-picker__progress[data-v-c5517ef8] {\n width: 200px;\n max-width: 0;\n transition: max-width var(--animation-quick) ease-in-out;\n margin-top: 8px;\n}\n.upload-picker__progress p[data-v-c5517ef8] {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.upload-picker--uploading .upload-picker__progress[data-v-c5517ef8] {\n max-width: 200px;\n margin-right: 20px;\n margin-left: 8px;\n}\n.upload-picker--paused .upload-picker__progress[data-v-c5517ef8] {\n animation: breathing-c5517ef8 3s ease-out infinite normal;\n}\n@keyframes breathing-c5517ef8 {\n0% {\n opacity: 0.5;\n}\n25% {\n opacity: 1;\n}\n60% {\n opacity: 0.5;\n}\n100% {\n opacity: 0.5;\n}\n}"],sourceRoot:""}]);const r=o},6058:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});var n=t(71354),a=t.n(n),i=t(76314),o=t.n(i)()(a());o.push([e.id,"\n.new-node-dialog__form[data-v-242a2438] {\n\t/* Ensure the dialog does not jump when there is a validity error */\n\tmin-height: calc(3 * var(--default-clickable-area));\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/NewNodeDialog.vue"],names:[],mappings:";AAwJA;CACA,mEAAA;CACA,mDAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n\n