import{d as s,a as r,t as i,s as a}from"./dav-D-0Zsvk_.chunk.mjs";import{N as n,k as l,o as m,u}from"./index-VDTWCae_.chunk.mjs";import{N as p}from"./NcEmptyContent-DEGDbAVb.chunk.mjs";import{N as c}from"./NcModal-kwRcir5Z.chunk.mjs";import{I as b,P as f,n as h}from"./icons-D6kGtfXC.chunk.mjs";import{A as d}from"./AlbumForm-YYJ6OUv6.chunk.mjs";import{C as _,a as y}from"./CollectionsList-B_QnF7pj.chunk.mjs";import{H as C}from"./HeaderNavigation-BTqHkD3d.chunk.mjs";import{F as v}from"./FetchCollectionsMixin-4Ojl9P_h.chunk.mjs";import"./NcLoadingIcon-Ctb4dpAr.chunk.mjs";import"./NcActions-JnumflF4-wQHpCaHI.chunk.mjs";import"./video-B2Zidy_E.chunk.mjs";import"./index-CxUc7fso.chunk.mjs";import"./GenRandomId-F5ebeBB_-DI-yuh7g.chunk.mjs";import"./index-DxP0KQWI.chunk.mjs";import"./NcTextField-BPhf3E7g-D6v3CVKd.chunk.mjs";import"./useModelMigration-EhAWvqDD-DCXJrerl.chunk.mjs";import"./PhotosFiltersInput-B7DcqFHr.chunk.mjs";import"./NcSelect-DrKzKPZL-BfehGCjx.chunk.mjs";import"./floating-ui.utils.dom-Ceub-oJ0.chunk.mjs";import"./NcAvatar-BBqomFJ3-XdOuYWZi.chunk.mjs";import"./dialog-DpWAQEF7.chunk.mjs";import"./NcDateTimePicker-Bd5bL_xz.chunk.mjs";import"./NcDialog-DmRqcm3W-CIMtFI-h.chunk.mjs";import"./NcDateTime-enXYuwj8-BXDyHBT-.chunk.mjs";import"./useFormatDateTime-BREnR9qx.chunk.mjs";import"./collectionFetcher-BH3RSWlN.chunk.mjs";import"./index-x9vhq81Z.chunk.mjs";import"./NcSelectUsers-z2bZafO2-Dkf7D5WK.chunk.mjs";import"./FetchCollectionContentMixin-DeRSEkiD.chunk.mjs";import"./AbortControllerMixin-C4cpCLeS.chunk.mjs";const A=s({name:"AlbumsView",components:{Plus:f,ImageMultipleOutline:b,NcModal:c,NcButton:n,NcEmptyContent:p,CollectionsList:y,CollectionCover:_,HeaderNavigation:C,AlbumForm:d},filters:{coverUrl(t){return t===-1?"":a(`/apps/photos/api/v1/preview/${t}?x=512&y=512`)}},mixins:[v],setup(){return{isMobile:u()}},data(){return{showAlbumCreationForm:!1}},computed:{albums(){return this.$store.getters.albums}},async beforeMount(){this.fetchAlbums()},methods:{fetchAlbums(){this.fetchCollections(l,m)},handleAlbumCreated({album:t}){this.showAlbumCreationForm=!1,this.$router.push(`/albums/${t.basename}`)},t:i,n:r}});var N=function(){var t=this,o=t._self._c;return t._self._setupProxy,o("div",[o("CollectionsList",{staticClass:"albums-list",attrs:{collections:t.albums,loading:t.loadingCollections,error:t.errorFetchingCollections},scopedSlots:t._u([{key:"header",fn:function(){return[o("HeaderNavigation",{key:"navigation",attrs:{loading:t.loadingCollections,title:t.t("photos","Albums"),"root-title":t.t("photos","Albums")},on:{refresh:t.fetchAlbums}},[o("NcButton",{attrs:{"aria-label":t.isMobile?t.t("photos","New album"):void 0},on:{click:function(e){t.showAlbumCreationForm=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Plus",{attrs:{size:20}})]},proxy:!0},t.isMobile?null:{key:"default",fn:function(){return[t._v(" "+t._s(t.t("photos","New album"))+" ")]},proxy:!0}],null,!0)})],1)]},proxy:!0},{key:"default",fn:function({collection:e}){return[o("CollectionCover",{key:e.basename,attrs:{"parent-route":"/albums","collection-name":e.basename,"alt-img":t.t("photos","Cover photo for album {albumName}",{albumName:e.basename}),"cover-url":t._f("coverUrl")(e.attributes["last-photo"])},scopedSlots:t._u([{key:"default",fn:function(){return[o("span",{staticClass:"album__name"},[t._v(" "+t._s(e.basename)+" ")])]},proxy:!0},{key:"subtitle",fn:function(){return[o("div",{staticClass:"album__details"},[t._v(" "+t._s(e.attributes.date)+" ⸱ "+t._s(t.n("photos","%n item","%n photos and videos",e.attributes.nbItems))+" ")])]},proxy:!0}],null,!0)})]}},{key:"empty-collections-list",fn:function(){return[o("NcEmptyContent",{attrs:{name:t.t("photos","There is no album yet!")},scopedSlots:t._u([{key:"icon",fn:function(){return[o("ImageMultipleOutline")]},proxy:!0}])})]},proxy:!0}])}),t.showAlbumCreationForm?o("NcModal",{attrs:{"label-id":"new-album-form"},on:{close:function(e){t.showAlbumCreationForm=!1}}},[o("h2",{staticClass:"album-creation__heading"},[t._v(" "+t._s(t.t("photos","New album"))+" ")]),o("AlbumForm",{on:{done:t.handleAlbumCreated}})],1):t._e()],1)},g=[],k=h(A,N,g,!1,null,"5f230c1c");const et=k.exports;export{et as default};
//# sourceMappingURL=AlbumsView-C3jELqy3.chunk.mjs.map
