import{a as e,t as a,g as r,_ as l}from"./vue.runtime.esm-Ct3_M7aQ.chunk.mjs";import{N as i}from"./NcEmptyContent-C3BLUUdi.chunk.mjs";import{N as n}from"./NcUserBubble-B3-E-5F5-CFjza24x.chunk.mjs";import{j as m,n as u}from"./icons-VGG7keIQ.chunk.mjs";import{C as c,a as b}from"./CollectionsList-DseFBUYn.chunk.mjs";import{H as p}from"./HeaderNavigation-Drss-bOM.chunk.mjs";import{F as h}from"./FetchCollectionsMixin-CqTYuk_r.chunk.mjs";import{q as d}from"./index-BMeBqg0T.chunk.mjs";import"./NcAvatar-YSp2ORHc-DYkeBvbf.chunk.mjs";import"./NcActionButton-CuVNJJtW-78GF8FR5.chunk.mjs";import"./index-XmYygNaN.chunk.mjs";import"./video-B-t_GSGv.chunk.mjs";import"./preload-helper-Dh9HmuEY.chunk.mjs";import"./collectionFetcher-Bc_5r3B7.chunk.mjs";import"./AbortControllerMixin-KqbYNBDv.chunk.mjs";const f={name:"SharedAlbums",components:{ImageMultipleOutline:m,NcEmptyContent:i,CollectionsList:b,CollectionCover:c,HeaderNavigation:p,NcUserBubble:n},filters:{coverUrl(t){return t===-1?"":l(`/apps/photos/api/v1/preview/${t}?x=512&y=512`)},albumOriginalName(t){return t.basename.replace(new RegExp(`\\(${t.attributes.collaborators[0].id}\\)$`),"")}},mixins:[h],computed:{sharedAlbums(){return this.$store.getters.sharedAlbums}},async beforeMount(){this.fetchSharedAlbums()},methods:{fetchSharedAlbums(){this.fetchCollections(`/photos/${r()?.uid}/sharedalbums`,d)},t:a,n:e}};var v=function(){var t=this,s=t._self._c;return s("CollectionsList",{staticClass:"albums-list",attrs:{collections:t.sharedAlbums,loading:t.loadingCollections,error:t.errorFetchingCollections},scopedSlots:t._u([{key:"default",fn:function({collection:o}){return s("CollectionCover",{key:o.basename,attrs:{"parent-route":"/sharedalbums","collection-name":o.basename,"alt-img":t.t("photos","Cover photo for shared album {albumName}",{albumName:o.basename}),"data-test":o.basename,"cover-url":t._f("coverUrl")(o.attributes["last-photo"])}},[s("span",{staticClass:"album__name"},[t._v(" "+t._s(t._f("albumOriginalName")(o))+" ")]),s("div",{staticClass:"album__details",attrs:{slot:"subtitle"},slot:"subtitle"},[t._v(" "+t._s(o.attributes.date)+" ⸱ "+t._s(t.n("photos","%n item","%n photos and videos",o.attributes.nbItems))+" "),s("br"),t._v(" "+t._s(t.t("photos","Shared by"))+" "),s("NcUserBubble",{attrs:{"display-name":o.attributes.collaborators[0].label,user:o.attributes.collaborators[0].id}})],1)])}}])},[s("HeaderNavigation",{key:"navigation",attrs:{slot:"header",loading:t.loadingCollections,title:t.t("photos","Collaborative albums"),"root-title":t.t("photos","Collaborative albums")},on:{refresh:t.fetchSharedAlbums},slot:"header"}),s("NcEmptyContent",{attrs:{slot:"empty-collections-list",name:t.t("photos","There is no album yet!")},slot:"empty-collections-list"},[s("ImageMultipleOutline",{attrs:{slot:"icon"},slot:"icon"})],1)],1)},C=[],_=u(f,v,C,!1,null,"48906c46");const B=_.exports;export{B as default};
//# sourceMappingURL=SharedAlbums-b3jNh1v4.chunk.mjs.map
