import { FORM_REDUX_FIELD_NAME } from '../../constants';

import { slice } from '../slices';
import createFormSelector from '@/modules/@common/Form/redux/selectors';

const nameSpace = slice.name;

export const isLoadingSelector = (state) => state[nameSpace].isLoading;
export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;
export const formChangedSelector = (state) => state[nameSpace].formChanged;

export const playlistIdSelector = (state) => state[nameSpace].playlistId;
export const duplicatedPlaylistIdSelector = (state) => state[nameSpace].duplicatedPlaylistId;
export const hubOptionsSelector = (state) => state[nameSpace].hubOptions;
export const hubSelector = (state) => state[nameSpace].hub;
export const nameSelector = (state) => state[nameSpace].name;
export const statusSelector = (state) => state[nameSpace].status;
export const urlSelector = (state) => state[nameSpace].url;
export const isPrefixSelector = (state) => state[nameSpace].isPrefix;
export const playerOptionsSelector = (state) => state[nameSpace].playerOptions;
export const playerSelector = (state) => state[nameSpace].player;
export const playlistsByUrlSelector = (state) => state[nameSpace].playlistsByUrl;
export const isFallbackSelector = (state) => state[nameSpace].isFallback;
export const shuffleSelector = (state) => state[nameSpace].shuffle;
export const clipsSelector = (state) => state[nameSpace].clips;

export const includeSponsoredContentSelector = (state) => state[nameSpace].includeSponsoredContent;
export const frequencySelector = (state) => state[nameSpace].frequency;
export const supplyTagSelector = (state) => state[nameSpace].supplyTag;
export const supplyTagOptionsSelector = (state) => state[nameSpace].supplyTagOptions;

const formSelectors = createFormSelector(FORM_REDUX_FIELD_NAME, nameSpace);

export const scrollFieldSelector = (state) => formSelectors.getScrollField(state);
export const schemeSelector = (state) => formSelectors.schemeSelector(state);
export const fullAccessToStoreFieldsForValidation = (state) => state[nameSpace];
