import{P as s}from"./ProductMixin-D4Z8_OKx-v4.7.11.js";import"./Pagination-DKj6Zlmg-v4.7.11.js";Alpine.data("WishlistItem",t=>({...s(t)}));Alpine.data("Wishlist",()=>({fetchingWishlist:!1,products:{data:[]},currentPage:1,get wishlistIsEmpty(){return this.products.data.length===0},get totalPage(){return Math.ceil(this.products.total/10)},init(){this.fetchWishlist()},changePage(t){this.currentPage=t,this.fetchWishlist()},async fetchWishlist(){this.fetchingWishlist=!0;try{const t=await axios.get(`/account/wishlist/products?page=${this.currentPage}`);this.products=t.data}catch(t){notify(t.response.data.message)}finally{this.fetchingWishlist=!1}},removeItem(t){this.products.data.splice(this.products.data.indexOf(t),1),this.products.total--,this.$store.wishlist.removeFromWishlist(t.id)}}));
