import{d as s}from"./dav-D-0Zsvk_.chunk.mjs";import{f as l}from"./collectionFetcher-BH3RSWlN.chunk.mjs";import{d as n,l as e}from"./index-VDTWCae_.chunk.mjs";import{A as c}from"./AbortControllerMixin-C4cpCLeS.chunk.mjs";const g=s({name:"FetchCollectionsMixin",data(){return{errorFetchingCollections:null,loadingCollections:!1}},mixins:[c],methods:{async fetchCollections(t,r=[],i=n){if(this.loadingCollections)return[];try{this.loadingCollections=!0,this.errorFetchingCollections=null;const o=await l(t,{signal:this.abortController.signal},r,i);return this.$store.dispatch("addCollections",{collections:o}),o}catch(o){o.response?.status===404?this.errorFetchingCollections=404:this.errorFetchingCollections=o,e.error("Error fetching collections:",{error:o})}finally{this.loadingCollections=!1}return[]}}});export{g as F};
//# sourceMappingURL=FetchCollectionsMixin-4Ojl9P_h.chunk.mjs.map
