import { slice } from '../slices';

const nameSpace = slice.name;

export const isLoadingSelector = (state) => state[nameSpace].isLoading;
export const providersSelector = (state) => state[nameSpace].providers;
export const awsRecognitionModelsSelector = (state) => state[nameSpace].awsRecognitionModels;
export const clarifaiModelsSelector = (state) => state[nameSpace].clarifaiModels;
export const googleModelsSelector = (state) => state[nameSpace].googleModels;
export const weavoModelsSelector = (state) => state[nameSpace].weavoModels;
export const dictionaryBrandSafetyCategoriesSelector = (state) => state[nameSpace].dictionaryBrandSafetyCategories;
export const dictionaryIabClassificationCategoriesSelector = (state) =>
  state[nameSpace].dictionaryIabClassificationCategories;
export const notificationsSelector = (state) => state[nameSpace].notifications;
export const dictionaryBrandSafetySpeechSelector = (state) => state[nameSpace].dictionaryBrandSafetySpeech;
export const dictionaryBrandSafetyTextSelector = (state) => state[nameSpace].dictionaryBrandSafetyText;
export const dictionaryBlacklistFileSelector = (state) => state[nameSpace].dictionaryBlacklistFile;
export const dictionaryMapFileSelector = (state) => state[nameSpace].dictionaryMapFile;
export const dictionaryCategorizationFileSelector = (state) => state[nameSpace].dictionaryCategorizationFile;
export const dictionaryFilterFileSelector = (state) => state[nameSpace].dictionaryFilterFile;
export const dictionaryBrandSafetyFileSelector = (state) => state[nameSpace].dictionaryBrandSafetyFile;
export const htmlParsingConfigFileSelector = (state) => state[nameSpace].htmlParsingConfigFile;
export const classificationIabWeightsFileSelector = (state) => state[nameSpace].classificationIabWeightsFile;
export const classificationIabCelebritiesMapFileSelector = (state) =>
  state[nameSpace].classificationIabCelebritiesMapFile;
export const classificationIabMapFileSelector = (state) => state[nameSpace].classificationIabMapFile;
export const classificationKeywordsLowerboundSelector = (state) => state[nameSpace].classificationKeywordsLowerbound;
export const classificationKeywordsCountSelector = (state) => state[nameSpace].classificationKeywordsCount;
export const classificationIabCountSelector = (state) => state[nameSpace].classificationIabCount;
export const classificationIabLowerboundSelector = (state) => state[nameSpace].classificationIabLowerbound;
export const enableIabKeywordsMergingAlgorithmSelector = (state) => state[nameSpace].enableIabKeywordsMergingAlgorithm;
export const enableIabCategorizationAlgorithmSelector = (state) => state[nameSpace].enableIabCategorizationAlgorithm;

export const dictionaryBlockInfoComputedSelector = (state) => ({
  isLoading: isLoadingSelector(state),
  weavoModels: weavoModelsSelector(state),
  googleModels: googleModelsSelector(state),
  clarifaiModels: clarifaiModelsSelector(state),
  awsRecognitionModels: awsRecognitionModelsSelector(state),
  dictionaryBrandSafetyCategories: dictionaryBrandSafetyCategoriesSelector(state),
  dictionaryIabClassificationCategories: dictionaryIabClassificationCategoriesSelector(state),
  notifications: notificationsSelector(state),
  dictionaryBrandSafetySpeech: dictionaryBrandSafetySpeechSelector(state),
  dictionaryBrandSafetyText: dictionaryBrandSafetyTextSelector(state),
  dictionaryBlacklistFile: dictionaryBlacklistFileSelector(state),
  dictionaryMapFile: dictionaryMapFileSelector(state),
  dictionaryCategorizationFile: dictionaryCategorizationFileSelector(state),
  dictionaryFilterFile: dictionaryFilterFileSelector(state),
  dictionaryBrandSafetyFile: dictionaryBrandSafetyFileSelector(state),
  htmlParsingConfigFile: htmlParsingConfigFileSelector(state),
  classificationIabWeightsFile: classificationIabWeightsFileSelector(state),
  classificationIabCelebritiesMapFile: classificationIabCelebritiesMapFileSelector(state),
  classificationIabMapFile: classificationIabMapFileSelector(state),
  classificationKeywordsLowerbound: classificationKeywordsLowerboundSelector(state),
  classificationKeywordsCount: classificationKeywordsCountSelector(state),
  classificationIabCount: classificationIabCountSelector(state),
  classificationIabLowerbound: classificationIabLowerboundSelector(state),
  enableIabKeywordsMergingAlgorithm: enableIabKeywordsMergingAlgorithmSelector(state),
  enableIabCategorizationAlgorithm: enableIabCategorizationAlgorithmSelector(state),
});

export const modelBlockInfoComputedSelector = (state) => ({
  isLoading: isLoadingSelector(state),
  providers: providersSelector(state),
  awsRecognitionModels: awsRecognitionModelsSelector(state),
  clarifaiModels: clarifaiModelsSelector(state),
  googleModels: googleModelsSelector(state),
  weavoModels: weavoModelsSelector(state),
});

export const getAllAnalyticsModelsComputedSelector = (state) => ({
  awsRecognitionModels: awsRecognitionModelsSelector(state),
  clarifaiModels: clarifaiModelsSelector(state),
  googleModels: googleModelsSelector(state),
  weavoModels: weavoModelsSelector(state),
});

export const getProvidersListComputedSelector = (state) => ({
  providers: providersSelector(state),
});
