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 role_permissionsSlice from "./role_permissions/role_permissionsSlice";
import membershipsSlice from "./memberships/membershipsSlice";
import eventsSlice from "./events/eventsSlice";
import albumsSlice from "./albums/albumsSlice";
import album_collaboratorsSlice from "./album_collaborators/album_collaboratorsSlice";
import access_rulesSlice from "./access_rules/access_rulesSlice";
import media_itemsSlice from "./media_items/media_itemsSlice";
import storage_bucketsSlice from "./storage_buckets/storage_bucketsSlice";
import storage_objectsSlice from "./storage_objects/storage_objectsSlice";
import upload_sessionsSlice from "./upload_sessions/upload_sessionsSlice";
import upload_filesSlice from "./upload_files/upload_filesSlice";
import tagsSlice from "./tags/tagsSlice";
import media_ai_tagsSlice from "./media_ai_tags/media_ai_tagsSlice";
import media_user_tagsSlice from "./media_user_tags/media_user_tagsSlice";
import likesSlice from "./likes/likesSlice";
import favouritesSlice from "./favourites/favouritesSlice";
import commentsSlice from "./comments/commentsSlice";
import mentionsSlice from "./mentions/mentionsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import notification_preferencesSlice from "./notification_preferences/notification_preferencesSlice";
import sharesSlice from "./shares/sharesSlice";
import download_jobsSlice from "./download_jobs/download_jobsSlice";
import watermark_profilesSlice from "./watermark_profiles/watermark_profilesSlice";
import ai_modelsSlice from "./ai_models/ai_modelsSlice";
import ai_embeddingsSlice from "./ai_embeddings/ai_embeddingsSlice";
import face_detectionsSlice from "./face_detections/face_detectionsSlice";
import selfie_referencesSlice from "./selfie_references/selfie_referencesSlice";
import face_matchesSlice from "./face_matches/face_matchesSlice";
import ai_captionsSlice from "./ai_captions/ai_captionsSlice";
import moderation_flagsSlice from "./moderation_flags/moderation_flagsSlice";
import storiesSlice from "./stories/storiesSlice";
import story_itemsSlice from "./story_items/story_itemsSlice";
import analytics_eventsSlice from "./analytics_events/analytics_eventsSlice";
import oauth_accountsSlice from "./oauth_accounts/oauth_accountsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
role_permissions: role_permissionsSlice,
memberships: membershipsSlice,
events: eventsSlice,
albums: albumsSlice,
album_collaborators: album_collaboratorsSlice,
access_rules: access_rulesSlice,
media_items: media_itemsSlice,
storage_buckets: storage_bucketsSlice,
storage_objects: storage_objectsSlice,
upload_sessions: upload_sessionsSlice,
upload_files: upload_filesSlice,
tags: tagsSlice,
media_ai_tags: media_ai_tagsSlice,
media_user_tags: media_user_tagsSlice,
likes: likesSlice,
favourites: favouritesSlice,
comments: commentsSlice,
mentions: mentionsSlice,
notifications: notificationsSlice,
notification_preferences: notification_preferencesSlice,
shares: sharesSlice,
download_jobs: download_jobsSlice,
watermark_profiles: watermark_profilesSlice,
ai_models: ai_modelsSlice,
ai_embeddings: ai_embeddingsSlice,
face_detections: face_detectionsSlice,
selfie_references: selfie_referencesSlice,
face_matches: face_matchesSlice,
ai_captions: ai_captionsSlice,
moderation_flags: moderation_flagsSlice,
stories: storiesSlice,
story_items: story_itemsSlice,
analytics_events: analytics_eventsSlice,
oauth_accounts: oauth_accountsSlice,
  },
})

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