()=>!0})],c.prototype,"updateFunction",2),f([h({default:()=>Me})],c.prototype,"getGridGap",2),f([h({default:()=>Pe})],c.prototype,"getColumnCount",2),f([h({default:()=>We})],c.prototype,"getWindowMargin",2),f([h({default:()=>Ie})],c.prototype,"getItemRatioHeight",2),f([h({default:null})],c.prototype,"scrollElement",2),f([h({default:500})],c.prototype,"updateTriggerMargin",2),f([h({default:null})],c.prototype,"loader",2),f([h({default:!1})],c.prototype,"debug",2),f([b()],c.prototype,"updateLock",2),f([b()],c.prototype,"bottomReached",2),f([b()],c.prototype,"ref",2),f([b()],c.prototype,"containerData",2),f([ze("scrollElement")],c.prototype,"onScrollElementChanged",1),c=f([Y({name:"VirtualGrid"})],c);var ke=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"virtualGrid",style:{boxSizing:"border-box",height:e.layoutData.totalHeight+"px",paddingTop:e.renderData!==null&&e.renderData.firstRenderedRowOffset!==null?e.renderData.firstRenderedRowOffset+"px":"0px"}},[r("div",{staticClass:"grid",style:{display:"-ms-grid",display:"grid","align-items":"center","grid-template-columns":"repeat("+e.configData.columnCount+", 1fr)",gap:e.configData.gridGap+"px"}},e._l(e.renderData.cellsToRender,function(i){return r("div",{key:i.id,staticClass:"grid-item-wrapper",style:{height:i.height+"px","grid-column-start":i.columnNumber,"grid-column-end":i.columnNumber+i.columnSpan,"grid-row-start":e.getGridRowStart(i,e.renderData)}},[r(i.renderComponent,e._g({tag:"component",attrs:{item:i}},e.$listeners))],1)}),0),r(e.loadingBatch&&e.loader,{tag:"component"})],1)},Ae=[];function Ge(e,t,r,i,o,s,l,n){var a=typeof e=="function"?e.options:e;t&&(a.render=t,a.staticRenderFns=r,a._compiled=!0);var d;if(o&&(d=o),d)if(a.functional){a._injectStyles=d;var g=a.render;a.render=function(p,m){return d.call(m),g(p,m)}}else{var u=a.beforeCreate;a.beforeCreate=u?[].concat(u,d):[d]}return{exports:e,options:a}}const U={};var Ue=Ge(c,ke,Ae,!1,He);function He(e){for(let t in U)this[t]=U[t]}var Ve=function(){return Ue.exports}();const qe={name:"FileLegacy",inheritAttrs:!1,props:{item:{type:Object,required:!0}},data(){return{loaded:!1,error:!1}},computed:{ariaUuid(){return`image-${this.item.injected.fileid}`},ariaLabel(){return v("photos",'Open the full size "{name}" image',{name:this.item.injected.basename})},isImage(){return this.item.injected.mime.startsWith("image")},decodedEtag(){return this.item.injected.etag.replace(""","").replace(""","")},src(){return x(`/core/preview?fileId=${this.item.injected.fileid}&c=${this.decodedEtag}&x=250&y=250&forceIcon=0&a=${this.croppedLayout?"0":"1"}`)},croppedLayout(){return this.$store.state.userConfig.croppedLayout}},beforeDestroy(){this.$refs.src=""},methods:{openViewer(){window.OCA.Viewer.open({fileInfo:W(this.item.injected),list:this.item.injected.list.map(e=>W(e))})},onLoad(){this.loaded=!0},onError(){this.error=!0},t:v}};var Be=function(){var e=this,t=e._self._c;return t("a",{staticClass:"file",class:{"file--cropped":e.croppedLayout},attrs:{href:e.item.injected.source,"aria-label":e.ariaLabel},on:{click:function(r){return r.preventDefault(),e.openViewer.apply(null,arguments)}}},[e.item.injected.mime.includes("video")&&e.item.injected.hasPreview?t("div",{staticClass:"icon-video-white"}):e._e(),t("transition-group",{staticClass:"transition-group",attrs:{name:"fade"}},[e.error?e._e():t("img",{key:`${e.item.injected.basename}-img`,ref:"img",attrs:{src:e.src,alt:e.item.injected.basename,"aria-describedby":e.ariaUuid},on:{load:e.onLoad,error:e.onError}}),!e.loaded||e.error?t("svg",{key:`${e.item.injected.basename}-svg`,attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"url(#placeholder__gradient)"}},[e.isImage?t("use",{attrs:{href:"#placeholder--img"}}):t("use",{attrs:{href:"#placeholder--video"}})]):e._e()]),t("p",{staticClass:"hidden-visually",attrs:{id:e.ariaUuid}},[e._v(e._s(e.item.injected.basename))]),t("div",{staticClass:"cover",attrs:{role:"none"}})],1)},Ke=[],Ye=R(qe,Be,Ke,!1,null,"f9084f09");const Qe=Ye.exports,Xe={name:"FolderTagPreview",components:{Folder:B,RouterLink:se},props:{name:{type:String,required:!0},path:{type:String,default:""},fileList:{type:Array,default:()=>[]}},data(){return{failed:[]}},computed:{isEmpty(){return this.previewList.length===0},ariaLabel(){return v("photos",'Open the "{name}" folder',{name:this.name})},previewList(){return this.fileList.filter(e=>this.failed.indexOf(e.fileid)===-1)},previewUrl(){if(this.previewList.length===0)return null;const{fileid:e,etag:t}=this.previewList.at(-1);return x(`/core/preview?fileId=${e}&c=${t}&x=250&y=250&forceIcon=0&a=0`)},toLink(){const e=`/files/${H()?.uid}`;let t=this.path.replace(new RegExp(`^${e}`),"");return t=/^\/?(.+)/i.exec(t)[1],{...this.$route,params:{path:t.split("/")}}}},methods:{onPreviewFail({fileid:e}){this.failed.push(e)},t:v}};var Je=function(){var e=this,t=e._self._c;return t("RouterLink",{staticClass:"folder",attrs:{to:e.toLink,"aria-label":e.ariaLabel}},[e.previewUrl?t("img",{staticClass:"folder__image",attrs:{src:e.previewUrl,alt:""},on:{error:function(r){return e.onPreviewFail(e.file)}}}):t("span",{staticClass:"folder__image folder__image--placeholder"},[t("Folder",{staticClass:"folder__icon",attrs:{size:96,"fill-color":"var(--color-primary-element)"}})],1),t("span",{staticClass:"folder__details"},[t("Folder"),t("span",{staticClass:"folder__title"},[e._v(e._s(e.name))])],1)])},Ze=[],et=R(Xe,Je,Ze,!1,null,"77be2b09");const tt=et.exports;async function Q(e="/",t={}){const r=x(`/apps/photos/api/v1/${t.shared?"shared":"albums"}`),i=(await ne.get(r+e,t)).data.map(n=>({...n,filename:`${w}${n.filename}`,source:decodeURI(Z+`${w}${n.filename}`)}));let o;const s=[],l=[];for(const n of i)n.filename===`${w}${e}`?o=n:n.type!=="file"?s.push(n):q.indexOf(n.mime)>-1&&l.push(n);return{folder:o,folders:s,files:l}}const rt=V({name:"FolderComponent",components:{FolderTagPreview:tt},mixins:[K],inheritAttrs:!1,props:{item:{type:Object,required:!0}},data(){return{previewFolder:this.item.injected.fileid}},computed:{files(){return this.$store.state.folders.files},subFolders(){return this.$store.state.folders.subFolders},folders(){return this.$store.state.folders.folders},folderContent(){return this.folders[this.item.injected.fileid]},previewFiles(){const e=this.folders[this.previewFolder],t=e?e.map(r=>this.files[r]).slice(0,4):[];if(t.length===0&&this.subFolders[this.previewFolder]&&this.previewFolder===this.item.injected.fileid){const r=this.subFolders[this.previewFolder][0];this.updatePreviewFolder(r),this.folders[this.previewFolder]||this.getFolderData(this.files[this.previewFolder].filename)}return t}},async created(){this.folderContent||await this.getFolderData(this.item.injected.filename)},methods:{async getFolderData(e){try{const t=`/files/${H()?.uid}`,r=e.replace(new RegExp(`^${t}`),""),{folder:i,folders:o,files:s}=await Q(r,{shared:this.item.injected.showShared,signal:this.abortController.signal});this.$store.dispatch("updateFolders",{fileid:i?.fileid,files:s,folders:o}),this.$store.dispatch("updateFoldersFiles",{folder:i,files:s,folders:o})}catch(t){j.error("Failed to get folder content",{error:t,filename:e})}},updatePreviewFolder(e){this.previewFolder=e}}});var it=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("FolderTagPreview",{attrs:{id:e.item.injected.fileid,name:e.item.injected.basename.toString(),path:e.item.injected.filename,"file-list":e.previewFiles}})},ot=[],nt=R(rt,it,ot,!1,null,"d58b828a");const at=nt.exports,C={400:{marginTop:66,marginW:8,count:3,folderCount:1},700:{marginTop:66,marginW:8,count:4,folderCount:1},1024:{marginTop:66,marginW:44,count:5,folderCount:2},1280:{marginTop:66,marginW:44,count:4,folderCount:2},1440:{marginTop:88,marginW:66,count:5,folderCount:3},1600:{marginTop:88,marginW:66,count:6,folderCount:4},2048:{marginTop:88,marginW:66,count:7,folderCount:4},2560:{marginTop:88,marginW:88,count:8,folderCount:6},3440:{marginTop:88,marginW:88,count:9,folderCount:8},max:{marginTop:88,marginW:88,count:10,folderCount:10}},_=new F({data(){return{gridConfig:C.max}},watch:{gridConfig(e){this.$emit("changed",e)}},created(){window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize()},beforeDestroy(){window.removeEventListener("resize",this.handleWindowResize)},methods:{handleWindowResize(){const e=Object.keys(C).map(t=>Number.parseInt(t)).find(t=>t>document.documentElement.clientWidth);this.gridConfig=C[e]||C.max}}}),st=V({data(){return{gridConfig:{}}},created(){_.$on("changed",this.handleGridConfigChange),j.debug("Grid config",{gridConfig:_.gridConfig}),this.gridConfig=_.gridConfig},beforeDestroy(){_.$off("changed",this.handleGridConfigChange)},methods:{handleGridConfigChange(e){this.gridConfig=e}}}),lt={name:"FoldersView",components:{FolderIcon:B,HeaderNavigation:le,NcEmptyContent:oe,NcLoadingIcon:ae,UploadPicker:re,VirtualGrid:Ve},mixins:[K,st],props:{rootTitle:{type:String,required:!0},path:{type:String,default:"/"},showShared:{type:Boolean,default:!1}},data(){return{error:null,allowedMimes:q,initializing:!0,loading:!1,appContent:document.getElementById("app-content-vue"),uploader:ie()}},computed:{files(){return this.$store.state.folders.files},folders(){return this.$store.state.folders.folders},folderId(){return this.$store.state.folders.paths[this.path]},folder(){return this.files[this.folderId]},folderAsFolder(){if(this.folder)return new ee({...this.folder,permissions:te(this.folder.permissions),owner:null})},folderContent(){return this.folders[this.folderId]||[]},fileList(){return this.folderContent&&this.folderContent.map(e=>this.files[e]).filter(e=>!!e)},subFolders(){return this.folderId&&this.files[this.folderId]&&this.$store.state.folders.subFolders[this.folderId]},folderList(){return this.subFolders&&this.subFolders.map(e=>this.files[e]).filter(e=>!!e)},contentList(){const e=this.folderList&&this.folderList.map(r=>({id:`folder-${r.fileid}`,injected:{...r,showShared:this.showShared},width:232,height:280,columnSpan:1,renderComponent:at})),t=this.fileList?.map(r=>({id:`file-${r.fileid}`,injected:{...r,list:this.fileList},width:256,height:256,columnSpan:1,renderComponent:Qe}));return[...e||[],...t||[]]},isEmpty(){return!this.haveFiles&&!this.haveFolders},haveFiles(){return!!this.fileList&&this.fileList.length!==0},haveFolders(){return!!this.folderList&&this.folderList.length!==0}},watch:{path(){this.fetchFolderContent()},showShared(){this.fetchFolderContent()}},beforeMount(){this.fetchFolderContent()},methods:{onRefresh(){this.fetchFolderContent()},async fetchFolderContent(){this.error=null,this.loading=!0,window.OCA?.Viewer?.close?.(),window.OCA?.Files?.Sidebar?.close?.(),(!this.files[this.folderId]||!this.folders[this.folderId])&&(this.initializing=!0);try{const{folder:e,folders:t,files:r}=await Q(this.path,{shared:this.showShared,signal:this.abortController.signal});this.$store.dispatch("addPath",{path:this.path,fileid:e?.fileid}),this.$store.dispatch("updateFolders",{fileid:e?.fileid,files:r,folders:t}),this.$store.dispatch("updateFoldersFiles",{folder:e,files:r,folders:t})}catch(e){e?.response&&e.response.status&&(e.response.status===404?(this.error=404,setTimeout(()=>{this.$router.push({name:this.$route.name??void 0})},3e3)):this.error=e),j.error("Error fetching album data",{error:e})}finally{this.loading=!1,this.initializing=!1}},async onUpload(e){const t=e.source.split(w).pop(),r=await de(w+t);if(r===null){j.error("Failed to fetch file",{relPath:t});return}const i={fileid:r.fileid,basename:r.basename,etag:r.attributes.etag,filename:r.root+r.path,source:r.source,lastmod:r.mtime?.getTime(),mime:r.mime,size:r.size,type:"file",permissions:"",hasPreview:r.attributes.hasPreview};this.$store.dispatch("appendFoldersFiles",[i]),this.$store.dispatch("addFilesToFolder",{fileid:this.folderId,files:[i]})},t:v}};var dt=function(){var e=this,t=e._self._c;return e.error===404?t("NcEmptyContent",{attrs:{name:e.t("photos","This folder does not exist")},scopedSlots:e._u([{key:"icon",fn:function(){return[t("FolderIcon")]},proxy:!0}],null,!1,1472452094)}):e.error?t("NcEmptyContent",{attrs:{name:e.t("photos","An error occurred")}}):e.initializing?t("NcEmptyContent",{attrs:{name:e.t("photos","Loading folders …")},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcLoadingIcon")]},proxy:!0}])}):e.initializing?e._e():t("div",[t("HeaderNavigation",{key:"navigation",class:{"photos-navigation--uploading":e.uploader.queue?.length>0},attrs:{loading:e.loading,path:e.path,title:e.folder?.basename?.toString?.()||e.rootTitle,"root-title":e.rootTitle},on:{refresh:e.onRefresh}},[t("UploadPicker",{attrs:{accept:e.allowedMimes,destination:e.folderAsFolder,multiple:!0},on:{uploaded:e.onUpload}})],1),e.isEmpty?t("NcEmptyContent",{key:"emptycontent",attrs:{name:e.t("photos","No photos in here")},scopedSlots:e._u([{key:"icon",fn:function(){return[t("FolderIcon")]},proxy:!0}],null,!1,1472452094)}):t("div",{staticClass:"grid-container",class:{"grid-container--folders":e.haveFolders}},[t("VirtualGrid",{ref:"virtualgrid",attrs:{items:e.contentList,"scroll-element":e.appContent,"get-column-count":()=>e.haveFolders?e.gridConfig.folderCount:e.gridConfig.count,"get-grid-gap":()=>e.haveFolders?16:8}})],1)],1)},ct=[],ft=R(lt,dt,ct,!1,null,"df5b01ef");const Dt=ft.exports;export{Dt as default};
-//# sourceMappingURL=FoldersView-CJt37-bF.chunk.mjs.map
+import"./index-CKppNoVt.chunk.mjs";import{V as F,t as v,_ as x,g as H,G as w,Q as Z,d as V,R as ee,S as te}from"./vue.runtime.esm-DE8Vf-Sj.chunk.mjs";import{U as re,g as ie}from"./index-DdKmqUaK-BqjcYAhI.chunk.mjs";import{N as oe}from"./NcEmptyContent-pb5UHZk8.chunk.mjs";import{j as W,k as ne,h as q,l as j,f as ae}from"./index-DiDFXBG0.chunk.mjs";import{n as R,c as B}from"./icons-CG9j2hi8.chunk.mjs";import{L as se}from"./index-4yKLijaA.chunk.mjs";import{A as K}from"./AbortControllerMixin-CtlVmv6y.chunk.mjs";import{H as le}from"./HeaderNavigation-zv21E5Jk.chunk.mjs";import{f as de}from"./fileFetcher-CTCND05K.chunk.mjs";import"./preload-helper-Dh9HmuEY.chunk.mjs";import"./index-Dnf1DK6t.chunk.mjs";import"./useHotKey-C9-yNPp6.chunk.mjs";import"./NcActionButton-CuVNJJtW-CuYdCDcU.chunk.mjs";import"./NcProgressBar-DegJ2JjE-CjUpCgie.chunk.mjs";import"./index-BKs8M_Od.chunk.mjs";var ce=Object.defineProperty,fe=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,he=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,T=(e,t,r)=>t in e?ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,N=(e,t)=>{for(var r in t||(t={}))he.call(t,r)&&T(e,r,t[r]);if(I)for(var r of I(t))pe.call(t,r)&&T(e,r,t[r]);return e},k=(e,t)=>fe(e,ue(t));function O(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(t){return typeof t}:O=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(e)}function me(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ge(e){return we(e)||ye(e)||ve()}function we(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t ()=>!0})],c.prototype,"updateFunction",2),f([h({default:()=>Me})],c.prototype,"getGridGap",2),f([h({default:()=>Pe})],c.prototype,"getColumnCount",2),f([h({default:()=>We})],c.prototype,"getWindowMargin",2),f([h({default:()=>Ie})],c.prototype,"getItemRatioHeight",2),f([h({default:null})],c.prototype,"scrollElement",2),f([h({default:500})],c.prototype,"updateTriggerMargin",2),f([h({default:null})],c.prototype,"loader",2),f([h({default:!1})],c.prototype,"debug",2),f([b()],c.prototype,"updateLock",2),f([b()],c.prototype,"bottomReached",2),f([b()],c.prototype,"ref",2),f([b()],c.prototype,"containerData",2),f([ze("scrollElement")],c.prototype,"onScrollElementChanged",1),c=f([Y({name:"VirtualGrid"})],c);var ke=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"virtualGrid",style:{boxSizing:"border-box",height:e.layoutData.totalHeight+"px",paddingTop:e.renderData!==null&&e.renderData.firstRenderedRowOffset!==null?e.renderData.firstRenderedRowOffset+"px":"0px"}},[r("div",{staticClass:"grid",style:{display:"-ms-grid",display:"grid","align-items":"center","grid-template-columns":"repeat("+e.configData.columnCount+", 1fr)",gap:e.configData.gridGap+"px"}},e._l(e.renderData.cellsToRender,function(i){return r("div",{key:i.id,staticClass:"grid-item-wrapper",style:{height:i.height+"px","grid-column-start":i.columnNumber,"grid-column-end":i.columnNumber+i.columnSpan,"grid-row-start":e.getGridRowStart(i,e.renderData)}},[r(i.renderComponent,e._g({tag:"component",attrs:{item:i}},e.$listeners))],1)}),0),r(e.loadingBatch&&e.loader,{tag:"component"})],1)},Ae=[];function Ge(e,t,r,i,o,s,l,n){var a=typeof e=="function"?e.options:e;t&&(a.render=t,a.staticRenderFns=r,a._compiled=!0);var d;if(o&&(d=o),d)if(a.functional){a._injectStyles=d;var g=a.render;a.render=function(p,m){return d.call(m),g(p,m)}}else{var u=a.beforeCreate;a.beforeCreate=u?[].concat(u,d):[d]}return{exports:e,options:a}}const U={};var Ue=Ge(c,ke,Ae,!1,He);function He(e){for(let t in U)this[t]=U[t]}var Ve=function(){return Ue.exports}();const qe={name:"FileLegacy",inheritAttrs:!1,props:{item:{type:Object,required:!0}},data(){return{loaded:!1,error:!1}},computed:{ariaUuid(){return`image-${this.item.injected.fileid}`},ariaLabel(){return v("photos",'Open the full size "{name}" image',{name:this.item.injected.basename})},isImage(){return this.item.injected.mime.startsWith("image")},decodedEtag(){return this.item.injected.etag.replace(""","").replace(""","")},src(){return x(`/core/preview?fileId=${this.item.injected.fileid}&c=${this.decodedEtag}&x=250&y=250&forceIcon=0&a=${this.croppedLayout?"0":"1"}`)},croppedLayout(){return this.$store.state.userConfig.croppedLayout}},beforeDestroy(){this.$refs.src=""},methods:{openViewer(){window.OCA.Viewer.open({fileInfo:W(this.item.injected),list:this.item.injected.list.map(e=>W(e))})},onLoad(){this.loaded=!0},onError(){this.error=!0},t:v}};var Be=function(){var e=this,t=e._self._c;return t("a",{staticClass:"file",class:{"file--cropped":e.croppedLayout},attrs:{href:e.item.injected.source,"aria-label":e.ariaLabel},on:{click:function(r){return r.preventDefault(),e.openViewer.apply(null,arguments)}}},[e.item.injected.mime.includes("video")&&e.item.injected.hasPreview?t("div",{staticClass:"icon-video-white"}):e._e(),t("transition-group",{staticClass:"transition-group",attrs:{name:"fade"}},[e.error?e._e():t("img",{key:`${e.item.injected.basename}-img`,ref:"img",attrs:{src:e.src,alt:e.item.injected.basename,"aria-describedby":e.ariaUuid},on:{load:e.onLoad,error:e.onError}}),!e.loaded||e.error?t("svg",{key:`${e.item.injected.basename}-svg`,attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"url(#placeholder__gradient)"}},[e.isImage?t("use",{attrs:{href:"#placeholder--img"}}):t("use",{attrs:{href:"#placeholder--video"}})]):e._e()]),t("p",{staticClass:"hidden-visually",attrs:{id:e.ariaUuid}},[e._v(e._s(e.item.injected.basename))]),t("div",{staticClass:"cover",attrs:{role:"none"}})],1)},Ke=[],Ye=R(qe,Be,Ke,!1,null,"f9084f09");const Qe=Ye.exports,Xe={name:"FolderTagPreview",components:{Folder:B,RouterLink:se},props:{name:{type:String,required:!0},path:{type:String,default:""},fileList:{type:Array,default:()=>[]}},data(){return{failed:[]}},computed:{isEmpty(){return this.previewList.length===0},ariaLabel(){return v("photos",'Open the "{name}" folder',{name:this.name})},previewList(){return this.fileList.filter(e=>this.failed.indexOf(e.fileid)===-1)},previewUrl(){if(this.previewList.length===0)return null;const{fileid:e,etag:t}=this.previewList.at(-1);return x(`/core/preview?fileId=${e}&c=${t}&x=250&y=250&forceIcon=0&a=0`)},toLink(){const e=`/files/${H()?.uid}`;let t=this.path.replace(new RegExp(`^${e}`),"");return t=/^\/?(.+)/i.exec(t)[1],{...this.$route,params:{path:t.split("/")}}}},methods:{onPreviewFail({fileid:e}){this.failed.push(e)},t:v}};var Je=function(){var e=this,t=e._self._c;return t("RouterLink",{staticClass:"folder",attrs:{to:e.toLink,"aria-label":e.ariaLabel}},[e.previewUrl?t("img",{staticClass:"folder__image",attrs:{src:e.previewUrl,alt:""},on:{error:function(r){return e.onPreviewFail(e.file)}}}):t("span",{staticClass:"folder__image folder__image--placeholder"},[t("Folder",{staticClass:"folder__icon",attrs:{size:96,"fill-color":"var(--color-primary-element)"}})],1),t("span",{staticClass:"folder__details"},[t("Folder"),t("span",{staticClass:"folder__title"},[e._v(e._s(e.name))])],1)])},Ze=[],et=R(Xe,Je,Ze,!1,null,"77be2b09");const tt=et.exports;async function Q(e="/",t={}){const r=x(`/apps/photos/api/v1/${t.shared?"shared":"albums"}`),i=(await ne.get(r+e,t)).data.map(n=>({...n,filename:`${w}${n.filename}`,source:decodeURI(Z+`${w}${n.filename}`)}));let o;const s=[],l=[];for(const n of i)n.filename===`${w}${e}`?o=n:n.type!=="file"?s.push(n):q.indexOf(n.mime)>-1&&l.push(n);return{folder:o,folders:s,files:l}}const rt=V({name:"FolderComponent",components:{FolderTagPreview:tt},mixins:[K],inheritAttrs:!1,props:{item:{type:Object,required:!0}},data(){return{previewFolder:this.item.injected.fileid}},computed:{files(){return this.$store.state.folders.files},subFolders(){return this.$store.state.folders.subFolders},folders(){return this.$store.state.folders.folders},folderContent(){return this.folders[this.item.injected.fileid]},previewFiles(){const e=this.folders[this.previewFolder],t=e?e.map(r=>this.files[r]).slice(0,4):[];if(t.length===0&&this.subFolders[this.previewFolder]&&this.previewFolder===this.item.injected.fileid){const r=this.subFolders[this.previewFolder][0];this.updatePreviewFolder(r),this.folders[this.previewFolder]||this.getFolderData(this.files[this.previewFolder].filename)}return t}},async created(){this.folderContent||await this.getFolderData(this.item.injected.filename)},methods:{async getFolderData(e){try{const t=`/files/${H()?.uid}`,r=e.replace(new RegExp(`^${t}`),""),{folder:i,folders:o,files:s}=await Q(r,{shared:this.item.injected.showShared,signal:this.abortController.signal});this.$store.dispatch("updateFolders",{fileid:i?.fileid,files:s,folders:o}),this.$store.dispatch("updateFoldersFiles",{folder:i,files:s,folders:o})}catch(t){j.error("Failed to get folder content",{error:t,filename:e})}},updatePreviewFolder(e){this.previewFolder=e}}});var it=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("FolderTagPreview",{attrs:{id:e.item.injected.fileid,name:e.item.injected.basename.toString(),path:e.item.injected.filename,"file-list":e.previewFiles}})},ot=[],nt=R(rt,it,ot,!1,null,"d58b828a");const at=nt.exports,C={400:{marginTop:66,marginW:8,count:3,folderCount:1},700:{marginTop:66,marginW:8,count:4,folderCount:1},1024:{marginTop:66,marginW:44,count:5,folderCount:2},1280:{marginTop:66,marginW:44,count:4,folderCount:2},1440:{marginTop:88,marginW:66,count:5,folderCount:3},1600:{marginTop:88,marginW:66,count:6,folderCount:4},2048:{marginTop:88,marginW:66,count:7,folderCount:4},2560:{marginTop:88,marginW:88,count:8,folderCount:6},3440:{marginTop:88,marginW:88,count:9,folderCount:8},max:{marginTop:88,marginW:88,count:10,folderCount:10}},_=new F({data(){return{gridConfig:C.max}},watch:{gridConfig(e){this.$emit("changed",e)}},created(){window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize()},beforeDestroy(){window.removeEventListener("resize",this.handleWindowResize)},methods:{handleWindowResize(){const e=Object.keys(C).map(t=>Number.parseInt(t)).find(t=>t>document.documentElement.clientWidth);this.gridConfig=C[e]||C.max}}}),st=V({data(){return{gridConfig:{}}},created(){_.$on("changed",this.handleGridConfigChange),j.debug("Grid config",{gridConfig:_.gridConfig}),this.gridConfig=_.gridConfig},beforeDestroy(){_.$off("changed",this.handleGridConfigChange)},methods:{handleGridConfigChange(e){this.gridConfig=e}}}),lt={name:"FoldersView",components:{FolderIcon:B,HeaderNavigation:le,NcEmptyContent:oe,NcLoadingIcon:ae,UploadPicker:re,VirtualGrid:Ve},mixins:[K,st],props:{rootTitle:{type:String,required:!0},path:{type:String,default:"/"},showShared:{type:Boolean,default:!1}},data(){return{error:null,allowedMimes:q,initializing:!0,loading:!1,appContent:document.getElementById("app-content-vue"),uploader:ie()}},computed:{files(){return this.$store.state.folders.files},folders(){return this.$store.state.folders.folders},folderId(){return this.$store.state.folders.paths[this.path]},folder(){return this.files[this.folderId]},folderAsFolder(){if(this.folder)return new ee({...this.folder,permissions:te(this.folder.permissions),owner:null})},folderContent(){return this.folders[this.folderId]||[]},fileList(){return this.folderContent&&this.folderContent.map(e=>this.files[e]).filter(e=>!!e)},subFolders(){return this.folderId&&this.files[this.folderId]&&this.$store.state.folders.subFolders[this.folderId]},folderList(){return this.subFolders&&this.subFolders.map(e=>this.files[e]).filter(e=>!!e)},contentList(){const e=this.folderList&&this.folderList.map(r=>({id:`folder-${r.fileid}`,injected:{...r,showShared:this.showShared},width:232,height:280,columnSpan:1,renderComponent:at})),t=this.fileList?.map(r=>({id:`file-${r.fileid}`,injected:{...r,list:this.fileList},width:256,height:256,columnSpan:1,renderComponent:Qe}));return[...e||[],...t||[]]},isEmpty(){return!this.haveFiles&&!this.haveFolders},haveFiles(){return!!this.fileList&&this.fileList.length!==0},haveFolders(){return!!this.folderList&&this.folderList.length!==0}},watch:{path(){this.fetchFolderContent()},showShared(){this.fetchFolderContent()}},beforeMount(){this.fetchFolderContent()},methods:{onRefresh(){this.fetchFolderContent()},async fetchFolderContent(){this.error=null,this.loading=!0,window.OCA?.Viewer?.close?.(),window.OCA?.Files?.Sidebar?.close?.(),(!this.files[this.folderId]||!this.folders[this.folderId])&&(this.initializing=!0);try{const{folder:e,folders:t,files:r}=await Q(this.path,{shared:this.showShared,signal:this.abortController.signal});this.$store.dispatch("addPath",{path:this.path,fileid:e?.fileid}),this.$store.dispatch("updateFolders",{fileid:e?.fileid,files:r,folders:t}),this.$store.dispatch("updateFoldersFiles",{folder:e,files:r,folders:t})}catch(e){e?.response&&e.response.status&&(e.response.status===404?(this.error=404,setTimeout(()=>{this.$router.push({name:this.$route.name??void 0})},3e3)):this.error=e),j.error("Error fetching album data",{error:e})}finally{this.loading=!1,this.initializing=!1}},async onUpload(e){const t=e.source.split(w).pop(),r=await de(w+t);if(r===null){j.error("Failed to fetch file",{relPath:t});return}const i={fileid:r.fileid,basename:r.basename,etag:r.attributes.etag,filename:r.root+r.path,source:r.source,lastmod:r.mtime?.getTime(),mime:r.mime,size:r.size,type:"file",permissions:"",hasPreview:r.attributes.hasPreview};this.$store.dispatch("appendFoldersFiles",[i]),this.$store.dispatch("addFilesToFolder",{fileid:this.folderId,files:[i]})},t:v}};var dt=function(){var e=this,t=e._self._c;return e.error===404?t("NcEmptyContent",{attrs:{name:e.t("photos","This folder does not exist")},scopedSlots:e._u([{key:"icon",fn:function(){return[t("FolderIcon")]},proxy:!0}],null,!1,1472452094)}):e.error?t("NcEmptyContent",{attrs:{name:e.t("photos","An error occurred")}}):e.initializing?t("NcEmptyContent",{attrs:{name:e.t("photos","Loading folders …")},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcLoadingIcon")]},proxy:!0}])}):e.initializing?e._e():t("div",[t("HeaderNavigation",{key:"navigation",class:{"photos-navigation--uploading":e.uploader.queue?.length>0},attrs:{loading:e.loading,path:e.path,title:e.folder?.basename?.toString?.()||e.rootTitle,"root-title":e.rootTitle},on:{refresh:e.onRefresh}},[t("UploadPicker",{attrs:{accept:e.allowedMimes,destination:e.folderAsFolder,multiple:!0},on:{uploaded:e.onUpload}})],1),e.isEmpty?t("NcEmptyContent",{key:"emptycontent",attrs:{name:e.t("photos","No photos in here")},scopedSlots:e._u([{key:"icon",fn:function(){return[t("FolderIcon")]},proxy:!0}],null,!1,1472452094)}):t("div",{staticClass:"grid-container",class:{"grid-container--folders":e.haveFolders}},[t("VirtualGrid",{ref:"virtualgrid",attrs:{items:e.contentList,"scroll-element":e.appContent,"get-column-count":()=>e.haveFolders?e.gridConfig.folderCount:e.gridConfig.count,"get-grid-gap":()=>e.haveFolders?16:8}})],1)],1)},ct=[],ft=R(lt,dt,ct,!1,null,"df5b01ef");const Dt=ft.exports;export{Dt as default};
+//# sourceMappingURL=FoldersView-BAsyjAUl.chunk.mjs.map
diff --git a/js/FoldersView-CJt37-bF.chunk.mjs.license b/js/FoldersView-BAsyjAUl.chunk.mjs.license
similarity index 100%
rename from js/FoldersView-CJt37-bF.chunk.mjs.license
rename to js/FoldersView-BAsyjAUl.chunk.mjs.license
diff --git a/js/FoldersView-CJt37-bF.chunk.mjs.map b/js/FoldersView-BAsyjAUl.chunk.mjs.map
similarity index 99%
rename from js/FoldersView-CJt37-bF.chunk.mjs.map
rename to js/FoldersView-BAsyjAUl.chunk.mjs.map
index 552d0d3a8..96e7cda79 100644
--- a/js/FoldersView-CJt37-bF.chunk.mjs.map
+++ b/js/FoldersView-BAsyjAUl.chunk.mjs.map
@@ -1 +1 @@
-{"version":3,"file":"FoldersView-CJt37-bF.chunk.mjs","sources":["../node_modules/vue-virtual-grid/dist/vue-virtual-grid.es.js","../src/components/FileLegacy.vue","../src/components/FolderTagPreview.vue","../src/services/FolderContent.ts","../src/components/FolderComponent.vue","../src/assets/grid-sizes.ts","../src/services/GridConfig.ts","../src/mixins/GridConfig.ts","../src/views/FoldersView.vue"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nimport Vue from \"vue\";\n/**\n * vue-class-component v7.2.6\n * (c) 2015-present Evan You\n * @license MIT\n */\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function(obj2) {\n return typeof obj2;\n };\n } else {\n _typeof = function(obj2) {\n return obj2 && typeof Symbol === \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? \"symbol\" : typeof obj2;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++)\n arr2[i] = arr[i];\n return arr2;\n }\n}\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\")\n return Array.from(iter);\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\nfunction reflectionIsSupported() {\n return typeof Reflect !== \"undefined\" && Reflect.defineMetadata && Reflect.getOwnMetadataKeys;\n}\nfunction copyReflectionMetadata(to, from) {\n forwardMetadata(to, from);\n Object.getOwnPropertyNames(from.prototype).forEach(function(key) {\n forwardMetadata(to.prototype, from.prototype, key);\n });\n Object.getOwnPropertyNames(from).forEach(function(key) {\n forwardMetadata(to, from, key);\n });\n}\nfunction forwardMetadata(to, from, propertyKey) {\n var metaKeys = propertyKey ? Reflect.getOwnMetadataKeys(from, propertyKey) : Reflect.getOwnMetadataKeys(from);\n metaKeys.forEach(function(metaKey) {\n var metadata = propertyKey ? Reflect.getOwnMetadata(metaKey, from, propertyKey) : Reflect.getOwnMetadata(metaKey, from);\n if (propertyKey) {\n Reflect.defineMetadata(metaKey, metadata, to, propertyKey);\n } else {\n Reflect.defineMetadata(metaKey, metadata, to);\n }\n });\n}\nvar fakeArray = {\n __proto__: []\n};\nvar hasProto = fakeArray instanceof Array;\nfunction createDecorator(factory) {\n return function(target, key, index) {\n var Ctor = typeof target === \"function\" ? target : target.constructor;\n if (!Ctor.__decorators__) {\n Ctor.__decorators__ = [];\n }\n if (typeof index !== \"number\") {\n index = void 0;\n }\n Ctor.__decorators__.push(function(options) {\n return factory(options, key, index);\n });\n };\n}\nfunction isPrimitive(value) {\n var type = _typeof(value);\n return value == null || type !== \"object\" && type !== \"function\";\n}\nfunction collectDataFromConstructor(vm, Component2) {\n var originalInit = Component2.prototype._init;\n Component2.prototype._init = function() {\n var _this = this;\n var keys = Object.getOwnPropertyNames(vm);\n if (vm.$options.props) {\n for (var key in vm.$options.props) {\n if (!vm.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n }\n keys.forEach(function(key2) {\n Object.defineProperty(_this, key2, {\n get: function get() {\n return vm[key2];\n },\n set: function set(value) {\n vm[key2] = value;\n },\n configurable: true\n });\n });\n };\n var data = new Component2();\n Component2.prototype._init = originalInit;\n var plainData = {};\n Object.keys(data).forEach(function(key) {\n if (data[key] !== void 0) {\n plainData[key] = data[key];\n }\n });\n return plainData;\n}\nvar $internalHooks = [\n \"data\",\n \"beforeCreate\",\n \"created\",\n \"beforeMount\",\n \"mounted\",\n \"beforeDestroy\",\n \"destroyed\",\n \"beforeUpdate\",\n \"updated\",\n \"activated\",\n \"deactivated\",\n \"render\",\n \"errorCaptured\",\n \"serverPrefetch\"\n];\nfunction componentFactory(Component2) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n options.name = options.name || Component2._componentTag || Component2.name;\n var proto = Component2.prototype;\n Object.getOwnPropertyNames(proto).forEach(function(key) {\n if (key === \"constructor\") {\n return;\n }\n if ($internalHooks.indexOf(key) > -1) {\n options[key] = proto[key];\n return;\n }\n var descriptor = Object.getOwnPropertyDescriptor(proto, key);\n if (descriptor.value !== void 0) {\n if (typeof descriptor.value === \"function\") {\n (options.methods || (options.methods = {}))[key] = descriptor.value;\n } else {\n (options.mixins || (options.mixins = [])).push({\n data: function data() {\n return _defineProperty({}, key, descriptor.value);\n }\n });\n }\n } else if (descriptor.get || descriptor.set) {\n (options.computed || (options.computed = {}))[key] = {\n get: descriptor.get,\n set: descriptor.set\n };\n }\n });\n (options.mixins || (options.mixins = [])).push({\n data: function data() {\n return collectDataFromConstructor(this, Component2);\n }\n });\n var decorators = Component2.__decorators__;\n if (decorators) {\n decorators.forEach(function(fn) {\n return fn(options);\n });\n delete Component2.__decorators__;\n }\n var superProto = Object.getPrototypeOf(Component2.prototype);\n var Super = superProto instanceof Vue ? superProto.constructor : Vue;\n var Extended = Super.extend(options);\n forwardStaticMembers(Extended, Component2, Super);\n if (reflectionIsSupported()) {\n copyReflectionMetadata(Extended, Component2);\n }\n return Extended;\n}\nvar shouldIgnore = {\n prototype: true,\n arguments: true,\n callee: true,\n caller: true\n};\nfunction forwardStaticMembers(Extended, Original, Super) {\n Object.getOwnPropertyNames(Original).forEach(function(key) {\n if (shouldIgnore[key]) {\n return;\n }\n var extendedDescriptor = Object.getOwnPropertyDescriptor(Extended, key);\n if (extendedDescriptor && !extendedDescriptor.configurable) {\n return;\n }\n var descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (!hasProto) {\n if (key === \"cid\") {\n return;\n }\n var superDescriptor = Object.getOwnPropertyDescriptor(Super, key);\n if (!isPrimitive(descriptor.value) && superDescriptor && superDescriptor.value === descriptor.value) {\n return;\n }\n }\n Object.defineProperty(Extended, key, descriptor);\n });\n}\nfunction Component(options) {\n if (typeof options === \"function\") {\n return componentFactory(options);\n }\n return function(Component2) {\n return componentFactory(Component2, options);\n };\n}\nComponent.registerHooks = function registerHooks(keys) {\n $internalHooks.push.apply($internalHooks, _toConsumableArray(keys));\n};\nglobalThis && globalThis.__spreadArrays || function() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nfunction needToProduceProvide(original) {\n return typeof original !== \"function\" || !original.managed && !original.managedReactive;\n}\nfunction produceProvide(original) {\n var provide = function() {\n var _this = this;\n var rv = typeof original === \"function\" ? original.call(this) : original;\n rv = Object.create(rv || null);\n rv[reactiveInjectKey] = Object.create(this[reactiveInjectKey] || {});\n for (var i in provide.managed) {\n rv[provide.managed[i]] = this[i];\n }\n var _loop_1 = function(i2) {\n rv[provide.managedReactive[i2]] = this_1[i2];\n Object.defineProperty(rv[reactiveInjectKey], provide.managedReactive[i2], {\n enumerable: true,\n configurable: true,\n get: function() {\n return _this[i2];\n }\n });\n };\n var this_1 = this;\n for (var i in provide.managedReactive) {\n _loop_1(i);\n }\n return rv;\n };\n provide.managed = {};\n provide.managedReactive = {};\n return provide;\n}\nvar reactiveInjectKey = \"__reactiveInject__\";\nfunction inheritInjected(componentOptions) {\n if (!Array.isArray(componentOptions.inject)) {\n componentOptions.inject = componentOptions.inject || {};\n componentOptions.inject[reactiveInjectKey] = {\n from: reactiveInjectKey,\n default: {}\n };\n }\n}\nvar reflectMetadataIsSupported = typeof Reflect !== \"undefined\" && typeof Reflect.getMetadata !== \"undefined\";\nfunction applyMetadata(options, target, key) {\n if (reflectMetadataIsSupported) {\n if (!Array.isArray(options) && typeof options !== \"function\" && !options.hasOwnProperty(\"type\") && typeof options.type === \"undefined\") {\n var type = Reflect.getMetadata(\"design:type\", target, key);\n if (type !== Object) {\n options.type = type;\n }\n }\n }\n}\nfunction Prop(options) {\n if (options === void 0) {\n options = {};\n }\n return function(target, key) {\n applyMetadata(options, target, key);\n createDecorator(function(componentOptions, k) {\n (componentOptions.props || (componentOptions.props = {}))[k] = options;\n })(target, key);\n };\n}\nfunction ProvideReactive(key) {\n return createDecorator(function(componentOptions, k) {\n var provide = componentOptions.provide;\n inheritInjected(componentOptions);\n if (needToProduceProvide(provide)) {\n provide = componentOptions.provide = produceProvide(provide);\n }\n provide.managedReactive[k] = key || k;\n });\n}\nfunction Watch(path, options) {\n if (options === void 0) {\n options = {};\n }\n var _a = options.deep, deep = _a === void 0 ? false : _a, _b = options.immediate, immediate = _b === void 0 ? false : _b;\n return createDecorator(function(componentOptions, handler) {\n if (typeof componentOptions.watch !== \"object\") {\n componentOptions.watch = /* @__PURE__ */ Object.create(null);\n }\n var watch = componentOptions.watch;\n if (typeof watch[path] === \"object\" && !Array.isArray(watch[path])) {\n watch[path] = [watch[path]];\n } else if (typeof watch[path] === \"undefined\") {\n watch[path] = [];\n }\n watch[path].push({ handler, deep, immediate });\n });\n}\nconst getGridGapDefault = (elementWidth, windowHeight) => {\n if (elementWidth > 720 && windowHeight > 480) {\n return 10;\n } else {\n return 5;\n }\n};\nconst getColumnCountDefault = (elementWidth) => {\n return Math.floor(elementWidth / 250);\n};\nconst getWindowMarginDefault = (windowHeight) => {\n return Math.round(windowHeight * 1.5);\n};\nconst getItemRatioHeightDefault = (height, width, columnWidth) => {\n const imageRatio = height / width;\n return Math.round(columnWidth * imageRatio);\n};\nconst debugLog = (condition, ...args) => {\n if (condition) {\n console.debug(...args);\n }\n};\nvar __defProp2 = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __decorateClass = (decorators, target, key, kind) => {\n var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;\n for (var i = decorators.length - 1, decorator; i >= 0; i--)\n if (decorator = decorators[i])\n result = (kind ? decorator(target, key, result) : decorator(result)) || result;\n if (kind && result)\n __defProp2(target, key, result);\n return result;\n};\nlet VirtualGrid$1 = class extends Vue {\n constructor() {\n super(...arguments);\n this.updateLock = false;\n this.bottomReached = false;\n this.ref = null;\n this.containerData = {\n windowSize: { height: 0, width: 0 },\n windowScroll: { x: 0, y: 0 },\n elementWindowOffset: 0,\n elementSize: { height: 0, width: 0 }\n };\n }\n get loadingBatch() {\n return this.loader && this.updateLock;\n }\n get configData() {\n return this.computeConfigData(this.containerData, this.items);\n }\n get layoutData() {\n return this.computeLayoutData(this.configData);\n }\n get renderData() {\n return this.computeRenderData(this.configData, this.containerData, this.layoutData);\n }\n mounted() {\n var _a;\n this.ref = this.$refs.virtualGrid;\n this.initiliazeGrid();\n window.addEventListener(\"resize\", this.resize);\n ((_a = this.scrollElement) != null ? _a : window).addEventListener(\"scroll\", this.scroll);\n }\n beforeDestroy() {\n var _a;\n window.removeEventListener(\"resize\", this.resize);\n ((_a = this.scrollElement) != null ? _a : window).removeEventListener(\"scroll\", this.scroll);\n }\n onScrollElementChanged(scrollElement, oldScrollElement) {\n (oldScrollElement != null ? oldScrollElement : window).removeEventListener(\"scroll\", this.scroll);\n (scrollElement != null ? scrollElement : window).addEventListener(\"scroll\", this.scroll);\n }\n resize() {\n this.loadMoreData();\n }\n scroll() {\n this.loadMoreData();\n }\n initiliazeGrid() {\n this.computeContainerData();\n this.$nextTick(async () => {\n this.loadMoreData();\n });\n }\n loadMoreData() {\n this.loadMoreDataAsync().catch((error) => {\n if (error) {\n console.error(\"Fail to load next data batch\", error);\n }\n }).then();\n }\n async loadMoreDataAsync() {\n this.computeContainerData();\n const windowTop = this.containerData.windowScroll.y;\n const windowBottom = windowTop + this.containerData.windowSize.height;\n const bottomTrigger = Math.max(0, this.containerData.elementWindowOffset + this.containerData.elementSize.height - this.updateTriggerMargin);\n if (!this.bottomReached && windowBottom >= bottomTrigger && !this.updateLock) {\n this.updateLock = true;\n debugLog(this.debug, \"Loading next batch\");\n const isLastBatch = await this.updateFunction();\n if (isLastBatch) {\n debugLog(this.debug, \"Bottom reached\");\n this.bottomReached = true;\n }\n this.updateLock = false;\n await this.loadMoreDataAsync();\n }\n return;\n }\n computeContainerData() {\n if (this.ref === null) {\n return;\n }\n const windowSize = this.getWindowSize();\n const windowScroll = this.getWindowScroll();\n const elementWindowOffset = this.getElementOffset(this.ref);\n const elementSize = this.getElementSize(this.ref);\n this.containerData = { windowSize, windowScroll, elementWindowOffset, elementSize };\n }\n computeConfigData(containerData, items) {\n if (containerData === null || items === null) {\n return {\n windowMargin: 0,\n gridGap: 0,\n columnCount: 1,\n entries: []\n };\n }\n const elementWidth = containerData.elementSize ? containerData.elementSize.width : 0;\n const windowMargin = this.getWindowMargin(containerData.windowSize.height);\n const gridGap = this.getGridGap(elementWidth, containerData.windowSize.height);\n const columnCount = this.getColumnCount(elementWidth);\n const columnWidth = this.getColumnWidth(columnCount, gridGap, elementWidth);\n const entries = items.map((item) => {\n if (!item.width) {\n return item;\n }\n const imageWidth = columnWidth * item.columnSpan + gridGap * (item.columnSpan - 1);\n return __spreadProps(__spreadValues({}, item), {\n height: this.getItemRatioHeight(item.height, item.width, imageWidth),\n width: imageWidth\n });\n });\n return {\n windowMargin,\n gridGap,\n columnCount,\n entries\n };\n }\n computeLayoutData(configData) {\n if (configData === null) {\n return { cells: [], totalHeight: 0 };\n }\n let currentRowNumber = 1;\n let prevRowsTotalHeight = 0;\n let currentRowMaxHeight = 0;\n let columnShift = 0;\n const cells = configData.entries.map((entry, index) => {\n const { columnCount, gridGap } = configData;\n let columnSpanRecompute = entry.columnSpan;\n let heightRecompute = entry.height;\n if (columnSpanRecompute < 1) {\n columnSpanRecompute = columnCount;\n }\n const distanceToRowStart = (index + columnShift) % columnCount;\n if (entry.newRow && distanceToRowStart !== 0) {\n columnShift += columnCount - distanceToRowStart;\n }\n const shiftedIndex = index + columnShift;\n const columnNumber = shiftedIndex % columnCount + 1;\n const rowNumber = Math.floor(shiftedIndex / columnCount) + 1;\n if (columnNumber + columnSpanRecompute > columnCount + 1) {\n const overlapNumber = columnNumber + columnSpanRecompute - columnCount - 1;\n const overlapRatio = overlapNumber / columnSpanRecompute;\n heightRecompute = heightRecompute * (1 - overlapRatio);\n columnSpanRecompute -= overlapNumber;\n }\n if (columnSpanRecompute > 1) {\n columnShift += columnSpanRecompute - 1;\n }\n if (rowNumber !== currentRowNumber) {\n currentRowNumber = rowNumber;\n prevRowsTotalHeight += currentRowMaxHeight + gridGap;\n currentRowMaxHeight = 0;\n }\n const offset = prevRowsTotalHeight;\n const height = Math.round(heightRecompute);\n currentRowMaxHeight = Math.max(currentRowMaxHeight, height);\n return __spreadProps(__spreadValues({}, entry), { columnNumber, rowNumber, offset, height, columnSpan: columnSpanRecompute });\n });\n const totalHeight = prevRowsTotalHeight + currentRowMaxHeight;\n return { cells, totalHeight };\n }\n computeRenderData(configData, containerData, layoutData) {\n if (layoutData === null || configData === null) {\n return { cellsToRender: [], firstRenderedRowNumber: 0, firstRenderedRowOffset: 0 };\n }\n const cellsToRender = [];\n let firstRenderedRowNumber = null;\n let firstRenderedRowOffset = null;\n if (containerData.elementWindowOffset !== null) {\n const elementWindowOffset = containerData.elementWindowOffset;\n for (const cell of layoutData.cells) {\n const cellTop = elementWindowOffset + cell.offset;\n const cellBottom = cellTop + cell.height;\n const windowTop = containerData.windowScroll.y;\n const windowBottom = windowTop + containerData.windowSize.height;\n const renderTop = windowTop - configData.windowMargin;\n const renderBottom = windowBottom + configData.windowMargin;\n if (cellTop > renderBottom) {\n continue;\n }\n if (cellBottom < renderTop) {\n continue;\n }\n if (firstRenderedRowNumber === null) {\n firstRenderedRowNumber = cell.rowNumber;\n }\n if (cell.rowNumber === firstRenderedRowNumber) {\n firstRenderedRowOffset = firstRenderedRowOffset ? Math.min(firstRenderedRowOffset, cell.offset) : cell.offset;\n }\n cellsToRender.push(cell);\n }\n }\n return { cellsToRender, firstRenderedRowNumber, firstRenderedRowOffset };\n }\n getColumnWidth(columnCount, gridGap, elementWidth) {\n if (columnCount === null || gridGap === null || elementWidth === null) {\n return 0;\n }\n const totalGapSpace = (columnCount - 1) * gridGap;\n const columnWidth = Math.round((elementWidth - totalGapSpace) / columnCount);\n return columnWidth;\n }\n getGridRowStart(cell, renderData) {\n if (renderData === null) {\n return void 0;\n }\n const offset = renderData.firstRenderedRowNumber !== null ? renderData.firstRenderedRowNumber - 1 : 0;\n const gridRowStart = cell.rowNumber - offset;\n return `${gridRowStart}`;\n }\n resetGrid() {\n this.bottomReached = false;\n this.loadMoreData();\n }\n isSameElementSize(a, b) {\n return a.width === b.width && a.height === b.height;\n }\n getWindowSize() {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n getElementSize(element) {\n const rect = element.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height\n };\n }\n isSameElementScroll(a, b) {\n return a.x === b.x && a.y === b.y;\n }\n getWindowScroll() {\n return {\n x: window.scrollX,\n y: window.scrollY\n };\n }\n getElementOffset(element) {\n return window.scrollY + element.getBoundingClientRect().top;\n }\n};\n__decorateClass([\n Prop({ required: true })\n], VirtualGrid$1.prototype, \"items\", 2);\n__decorateClass([\n Prop({ default: () => () => true })\n], VirtualGrid$1.prototype, \"updateFunction\", 2);\n__decorateClass([\n Prop({ default: () => getGridGapDefault })\n], VirtualGrid$1.prototype, \"getGridGap\", 2);\n__decorateClass([\n Prop({ default: () => getColumnCountDefault })\n], VirtualGrid$1.prototype, \"getColumnCount\", 2);\n__decorateClass([\n Prop({ default: () => getWindowMarginDefault })\n], VirtualGrid$1.prototype, \"getWindowMargin\", 2);\n__decorateClass([\n Prop({ default: () => getItemRatioHeightDefault })\n], VirtualGrid$1.prototype, \"getItemRatioHeight\", 2);\n__decorateClass([\n Prop({ default: null })\n], VirtualGrid$1.prototype, \"scrollElement\", 2);\n__decorateClass([\n Prop({ default: 500 })\n], VirtualGrid$1.prototype, \"updateTriggerMargin\", 2);\n__decorateClass([\n Prop({ default: null })\n], VirtualGrid$1.prototype, \"loader\", 2);\n__decorateClass([\n Prop({ default: false })\n], VirtualGrid$1.prototype, \"debug\", 2);\n__decorateClass([\n ProvideReactive()\n], VirtualGrid$1.prototype, \"updateLock\", 2);\n__decorateClass([\n ProvideReactive()\n], VirtualGrid$1.prototype, \"bottomReached\", 2);\n__decorateClass([\n ProvideReactive()\n], VirtualGrid$1.prototype, \"ref\", 2);\n__decorateClass([\n ProvideReactive()\n], VirtualGrid$1.prototype, \"containerData\", 2);\n__decorateClass([\n Watch(\"scrollElement\")\n], VirtualGrid$1.prototype, \"onScrollElementChanged\", 1);\nVirtualGrid$1 = __decorateClass([\n Component({\n name: \"VirtualGrid\"\n })\n], VirtualGrid$1);\nvar render = function() {\n var _vm = this;\n var _h = _vm.$createElement;\n var _c = _vm._self._c || _h;\n return _c(\"div\", { ref: \"virtualGrid\", style: {\n boxSizing: \"border-box\",\n height: _vm.layoutData.totalHeight + \"px\",\n paddingTop: _vm.renderData !== null && _vm.renderData.firstRenderedRowOffset !== null ? _vm.renderData.firstRenderedRowOffset + \"px\" : \"0px\"\n } }, [_c(\"div\", { staticClass: \"grid\", style: {\n \"display\": \"-ms-grid\",\n \"display\": \"grid\",\n \"align-items\": \"center\",\n \"grid-template-columns\": \"repeat(\" + _vm.configData.columnCount + \", 1fr)\",\n \"gap\": _vm.configData.gridGap + \"px\"\n } }, _vm._l(_vm.renderData.cellsToRender, function(item) {\n return _c(\"div\", { key: item.id, staticClass: \"grid-item-wrapper\", style: {\n \"height\": item.height + \"px\",\n \"grid-column-start\": item.columnNumber,\n \"grid-column-end\": item.columnNumber + item.columnSpan,\n \"grid-row-start\": _vm.getGridRowStart(item, _vm.renderData)\n } }, [_c(item.renderComponent, _vm._g({ tag: \"component\", attrs: { \"item\": item } }, _vm.$listeners))], 1);\n }), 0), _c(_vm.loadingBatch && _vm.loader, { tag: \"component\" })], 1);\n};\nvar staticRenderFns = [];\nfunction normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {\n var options = typeof scriptExports === \"function\" ? scriptExports.options : scriptExports;\n if (render2) {\n options.render = render2;\n options.staticRenderFns = staticRenderFns2;\n options._compiled = true;\n }\n if (functionalTemplate) {\n options.functional = true;\n }\n if (scopeId) {\n options._scopeId = \"data-v-\" + scopeId;\n }\n var hook;\n if (moduleIdentifier) {\n hook = function(context) {\n context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;\n if (!context && typeof __VUE_SSR_CONTEXT__ !== \"undefined\") {\n context = __VUE_SSR_CONTEXT__;\n }\n if (injectStyles) {\n injectStyles.call(this, context);\n }\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n };\n options._ssrRegister = hook;\n } else if (injectStyles) {\n hook = shadowMode ? function() {\n injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);\n } : injectStyles;\n }\n if (hook) {\n if (options.functional) {\n options._injectStyles = hook;\n var originalRender = options.render;\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n return {\n exports: scriptExports,\n options\n };\n}\nconst __cssModules = {};\nvar __component__ = /* @__PURE__ */ normalizeComponent(VirtualGrid$1, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);\nfunction __vue2_injectStyles(context) {\n for (let o in __cssModules) {\n this[o] = __cssModules[o];\n }\n}\nvar VirtualGrid = /* @__PURE__ */ function() {\n return __component__.exports;\n}();\nexport { VirtualGrid as default };\n","\n\n\n\t\n\t\t\n\t\t\n\t\t {{ item.injected.basename }} {{ item.injected.basename }}\n\n\t\t\t\n\t\t
\n\n\t\t\n\t\t\t
\n\n\t\t\t\n\t\t
\n\n\t\t\n\t\t\t
T)){if(l<0)l=T+(l+1);else if(l===0)continue;a.indexOf(l)===-1&&a.push(l)}}return a.sort(function(u,c){return u-c})}_byDayAndMonthDay(e){let r,i=this.by_data.BYDAY,T,a=0,n,s=i.length,l=0,u,c=this,A=this.last.day;function E(){for(u=d.daysInMonth(c.last.month,c.last.year),r=c.normalizeByMonthDayRules(c.last.year,c.last.month,c.by_data.BYMONTHDAY),n=r.length;r[a]<=A&&!(e&&r[a]==A)&&ar&&(this.last.day=1,this.increment_month(),this.is_day_in_byday(this.last)?(!this.has_by_data("BYSETPOS")||this.check_set_position(1))&&(e=1):e=0)}else if(this.has_by_data("BYMONTHDAY")){if(this.by_indices.BYMONTHDAY++,this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length&&(this.by_indices.BYMONTHDAY=0,this.increment_month(),this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length))return 0;let r=d.daysInMonth(this.last.month,this.last.year),i=this.by_data.BYMONTHDAY[this.by_indices.BYMONTHDAY];i<0&&(i=r+i+1),i>r?(this.last.day=1,e=this.is_day_in_byday(this.last)):this.last.day=i}else{this.increment_month();let r=d.daysInMonth(this.last.month,this.last.year);this.by_data.BYMONTHDAY[0]>r?e=0:this.last.day=this.by_data.BYMONTHDAY[0]}return e}next_weekday_by_week(){let e=0;if(this.next_hour()==0)return e;if(!this.has_by_data("BYDAY"))return 1;for(;;){let r=new d;this.by_indices.BYDAY++,this.by_indices.BYDAY==Object.keys(this.by_data.BYDAY).length&&(this.by_indices.BYDAY=0,e=1);let i=this.by_data.BYDAY[this.by_indices.BYDAY],T=this.ruleDayOfWeek(i)[1];T-=this.rule.wkst,T<0&&(T+=7),r.year=this.last.year,r.month=this.last.month,r.day=this.last.day;let a=r.startDoyWeek(this.rule.wkst);if(T+a<1&&!e)continue;let n=d.fromDayOfYear(a+T,this.last.year);return this.last.year=n.year,this.last.month=n.month,this.last.day=n.day,e}}next_year(){if(this.next_hour()==0)return 0;if(++this.days_index==this.days.length){this.days_index=0;do this.increment_year(this.rule.interval),this.has_by_data("BYMONTHDAY")&&(this.by_data.BYMONTHDAY=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY)),this.expand_year_days(this.last.year);while(this.days.length==0)}return this._nextByYearDay(),1}_nextByYearDay(){let e=this.days[this.days_index],r=this.last.year;e<1&&(e+=1,r+=1);let i=d.fromDayOfYear(e,r);this.last.day=i.day,this.last.month=i.month}ruleDayOfWeek(e,r){let i=e.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);if(i){let T=parseInt(i[1]||0,10);return e=P.icalDayToNumericDay(i[2],r),[T,e]}else return[0,0]}next_generic(e,r,i,T,a){let n=e in this.by_data,s=this.rule.freq==r,l=0;if(a&&this[a]()==0)return l;if(n){this.by_indices[e]++;let u=this.by_data[e];this.by_indices[e]==u.length&&(this.by_indices[e]=0,l=1),this.last[i]=u[this.by_indices[e]]}else s&&this["increment_"+i](this.rule.interval);return n&&l&&s&&this["increment_"+T](1),l}increment_monthday(e){for(let r=0;r\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{ place.label }}\n\t\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{ option.label }}\n\t\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{ place.label }}\n\t\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{ option.label }}\n\t\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\n\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\t{{ dateMonthAndYear(file.id) }}\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t
\n\t\t\n\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\t{{ dateMonthAndYear(file.id) }}\n\t\t\t\t
\n\n\t\t\t\t
\\n');\n } else if (!token.isLink || !opts.check(token)) {\n result.push(escapeText(token.toString()));\n } else {\n result.push(opts.render(token));\n }\n }\n\n return result.join('');\n}\n\nif (!String.prototype.linkify) {\n Object.defineProperty(String.prototype, 'linkify', {\n writable: false,\n value: function linkify(options) {\n return linkifyStr(this, options);\n }\n });\n}\n\nexport { linkifyStr as default };\n","import '../assets/NcAppSidebar-BFg2HHh6.css';\nimport { Portal } from \"@linusborg/vue-simple-portal\";\nimport NcVNodes from \"../Components/NcVNodes.mjs\";\nimport { N as NcCheckboxRadioSwitch } from \"./NcCheckboxRadioSwitch-VeztTzpz.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { N as NcActions } from \"./NcActions-B4VZCD8B.mjs\";\nimport { N as NcAppSidebarHeader } from \"./NcAppSidebarHeader-G2VD8Nfl.mjs\";\nimport NcButton from \"../Components/NcButton.mjs\";\nimport NcEmptyContent from \"../Components/NcEmptyContent.mjs\";\nimport NcLoadingIcon from \"../Components/NcLoadingIcon.mjs\";\nimport directive from \"../Directives/Focus.mjs\";\nimport { useIsSmallMobile } from \"../Composables/useIsMobile.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nimport { g as getTrapStack } from \"./focusTrap-DmkaYJTC.mjs\";\nimport { r as register, R as t13, a as t } from \"./_l10n-DQgzdF9S.mjs\";\nimport { A as ArrowRight } from \"./ArrowRight-CY2b9hgN.mjs\";\nimport { C as Close } from \"./Close-BtLPUSdO.mjs\";\nimport { vOnClickOutside } from \"@vueuse/components\";\nimport { createFocusTrap } from \"focus-trap\";\nimport Vue, { ref, provide } from \"vue\";\nconst _sfc_main$4 = {\n name: \"NcAppSidebarTabs\",\n components: {\n NcCheckboxRadioSwitch,\n NcVNodes\n },\n provide() {\n return {\n registerTab: this.registerTab,\n unregisterTab: this.unregisterTab,\n // Getter as an alternative to Vue 2.7 computed(() => this.activeTab)\n getActiveTab: () => this.activeTab,\n // Used to check whether the tab header is shown so the tabs can reference the tab header for `aria-labelledby` or not\n isTablistShown: () => this.hasMultipleTabs\n };\n },\n props: {\n /**\n * Id of the tab to activate\n */\n active: {\n type: String,\n default: \"\"\n },\n /**\n * Force the tab navigation to display even if there is only one tab\n */\n forceTabs: {\n type: Boolean,\n default: false\n }\n },\n emits: [\"update:active\"],\n data() {\n return {\n /**\n * Tab descriptions from the passed NcSidebarTab components' props to build the tab navbar from.\n */\n tabs: [],\n /**\n * Local active (open) tab's ID. It allows to use component without active.sync\n */\n activeTab: \"\"\n };\n },\n computed: {\n /**\n * Has multiple tabs. If only one tab - its content is shown without navigation\n *\n * @return {boolean}\n */\n hasMultipleTabs() {\n return this.tabs.length > 1;\n },\n showForSingleTab() {\n return this.forceTabs && this.tabs.length === 1;\n },\n currentTabIndex() {\n return this.tabs.findIndex((tab) => tab.id === this.activeTab);\n }\n },\n watch: {\n active(active) {\n if (active !== this.activeTab) {\n this.updateActive();\n }\n }\n },\n methods: {\n /**\n * Set the current active tab\n *\n * @param {string} id the id of the tab\n */\n setActive(id) {\n this.activeTab = id;\n this.$emit(\"update:active\", this.activeTab);\n },\n /**\n * Focus the previous tab\n * and emit to the parent component\n */\n focusPreviousTab() {\n if (this.currentTabIndex > 0) {\n this.setActive(this.tabs[this.currentTabIndex - 1].id);\n }\n this.focusActiveTab();\n },\n /**\n * Focus the next tab\n * and emit to the parent component\n */\n focusNextTab() {\n if (this.currentTabIndex < this.tabs.length - 1) {\n this.setActive(this.tabs[this.currentTabIndex + 1].id);\n }\n this.focusActiveTab();\n },\n /**\n * Focus the first tab\n * and emit to the parent component\n */\n focusFirstTab() {\n this.setActive(this.tabs[0].id);\n this.focusActiveTab();\n },\n /**\n * Focus the last tab\n * and emit to the parent component\n */\n focusLastTab() {\n this.setActive(this.tabs[this.tabs.length - 1].id);\n this.focusActiveTab();\n },\n /**\n * Focus the current active tab\n */\n focusActiveTab() {\n this.$el.querySelector(`#tab-button-${this.activeTab}`).focus();\n },\n /**\n * Focus the content on tab\n * see aria accessibility guidelines\n */\n focusActiveTabContent() {\n this.$el.querySelector(\"#tab-\" + this.activeTab).focus();\n },\n /**\n * Update the current active tab\n */\n updateActive() {\n this.activeTab = this.active && this.tabs.some((tab) => tab.id === this.active) ? this.active : this.tabs.length > 0 ? this.tabs[0].id : \"\";\n },\n /**\n * Register child tab in the tabs\n *\n * @param {object} tab child tab passed to slot\n */\n registerTab(tab) {\n this.tabs.push(tab);\n this.tabs.sort((a, b) => {\n if (a.order === b.order) {\n return OC.Util.naturalSortCompare(a.name, b.name);\n }\n return a.order - b.order;\n });\n this.updateActive();\n },\n /**\n * Unregister child tab from the tabs\n *\n * @param {string} id tab's id\n */\n unregisterTab(id) {\n const tabIndex = this.tabs.findIndex((tab) => tab.id === id);\n if (tabIndex !== -1) {\n this.tabs.splice(tabIndex, 1);\n }\n if (this.activeTab === id) {\n this.updateActive();\n }\n }\n }\n};\nvar _sfc_render$4 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"app-sidebar-tabs\" }, [_vm.hasMultipleTabs || _vm.showForSingleTab ? _c(\"div\", { staticClass: \"app-sidebar-tabs__nav\", attrs: { \"role\": \"tablist\" }, on: { \"keydown\": [function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"left\", 37, $event.key, [\"Left\", \"ArrowLeft\"])) return null;\n if (\"button\" in $event && $event.button !== 0) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusPreviousTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"right\", 39, $event.key, [\"Right\", \"ArrowRight\"])) return null;\n if (\"button\" in $event && $event.button !== 2) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusNextTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"tab\", 9, $event.key, \"Tab\")) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusActiveTabContent.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"home\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusFirstTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"end\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusLastTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"page-up\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusFirstTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"page-down\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusLastTab.apply(null, arguments);\n }] } }, _vm._l(_vm.tabs, function(tab) {\n return _c(\"NcCheckboxRadioSwitch\", { key: tab.id, staticClass: \"app-sidebar-tabs__tab\", class: { active: tab.id === _vm.activeTab }, attrs: { \"aria-controls\": `tab-${tab.id}`, \"aria-selected\": String(_vm.activeTab === tab.id), \"button-variant\": true, \"checked\": _vm.activeTab === tab.id, \"wrapper-id\": `tab-button-${tab.id}`, \"tabindex\": _vm.activeTab === tab.id ? 0 : -1, \"button-variant-grouped\": \"horizontal\", \"role\": \"tab\", \"type\": \"button\" }, on: { \"update:checked\": function($event) {\n return _vm.setActive(tab.id);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"NcVNodes\", { attrs: { \"vnodes\": tab.renderIcon() } }, [_c(\"span\", { staticClass: \"app-sidebar-tabs__tab-icon\", class: tab.icon })])];\n }, proxy: true }], null, true) }, [_c(\"span\", { staticClass: \"app-sidebar-tabs__tab-caption\" }, [_vm._v(\" \" + _vm._s(tab.name) + \" \")])]);\n }), 1) : _vm._e(), _c(\"div\", { staticClass: \"app-sidebar-tabs__content\", class: { \"app-sidebar-tabs__content--multiple\": _vm.hasMultipleTabs } }, [_vm._t(\"default\")], 2)]);\n};\nvar _sfc_staticRenderFns$4 = [];\nvar __component__$4 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$4,\n _sfc_render$4,\n _sfc_staticRenderFns$4,\n false,\n null,\n \"d9f30f05\"\n);\nconst NcAppSidebarTabs = __component__$4.exports;\nregister(t13);\nconst _sfc_main$3 = {\n name: \"DockRightIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$3 = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon dock-right-icon\", attrs: { \"aria-hidden\": _vm.title ? null : \"true\", \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M20 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V6A2 2 0 0 0 20 4M15 18H4V6H15Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$3 = [];\nvar __component__$3 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$3,\n _sfc_render$3,\n _sfc_staticRenderFns$3,\n false,\n null,\n null\n);\nconst IconDockRight = __component__$3.exports;\nconst _sfc_main$2 = {\n name: \"StarIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$2 = function render3() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon star-icon\", attrs: { \"aria-hidden\": _vm.title ? null : \"true\", \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$2 = [];\nvar __component__$2 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$2,\n _sfc_render$2,\n _sfc_staticRenderFns$2,\n false,\n null,\n null\n);\nconst Star = __component__$2.exports;\nconst _sfc_main$1 = {\n name: \"StarOutlineIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render4() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon star-outline-icon\", attrs: { \"aria-hidden\": _vm.title ? null : \"true\", \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst StarOutline = __component__$1.exports;\nconst _sfc_main = {\n name: \"NcAppSidebar\",\n components: {\n Teleport: Portal,\n NcActions,\n NcAppSidebarHeader,\n NcAppSidebarTabs,\n ArrowRight,\n IconDockRight,\n NcButton,\n NcLoadingIcon,\n NcEmptyContent,\n Close,\n Star,\n StarOutline\n },\n directives: {\n focus: directive,\n ClickOutside: vOnClickOutside\n },\n inject: {\n ncContentSelector: {\n from: \"NcContent:selector\",\n default: void 0\n }\n },\n props: {\n active: {\n type: String,\n default: \"\"\n },\n name: {\n type: String,\n default: \"\",\n required: true\n },\n /**\n * Allow to edit the sidebar name.\n */\n nameEditable: {\n type: Boolean,\n default: false\n },\n namePlaceholder: {\n type: String,\n default: \"\"\n },\n subname: {\n type: String,\n default: \"\"\n },\n /**\n * Title to display for the subname.\n */\n subtitle: {\n type: String,\n default: \"\"\n },\n /**\n * Url to the top header background image\n * Applied with css\n */\n background: {\n type: String,\n default: \"\"\n },\n /**\n * Enable the favourite icon if not null\n * See fired events\n */\n starred: {\n type: Boolean,\n default: null\n },\n /**\n * Show loading spinner instead of the star icon\n */\n starLoading: {\n type: Boolean,\n default: false\n },\n /**\n * Show loading spinner instead of tabs\n */\n loading: {\n type: Boolean,\n default: false\n },\n /**\n * Display the sidebar in compact mode\n */\n compact: {\n type: Boolean,\n default: false\n },\n /**\n * Only display close button and default slot content.\n * Don't display other header content and primary and secondary actions.\n * Useful when showing the EmptyContent component as content.\n */\n empty: {\n type: Boolean,\n default: false\n },\n /**\n * Force the actions to display in a three dot menu\n */\n forceMenu: {\n type: Boolean,\n default: false\n },\n /**\n * Force the tab navigation to display even if there is only one tab\n */\n forceTabs: {\n type: Boolean,\n default: false\n },\n /**\n * Linkify the name\n */\n linkifyName: {\n type: Boolean,\n default: false\n },\n /**\n * Title to display for the name.\n * Can be set to the same text in case it's too long.\n */\n title: {\n type: String,\n default: \"\"\n },\n /**\n * Allow to conditionally show the sidebar\n * You can also use `v-if` on the sidebar, but using the open prop allow to keep\n * the sidebar inside the DOM for performance if it is opened and closed multiple times.\n *\n * When using the `open` property to close the sidebar a built-in toggle button will be shown to reopen it,\n * similar to the app navigation. You can remove this button with the `no-toggle` prop.\n */\n open: {\n type: Boolean,\n default: true\n },\n /**\n * Custom classes to assign to the sidebar toggle button.\n * If needed this can be used to assign styles to the button using `:deep()` selector.\n */\n toggleClasses: {\n type: [String, Array, Object],\n default: \"\"\n },\n /**\n * Custom attrs to assign to the sidebar toggle button.\n */\n toggleAttrs: {\n type: Object,\n default: void 0\n },\n /**\n * Do not add the built-in toggle button with `open` prop.\n */\n noToggle: {\n type: Boolean,\n default: false\n }\n },\n emits: [\n \"close\",\n \"closing\",\n \"closed\",\n \"opening\",\n \"opened\",\n \"figure-click\",\n \"update:active\",\n \"update:name\",\n \"update:nameEditable\",\n \"update:open\",\n \"update:starred\",\n \"submit-name\",\n \"dismiss-editing\"\n ],\n setup() {\n const headerRef = ref(null);\n provide(\"NcAppSidebar:header:ref\", headerRef);\n return {\n uid: GenRandomId(),\n isMobile: useIsSmallMobile(),\n headerRef\n };\n },\n data() {\n return {\n changeNameTranslated: t(\"Change name\"),\n closeTranslated: t(\"Close sidebar\"),\n favoriteTranslated: t(\"Favorite\"),\n isStarred: this.starred,\n focusTrap: null,\n elementToReturnFocus: null\n };\n },\n computed: {\n canStar() {\n return this.isStarred !== null;\n },\n hasFigure() {\n return this.$slots.header || this.background;\n },\n hasFigureClickListener() {\n return this.$listeners[\"figure-click\"];\n }\n },\n watch: {\n starred() {\n this.isStarred = this.starred;\n },\n isMobile() {\n this.toggleFocusTrap();\n },\n open() {\n this.checkToggleButtonContainerAvailability();\n }\n },\n created() {\n this.preserveElementToReturnFocus();\n this.checkToggleButtonContainerAvailability();\n },\n beforeDestroy() {\n this.$emit(\"closed\");\n this.focusTrap?.deactivate();\n },\n methods: {\n t,\n preserveElementToReturnFocus() {\n if (document.activeElement && document.activeElement !== document.body) {\n this.elementToReturnFocus = document.activeElement;\n if (this.elementToReturnFocus.getAttribute(\"role\") === \"menuitem\") {\n const menu = this.elementToReturnFocus.closest('[role=\"menu\"]');\n if (menu) {\n const menuTrigger = document.querySelector(`[aria-controls=\"${menu.id}\"]`);\n this.elementToReturnFocus = menuTrigger;\n }\n }\n }\n },\n initFocusTrap() {\n if (this.focusTrap) {\n return;\n }\n this.focusTrap = createFocusTrap([\n // The sidebar itself\n this.$refs.sidebar,\n // Nextcloud Server header navigarion\n document.querySelector(\"#header\")\n ], {\n allowOutsideClick: true,\n fallbackFocus: this.$refs.closeButton.$el,\n trapStack: getTrapStack(),\n escapeDeactivates: false\n });\n },\n /**\n * Activate focus trap if it is currently needed, otherwise deactivate\n */\n toggleFocusTrap() {\n if (this.open && this.isMobile) {\n this.initFocusTrap();\n this.focusTrap.activate();\n } else {\n this.focusTrap?.deactivate();\n }\n },\n /**\n * Close the sidebar on pressing the escape key on mobile\n *\n * @param {KeyboardEvent} event key down event\n */\n onKeydownEsc(event) {\n if (this.isMobile) {\n event.stopPropagation();\n this.closeSidebar();\n }\n },\n onBeforeEnter(element) {\n this.$emit(\"opening\", element);\n },\n onAfterEnter(element) {\n if (this.elementToReturnFocus) {\n this.focus();\n }\n this.toggleFocusTrap();\n this.$emit(\"opened\", element);\n },\n onBeforeLeave(element) {\n this.$emit(\"closing\", element);\n },\n onAfterLeave(element) {\n this.$emit(\"closed\", element);\n this.toggleFocusTrap();\n this.elementToReturnFocus?.focus({ focusVisible: true });\n this.elementToReturnFocus = null;\n },\n /**\n * Used to tell parent component the user asked to close the sidebar\n *\n * @param {Event} e close icon click event\n */\n closeSidebar(e) {\n this.$emit(\"close\", e);\n this.$emit(\"update:open\", false);\n },\n /**\n * Emit figure click event to parent component\n *\n * @param {Event} e click event\n */\n onFigureClick(e) {\n this.$emit(\"figure-click\", e);\n },\n /**\n * Toggle the favourite state\n * and emit to the parent component\n */\n toggleStarred() {\n this.isStarred = !this.isStarred;\n this.$emit(\"update:starred\", this.isStarred);\n },\n editName() {\n this.$emit(\"update:nameEditable\", true);\n if (this.nameEditable) {\n this.$nextTick(\n () => this.$refs.nameInput.focus()\n );\n }\n },\n /**\n * Focus the sidebar\n * @public\n */\n focus() {\n if (!this.open && !this.noToggle) {\n this.$refs.toggle.$el.focus();\n return;\n }\n try {\n this.headerRef.focus();\n } catch {\n Vue.util.warn(\"NcAppSidebar should have focusable header for accessibility reasons. Use NcAppSidebarHeader component.\");\n }\n },\n /**\n * Focus the active tab\n * @public\n */\n focusActiveTabContent() {\n this.preserveElementToReturnFocus();\n this.$refs.tabs.focusActiveTabContent();\n },\n /**\n * Check if the toggle button container is available\n */\n checkToggleButtonContainerAvailability() {\n if (this.open === false && !this.noToggle && !this.ncContentSelector) {\n console.warn(\n \"[NcAppSidebar] It looks like you want to use NcAppSidebar with the built-in toggle button. This feature is only available when NcAppSidebar is used in NcContent.\"\n );\n }\n },\n /**\n * Emit name change event to parent component\n *\n * @param {Event} event input event\n */\n onNameInput(event) {\n this.$emit(\"update:name\", event.target.value);\n },\n /**\n * Emit when the name form edit confirm button is pressed in order\n * to change the name.\n *\n * @param {Event} event submit event\n */\n onSubmitName(event) {\n this.$emit(\"update:nameEditable\", false);\n this.$emit(\"submit-name\", event);\n },\n onDismissEditing() {\n this.$emit(\"update:nameEditable\", false);\n this.$emit(\"dismiss-editing\");\n },\n onUpdateActive(activeTab) {\n this.$emit(\"update:active\", activeTab);\n }\n }\n};\nvar _sfc_render = function render5() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"transition\", { attrs: { \"appear\": \"\", \"name\": \"slide-right\" }, on: { \"before-enter\": _vm.onBeforeEnter, \"after-enter\": _vm.onAfterEnter, \"before-leave\": _vm.onBeforeLeave, \"after-leave\": _vm.onAfterLeave } }, [_c(\"aside\", { directives: [{ name: \"show\", rawName: \"v-show\", value: _vm.open, expression: \"open\" }], ref: \"sidebar\", staticClass: \"app-sidebar\", attrs: { \"id\": \"app-sidebar-vue\", \"aria-labelledby\": `app-sidebar-vue-${_vm.uid}__header` }, on: { \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"esc\", 27, $event.key, [\"Esc\", \"Escape\"])) return null;\n return _vm.onKeydownEsc.apply(null, arguments);\n } } }, [_vm.ncContentSelector && !_vm.open && !_vm.noToggle ? _c(\"Teleport\", { attrs: { \"selector\": _vm.ncContentSelector } }, [_c(\"NcButton\", _vm._b({ ref: \"toggle\", staticClass: \"app-sidebar__toggle\", class: _vm.toggleClasses, attrs: { \"aria-label\": _vm.t(\"Open sidebar\"), \"variant\": \"tertiary\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"update:open\", true);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm._t(\"toggle-icon\", function() {\n return [_c(\"IconDockRight\", { attrs: { \"size\": 20 } })];\n })];\n }, proxy: true }], null, true) }, \"NcButton\", _vm.toggleAttrs, false))], 1) : _vm._e(), _c(\"header\", { staticClass: \"app-sidebar-header\", class: {\n \"app-sidebar-header--with-figure\": _vm.hasFigure,\n \"app-sidebar-header--compact\": _vm.compact\n } }, [!_vm.empty ? _vm._t(\"info\", function() {\n return [_c(\"div\", { staticClass: \"app-sidebar-header__info\" }, [_vm.hasFigure ? _c(\"div\", { staticClass: \"app-sidebar-header__figure\", class: {\n \"app-sidebar-header__figure--with-action\": _vm.hasFigureClickListener\n }, style: {\n backgroundImage: `url(${_vm.background})`\n }, attrs: { \"tabindex\": \"0\" }, on: { \"click\": _vm.onFigureClick, \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")) return null;\n return _vm.onFigureClick.apply(null, arguments);\n } } }, [_vm._t(\"header\")], 2) : _vm._e(), _c(\"div\", { staticClass: \"app-sidebar-header__desc\", class: {\n \"app-sidebar-header__desc--with-tertiary-action\": _vm.canStar || _vm.$slots[\"tertiary-actions\"],\n \"app-sidebar-header__desc--editable\": _vm.nameEditable && !_vm.subname,\n \"app-sidebar-header__desc--with-subname--editable\": _vm.nameEditable && _vm.subname,\n \"app-sidebar-header__desc--without-actions\": !_vm.$slots[\"secondary-actions\"]\n } }, [_vm.canStar || _vm.$slots[\"tertiary-actions\"] ? _c(\"div\", { staticClass: \"app-sidebar-header__tertiary-actions\" }, [_vm._t(\"tertiary-actions\", function() {\n return [_vm.canStar ? _c(\"NcButton\", { staticClass: \"app-sidebar-header__star\", attrs: { \"aria-label\": _vm.favoriteTranslated, \"pressed\": _vm.isStarred, \"variant\": \"secondary\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.toggleStarred.apply(null, arguments);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm.starLoading ? _c(\"NcLoadingIcon\") : _vm.isStarred ? _c(\"Star\", { attrs: { \"size\": 20 } }) : _c(\"StarOutline\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, false, 2575459756) }) : _vm._e()];\n })], 2) : _vm._e(), _c(\"div\", { staticClass: \"app-sidebar-header__name-container\" }, [_c(\"div\", { staticClass: \"app-sidebar-header__mainname-container\" }, [_c(\"NcAppSidebarHeader\", { directives: [{ name: \"show\", rawName: \"v-show\", value: !_vm.nameEditable, expression: \"!nameEditable\" }], staticClass: \"app-sidebar-header__mainname\", attrs: { \"name\": _vm.name, \"linkify\": _vm.linkifyName, \"title\": _vm.title, \"tabindex\": _vm.nameEditable ? 0 : -1 }, nativeOn: { \"click\": function($event) {\n if ($event.target !== $event.currentTarget) return null;\n return _vm.editName.apply(null, arguments);\n } } }), _vm.nameEditable ? [_c(\"form\", { directives: [{ name: \"click-outside\", rawName: \"v-click-outside\", value: () => _vm.onSubmitName(), expression: \"() => onSubmitName()\" }], staticClass: \"app-sidebar-header__mainname-form\", on: { \"submit\": function($event) {\n $event.preventDefault();\n return _vm.onSubmitName.apply(null, arguments);\n } } }, [_c(\"input\", { directives: [{ name: \"focus\", rawName: \"v-focus\" }], ref: \"nameInput\", staticClass: \"app-sidebar-header__mainname-input\", attrs: { \"type\": \"text\", \"placeholder\": _vm.namePlaceholder }, domProps: { \"value\": _vm.name }, on: { \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"esc\", 27, $event.key, [\"Esc\", \"Escape\"])) return null;\n $event.stopPropagation();\n return _vm.onDismissEditing.apply(null, arguments);\n }, \"input\": _vm.onNameInput } }), _c(\"NcButton\", { attrs: { \"aria-label\": _vm.changeNameTranslated, \"type\": \"submit\", \"variant\": \"tertiary-no-background\" }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"ArrowRight\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, false, 1252225425) })], 1)] : _vm._e(), _vm.$slots[\"secondary-actions\"] ? _c(\"NcActions\", { staticClass: \"app-sidebar-header__menu\", attrs: { \"force-menu\": _vm.forceMenu } }, [_vm._t(\"secondary-actions\")], 2) : _vm._e()], 2), _vm.subname.trim() !== \"\" || _vm.$slots[\"subname\"] ? _c(\"p\", { staticClass: \"app-sidebar-header__subname\", attrs: { \"title\": _vm.subtitle || void 0 } }, [_vm._t(\"subname\", function() {\n return [_vm._v(\" \" + _vm._s(_vm.subname) + \" \")];\n })], 2) : _vm._e()])])])];\n }) : _c(\"NcAppSidebarHeader\", { staticClass: \"app-sidebar-header__mainname--hidden\", attrs: { \"name\": _vm.name, \"tabindex\": \"-1\" } }), _c(\"NcButton\", { ref: \"closeButton\", staticClass: \"app-sidebar__close\", attrs: { \"aria-label\": _vm.closeTranslated, \"title\": _vm.closeTranslated, \"variant\": \"tertiary\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.closeSidebar.apply(null, arguments);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"Close\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) }), _vm.$slots[\"description\"] && !_vm.empty ? _c(\"div\", { staticClass: \"app-sidebar-header__description\" }, [_vm._t(\"description\")], 2) : _vm._e()], 2), _c(\"NcAppSidebarTabs\", { directives: [{ name: \"show\", rawName: \"v-show\", value: !_vm.loading, expression: \"!loading\" }], ref: \"tabs\", attrs: { \"active\": _vm.active, \"force-tabs\": _vm.forceTabs }, on: { \"update:active\": _vm.onUpdateActive } }, [_vm._t(\"default\")], 2), _vm.loading ? _c(\"NcEmptyContent\", { scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"NcLoadingIcon\", { attrs: { \"size\": 64 } })];\n }, proxy: true }], null, false, 826850984) }) : _vm._e()], 1)]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"034b862f\"\n);\nconst NcAppSidebar = __component__.exports;\nexport {\n NcAppSidebar as N\n};\n//# sourceMappingURL=NcAppSidebar-BdryV6wY.mjs.map\n","import PQueue from \"p-queue\";\nconst queue = new PQueue({ concurrency: 5 });\nfunction preloadImage(url) {\n const { resolve, promise } = Promise.withResolvers();\n queue.add(() => {\n const image = new Image();\n image.onerror = () => resolve(false);\n image.onload = () => resolve(true);\n image.src = url;\n return promise;\n });\n return promise;\n}\nexport {\n preloadImage\n};\n//# sourceMappingURL=preloadImage.mjs.map\n","import '../assets/NcCollectionList-yjTCAR46.css';\nimport debounce from \"debounce\";\nimport { ref, set } from \"vue\";\nimport { r as register, L as t6, M as t26, a as t } from \"./_l10n-DQgzdF9S.mjs\";\nimport { N as NcAvatar } from \"./NcAvatar-YSp2ORHc.mjs\";\nimport { N as NcSelect } from \"./NcSelect-CjUzohn5.mjs\";\nimport { g as getRoute } from \"./autolink-cbuFALXr.mjs\";\nimport { N as NcActions } from \"./NcActions-B4VZCD8B.mjs\";\nimport { N as NcActionButton } from \"./NcActionButton-CuVNJJtW.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport axios from \"@nextcloud/axios\";\nimport { generateOcsUrl } from \"@nextcloud/router\";\nregister(t6);\nregister(t26);\nconst _sfc_main$1 = {\n name: \"NcCollectionListItem\",\n components: {\n NcAvatar,\n NcActions,\n NcActionButton\n },\n props: {\n collection: {\n type: Object,\n default: null\n },\n error: {\n type: String,\n default: void 0\n }\n },\n emits: [\"remove-resource\", \"rename-collection\"],\n data() {\n return {\n detailsOpen: false,\n newName: null\n };\n },\n computed: {\n getIcon() {\n return (resource) => [resource.iconClass];\n },\n typeClass() {\n return (resource) => \"resource-type-\" + resource.type;\n },\n resources() {\n return this.collection.resources?.filter((resource) => !Array.isArray(resource)) ?? [];\n },\n getComponent() {\n return (resource) => {\n const route = getRoute(this.$router, resource.link);\n return route ? { component: \"router-link\", to: route, href: void 0 } : { component: \"a\", to: void 0, href: resource.link };\n };\n },\n iconUrl() {\n return (resource) => {\n if (resource.mimetype) {\n return OC.MimeType.getIconUrl(resource.mimetype);\n }\n if (resource.iconUrl) {\n return resource.iconUrl;\n }\n return \"\";\n };\n }\n },\n methods: {\n t,\n toggleDetails() {\n this.detailsOpen = !this.detailsOpen;\n },\n showDetails() {\n this.detailsOpen = true;\n },\n removeResource(collection, resource) {\n this.$emit(\"remove-resource\", {\n collectionId: collection.id,\n resourceType: resource.type,\n resourceId: resource.id\n });\n },\n openRename() {\n this.newName = this.collection.name;\n },\n renameCollection() {\n if (this.newName) {\n this.$emit(\"rename-collection\", {\n collectionId: this.collection.id,\n name: this.newName\n });\n }\n this.newName = null;\n }\n }\n};\nvar _sfc_render$1 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"li\", { staticClass: \"collection-list-item\" }, [_c(\"NcAvatar\", { staticClass: \"collection-avatar\", attrs: { \"display-name\": _vm.collection.name, \"allow-placeholder\": \"\" } }), _vm.newName === null ? _c(\"span\", { staticClass: \"collection-item-name\", attrs: { \"title\": \"\" }, on: { \"click\": _vm.showDetails } }, [_vm._v(_vm._s(_vm.collection.name))]) : _c(\"form\", { class: { \"should-shake\": _vm.error }, on: { \"submit\": function($event) {\n $event.preventDefault();\n return _vm.renameCollection.apply(null, arguments);\n } } }, [_c(\"input\", { directives: [{ name: \"model\", rawName: \"v-model\", value: _vm.newName, expression: \"newName\" }], attrs: { \"type\": \"text\", \"autocomplete\": \"off\", \"autocapitalize\": \"off\" }, domProps: { \"value\": _vm.newName }, on: { \"input\": function($event) {\n if ($event.target.composing) return;\n _vm.newName = $event.target.value;\n } } }), _c(\"input\", { staticClass: \"icon-confirm\", attrs: { \"type\": \"submit\", \"value\": \"\" } })]), !_vm.detailsOpen && _vm.newName === null ? _c(\"div\", { staticClass: \"linked-icons\" }, _vm._l(_vm.resources.slice(0, 2), function(resource) {\n return _c(_vm.getComponent(resource).component, { key: resource.type + \"|\" + resource.id, tag: \"component\", class: _vm.typeClass(resource), attrs: { \"title\": resource.name, \"to\": _vm.getComponent(resource).to, \"href\": _vm.getComponent(resource).href } }, [_c(\"img\", { attrs: { \"src\": _vm.iconUrl(resource), \"alt\": resource.name } })]);\n }), 1) : _vm._e(), _vm.newName === null ? _c(\"span\", { staticClass: \"sharingOptionsGroup\" }, [_c(\"NcActions\", [_c(\"NcActionButton\", { attrs: { \"icon\": \"icon-info\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.toggleDetails.apply(null, arguments);\n } } }, [_vm._v(\" \" + _vm._s(_vm.detailsOpen ? _vm.t(\"Hide details\") : _vm.t(\"Show details\")) + \" \")]), _c(\"NcActionButton\", { attrs: { \"icon\": \"icon-rename\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.openRename.apply(null, arguments);\n } } }, [_vm._v(\" \" + _vm._s(_vm.t(\"Rename project\")) + \" \")])], 1)], 1) : _vm._e(), _c(\"transition\", { attrs: { \"name\": \"fade\" } }, [_vm.error ? _c(\"div\", { staticClass: \"error\" }, [_vm._v(\" \" + _vm._s(_vm.error) + \" \")]) : _vm._e()]), _c(\"transition\", { attrs: { \"name\": \"fade\" } }, [_vm.detailsOpen ? _c(\"ul\", { staticClass: \"resource-list-details\" }, _vm._l(_vm.resources, function(resource) {\n return _c(\"li\", { key: resource.type + \"|\" + resource.id, class: _vm.typeClass(resource) }, [_c(_vm.getComponent(resource).component, { tag: \"component\", attrs: { \"to\": _vm.getComponent(resource).to, \"href\": _vm.getComponent(resource).href } }, [_c(\"img\", { attrs: { \"src\": _vm.iconUrl(resource), \"alt\": resource.name } }), _c(\"span\", { staticClass: \"resource-name\" }, [_vm._v(_vm._s(resource.name || \"\"))])]), _c(\"span\", { staticClass: \"icon-close\", on: { \"click\": function($event) {\n return _vm.removeResource(_vm.collection, resource);\n } } })], 1);\n }), 0) : _vm._e()])], 1);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n \"878b819f\"\n);\nconst NcCollectionListItem = __component__$1.exports;\nfunction extractOcsData(response) {\n return response.data.ocs.data;\n}\nfunction renameCollectionService(collectionId, collectionName) {\n return axios.put(generateOcsUrl(\"collaboration/resources/collections/{collectionId}\", { collectionId }), { collectionName }).then(extractOcsData);\n}\nfunction getCollectionsByResourceService(resourceType, resourceId) {\n return axios.get(generateOcsUrl(\"collaboration/resources/{resourceType}/{resourceId}\", { resourceType, resourceId })).then(extractOcsData);\n}\nfunction createCollectionService(resourceType, resourceId, name) {\n return axios.post(generateOcsUrl(\"collaboration/resources/{resourceType}/{resourceId}\", { resourceType, resourceId }), { name }).then(extractOcsData);\n}\nfunction addResourceService(collectionId, resourceType, resourceId) {\n return axios.post(generateOcsUrl(\"collaboration/resources/collections/{collectionId}\", { collectionId }), { resourceType, resourceId }).then(extractOcsData);\n}\nfunction removeResourceService(collectionId, resourceType, resourceId) {\n return axios.delete(generateOcsUrl(\"collaboration/resources/collections/{collectionId}\", { collectionId }), { params: { resourceType, resourceId } }).then(extractOcsData);\n}\nfunction searchService(query) {\n return axios.get(generateOcsUrl(\"collaboration/resources/collections/search/{query}\", { query })).then(extractOcsData);\n}\nfunction useCollections() {\n const storedCollections = ref([]);\n const addCollections = (collections) => {\n set(storedCollections, \"value\", collections);\n };\n const addCollection = (collection) => {\n set(storedCollections, \"value\", [...storedCollections.value, collection]);\n };\n const removeCollection = (collectionId) => {\n set(storedCollections, \"value\", storedCollections.value.filter((item) => item.id !== collectionId));\n };\n const updateCollection = (collection) => {\n const index = storedCollections.value.findIndex((item) => item.id === collection.id);\n if (index !== -1) {\n set(storedCollections.value, index, collection);\n } else {\n addCollection(collection);\n }\n };\n const fetchCollectionsByResource = async ({ resourceType, resourceId }) => {\n const collections = await getCollectionsByResourceService(resourceType, resourceId);\n addCollections(collections);\n };\n const createCollection = async ({ baseResourceType, baseResourceId, resourceType, resourceId, name }) => {\n const collection = await createCollectionService(baseResourceType, baseResourceId, name);\n addCollection(collection);\n await addResourceToCollection({\n collectionId: collection.id,\n resourceType,\n resourceId\n });\n };\n const renameCollection = async ({ collectionId, name }) => {\n const collection = await renameCollectionService(collectionId, name);\n updateCollection(collection);\n };\n const addResourceToCollection = async ({ collectionId, resourceType, resourceId }) => {\n const collection = await addResourceService(collectionId, resourceType, String(resourceId));\n updateCollection(collection);\n };\n const removeResourceFromCollection = async ({ collectionId, resourceType, resourceId }) => {\n const collection = await removeResourceService(collectionId, resourceType, String(resourceId));\n if (collection.resources.length > 0) {\n updateCollection(collection);\n } else {\n removeCollection(collectionId);\n }\n };\n return {\n storedCollections,\n fetchCollectionsByResource,\n createCollection,\n renameCollection,\n addResourceToCollection,\n removeResourceFromCollection\n };\n}\nconst METHOD_CREATE_COLLECTION = 0;\nconst METHOD_ADD_TO_COLLECTION = 1;\nconst _sfc_main = {\n name: \"NcCollectionList\",\n components: {\n NcCollectionListItem,\n NcAvatar,\n NcSelect\n },\n props: {\n /**\n * Resource type identifier\n */\n type: {\n type: String,\n default: null\n },\n /**\n * Unique id of the resource\n */\n id: {\n type: String,\n default: null\n },\n /**\n * Name of the resource\n */\n name: {\n type: String,\n default: \"\"\n },\n /**\n * Whether the component is active (to start fetch resources)\n */\n isActive: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const {\n storedCollections,\n fetchCollectionsByResource,\n createCollection,\n addResourceToCollection,\n removeResourceFromCollection,\n renameCollection\n } = useCollections();\n const searchCollections = ref([]);\n const search = debounce(function(query, loading) {\n if (query !== \"\") {\n loading(true);\n searchService(query).then((collections) => {\n searchCollections.value = collections;\n }).catch((e) => {\n console.error(\"Failed to search for collections\", e);\n }).finally(() => {\n loading(false);\n });\n }\n }, 500);\n return {\n storedCollections,\n fetchCollectionsByResource,\n createCollection,\n addResourceToCollection,\n removeResourceFromCollection,\n renameCollection,\n searchCollections,\n search\n };\n },\n data() {\n return {\n selectIsOpen: false,\n generatingCodes: false,\n codes: void 0,\n value: null,\n model: {},\n collectionsError: {},\n error: null,\n isSelectOpen: false\n };\n },\n computed: {\n collections() {\n return this.storedCollections.filter(\n (collection) => collection.resources.some((resource) => resource && resource.id === String(this.id) && resource.type === this.type)\n );\n },\n placeholder() {\n return this.isSelectOpen ? t(\"Type to search for existing projects\") : t(\"Add to a project\");\n },\n options() {\n const options = [];\n window.OCP.Collaboration.getTypes().sort().forEach((type) => {\n options.push({\n method: METHOD_CREATE_COLLECTION,\n type,\n title: window.OCP.Collaboration.getLabel(type),\n class: window.OCP.Collaboration.getIcon(type),\n action: () => window.OCP.Collaboration.trigger(type)\n });\n });\n for (const index in this.searchCollections) {\n if (!this.collections.find((collection) => collection.id === this.searchCollections[index].id)) {\n options.push({\n method: METHOD_ADD_TO_COLLECTION,\n title: this.searchCollections[index].name,\n collectionId: this.searchCollections[index].id\n });\n }\n }\n return options;\n },\n resourceIdentifier() {\n return {\n resourceType: this.type,\n resourceId: this.id,\n isActive: this.isActive\n };\n }\n },\n watch: {\n resourceIdentifier: {\n deep: true,\n immediate: true,\n handler(resourceIdentifier) {\n if (!resourceIdentifier.isActive || !resourceIdentifier.resourceId || !resourceIdentifier.resourceType) {\n return;\n }\n this.fetchCollectionsByResource(resourceIdentifier);\n }\n }\n },\n methods: {\n t,\n select(selectedOption) {\n if (selectedOption.method === METHOD_CREATE_COLLECTION) {\n selectedOption.action().then((resourceId) => {\n this.createCollection({\n baseResourceType: this.type,\n baseResourceId: this.id,\n resourceType: selectedOption.type,\n resourceId,\n name: this.name\n }).catch((e) => {\n this.setError(t(\"Failed to create a project\"), e);\n });\n }).catch((e) => {\n console.error(\"No resource selected\", e);\n });\n }\n if (selectedOption.method === METHOD_ADD_TO_COLLECTION) {\n this.addResourceToCollection({\n collectionId: selectedOption.collectionId,\n resourceType: this.type,\n resourceId: this.id\n }).catch((e) => {\n this.setError(t(\"Failed to add the item to the project\"), e);\n });\n }\n this.value = null;\n },\n showSelect() {\n this.selectIsOpen = true;\n this.$refs.select.$el.focus();\n },\n setError(error, e) {\n console.error(error, e);\n this.error = error;\n setTimeout(() => {\n this.error = null;\n }, 5e3);\n },\n renameCollectionFromItem({ collectionId, name }) {\n this.renameCollection({ collectionId, name }).catch((e) => {\n console.error(t(\"Failed to rename the project\"), e);\n this.collectionsError[collectionId] = t(\"Failed to rename the project\");\n setTimeout(() => {\n this.collectionsError[collectionId] = null;\n }, 5e3);\n });\n }\n }\n};\nvar _sfc_render = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _vm.collections && _vm.type && _vm.id ? _c(\"ul\", { staticClass: \"collection-list\", attrs: { \"id\": \"collection-list\" } }, [_c(\"li\", { on: { \"click\": _vm.showSelect } }, [_vm._m(0), _c(\"div\", { attrs: { \"id\": \"collection-select-container\" } }, [_c(\"NcSelect\", { ref: \"select\", attrs: { \"aria-label-combobox\": _vm.t(\"Add to a project\"), \"options\": _vm.options, \"placeholder\": _vm.placeholder, \"label\": \"title\", \"limit\": 5 }, on: { \"close\": function($event) {\n _vm.isSelectOpen = false;\n }, \"open\": function($event) {\n _vm.isSelectOpen = true;\n }, \"option:selected\": _vm.select, \"search\": _vm.search }, scopedSlots: _vm._u([{ key: \"selected-option\", fn: function(option) {\n return [_c(\"span\", { staticClass: \"option__desc\" }, [_c(\"span\", { staticClass: \"option__title\" }, [_vm._v(_vm._s(option.title))])])];\n } }, { key: \"option\", fn: function(option) {\n return [_c(\"span\", { staticClass: \"option__wrapper\" }, [option.class ? _c(\"span\", { staticClass: \"avatar\", class: option.class }) : option.method !== 2 ? _c(\"NcAvatar\", { attrs: { \"allow-placeholder\": \"\", \"display-name\": option.title } }) : _vm._e(), _c(\"span\", { staticClass: \"option__title\" }, [_vm._v(_vm._s(option.title))])], 1)];\n } }], null, false, 2397208459), model: { value: _vm.value, callback: function($$v) {\n _vm.value = $$v;\n }, expression: \"value\" } }, [_c(\"p\", { staticClass: \"hint\" }, [_vm._v(\" \" + _vm._s(_vm.t(\"Connect items to a project to make them easier to find\")) + \" \")])])], 1)]), _c(\"transition\", { attrs: { \"name\": \"fade\" } }, [_vm.error ? _c(\"li\", { staticClass: \"error\" }, [_vm._v(\" \" + _vm._s(_vm.error) + \" \")]) : _vm._e()]), _vm._l(_vm.collections, function(collection) {\n return _c(\"NcCollectionListItem\", { key: collection.id, attrs: { \"collection\": collection, \"error\": _vm.collectionsError[collection.id] }, on: { \"rename-collection\": _vm.renameCollectionFromItem, \"remove-resource\": _vm.removeResourceFromCollection } });\n })], 2) : _vm._e();\n};\nvar _sfc_staticRenderFns = [function() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"avatar\" }, [_c(\"span\", { staticClass: \"icon-projects\" })]);\n}];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"efe8beb8\"\n);\nconst NcCollectionList = __component__.exports;\nexport {\n NcCollectionList as N\n};\n//# sourceMappingURL=NcCollectionList-CFt-EZON.mjs.map\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.VueColor=t():e.VueColor=t()}(\"undefined\"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=60)}([function(e,t){function n(e,t){var n=e[1]||\"\",i=e[3];if(!i)return n;if(t&&\"function\"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(e){return\"/*# sourceURL=\"+i.sourceRoot+e+\" */\"})).concat([o]).join(\"\\n\")}return[n].join(\"\\n\")}function r(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?\"@media \"+t[2]+\"{\"+r+\"}\":r}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var r={},i=0;i