import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';
import openAiSlice from './openAiSlice';

import usersSlice from "./users/usersSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";
import user_rolesSlice from "./user_roles/user_rolesSlice";
import role_permissionsSlice from "./role_permissions/role_permissionsSlice";
import auth_sessionsSlice from "./auth_sessions/auth_sessionsSlice";
import api_keysSlice from "./api_keys/api_keysSlice";
import categoriesSlice from "./categories/categoriesSlice";
import brandsSlice from "./brands/brandsSlice";
import suppliersSlice from "./suppliers/suppliersSlice";
import productsSlice from "./products/productsSlice";
import product_variantsSlice from "./product_variants/product_variantsSlice";
import variant_attributesSlice from "./variant_attributes/variant_attributesSlice";
import seo_entriesSlice from "./seo_entries/seo_entriesSlice";
import product_reviewsSlice from "./product_reviews/product_reviewsSlice";
import wishlist_itemsSlice from "./wishlist_items/wishlist_itemsSlice";
import comparison_itemsSlice from "./comparison_items/comparison_itemsSlice";
import cartsSlice from "./carts/cartsSlice";
import cart_itemsSlice from "./cart_items/cart_itemsSlice";
import couponsSlice from "./coupons/couponsSlice";
import user_addressesSlice from "./user_addresses/user_addressesSlice";
import shipping_carriersSlice from "./shipping_carriers/shipping_carriersSlice";
import shipping_methodsSlice from "./shipping_methods/shipping_methodsSlice";
import ordersSlice from "./orders/ordersSlice";
import order_itemsSlice from "./order_items/order_itemsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import shipmentsSlice from "./shipments/shipmentsSlice";
import ad_placementsSlice from "./ad_placements/ad_placementsSlice";
import adsSlice from "./ads/adsSlice";
import ad_eventsSlice from "./ad_events/ad_eventsSlice";
import app_settingsSlice from "./app_settings/app_settingsSlice";
import cms_pagesSlice from "./cms_pages/cms_pagesSlice";
import footer_settingsSlice from "./footer_settings/footer_settingsSlice";
import social_linksSlice from "./social_links/social_linksSlice";
import footer_linksSlice from "./footer_links/footer_linksSlice";
import newsletter_subscribersSlice from "./newsletter_subscribers/newsletter_subscribersSlice";
import payment_iconsSlice from "./payment_icons/payment_iconsSlice";
import push_subscriptionsSlice from "./push_subscriptions/push_subscriptionsSlice";
import notificationsSlice from "./notifications/notificationsSlice";

export const store = configureStore({
  reducer: {
    style: styleReducer,
    main: mainReducer,
    auth: authSlice,
    openAi: openAiSlice,

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
user_roles: user_rolesSlice,
role_permissions: role_permissionsSlice,
auth_sessions: auth_sessionsSlice,
api_keys: api_keysSlice,
categories: categoriesSlice,
brands: brandsSlice,
suppliers: suppliersSlice,
products: productsSlice,
product_variants: product_variantsSlice,
variant_attributes: variant_attributesSlice,
seo_entries: seo_entriesSlice,
product_reviews: product_reviewsSlice,
wishlist_items: wishlist_itemsSlice,
comparison_items: comparison_itemsSlice,
carts: cartsSlice,
cart_items: cart_itemsSlice,
coupons: couponsSlice,
user_addresses: user_addressesSlice,
shipping_carriers: shipping_carriersSlice,
shipping_methods: shipping_methodsSlice,
orders: ordersSlice,
order_items: order_itemsSlice,
payments: paymentsSlice,
shipments: shipmentsSlice,
ad_placements: ad_placementsSlice,
ads: adsSlice,
ad_events: ad_eventsSlice,
app_settings: app_settingsSlice,
cms_pages: cms_pagesSlice,
footer_settings: footer_settingsSlice,
social_links: social_linksSlice,
footer_links: footer_linksSlice,
newsletter_subscribers: newsletter_subscribersSlice,
payment_icons: payment_iconsSlice,
push_subscriptions: push_subscriptionsSlice,
notifications: notificationsSlice,
  },
})

// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
