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 organizationsSlice from "./organizations/organizationsSlice";
import creator_profilesSlice from "./creator_profiles/creator_profilesSlice";
import fan_profilesSlice from "./fan_profiles/fan_profilesSlice";
import followsSlice from "./follows/followsSlice";
import theme_profilesSlice from "./theme_profiles/theme_profilesSlice";
import profile_stylesSlice from "./profile_styles/profile_stylesSlice";
import discovery_itemsSlice from "./discovery_items/discovery_itemsSlice";
import streamsSlice from "./streams/streamsSlice";
import videosSlice from "./videos/videosSlice";
import commentsSlice from "./comments/commentsSlice";
import playlistsSlice from "./playlists/playlistsSlice";
import playlist_itemsSlice from "./playlist_items/playlist_itemsSlice";
import tip_pagesSlice from "./tip_pages/tip_pagesSlice";
import tipsSlice from "./tips/tipsSlice";
import alert_profilesSlice from "./alert_profiles/alert_profilesSlice";
import alertsSlice from "./alerts/alertsSlice";
import overlay_profilesSlice from "./overlay_profiles/overlay_profilesSlice";
import widget_catalog_itemsSlice from "./widget_catalog_items/widget_catalog_itemsSlice";
import overlay_widgetsSlice from "./overlay_widgets/overlay_widgetsSlice";
import merch_storesSlice from "./merch_stores/merch_storesSlice";
import productsSlice from "./products/productsSlice";
import product_variantsSlice from "./product_variants/product_variantsSlice";
import ordersSlice from "./orders/ordersSlice";
import order_itemsSlice from "./order_items/order_itemsSlice";
import shipping_profilesSlice from "./shipping_profiles/shipping_profilesSlice";
import private_mailboxesSlice from "./private_mailboxes/private_mailboxesSlice";
import messagesSlice from "./messages/messagesSlice";
import reportsSlice from "./reports/reportsSlice";
import demo_walletsSlice from "./demo_wallets/demo_walletsSlice";
import wallet_transactionsSlice from "./wallet_transactions/wallet_transactionsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
creator_profiles: creator_profilesSlice,
fan_profiles: fan_profilesSlice,
follows: followsSlice,
theme_profiles: theme_profilesSlice,
profile_styles: profile_stylesSlice,
discovery_items: discovery_itemsSlice,
streams: streamsSlice,
videos: videosSlice,
comments: commentsSlice,
playlists: playlistsSlice,
playlist_items: playlist_itemsSlice,
tip_pages: tip_pagesSlice,
tips: tipsSlice,
alert_profiles: alert_profilesSlice,
alerts: alertsSlice,
overlay_profiles: overlay_profilesSlice,
widget_catalog_items: widget_catalog_itemsSlice,
overlay_widgets: overlay_widgetsSlice,
merch_stores: merch_storesSlice,
products: productsSlice,
product_variants: product_variantsSlice,
orders: ordersSlice,
order_items: order_itemsSlice,
shipping_profiles: shipping_profilesSlice,
private_mailboxes: private_mailboxesSlice,
messages: messagesSlice,
reports: reportsSlice,
demo_wallets: demo_walletsSlice,
wallet_transactions: wallet_transactionsSlice,
  },
})

// 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
