import{a as e,t as a,v as r,s as l}from"./dav-D-0Zsvk_.chunk.mjs";import{N as i}from"./NcEmptyContent-DEGDbAVb.chunk.mjs";import{N as n}from"./NcUserBubble-CuCNjhc8-zjOyCAzw.chunk.mjs";import{I as m,n as u}from"./icons-D6kGtfXC.chunk.mjs";import{C as c,a as p}from"./CollectionsList-B_QnF7pj.chunk.mjs";import{H as b}from"./HeaderNavigation-BTqHkD3d.chunk.mjs";import{F as h}from"./FetchCollectionsMixin-4Ojl9P_h.chunk.mjs";import{o as d}from"./index-VDTWCae_.chunk.mjs";import"./NcLoadingIcon-Ctb4dpAr.chunk.mjs";import"./video-B2Zidy_E.chunk.mjs";import"./index-CxUc7fso.chunk.mjs";import"./NcAvatar-BBqomFJ3-XdOuYWZi.chunk.mjs";import"./NcActions-JnumflF4-wQHpCaHI.chunk.mjs";import"./GenRandomId-F5ebeBB_-DI-yuh7g.chunk.mjs";import"./collectionFetcher-BH3RSWlN.chunk.mjs";import"./AbortControllerMixin-C4cpCLeS.chunk.mjs";const f={name:"SharedAlbums",components:{ImageMultipleOutline:m,NcEmptyContent:i,CollectionsList:p,CollectionCover:c,HeaderNavigation:b,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 F=_.exports;export{F as default};
//# sourceMappingURL=SharedAlbums-BWvmFp2G.chunk.mjs.map
