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rU,SAAS,UACnC5L,EACAwgB,EAAQtjB,SACZyF,OAAQ6d,EAAQ7d,QAAU,EAC1BC,MAAO4d,EAAQ5d,OAASxI,EAAAA,GAAcqmB,0BAExC,IAAKjB,KAAkBgB,EAASE,qBAAiB1gB,GAErD,aAAa2gB,IAAAA,IAA+BxM,EAAK,CAAElX,UAAS,EAGjDgc,EAAyB+G,UAGpC,MAAM7L,EAAM,GAAG/Z,EAAAA,GAAcgmB,cAAcF,EAAAA,EAAmBU,qBAExD3jB,EAAS,IAAKuiB,KAAkBgB,GAEtC,aAAaG,IAAAA,IAA+BxM,EAAK,CAAElX,UAAS,C","sources":["elements/Accounts/_partials/Favorites/FavoritesCasinoContent/FavoriteProviders/skeleton.tsx","newcomponents/UI/UserPersonalization/__partials/Steps/SelectCasinoGames/PersonalizedGameCard.tsx","newcomponents/UI/UserPersonalization/__partials/Steps/SelectCasinoGames/PersonalizedGamesProvider.tsx","newelements/Casino/Games/__partials/constants/generic.ts","newelements/Casino/Games/__partials/hooks/useSelectedCategory.ts","newelements/Casino/Games/__partials/providers/CasinoGamesConditionalsProvider.tsx","newelements/Casino/Games/__partials/providers/CasinoGamesFetchDisabledContext.tsx","newelements/Casino/Games/__partials/providers/CasinoGamesFetchParamsContext.tsx","newelements/Casino/Games/__partials/state/conditionals-reducer.ts","newelements/Casino/Games/__partials/state/reducer.ts","newelements/Casino/Games/__partials/utils/default-constants.ts","newelements/Casino/Games/__partials/constants/fetch-params.ts","newelements/Casino/Games/__partials/utils/compute-configs.ts","newelements/Casino/Games/__partials/components/EmptyCasinoGamesResult/index.tsx","utils/generic/divide-array.ts","newelements/Casino/Games/__partials/components/GamesCarousel/SeeAllGames.tsx","newelements/Casino/Games/__partials/hooks/useGamesLoadMore.ts","newelements/Casino/Games/__partials/components/GamesByCategory/Skeleton.tsx","newelements/Casino/Games/__partials/components/GamesCarousel/index.tsx","hooks/useDebouncedCallback.ts","newelements/Casino/Games/__partials/components/GamesLazyLoad/index.tsx","newelements/Casino/Games/__partials/components/GamesByCategory/index.tsx","newhooks/generic/useQueryClient.ts","newelements/Casino/Games/__partials/utils/check-selected-category.ts","newelements/Casino/Games/__partials/hooks/useGamesCombinedData.ts","newhooks/casino/useCasinoOnlinePlayers.ts","newelements/Casino/Games/__partials/hooks/useCombineFavoriteGames.ts","newelements/Casino/Games/__partials/utils/check-backend-anomaly.ts","newelements/Casino/Games/GamesContent.tsx","newelements/Casino/Games/__partials/hooks/useGamesQuery.ts","newelements/Casino/Games/__partials/hooks/useGamesOrder.ts","newelements/Casino/Games/index.tsx","newhooks/dom/useInView.ts","services/casino/casino-fetch-games-query.ts"],"sourcesContent":["import { ReactElement } from 'react';\nimport cc from 'classcat';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { Skeleton } from 'newcomponents/UI/Skeleton';\nimport './index.less';\n\nexport const FavoriteCasinoProviderCardSkeleton = (): ReactElement => {\n return (\n <div className=\"favoritesCasinoProviders__provider\">\n <Skeleton\n active\n title={{\n width: '35px',\n style: { height: 35, margin: 10 }\n }}\n paragraph={false}\n className=\"matchHeader__skeleton\"\n />\n <Skeleton\n active\n title={{ width: 276, style: { height: 175 } }}\n paragraph={false}\n className={cc([\n 'matchHeader__skeleton providerRightImage__skeleton',\n {\n 'providerRightImage__skeleton--rtl': SpringConfigs.IS_RTL\n }\n ])}\n />\n <Skeleton\n active\n title={{ width: '40%', style: { height: 20 } }}\n paragraph={false}\n className=\"matchHeader__skeleton\"\n />\n </div>\n );\n};\n","import { useContext } from 'react';\nimport cc from 'classcat';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { isMobile } from 'utils/is-mobile';\nimport { NewCasinoGame } from 'interfaces/new-casino';\nimport { PersonalizedGamesContext } from './PersonalizedGamesProvider';\nimport { Checkbox } from 'newcomponents/UI/Checkbox';\nimport './index.less';\n\nexport const PersonalizedGameCard = ({ game }: { game: NewCasinoGame }) => {\n const { games, onCheck } = useContext(PersonalizedGamesContext);\n\n return (\n <div\n key={game.id}\n className={cc([\n 'personalizedCasinoGames-item',\n {\n selected: games?.length && games.find(item => item.id === game.id),\n 'personalizedCasinoGames__item--mobile': isMobile()\n }\n ])}\n onClick={() => {\n onCheck && onCheck?.(game);\n }}\n >\n <div className=\"personalizedCasinoGames-item-img\">\n <img\n key={game.id}\n src={`${\n SpringConfigs.CASINO_HIGH_QUALITY_PICTURES && game.icon_3\n ? game.icon_3\n : isMobile() && game.icon_1\n ? game.icon_1\n : game.icon_2\n }?v=${SpringConfigs.VERSION}`}\n alt={game.name}\n loading=\"lazy\"\n />\n </div>\n <div className=\"personalizedCasinoGames-item-footer\">\n <span className=\"personalizedCasinoGames-item-name globalEllipsis\">\n {game.name}\n </span>\n <span className=\"personalizedCasinoGames-item-providerName\">\n {game.provider_title}\n </span>\n </div>\n {games && games.find(item => item.id === game.id) ? (\n <Checkbox className=\"personalizedCasinoGames-item-checkbox\" checked />\n ) : null}\n </div>\n );\n};\n","import { createContext, ReactNode } from 'react';\nimport { NewCasinoGame } from 'interfaces/new-casino';\n\ntype Props = {\n children: ReactNode;\n value: {\n games: NewCasinoGame[] | null;\n onCheck: (value: NewCasinoGame) => void | null;\n };\n};\nexport const PersonalizedGamesContext = createContext<Props['value']>({\n games: null,\n onCheck: () => {}\n});\n\nexport const PersonalizedGamesProvider = ({ children, value }: Props) => {\n return (\n <PersonalizedGamesContext.Provider value={value}>\n {children}\n </PersonalizedGamesContext.Provider>\n );\n};\n","export const CASINO_GAMES_SLIDER_LIMIT_MULTIPLIER = 2;\n","import { useLocation } from 'react-router-dom';\nimport { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport { mountPoint } from 'utils/generic/route-manipulation';\nimport { useSbRouteMatch } from 'newhooks/generic/useSbRouteMatch';\nimport { CasinoGamesConfigs } from '../providers/CasinoGamesConfigsContext';\n\nexport const useSelectedCategory = ({\n configs\n}: {\n configs: Partial<CasinoGamesConfigs>;\n}) => {\n const location = useLocation();\n const routeMatch = useSbRouteMatch(\n `${mountPoint(location.pathname, false, true)}/:category`\n );\n\n const selectedCategory =\n !configs.bindWithCategories && !configs.groupAllByCategories\n ? configs.categoryIds || CUSTOM_CATEGORIES.all.id\n : routeMatch?.params?.category || CUSTOM_CATEGORIES.all.id;\n\n return { selectedCategory };\n};\n","import {\n createContext,\n memo,\n ReactElement,\n ReactNode,\n useContext\n} from 'react';\nimport {\n CasinoGamesConditionalsActionType,\n ConditionalsState\n} from '../state/conditionals-reducer';\n\nexport type CasinoGamesConditionalsProviderProps = {\n children: ReactNode;\n value: {\n conditionals: Partial<ConditionalsState>;\n dispatchConditionals: (action: {\n type: CasinoGamesConditionalsActionType;\n payload?: Partial<ConditionalsState>;\n }) => void;\n };\n};\n\nconst CasinoGamesConditionalsContext = createContext<\n CasinoGamesConditionalsProviderProps['value']\n>({\n conditionals: {},\n dispatchConditionals: () => {}\n});\n\nexport const CasinoGamesConditionalsProvider = memo(\n (props: CasinoGamesConditionalsProviderProps): ReactElement => {\n return (\n <CasinoGamesConditionalsContext.Provider value={props.value}>\n {props.children}\n </CasinoGamesConditionalsContext.Provider>\n );\n }\n);\n\nexport const useCasinoGamesConditionalsValues =\n (): CasinoGamesConditionalsProviderProps['value'] => {\n return useContext(CasinoGamesConditionalsContext);\n };\n","import { createContext, ReactElement, ReactNode, useContext } from 'react';\n\nexport type CasinoGamesFetchDisabledProviderProps = {\n children: ReactNode;\n value: {\n isFetchDisabled: boolean;\n setIsFetchDisabled: (value: boolean) => void;\n };\n};\n\nconst CasinoGamesFetchDisabledContext = createContext<\n CasinoGamesFetchDisabledProviderProps['value']\n>({\n isFetchDisabled: false,\n setIsFetchDisabled: () => {}\n});\n\nexport const CasinoGamesFetchDisabledProvider = (\n props: CasinoGamesFetchDisabledProviderProps\n): ReactElement => {\n return (\n <CasinoGamesFetchDisabledContext.Provider value={props.value}>\n {props.children}\n </CasinoGamesFetchDisabledContext.Provider>\n );\n};\n\nexport const useCasinoGamesFetchDisabledValues =\n (): CasinoGamesFetchDisabledProviderProps['value'] => {\n return useContext(CasinoGamesFetchDisabledContext);\n };\n","import { createContext, ReactElement, ReactNode, useContext } from 'react';\nimport { NewCasinoGamesFetchingParams } from 'interfaces/new-casino';\nimport { CasinoGamesFetchingParamsActionType } from '../state/reducer';\n\nexport type CasinoGamesFetchParamsProviderProps = {\n children: ReactNode;\n value: {\n fetchParams: Partial<NewCasinoGamesFetchingParams>;\n dispatchFetchParams: (action: {\n type: CasinoGamesFetchingParamsActionType;\n payload?: Partial<NewCasinoGamesFetchingParams>;\n }) => void;\n };\n};\n\nconst CasinoGamesFetchParamsContext = createContext<\n CasinoGamesFetchParamsProviderProps['value']\n>({\n fetchParams: {},\n dispatchFetchParams: () => {}\n});\n\nexport const CasinoGamesFetchParamsProvider = (\n props: CasinoGamesFetchParamsProviderProps\n): ReactElement => {\n return (\n <CasinoGamesFetchParamsContext.Provider value={props.value}>\n {props.children}\n </CasinoGamesFetchParamsContext.Provider>\n );\n};\n\nexport const useCasinoGamesFetchParamsValues =\n (): CasinoGamesFetchParamsProviderProps['value'] => {\n return useContext(CasinoGamesFetchParamsContext);\n };\n","export enum CasinoGamesConditionalsActionType {\n SET = 'SET_CONDITIONAL',\n RESET = 'RESET_CONDITIONALS'\n}\n\nexport interface ConditionalsState {\n emptyResults: boolean;\n loading: boolean;\n queryLoading: boolean;\n}\n\nexport const casinoGamesConditionalsReducer = (\n state: Partial<ConditionalsState>,\n action: {\n type: CasinoGamesConditionalsActionType;\n payload?: Partial<ConditionalsState>;\n }\n): Partial<ConditionalsState> => {\n const { type, payload } = action;\n\n switch (type) {\n case CasinoGamesConditionalsActionType.SET:\n return { ...state, ...payload };\n case CasinoGamesConditionalsActionType.RESET:\n return {};\n default:\n return state;\n }\n};\n","import { NewCasinoGamesFetchingParams } from 'interfaces/new-casino';\n\nexport enum CasinoGamesFetchingParamsActionType {\n SET = 'SET_FETCHING_PARAMS',\n RESET = 'RESET_FETCHING_PARAMS'\n}\n\nexport const casinoGamesFetchingParamsReducer = (\n state: Partial<NewCasinoGamesFetchingParams>,\n action: {\n type: CasinoGamesFetchingParamsActionType;\n payload?: Partial<NewCasinoGamesFetchingParams>;\n }\n): Partial<NewCasinoGamesFetchingParams> => {\n const { type, payload } = action;\n\n switch (type) {\n case CasinoGamesFetchingParamsActionType.SET:\n return { ...state, ...payload };\n case CasinoGamesFetchingParamsActionType.RESET:\n return {};\n default:\n return state;\n }\n};\n","import { CasinoGamesLoadMoreBtnType } from '../providers/CasinoGamesConfigsContext';\n\nexport const CasinoGamesDefaultConstants = {\n LOAD_MORE_TYPE: CasinoGamesLoadMoreBtnType.BUTTON,\n GAMES_PER_ROW: 6,\n GAMES_ROWS: 1,\n CASINO_GAMES_LIMIT: 16,\n LOAD_MORE_BUTTON_ENABLED: false,\n ARROWS_ENABLED: false,\n CATEGORY_NAME_VISIBLE: false\n};\n","import { LIVE_CASINO_CATEGORY } from 'utils/constants/casino/casino_categories';\nimport { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport {\n ENewCasinoGamesFetchingParamsKey,\n NewCasinoGamesFetchingParams\n} from 'interfaces/new-casino';\nimport type { CasinoGamesConfigs } from '../providers/CasinoGamesConfigsContext';\n\nexport const INITIAL_FETCH_PARAMS_STATE: Partial<NewCasinoGamesFetchingParams> =\n {\n by_key: ENewCasinoGamesFetchingParamsKey.Category,\n external_id: undefined,\n provider: undefined\n };\n\nexport const INITIAL_FETCH_PARAMS_STATE_FOR_SKIP_QUERY_KEYS_CHECK_ALL_CATEGORY: Partial<NewCasinoGamesFetchingParams> =\n {\n by_key: ENewCasinoGamesFetchingParamsKey.Id,\n external_id: undefined,\n provider: undefined,\n _fake_category: CUSTOM_CATEGORIES.all.id\n };\n\nexport const INITIAL_FETCH_PARAMS_STATE_FOR_SKIP_QUERY_KEYS_CHECK_LIVE_CASINO_CATEGORY: Partial<NewCasinoGamesFetchingParams> =\n {\n by_key: ENewCasinoGamesFetchingParamsKey.Id,\n external_id: undefined,\n provider: undefined,\n category: `${LIVE_CASINO_CATEGORY}`\n };\n\nconst INITIAL_FETCH_PARAMS_BY_SKIP_CATEGORY: Record<\n string,\n Partial<NewCasinoGamesFetchingParams>\n> = {\n [CUSTOM_CATEGORIES.all.id]:\n INITIAL_FETCH_PARAMS_STATE_FOR_SKIP_QUERY_KEYS_CHECK_ALL_CATEGORY,\n [`${LIVE_CASINO_CATEGORY}`]:\n INITIAL_FETCH_PARAMS_STATE_FOR_SKIP_QUERY_KEYS_CHECK_LIVE_CASINO_CATEGORY\n};\n\nexport const getInitialFetchParams = (configs: Partial<CasinoGamesConfigs>) => {\n return configs.skipQueryKeysCheck\n ? INITIAL_FETCH_PARAMS_BY_SKIP_CATEGORY[\n configs.categoryIds || CUSTOM_CATEGORIES.all.id\n ] || INITIAL_FETCH_PARAMS_STATE\n : INITIAL_FETCH_PARAMS_STATE;\n};\n","import { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { isMobile } from 'utils/is-mobile';\nimport { CasinoGamesDefaultConstants } from './default-constants';\nimport {\n CasinoGamesConfigs,\n CasinoGamesLayoutType,\n CasinoGamesLoadMoreBtnType\n} from '../providers/CasinoGamesConfigsContext';\n\nexport const computeCasinoLoadMoreButtonType = (\n configs: Partial<CasinoGamesConfigs>\n): CasinoGamesLoadMoreBtnType => {\n return (\n (isMobile() && configs.mobileCustomSettings\n ? configs.mobileLoadMoreType\n : configs.loadMoreType) || CasinoGamesDefaultConstants.LOAD_MORE_TYPE\n );\n};\n\nexport const computeCasinoGamesPerRow = (\n configs: Partial<CasinoGamesConfigs>\n): number => {\n return (\n (isMobile() && configs.mobileCustomSettings\n ? configs.mobileGamesPerRow\n : configs.gamesPerRow) || CasinoGamesDefaultConstants.GAMES_PER_ROW\n );\n};\n\nexport const computeCasinoGamesRows = (\n configs: Partial<CasinoGamesConfigs>\n): number => {\n return (\n (isMobile() && configs.mobileCustomSettings\n ? configs.mobileGamesRows\n : configs.gamesRows) || CasinoGamesDefaultConstants.GAMES_ROWS\n );\n};\n\nexport const computeCasinoGamesCountForSliderSkeleton = (\n configs: Partial<CasinoGamesConfigs>\n): number => {\n return computeCasinoLoadMoreButtonType(configs) !==\n CasinoGamesLoadMoreBtnType.SLIDER\n ? computeCasinoGamesLimit(configs)\n : computeCasinoGamesRows(configs) * computeCasinoGamesPerRow(configs);\n};\n\nexport const computeCasinoGamesLimit = (\n configs: Partial<CasinoGamesConfigs>\n): number => {\n return (\n (isMobile() && configs.mobileCustomSettings\n ? configs.mobileCasinoGamesLimit\n : configs.casinoGamesLimit) ||\n CasinoGamesDefaultConstants.CASINO_GAMES_LIMIT\n );\n};\n\nexport const computeCasinoGamesLoadMoreButtonEnabled = (\n configs: Partial<CasinoGamesConfigs>,\n selectedCategory: string\n): boolean => {\n // these categories are getting games from promoted endpoint, which works very bad with pagination\n if (\n [CUSTOM_CATEGORIES.special.id, CUSTOM_CATEGORIES.specialLive.id].includes(\n selectedCategory\n )\n ) {\n return false;\n }\n\n return (\n (isMobile() && configs?.mobileCustomSettings\n ? configs.mobileShowLoadMoreBtn\n : configs.showLoadMoreBtn) ||\n CasinoGamesDefaultConstants.LOAD_MORE_BUTTON_ENABLED\n );\n};\n\nexport const computeCasinoGamesArrowsEnabled = (\n configs: Partial<CasinoGamesConfigs>\n): boolean => {\n return (\n (isMobile() && configs?.mobileCustomSettings\n ? configs.mobileShowArrow\n : configs.showArrowForMobile) ||\n CasinoGamesDefaultConstants.ARROWS_ENABLED\n );\n};\n\nexport const computeCasinoGamesLayoutType = (\n configs: Partial<CasinoGamesConfigs>\n): CasinoGamesLayoutType => {\n return configs.layoutType ?? CasinoGamesLayoutType.CLASSIC;\n};\n\nexport const computeCasinoGamesCategoryNameVisible = (\n configs: Partial<CasinoGamesConfigs>,\n selectedCategory: string\n): boolean => {\n if (SpringConfigs.DECENTRALIZED_CASINO_URL) {\n return false;\n }\n\n if (\n selectedCategory === CUSTOM_CATEGORIES.all.id &&\n !configs.groupAllByCategories\n ) {\n return false;\n }\n\n return (\n configs.showCategoryName ||\n CasinoGamesDefaultConstants.CATEGORY_NAME_VISIBLE\n );\n};\n\nexport const computeLeftSideBarCasinoAvailable = (): boolean => {\n const matchCasinoUrl = new RegExp(`${SpringConfigs.PAGE_URLS.casino}/`);\n\n return (\n !isMobile() &&\n !!window.location.href.match(matchCasinoUrl) &&\n SpringConfigs.LEFT_SIDE_BAR &&\n SpringConfigs.LEFT_SIDE_BAR_CASINO\n );\n};\n","import { useTranslation } from 'react-i18next';\nimport { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { EmptyCasinoGames } from 'components/EmptyResultBoxes/EmptyCasinoGames';\nimport { useSelectedCategory } from '../../hooks/useSelectedCategory';\nimport { useCasinoGamesConfigsValues } from '../../providers/CasinoGamesConfigsContext';\n\nexport const EmptyCasinoGamesResult = () => {\n const { configs } = useCasinoGamesConfigsValues();\n const { t } = useTranslation();\n\n const { selectedCategory } = useSelectedCategory({ configs });\n\n const isFavoriteCategory = selectedCategory === CUSTOM_CATEGORIES.favorite.id;\n const isLastPlayedCategory =\n selectedCategory === CUSTOM_CATEGORIES.lastPlayed.id;\n\n return (\n <EmptyCasinoGames\n title={t(\n `emptyMessages.${\n isFavoriteCategory\n ? SpringConfigs.USER_PERSONALIZATION_ENABLED\n ? 'noCasinoPersonalizationFavorite'\n : 'noCasinoGameFavorite'\n : isLastPlayedCategory\n ? 'noCasinoGameLastPlayed'\n : 'noCasinoGame'\n }`\n )}\n gameText={t(\n `emptyMessages.${\n isFavoriteCategory\n ? SpringConfigs.USER_PERSONALIZATION_ENABLED\n ? 'noCasinoPersonalizationTextFavorite'\n : 'noCasinoGameTextFavorite'\n : isLastPlayedCategory\n ? 'noCasinoGameTextLastPlayed'\n : 'noCasinoGameText'\n }`\n )}\n />\n );\n};\n","// input divideArray([1, 2, 3, 4, 5, 6], 2, 6)\n// output [[1, 2], [3, 4], [5, 6]]\nexport const divideArray = (\n array: any[],\n itemLength: number,\n itemsCount: number\n) => {\n const ans = [];\n let temp = [];\n\n for (let i = 0; i < itemsCount; i++) {\n temp.push(array[i]);\n\n if ((i + 1) % itemLength == 0) {\n ans.push(temp);\n temp = [];\n }\n }\n\n // If last group doesn't have enough\n // elements then add null to it\n if (temp.length != 0) {\n let a = temp.length;\n\n while (a != itemLength) {\n temp.push(null);\n a++;\n }\n\n ans.push(temp);\n }\n\n return ans;\n};\n","import { MouseEventHandler } from 'react';\nimport { useTranslation } from 'react-i18next';\n\ntype SeeAllGamesProps = {\n onViewAll?: MouseEventHandler<HTMLDivElement>;\n slidesPerView: number;\n};\nconst GAMES_CARD_WIDTH = 24;\n\nexport const SeeAllGames = ({ onViewAll, slidesPerView }: SeeAllGamesProps) => {\n const { t } = useTranslation();\n\n return (\n <div\n className=\"seeAllGames x-casinoGameCardImageWrapper\"\n onClick={onViewAll}\n style={{\n width: window.innerWidth / slidesPerView - GAMES_CARD_WIDTH\n }}\n >\n <span className=\"seeAllGames__text\">{t('casino.seeAll')}</span>\n </div>\n );\n};\n","import { useCallback } from 'react';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { CASINO_GAMES_SLIDER_LIMIT_MULTIPLIER } from '../constants/generic';\nimport { useCasinoGamesConditionalsValues } from '../providers/CasinoGamesConditionalsProvider';\nimport {\n CasinoGamesLoadMoreBtnType,\n useCasinoGamesConfigsValues\n} from '../providers/CasinoGamesConfigsContext';\nimport { useCasinoGamesFetchParamsValues } from '../providers/CasinoGamesFetchParamsContext';\nimport { CasinoGamesFetchingParamsActionType } from '../state/reducer';\nimport { CasinoGamesDefaultConstants } from '../utils/default-constants';\n\nexport const useGamesLoadMore = () => {\n const { dispatchFetchParams, fetchParams } =\n useCasinoGamesFetchParamsValues();\n\n const { computedConfigs } = useCasinoGamesConfigsValues();\n\n const { conditionals } = useCasinoGamesConditionalsValues();\n\n const handleLoadMore = useCallback(() => {\n if (fetchParams.offset === undefined || fetchParams.limit === undefined) {\n return;\n }\n\n if (conditionals.queryLoading) {\n return;\n }\n\n let gamesLimit = computedConfigs.gamesLimit;\n\n // In case of slider type, we need to change the limit and offset based on gamesRows and gamesPerRow\n if (\n computedConfigs.loadMoreButtonType === CasinoGamesLoadMoreBtnType.SLIDER\n ) {\n gamesLimit =\n (computedConfigs.gamesRows || CasinoGamesDefaultConstants.GAMES_ROWS) *\n (computedConfigs.gamesPerRow ||\n CasinoGamesDefaultConstants.GAMES_PER_ROW) *\n CASINO_GAMES_SLIDER_LIMIT_MULTIPLIER;\n }\n\n dispatchFetchParams({\n type: CasinoGamesFetchingParamsActionType.SET,\n payload: {\n offset: fetchParams.limit,\n limit:\n fetchParams.limit +\n Math.min(gamesLimit, SpringConfigs.CASINO_GAMES_FETCH_MAX_COUNT)\n }\n });\n }, [\n fetchParams.offset,\n fetchParams.limit,\n computedConfigs.gamesLimit,\n computedConfigs.loadMoreButtonType,\n computedConfigs.gamesRows,\n computedConfigs.gamesPerRow,\n conditionals.queryLoading\n ]);\n\n return { handleLoadMore };\n};\n","import { CSSProperties, ReactElement, useMemo } from 'react';\nimport cc from 'classcat';\nimport { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport {\n FavoritePerRow,\n FavoritePerRowMobile\n} from 'utils/constants/sportsbook/magic-numbers';\nimport { createArray } from 'utils/helpers/create-fake-array';\nimport { isMobile } from 'utils/is-mobile';\nimport { FavoriteCasinoProviderCardSkeleton } from 'elements/Accounts/_partials/Favorites/FavoritesCasinoContent/FavoriteProviders/skeleton';\nimport { CasinoGameCardSkeleton } from 'newcomponents/Shared/casino/CasinoGameCard/Skeleton';\nimport { Skeleton } from 'newcomponents/UI/Skeleton';\nimport { useSelectedCategory } from '../../hooks/useSelectedCategory';\nimport {\n CasinoGamesLoadMoreBtnType,\n useCasinoGamesConfigsValues\n} from '../../providers/CasinoGamesConfigsContext';\nimport { computeCasinoLoadMoreButtonType } from '../../utils/compute-configs';\nimport './index.less';\n\ntype TCasinoGamesByCategorySkeletonProps = {\n favProvidersEnabled?: boolean;\n};\ninterface CustomCSSProperties extends CSSProperties {\n '--games-per-row'?: number;\n}\n\nexport const CasinoGamesByCategorySkeleton = ({\n favProvidersEnabled = false\n}: TCasinoGamesByCategorySkeletonProps): ReactElement => {\n const { configs, computedConfigs } = useCasinoGamesConfigsValues();\n const loadMoreButtonType = computeCasinoLoadMoreButtonType(configs);\n const { selectedCategory } = useSelectedCategory({ configs });\n\n const gamesByCategoryClasses = {\n aspectRatio: {\n [`casino-container__${\n configs.aspectRatio && configs.aspectRatio.toString().replace('.', '-')\n }`]: configs.aspectRatio\n }\n };\n\n const sliderSkeletonGridTemplate = useMemo(() => {\n if (loadMoreButtonType === CasinoGamesLoadMoreBtnType.SLIDER) {\n return {\n gridTemplateRows: `repeat(${computedConfigs.gamesRows}, auto)`,\n gridTemplateColumns: `repeat(${Math.ceil(\n computedConfigs.gamesCountForSkeleton /\n (computedConfigs.gamesRows || 1)\n )}, minmax(${computedConfigs.gamesPerRow}, auto)`,\n '--games-per-row': computedConfigs.gamesPerRow\n };\n }\n\n return { '--games-per-row': computedConfigs.gamesPerRow };\n }, [\n computedConfigs.gamesCountForSkeleton,\n computedConfigs.gamesRows,\n computedConfigs.gamesPerRow\n ]);\n\n const CategoryNameSkeleton = () => (\n <div\n className={cc([\n 'x-casinoGamesByCategories__categoryName',\n { 'x-casinoGamesByCategories__categoryName--mobile': isMobile() }\n ])}\n >\n <Skeleton\n title={{\n style: { width: '150px', margin: '0', height: 24 }\n }}\n paragraph={false}\n active\n />\n\n {(selectedCategory === CUSTOM_CATEGORIES.all.id ||\n selectedCategory === CUSTOM_CATEGORIES.favorite.id) && (\n <div className=\"x-casinoGamesByCategories__categoryName__viewAll\">\n <Skeleton\n title={{\n style: { width: '100px', margin: '0', height: 20 }\n }}\n paragraph={false}\n active\n />\n </div>\n )}\n </div>\n );\n\n return (\n <div\n className={cc([\n 'x-casinoGamesByCategories',\n gamesByCategoryClasses.aspectRatio,\n {\n 'x-casinoGamesByCategories__slider':\n loadMoreButtonType === CasinoGamesLoadMoreBtnType.SLIDER\n }\n ])}\n >\n {favProvidersEnabled && (\n <div\n className={cc([\n 'favoritesCasinoProviders__container--skeleton',\n {\n 'favoritesCasinoProviders__container--skeleton--mobile':\n isMobile()\n }\n ])}\n >\n {computedConfigs.categoryNameVisible &&\n configs.groupAllByCategories && <CategoryNameSkeleton />}\n <div\n className=\"x-casinoGamesByCategories__providers favoritesCasinoProviders\"\n style={\n {\n ...sliderSkeletonGridTemplate,\n '--games-per-row': isMobile()\n ? FavoritePerRowMobile\n : FavoritePerRow\n } as CustomCSSProperties\n }\n >\n {Array.from({ length: 3 }, (v, i) => i).map(provider => (\n <FavoriteCasinoProviderCardSkeleton key={provider} />\n ))}\n </div>\n </div>\n )}\n\n {computedConfigs.categoryNameVisible && <CategoryNameSkeleton />}\n\n <div\n className=\"x-casinoGamesByCategories__games\"\n style={sliderSkeletonGridTemplate}\n >\n {createArray(computedConfigs.gamesCountForSkeleton).map(key => (\n <CasinoGameCardSkeleton key={key} />\n ))}\n </div>\n </div>\n );\n};\n","import {\n ComponentProps,\n FC,\n memo,\n MouseEventHandler,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport cc from 'classcat';\nimport { DEBOUNCE_DELAY } from 'utils/constants/app/magic-numbers-app';\nimport { divideArray } from 'utils/generic/divide-array';\nimport { lazy } from 'utils/generic/lazy';\nimport { isMobile } from 'utils/is-mobile';\nimport { NewCasinoGame } from 'interfaces/new-casino';\nimport { SeeAllGames } from './SeeAllGames';\nimport { CasinoGameCard as CasinoGameCardComponent } from 'newcomponents/Shared/casino/CasinoGameCard';\nimport { useDebouncedCallback } from 'hooks/useDebouncedCallback';\nimport { useInView } from 'newhooks/dom/useInView';\nimport { useGamesLoadMore } from '../../hooks/useGamesLoadMore';\nimport { useCasinoGamesConfigsValues } from '../../providers/CasinoGamesConfigsContext';\nimport { CasinoGamesByCategorySkeleton } from '../GamesByCategory/Skeleton';\nimport './index.less';\n\nconst { SwiperSlider } = lazy(\n () =>\n import(\n /* webpackChunkName: \"swiper-wrapper\" */ 'newcomponents/UI/SwiperSlider'\n )\n);\n\ninterface ICasinoGamesCarouselProps {\n loadMoreFunctionalityAvailable: boolean;\n data: NewCasinoGame[];\n viewAllEnabled: boolean;\n onViewAll: MouseEventHandler<HTMLDivElement>;\n CasinoGameCard: (\n props: Pick<\n ComponentProps<typeof CasinoGameCardComponent>,\n 'game' | 'index'\n >\n ) => ReturnType<typeof CasinoGameCardComponent>;\n}\n\nconst _CasinoGamesCarousel: FC<ICasinoGamesCarouselProps> = ({\n data,\n loadMoreFunctionalityAvailable,\n CasinoGameCard,\n viewAllEnabled,\n onViewAll\n}) => {\n const { computedConfigs } = useCasinoGamesConfigsValues();\n const { handleLoadMore } = useGamesLoadMore();\n const [observableReference, setObservableReference] =\n useState<HTMLDivElement | null>();\n\n const scrollableReference = useRef<HTMLDivElement | null>(null);\n\n const inView = useInView(observableReference, {\n destructOnFirstIntersect: true,\n options: {\n threshold: 0.5\n }\n });\n\n // this technique ensures that the observableReference is attached at least to the last card based on\n // games rows and games per row to be visible in case of user swipes very quickly\n const observableIndexDiff =\n computedConfigs.gamesPerRow * computedConfigs.gamesRows;\n\n const showArrows = isMobile() ? computedConfigs.arrowsEnabled : true;\n\n const loadMoreGames = useCallback(() => {\n if (!loadMoreFunctionalityAvailable) {\n return false;\n }\n\n handleLoadMore();\n\n return true;\n }, [loadMoreFunctionalityAvailable, handleLoadMore]);\n\n const debouncedLoadMoreGames = useDebouncedCallback(\n loadMoreGames,\n DEBOUNCE_DELAY._300\n );\n\n // the check when arrows are disabled is done through attaching the ref to game card\n useEffect(() => {\n if (!inView) {\n return;\n }\n\n loadMoreGames();\n }, [inView]);\n\n // the check when arrows are disabled is done through attaching the ref to scrollable element\n useEffect(() => {\n const scrollableElement = scrollableReference.current;\n\n if (!scrollableElement) {\n return;\n }\n\n let loadMoreCalled = false;\n\n const handleScroll = () => {\n if (!scrollableElement) {\n return;\n }\n\n const totalScrollWidth = scrollableElement.scrollWidth;\n const scrollLeft = scrollableElement.scrollLeft;\n const clientWidth = scrollableElement.clientWidth;\n\n if (\n scrollLeft + clientWidth + clientWidth > totalScrollWidth &&\n !loadMoreCalled\n ) {\n loadMoreCalled = loadMoreGames();\n }\n };\n\n scrollableElement.addEventListener('scroll', handleScroll);\n\n return () => {\n if (!scrollableElement) {\n return;\n }\n\n scrollableElement.removeEventListener('scroll', handleScroll);\n };\n }, [data.length]);\n\n const drawableData = useMemo(() => {\n let res;\n\n if (computedConfigs.gamesRows > 1) {\n const dividedData = divideArray(\n data,\n computedConfigs.gamesRows,\n data.length\n );\n\n res = dividedData.map((group, groupIndex, dataArray) => (\n <div\n className=\"casinoGame__carousel-item casinoGame__carousel-item-grid\"\n key={group[0].id}\n /* this ensures that observable reference is being attached only when arrows are enabled*/\n {...(showArrows &&\n groupIndex + observableIndexDiff === dataArray.length && {\n ref: setObservableReference\n })}\n >\n {group.map(\n (game, index) =>\n game && <CasinoGameCard game={game} index={index} key={game.id} />\n )}\n </div>\n ));\n } else {\n res = data.map((game, index, dataArray) => (\n <div\n className=\"casinoGame__carousel-item\"\n key={game.id}\n /* this ensures that observable reference is being attached only when arrows are enabled*/\n {...(showArrows &&\n index + observableIndexDiff === dataArray.length && {\n ref: setObservableReference\n })}\n >\n <CasinoGameCard game={game} index={index} />\n </div>\n ));\n }\n\n if (viewAllEnabled && isMobile()) {\n res.push(\n <div className=\"casinoGame__carousel-item casinoGame__carousel-item-grid\">\n <SeeAllGames\n onViewAll={onViewAll}\n slidesPerView={computedConfigs.gamesPerRow}\n />\n </div>\n );\n }\n\n return res;\n }, [data]);\n\n return (\n <Suspense fallback={<CasinoGamesByCategorySkeleton />}>\n <div\n className={cc([\n {\n 'casinoGame__carousel-wrapper': !isMobile(),\n 'casinoGame__carousel-wrapper-mobile': isMobile(),\n 'casinoGame__carousel-without-arrows':\n isMobile() && !computedConfigs.arrowsEnabled\n }\n ])}\n >\n <SwiperSlider\n bodyArrows={isMobile() ? computedConfigs.arrowsEnabled : true}\n activeSlide={0}\n slidesPerView={computedConfigs.gamesPerRow}\n disableSwiping={!isMobile() || computedConfigs.arrowsEnabled}\n alwaysShowArrows={isMobile()}\n spaceBetween={8}\n slideOnHover={computedConfigs.nextSlideOnHover && !isMobile()}\n fetchOnProgress={{\n point: 0.7,\n callback: () => {\n debouncedLoadMoreGames();\n }\n }}\n drawableTabs={drawableData}\n />\n </div>\n </Suspense>\n );\n};\n\nexport const CasinoGamesCarousel = memo(_CasinoGamesCarousel);\n","import { useEffect, useMemo, useRef } from 'react';\nimport { timeoutDuration } from 'utils/constants/dateInfo/time-numbers';\nimport { debounce } from 'utils/helpers/debounce';\nimport RidGenerator from 'utils/swarm/rid-generator';\n\nexport const useDebouncedCallback = (\n callback: Function,\n delay: number = timeoutDuration.DURATION_300,\n deps: Array<any> = []\n) => {\n const ref = useRef<Function>();\n const debounceId = useRef(RidGenerator.rand());\n\n useEffect(() => {\n ref.current = callback;\n }, [callback]);\n\n return useMemo(() => {\n const func = () => {\n ref.current?.();\n };\n\n return debounce(debounceId.current, func, delay);\n }, deps);\n};\n","import { ComponentProps, CSSProperties, FC, useEffect, useState } from 'react';\nimport { NewCasinoGame } from 'interfaces/new-casino';\nimport { Loading } from 'components/Loading';\nimport { CasinoGameCard as CasinoGameCardComponent } from 'newcomponents/Shared/casino/CasinoGameCard';\nimport { useGamesLoadMore } from '../../hooks/useGamesLoadMore';\nimport { useCasinoGamesConditionalsValues } from '../../providers/CasinoGamesConditionalsProvider';\nimport { useCasinoGamesConfigsValues } from '../../providers/CasinoGamesConfigsContext';\n\ninterface ICasinoGamesLazyLoadProps {\n gamesCount: number;\n data: NewCasinoGame[];\n loadMoreContainerStyles: { className: string; style: CSSProperties };\n loadMoreFunctionalityAvailable: boolean;\n CasinoGameCard: (\n props: Pick<\n ComponentProps<typeof CasinoGameCardComponent>,\n 'game' | 'index'\n >\n ) => ReturnType<typeof CasinoGameCardComponent>;\n}\n\nconst TRIGGER_ELEMENT_THRESHOLD = 0.5;\n\nconst createIntersectionObserver = (callback: () => void) => {\n return new IntersectionObserver(\n ([entry], observer) => {\n if (!entry.isIntersecting) {\n return;\n }\n\n observer.unobserve(entry.target);\n observer.disconnect();\n callback();\n },\n { threshold: TRIGGER_ELEMENT_THRESHOLD }\n );\n};\n\nexport const GamesLazyLoad: FC<ICasinoGamesLazyLoadProps> = ({\n data,\n loadMoreContainerStyles,\n loadMoreFunctionalityAvailable,\n CasinoGameCard\n}) => {\n const { handleLoadMore } = useGamesLoadMore();\n const { conditionals } = useCasinoGamesConditionalsValues();\n const { computedConfigs } = useCasinoGamesConfigsValues();\n const [triggerCard, setTriggerCard] = useState<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (!triggerCard) {\n return;\n }\n\n const observer = createIntersectionObserver(handleLoadMore);\n observer.observe(triggerCard);\n\n return () => {\n if (!triggerCard) {\n return;\n }\n\n observer.unobserve(triggerCard);\n observer.disconnect();\n };\n }, [triggerCard]);\n\n return (\n <>\n <div\n className={loadMoreContainerStyles.className}\n style={loadMoreContainerStyles.style}\n >\n {data.map((game, index) => (\n <div\n key={game.id}\n ref={(elem: HTMLDivElement) => {\n if (data.length - computedConfigs.gamesPerRow !== index) {\n return;\n }\n\n if (!elem) {\n return;\n }\n\n if (loadMoreFunctionalityAvailable) {\n setTriggerCard(elem);\n } else {\n setTriggerCard(null);\n }\n }}\n >\n <CasinoGameCard game={game} />\n </div>\n ))}\n </div>\n {conditionals.queryLoading && (\n <Loading className=\"x-casinoGames__loading\" />\n )}\n </>\n );\n};\n","import {\n ComponentProps,\n CSSProperties,\n FC,\n Fragment,\n memo,\n MouseEventHandler,\n RefObject,\n Suspense,\n useCallback,\n useMemo\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\nimport cc from 'classcat';\nimport {\n CUSTOM_CATEGORIES,\n CUSTOM_CATEGORIES_ARRAY,\n CUSTOM_CATEGORY_IDS_WITHOUT_PROVIDERS\n} from 'utils/constants/casino/custom-categories';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { lazy as namedLazy } from 'utils/generic/lazy';\nimport { mountPoint, shouldRedirect } from 'utils/generic/route-manipulation';\nimport { isMobile } from 'utils/is-mobile';\nimport { NewCasinoGame } from 'interfaces/new-casino';\nimport { CasinoGameCard as CasinoGameCardComponent } from 'newcomponents/Shared/casino/CasinoGameCard';\nimport { PersonalizedGameCard } from 'newcomponents/UI/UserPersonalization/__partials/Steps/SelectCasinoGames/PersonalizedGameCard';\nimport { clearAllFavorite } from 'store/actions';\nimport { getFavoriteProviders } from 'store/selectors/fav-data';\nimport { useSelectedCategory } from '../../hooks/useSelectedCategory';\nimport {\n CasinoGamesLayoutType,\n CasinoGamesLoadMoreBtnType,\n useCasinoGamesConfigsValues\n} from '../../providers/CasinoGamesConfigsContext';\nimport { CasinoGamesCarousel } from '../GamesCarousel';\nimport { GamesLazyLoad } from '../GamesLazyLoad';\nimport './index.less';\n\nconst { CasinoLoadMoreButton } = namedLazy(\n /* webpackChunkName: \"CasinoLoadMoreButton\" */ () =>\n import('../LoadMoreButton')\n);\n\ninterface GamesByCategoryProps {\n category: {\n id: string;\n name: string;\n gamesCount: number;\n };\n data: NewCasinoGame[];\n parentRef: RefObject<HTMLDivElement>;\n}\nconst MIN_GAMES_PER_ROW = 4;\n\nconst _GamesByCategory: FC<GamesByCategoryProps> = ({\n category,\n data,\n parentRef\n}) => {\n const { configs, computedConfigs } = useCasinoGamesConfigsValues();\n const favoriteProviders = useSelector(getFavoriteProviders) || [];\n\n const { selectedCategory } = useSelectedCategory({ configs });\n const dispatch = useDispatch();\n\n const { t } = useTranslation();\n const history = useHistory();\n const { location } = history;\n\n const isLoadMoreButtonSlider =\n computedConfigs.loadMoreButtonType === CasinoGamesLoadMoreBtnType.SLIDER;\n\n const isLoadMoreButtonLazyLoad =\n computedConfigs.loadMoreButtonType === CasinoGamesLoadMoreBtnType.LAZY_LOAD;\n\n const customCategory = {\n isSelected:\n CUSTOM_CATEGORY_IDS_WITHOUT_PROVIDERS.includes(selectedCategory),\n category: CUSTOM_CATEGORIES_ARRAY.find(\n _customCategory => _customCategory.id === selectedCategory\n )\n };\n\n const viewAllEnabled =\n selectedCategory === CUSTOM_CATEGORIES.all.id &&\n !!configs.groupAllByCategories;\n\n const isPromotedCategory = [\n CUSTOM_CATEGORIES.special.id,\n CUSTOM_CATEGORIES.specialLive.id\n ].includes(selectedCategory);\n\n const loadMoreFunctionalityAvailable =\n computedConfigs.loadMoreButtonEnabled &&\n (selectedCategory !== CUSTOM_CATEGORIES.all.id ||\n (selectedCategory === CUSTOM_CATEGORIES.all.id &&\n !configs.groupAllByCategories)) &&\n !isPromotedCategory && // in case of it is a promoted category, load more should not work, because that endpoint does not work correctly\n data.length < category.gamesCount;\n\n const loadMoreButtonAvailable =\n loadMoreFunctionalityAvailable &&\n computedConfigs.loadMoreButtonType === CasinoGamesLoadMoreBtnType.BUTTON;\n\n const drawGamesWithCarousel =\n isLoadMoreButtonSlider && data.length >= computedConfigs.gamesPerRow;\n\n const drawGamesFallback = !drawGamesWithCarousel && !isLoadMoreButtonLazyLoad;\n\n const gamesByCategoryClasses = {\n aspectRatio: {\n [`casino-container__${\n configs.aspectRatio && configs.aspectRatio.toString().replace('.', '-')\n }`]: configs.aspectRatio\n },\n arrows: {\n 'x-casinoGamesByCategories__arrows':\n computedConfigs.categoryNameVisible &&\n !viewAllEnabled &&\n isLoadMoreButtonSlider &&\n isMobile()\n }\n };\n\n const isAlternativeTitle = configs.favorite?.useAlternativeTitle;\n const isFavoriteMultiView =\n customCategory?.category?.id === 'favorite' && isAlternativeTitle;\n\n const createCategoryTitle = () => {\n if (isFavoriteMultiView) {\n return t('casino.favoriteGames');\n } else if (customCategory.isSelected) {\n return customCategory?.category?.title;\n } else {\n return category.name;\n }\n };\n\n const loadMoreContainerStyles = useMemo(\n () => ({\n className: cc([\n 'x-casinoGamesByCategories__games',\n {\n 'x-casinoGamesByCategories__small':\n computedConfigs.gamesPerRow >= MIN_GAMES_PER_ROW\n }\n ]),\n style: {\n '--games-per-row': computedConfigs.gamesPerRow,\n overflow: 'unset'\n } as CSSProperties\n }),\n [computedConfigs.gamesPerRow]\n );\n\n const onViewAll: MouseEventHandler<HTMLDivElement> = () => {\n const redirectPathToCasino = SpringConfigs.PAGE_URLS.casino;\n const shouldRedirectToCasino = shouldRedirect(redirectPathToCasino);\n\n const redirectPathToLiveCasino = SpringConfigs.PAGE_URLS['live-casino'];\n const shouldRedirectToLiveCasino = shouldRedirect(redirectPathToLiveCasino);\n\n if (!shouldRedirectToCasino || !shouldRedirectToLiveCasino) {\n parentRef?.current?.scrollIntoView();\n\n history.push({\n pathname: `${mountPoint(location.pathname, false, true)}/${\n category.id\n }`,\n search: location.search\n });\n } else {\n const redirectPath = shouldRedirectToCasino\n ? redirectPathToCasino\n : redirectPathToLiveCasino;\n\n window.location.href = `${redirectPath}/${SpringConfigs.CASINO_MOUNT_PATH}/${category.id}`;\n }\n };\n\n const CasinoGameCard = useCallback(\n ({\n game,\n index\n }: Pick<\n ComponentProps<typeof CasinoGameCardComponent>,\n 'game' | 'index'\n >) =>\n computedConfigs.layoutType === CasinoGamesLayoutType.CLASSIC ? (\n <CasinoGameCardComponent\n game={game}\n casinoPlayRealBtnSize={configs.casinoPlayRealBtnSize}\n casinoNameSize={configs.casinoNameSize}\n index={index}\n />\n ) : (\n <PersonalizedGameCard game={game} />\n ),\n [\n configs.casinoPlayRealBtnSize,\n configs.casinoNameSize,\n computedConfigs.layoutType\n ]\n );\n\n if (\n SpringConfigs.USER_PERSONALIZATION_ENABLED &&\n !favoriteProviders?.length &&\n !data.length\n ) {\n return null;\n }\n\n const dataLength = SpringConfigs.USER_PERSONALIZATION_ENABLED\n ? favoriteProviders?.length + data.length\n : data.length;\n\n if (!dataLength) {\n return null;\n }\n\n return (\n <>\n <div\n className={cc([\n 'x-casinoGamesByCategories',\n {\n 'x-casinoGamesByCategories__carousel': isLoadMoreButtonSlider,\n 'x-casinoGamesByCategories__carousel-mobile': isMobile()\n },\n gamesByCategoryClasses.aspectRatio,\n gamesByCategoryClasses.arrows\n ])}\n >\n {computedConfigs.categoryNameVisible || category.id === 'favorite' ? (\n <div\n className={cc([\n 'x-casinoGamesByCategories__categoryName',\n {\n 'x-casinoGamesByCategories__categoryName--small': isMobile(),\n 'x-casinoGamesByCategories__categoryName--alternativeTitle':\n isAlternativeTitle\n }\n ])}\n data-testid={`${category?.name?.toLowerCase()}`}\n >\n {computedConfigs.categoryNameVisible && createCategoryTitle()}\n {category.id === 'favorite' ? (\n <div\n className={cc([\n 'x-casinoGamesByCategories__categoryName__clearAll',\n {\n 'x-casinoGamesByCategories__categoryName__clearAll--mobile':\n isMobile()\n }\n ])}\n onClick={() => {\n dispatch(clearAllFavorite('casino'));\n }}\n style={\n SpringConfigs.IS_RTL\n ? { marginRight: 'auto' }\n : { marginLeft: 'auto' }\n }\n >\n {t('casino.clearAll')} ({category.gamesCount})\n </div>\n ) : (\n viewAllEnabled && (\n <div\n className={cc([\n 'x-casinoGamesByCategories__categoryName__viewAll',\n {\n 'x-casinoGamesByCategories__categoryName__viewAll--small':\n isMobile()\n }\n ])}\n onClick={onViewAll}\n >\n {t('casino.viewAll')} ({category.gamesCount})\n </div>\n )\n )}\n </div>\n ) : null}\n {/* render games with CAROUSEL */}\n {drawGamesWithCarousel && (\n <CasinoGamesCarousel\n loadMoreFunctionalityAvailable={loadMoreFunctionalityAvailable}\n data={data}\n CasinoGameCard={CasinoGameCard}\n viewAllEnabled={viewAllEnabled}\n onViewAll={onViewAll}\n />\n )}\n {/* render games with LAZY LOAD */}\n {isLoadMoreButtonLazyLoad && (\n <GamesLazyLoad\n gamesCount={category.gamesCount}\n data={data}\n loadMoreContainerStyles={loadMoreContainerStyles}\n loadMoreFunctionalityAvailable={loadMoreFunctionalityAvailable}\n CasinoGameCard={CasinoGameCard}\n />\n )}\n {/* render games with LOAD MORE */}\n {drawGamesFallback && (\n <div\n className={loadMoreContainerStyles.className}\n style={loadMoreContainerStyles.style}\n >\n {data.map(game => (\n <Fragment key={game.id}>\n <CasinoGameCard game={game} />\n </Fragment>\n ))}\n </div>\n )}\n </div>\n {loadMoreButtonAvailable && (\n <Suspense fallback={null}>\n <CasinoLoadMoreButton />\n </Suspense>\n )}\n </>\n );\n};\n\nexport const GamesByCategory = memo(_GamesByCategory);\n","import { useQueryClient as useQueryClientRQ } from '@tanstack/react-query';\n\nexport const useQueryClient = () => {\n const queryClient = useQueryClientRQ();\n\n return { queryClient };\n};\n","import { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\n\nexport const checkIsSelectedCategoryFavorites = (\n selectedCategory: string\n): boolean => {\n return selectedCategory === CUSTOM_CATEGORIES.favorite.id;\n};\n","import { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport {\n CASINO_GAME_TEMPLATE,\n decentralizedGameCategoriesMapper,\n gameMapper\n} from 'utils/casino/maps';\nimport {\n CUSTOM_CATEGORIES,\n CUSTOM_CATEGORY_IDS\n} from 'utils/constants/casino/custom-categories';\nimport { ECasinoQueryKey } from 'utils/constants/store/query-keys';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport type {\n DecentralizedCasinoGamesData,\n IGetCasinoGamesResponse,\n TNewCasinoData,\n TNewCasinoFailedData\n} from 'interfaces/new-casino';\nimport {\n DecentralizedCasinoGame,\n ENewCasinoFailedDataMessage,\n ENewCasinoGamesFetchingParamsKey,\n NewCasinoGame,\n TNewCasinoDataByAllGroup\n} from 'interfaces/new-casino';\nimport { useCombineFavoriteGames } from './useCombineFavoriteGames';\nimport { useSelectedCategory } from './useSelectedCategory';\nimport {\n CASINO_PROVIDER_CRASH_GAMES,\n useCasinoOnlinePlayers\n} from 'newhooks/casino/useCasinoOnlinePlayers';\nimport { useQueryClient } from 'newhooks/generic/useQueryClient';\nimport { useCasinoGamesConditionalsValues } from '../providers/CasinoGamesConditionalsProvider';\nimport {\n CasinoGamesLoadMoreBtnType,\n useCasinoGamesConfigsValues\n} from '../providers/CasinoGamesConfigsContext';\nimport { CasinoGamesConditionalsActionType } from '../state/conditionals-reducer';\nimport { checkBackendAnomaly } from '../utils/check-backend-anomaly';\nimport { checkIsSelectedCategoryFavorites } from '../utils/check-selected-category';\nimport type { AxiosResponse } from 'axios';\n\nexport type UseGamesCombinedDataProps = {\n data: AxiosResponse<IGetCasinoGamesResponse> | undefined;\n paramsWithoutPaginationStringified: string;\n};\n\ntype TCasinoGamesCombinedDataPartition = Partial<\n Omit<\n AxiosResponse<Exclude<IGetCasinoGamesResponse, TNewCasinoFailedData>>,\n 'data'\n >\n> & {\n data: {\n status?: string;\n games: Record<\n string,\n {\n count: number;\n games: NewCasinoGame[];\n }\n >;\n };\n};\n\nexport type TCasinoGamesCombinedData = {\n queryKey?: string;\n data?: TCasinoGamesCombinedDataPartition;\n};\n\nconst isGamesGroupedByCategory = (\n data: IGetCasinoGamesResponse\n): data is TNewCasinoDataByAllGroup => {\n return !Array.isArray(data as TNewCasinoDataByAllGroup);\n};\n\nconst isGamesGroupedById = (\n data: IGetCasinoGamesResponse\n): data is TNewCasinoData => {\n return (data as TNewCasinoData).total_count !== undefined;\n};\n\nconst isGamesDecentralized = (\n data: IGetCasinoGamesResponse\n): data is DecentralizedCasinoGamesData => {\n return typeof (data as DecentralizedCasinoGamesData).count === 'number';\n};\n\nconst generateCategoryAllSelectorKey = (providers: string | undefined) => {\n return `${CUSTOM_CATEGORIES.all.id}-${providers}`;\n};\n\nconst setUniqueGames = (games: NewCasinoGame[]) => {\n const uniqueGamesIds: string[] = [];\n const uniqueGames: NewCasinoGame[] = [];\n\n const crashGamesIds: number[] = [];\n\n games.forEach(game => {\n if (!uniqueGamesIds.includes(game.id)) {\n uniqueGamesIds.push(game.id);\n uniqueGames.push(game);\n\n if (game.categories.includes(CASINO_PROVIDER_CRASH_GAMES)) {\n crashGamesIds.push(+game.extearnal_game_id);\n }\n }\n });\n\n return {\n uniqueGames,\n crashGamesIds\n };\n};\n\nexport const useGamesCombinedData = ({\n data: _data,\n paramsWithoutPaginationStringified\n}: UseGamesCombinedDataProps) => {\n const { configs, computedConfigs } = useCasinoGamesConfigsValues();\n const { dispatchConditionals } = useCasinoGamesConditionalsValues();\n const { queryClient } = useQueryClient();\n\n const { updateCrashGamesIds } = useCasinoOnlinePlayers();\n\n const [combinedData, setCombinedData] = useState<TCasinoGamesCombinedData>(\n {}\n );\n\n useCombineFavoriteGames({ setCombinedData });\n\n // to prevent unnecessary re-renders\n const paramsWithoutPaginationStringifiedRef = useRef(\n paramsWithoutPaginationStringified\n );\n\n const _setUniqueGames = (games: NewCasinoGame[]) => {\n const { crashGamesIds, uniqueGames } = setUniqueGames(games);\n\n updateCrashGamesIds(crashGamesIds);\n\n return uniqueGames;\n };\n\n // layout effect is used to set data to empty object when specific conditions are not met\n useLayoutEffect(() => {\n if (SpringConfigs.MOCKED_DATA) {\n return;\n }\n\n if (checkIsSelectedCategoryFavorites(selectedCategoryRef.current)) {\n return;\n }\n\n paramsWithoutPaginationStringifiedRef.current =\n paramsWithoutPaginationStringified;\n\n const queryKey = [\n ECasinoQueryKey.CasinoGames,\n configs.moduleId,\n paramsWithoutPaginationStringified,\n 0 // offset is 0 for ensuring first page is cached\n ];\n\n const cache = queryClient.getQueryCache();\n const cachedData = cache.findAll({\n queryKey,\n exact: true,\n fetchStatus: 'idle' // to ensure cache is present and currently not being updated\n });\n\n const parsedParams = JSON.parse(paramsWithoutPaginationStringified);\n\n // check for parsedParams length is because react query has an in-between case where it has only one parameter\n // in that case there is no fetch for the data and query is decided to be a miss\n if (\n !cachedData.length ||\n (Object.keys(parsedParams).length < 2 &&\n ![CUSTOM_CATEGORIES.special.id].includes(selectedCategoryRef.current))\n ) {\n setCombinedData({});\n }\n }, [paramsWithoutPaginationStringified]);\n\n // to write filter for custom categories;\n const { selectedCategory } = useSelectedCategory({ configs });\n const selectedCategoryRef = useRef(selectedCategory);\n\n useEffect(() => {\n selectedCategoryRef.current = selectedCategory;\n }, [selectedCategory]);\n\n useEffect(() => {\n if (SpringConfigs.MOCKED_DATA) {\n return;\n }\n\n if (!_data) {\n return;\n }\n\n if (checkBackendAnomaly(_data)) {\n const data = _data as AxiosResponse<TNewCasinoFailedData>;\n\n if (data.data.message === ENewCasinoFailedDataMessage.TimeoutError) {\n dispatchConditionals({\n type: CasinoGamesConditionalsActionType.SET,\n payload: {\n emptyResults: true,\n queryLoading: undefined,\n loading: undefined\n }\n });\n }\n\n return;\n }\n\n const data = _data as AxiosResponse<\n Exclude<IGetCasinoGamesResponse, TNewCasinoFailedData>\n >;\n\n if (checkIsSelectedCategoryFavorites(selectedCategoryRef.current)) {\n return;\n }\n\n // when fetching direct games without grouping by categories and no games are returned\n // (slider type games for example)\n if (\n [ENewCasinoGamesFetchingParamsKey.Id].includes(data.config.params.by_key)\n ) {\n const gamesData = data.data;\n\n if (\n computedConfigs.loadMoreButtonType ===\n CasinoGamesLoadMoreBtnType.SLIDER &&\n isGamesGroupedById(gamesData) &&\n gamesData.games.length === 0\n ) {\n return;\n }\n }\n\n const isCustomCategory = CUSTOM_CATEGORY_IDS.includes(\n selectedCategoryRef.current\n );\n\n const isCustomCategoryAll =\n selectedCategoryRef.current === CUSTOM_CATEGORIES.all.id;\n\n const queryKey = isCustomCategory\n ? selectedCategoryRef.current\n : paramsWithoutPaginationStringifiedRef.current;\n\n const isDecentralizedEndpoint =\n SpringConfigs.DECENTRALIZED_CASINO_URL &&\n data.config.url?.includes(SpringConfigs.DECENTRALIZED_CASINO_URL);\n\n const gamesData = data.data;\n\n if (isDecentralizedEndpoint) {\n setCombinedData(prevCombinedData => {\n const categoryId: string = isCustomCategory\n ? isCustomCategoryAll\n ? generateCategoryAllSelectorKey(data.config.params.provider)\n : selectedCategoryRef.current\n : isGamesDecentralized(gamesData)\n ? gamesData.games?.[0]?.categoryId || ''\n : '';\n\n const mappedGames = (\n isGamesDecentralized(gamesData) ? gamesData.games : []\n ).map((game: DecentralizedCasinoGame) => {\n return gameMapper({\n ...CASINO_GAME_TEMPLATE,\n extearnal_game_id: game.externalGameId.toString(),\n types: {\n realMode: 0,\n funMode: 0\n },\n icon_1: game.icon1,\n icon_2: game.icon2,\n icon_3: game.icon3,\n provider: 'ALL',\n provider_badge: null,\n provider_title: 'ALL',\n show_as_provider: 'ALL',\n cats: game.categories.map(decentralizedGameCategoriesMapper)\n });\n });\n\n if (prevCombinedData.queryKey !== queryKey) {\n return {\n queryKey: queryKey,\n data: {\n ...data,\n data: {\n status: gamesData.status,\n games: {\n [categoryId]: {\n count: isGamesDecentralized(gamesData)\n ? gamesData.count\n : 0,\n games: _setUniqueGames(mappedGames)\n }\n }\n }\n }\n };\n }\n\n return {\n queryKey: queryKey,\n data: {\n ...data,\n data: {\n status: gamesData.status,\n games: {\n [categoryId]: {\n count: isGamesDecentralized(gamesData) ? gamesData.count : 0,\n games: _setUniqueGames([\n ...(prevCombinedData.data?.data?.games?.[categoryId]\n ?.games || []),\n ...(mappedGames || [])\n ])\n }\n }\n }\n }\n };\n });\n\n return;\n }\n\n // when fetching direct games without grouping by categories\n if (\n [ENewCasinoGamesFetchingParamsKey.Id].includes(data.config.params.by_key)\n ) {\n setCombinedData(prevCombinedData => {\n const categoryId: string = isCustomCategory\n ? isCustomCategoryAll\n ? generateCategoryAllSelectorKey(data.config.params.provider)\n : selectedCategoryRef.current\n : isGamesGroupedById(gamesData)\n ? configs.groupAllByCategories\n ? gamesData.games?.[0]?.cats?.[0]?.id || ''\n : CUSTOM_CATEGORIES.all.id\n : '';\n\n if (prevCombinedData.queryKey !== queryKey) {\n return {\n queryKey: queryKey,\n data: {\n ...data,\n data: {\n status: gamesData.status,\n games: {\n [categoryId]: {\n count: Number(\n (isGamesGroupedById(gamesData)\n ? gamesData\n : { total_count: '' }\n ).total_count\n ),\n games: _setUniqueGames(\n (isGamesGroupedById(gamesData)\n ? gamesData.games\n : []\n ).map(gameMapper)\n )\n }\n }\n }\n }\n };\n }\n\n return {\n queryKey: queryKey,\n data: {\n ...data,\n data: {\n status: gamesData.status,\n games: {\n ...(configs.groupAllByCategories\n ? prevCombinedData.data?.data?.games || {}\n : {}),\n [categoryId]: {\n count: Number(\n (isGamesGroupedById(gamesData)\n ? gamesData\n : { total_count: '' }\n ).total_count\n ),\n games: _setUniqueGames([\n ...(prevCombinedData.data?.data?.games?.[categoryId]\n ?.games || []),\n ...(isGamesGroupedById(gamesData)\n ? gamesData.games\n : []\n ).map(gameMapper)\n ])\n }\n }\n }\n }\n };\n });\n\n return;\n }\n\n // when fetching games with grouping by categories\n setCombinedData(prevCombinedData => {\n if (prevCombinedData.queryKey !== queryKey) {\n const mappedGames: TCasinoGamesCombinedDataPartition['data']['games'] =\n {};\n\n Object.entries(\n isGamesGroupedByCategory(gamesData) ? gamesData.games : {}\n ).map(([categoryId, games]) => {\n mappedGames[categoryId] = {\n count: Number(games.count),\n games: _setUniqueGames(games.games.map(gameMapper))\n };\n });\n\n return {\n queryKey: queryKey,\n data: {\n ...data,\n data: {\n status: gamesData.status,\n games: mappedGames\n }\n }\n };\n }\n\n const allGames: TCasinoGamesCombinedDataPartition['data']['games'] =\n prevCombinedData.data?.data?.games || {};\n\n const mergedGames = Object.keys(allGames).reduce((acc, categoryId) => {\n const games = allGames[categoryId];\n acc[categoryId] = {\n count: Number(\n isGamesGroupedByCategory(gamesData)\n ? gamesData?.games?.[categoryId]?.count || games.count\n : games.count\n ),\n games: _setUniqueGames([\n ...(games.games || []),\n ...(isGamesGroupedByCategory(gamesData)\n ? gamesData.games?.[categoryId]?.games || []\n : []\n ).map(gameMapper)\n ])\n };\n\n return acc;\n }, {} as TCasinoGamesCombinedDataPartition['data']['games']);\n\n return {\n queryKey: queryKey,\n data: {\n ...data,\n data: {\n status: gamesData.status,\n games: mergedGames\n }\n }\n };\n });\n }, [_data]);\n\n return { combinedData, setCombinedData };\n};\n","import { useEffect } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useQuery } from '@tanstack/react-query';\nimport { DEBOUNCE_DELAY } from 'utils/constants/app/magic-numbers-app';\nimport { ECasinoQueryKey } from 'utils/constants/store/query-keys';\nimport { CommandNames } from 'utils/constants/swarm/swarm-command-names';\nimport {\n CrashGamesDataResults,\n CrashGamesResponse,\n CrashGamesResponseResultItem\n} from 'interfaces/casino-data';\nimport { swarmCommand } from 'services/get-swarm-data';\nimport {\n setOnlinePlayersCrashGamesIds,\n setOnlinePlayesCrashGamesData\n} from 'store/actions';\nimport { getOnlinePlayersCrashGamesIds } from 'store/selectors/casino-data';\n\nexport const CASINO_PROVIDER_CRASH_GAMES = '406';\n\nconst CASINO_CRASH_RESULTS_COUNT = 10;\n\nexport const useCasinoOnlinePlayers = (): {\n updateCrashGamesIds: (ids: Array<number>) => void;\n} => {\n const dispatch = useDispatch();\n\n const crashGamesIds = useSelector(getOnlinePlayersCrashGamesIds);\n\n const crashGamesEffect = () => {\n if (crashGamesIds.length) {\n swarmCommand(\n CommandNames.GET_PROVIDER_CRASH_GAMES,\n { game_ids: crashGamesIds },\n (data: CrashGamesResponse) => {\n if (data.result === 0 && !data.details.HasError) {\n const games: CrashGamesDataResults = {};\n\n data.details.Result.forEach(\n (game: CrashGamesResponseResultItem) => {\n games[game.GameId] = {\n onlinePlayerCount: game.OnlinePlayersCount,\n results: game.Results.slice(-CASINO_CRASH_RESULTS_COUNT)\n };\n }\n );\n\n dispatch(setOnlinePlayesCrashGamesData(games));\n }\n }\n );\n }\n\n return () => {\n // This is useEffect or useQuery.queryFn return function.\n };\n };\n\n useEffect(crashGamesEffect, [crashGamesIds.length]);\n useQuery({\n queryKey: [ECasinoQueryKey.CasinoCrashGames],\n queryFn: crashGamesEffect,\n refetchOnWindowFocus: true,\n refetchInterval: DEBOUNCE_DELAY._20000\n });\n\n return {\n updateCrashGamesIds: (ids: Array<number>) => {\n dispatch(\n setOnlinePlayersCrashGamesIds(\n [...new Set([...ids, ...crashGamesIds])].sort()\n )\n );\n }\n };\n};\n","import { useEffect, useLayoutEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { gameMapper } from 'utils/casino/maps';\nimport { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport { NewCasinoGame, NewCasinoGameBackend } from 'interfaces/new-casino';\nimport { useSelectedCategory } from './useSelectedCategory';\nimport { getFavoriteCasinoGames } from 'store/selectors/fav-data';\nimport { getIsLoggedIn } from 'store/selectors/user-data';\nimport { useCasinoGamesConfigsValues } from '../providers/CasinoGamesConfigsContext';\nimport type { TCasinoGamesCombinedData } from './useGamesCombinedData';\n\ntype UseCombineFavoriteGamesProps = {\n setCombinedData: (\n value:\n | ((prevState: TCasinoGamesCombinedData) => TCasinoGamesCombinedData)\n | TCasinoGamesCombinedData\n ) => void;\n};\n\nexport const useCombineFavoriteGames = ({\n setCombinedData\n}: UseCombineFavoriteGamesProps) => {\n const isLoggedIn = useSelector(getIsLoggedIn);\n const { configs } = useCasinoGamesConfigsValues();\n const favoriteGames: (NewCasinoGame | NewCasinoGameBackend)[] | undefined =\n useSelector(getFavoriteCasinoGames);\n\n const { selectedCategory } = useSelectedCategory({ configs });\n\n useLayoutEffect(() => {\n if (selectedCategory !== CUSTOM_CATEGORIES.favorite.id) {\n return;\n }\n\n if (!isLoggedIn) {\n return;\n }\n\n setCombinedData(prevData => {\n if (prevData.queryKey !== 'favorite') {\n return {\n queryKey: CUSTOM_CATEGORIES.favorite.id,\n data: undefined\n };\n } else {\n return prevData;\n }\n });\n }, [isLoggedIn]);\n\n useEffect(() => {\n if (selectedCategory !== CUSTOM_CATEGORIES.favorite.id) {\n return;\n }\n\n if (!favoriteGames) {\n return;\n }\n\n setCombinedData({\n queryKey: CUSTOM_CATEGORIES.favorite.id,\n data: {\n data: {\n status: '200',\n games: {\n [CUSTOM_CATEGORIES.favorite.id]: {\n count: favoriteGames.length,\n games: favoriteGames.map(gameMapper)\n }\n }\n }\n }\n });\n }, [selectedCategory, favoriteGames]);\n};\n","import { AxiosResponse } from 'axios';\nimport type { IGetCasinoGamesResponse } from 'interfaces/new-casino';\n\nexport const checkBackendAnomaly = (\n data: AxiosResponse<IGetCasinoGamesResponse>\n) => {\n return data.data.status === -1;\n};\n","import { Fragment, memo, Suspense, useEffect, useMemo, useRef } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { leftSideBarCasinoMain } from 'utils/casino/casino';\nimport { CUSTOM_CATEGORIES } from 'utils/constants/casino/custom-categories';\nimport { CUSTOM_PROVIDERS } from 'utils/constants/casino/custom-providers';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { lazy } from 'utils/generic/lazy';\nimport { isMobile } from 'utils/is-mobile';\nimport { NewCasinoGame } from 'interfaces/new-casino';\nimport { EmptyCasinoGamesResult } from './__partials/components/EmptyCasinoGamesResult';\nimport { GamesByCategory } from './__partials/components/GamesByCategory';\nimport { CasinoGamesByCategorySkeleton } from './__partials/components/GamesByCategory/Skeleton';\nimport { useGamesCombinedData } from './__partials/hooks/useGamesCombinedData';\nimport { useGamesOrder } from './__partials/hooks/useGamesOrder';\nimport { useGamesQuery } from './__partials/hooks/useGamesQuery';\nimport { useSelectedCategory } from './__partials/hooks/useSelectedCategory';\nimport { useCasinoGamesConditionalsValues } from './__partials/providers/CasinoGamesConditionalsProvider';\nimport { useCasinoGamesConfigsValues } from './__partials/providers/CasinoGamesConfigsContext';\nimport { useCasinoGamesFetchDisabledValues } from './__partials/providers/CasinoGamesFetchDisabledContext';\nimport { useCasinoGamesFetchParamsValues } from './__partials/providers/CasinoGamesFetchParamsContext';\nimport { CasinoGamesConditionalsActionType } from './__partials/state/conditionals-reducer';\nimport { LazyLoad } from 'components/Shared/LazyLoad';\nimport { setGamesConfigs } from 'store/actions/new-casino';\nimport { getFavoriteProviders } from 'store/selectors/fav-data';\nimport { useCategories } from '../Categories/__partials/hooks/useCategories';\nimport './index.less';\n\nconst { MockInitializer } = lazy(\n () =>\n import(\n /* webpackChunkName: \"CasinoGamesMockInitializer\" */ './__partials/components/MockInitializer'\n )\n);\n\nconst { FavoriteProviders } = lazy(\n () =>\n import(\n /* webpackChunkName: \"my-casino-providers\" */ './__partials/components/FavoriteProviders'\n )\n);\n\nconst LOAD_COUNT_DESKTOP = 5;\nconst LAZY_LOAD_INITIAL_COUNT_MOBILE = 3;\nconst LAZY_LOAD_INITIAL_COUNT = 5;\n\nconst _CasinoGamesContent = () => {\n const { configs } = useCasinoGamesConfigsValues();\n const { fetchParams } = useCasinoGamesFetchParamsValues();\n const { isFetchDisabled } = useCasinoGamesFetchDisabledValues();\n const dispatch = useDispatch();\n const containerRef = useRef(null);\n const { selectedCategory } = useSelectedCategory({ configs });\n\n const categories = useCategories(leftSideBarCasinoMain());\n const isFavoriteCategory = selectedCategory === CUSTOM_CATEGORIES.favorite.id;\n const { conditionals, dispatchConditionals } =\n useCasinoGamesConditionalsValues();\n\n const favoriteProviders = useSelector(getFavoriteProviders);\n const {\n data,\n paramsWithoutPaginationStringified,\n isLoading: isQueryLoading\n } = useGamesQuery({\n configs: configs,\n params: fetchParams,\n isFetchDisabled: isFetchDisabled\n });\n\n const { combinedData, setCombinedData } = useGamesCombinedData({\n data,\n paramsWithoutPaginationStringified\n });\n\n // setting loading state for load more functionality\n useEffect(() => {\n dispatchConditionals({\n type: CasinoGamesConditionalsActionType.SET,\n payload: {\n queryLoading: isQueryLoading\n }\n });\n }, [isQueryLoading]);\n\n useEffect(() => {\n dispatch(setGamesConfigs(configs));\n }, [configs]);\n\n const unorderedGames = useMemo(() => {\n if (!combinedData.data?.data?.games) {\n return null;\n }\n\n return Object.entries(combinedData.data.data.games)\n .map(([id, _games]) => {\n const providerIdsConfig = configs.providerIds;\n const filteredGames =\n providerIdsConfig && providerIdsConfig !== CUSTOM_PROVIDERS.all.name\n ? _games.games?.filter((game: NewCasinoGame) =>\n providerIdsConfig.includes(game.provider)\n )\n : _games.games;\n\n if (!filteredGames?.length) {\n return null;\n }\n\n return {\n id,\n count: _games.count,\n games: filteredGames,\n categoryName: _games.games?.[0]?.cats?.[0]?.title || ''\n };\n })\n .filter(Boolean);\n }, [combinedData]);\n\n const { orderedGames: games } = useGamesOrder({ games: unorderedGames });\n const isDisableProviders = configs.favorite?.disableProviders;\n\n const gamesData = useMemo(() => {\n if (games?.length) {\n const orderMap = new Map(\n categories?.map((value, index) => {\n return [value.id, index];\n })\n );\n\n const sortedGames = games.sort((a, b) => {\n const indexA = orderMap.has(a?.id || '')\n ? orderMap.get(a?.id || '') || Infinity\n : Infinity;\n\n const indexB = orderMap.has(b?.id || '')\n ? orderMap.get(b?.id || '') || Infinity\n : Infinity;\n\n return indexA - indexB;\n });\n\n return configs.categoriesLength\n ? sortedGames.slice(0, configs.categoriesLength)\n : sortedGames;\n }\n\n return [];\n }, [games, configs.categoriesLength]);\n\n const isEmptyResults = useMemo(() => {\n if (conditionals.emptyResults) {\n return conditionals.emptyResults;\n }\n\n if (\n SpringConfigs.USER_PERSONALIZATION_ENABLED &&\n isFavoriteCategory &&\n !isDisableProviders\n ) {\n if (\n games === undefined ||\n games === null ||\n favoriteProviders === undefined ||\n favoriteProviders === null\n ) {\n return false;\n }\n\n return !games?.length && !favoriteProviders?.length;\n }\n\n return games ? games?.length === 0 : false;\n }, [\n conditionals.emptyResults,\n favoriteProviders?.length,\n games,\n isFavoriteCategory,\n isDisableProviders\n ]);\n\n const isExternalLoading =\n combinedData.data?.data?.games &&\n Object.keys(combinedData.data?.data?.games)[0] === '';\n\n const isLoading = SpringConfigs.MOCKED_DATA\n ? false\n : conditionals.loading || !combinedData.data || isExternalLoading;\n\n const favProvidersEnabledSetting =\n isFavoriteCategory &&\n SpringConfigs.USER_PERSONALIZATION_ENABLED &&\n !configs.favorite?.disableProviders;\n\n const favProvidersEnabled =\n favoriteProviders?.length && favProvidersEnabledSetting;\n\n if (isEmptyResults) {\n return <EmptyCasinoGamesResult />;\n }\n\n if (isLoading) {\n return (\n <CasinoGamesByCategorySkeleton\n favProvidersEnabled={favProvidersEnabledSetting || false}\n />\n );\n }\n\n return (\n <div ref={containerRef} style={{ width: '100%' }}>\n {SpringConfigs.MOCKED_DATA && (\n <Suspense>\n <MockInitializer setCombinedData={setCombinedData} />\n </Suspense>\n )}\n {!SpringConfigs.MOCKED_DATA &&\n SpringConfigs.USER_PERSONALIZATION_ENABLED &&\n favProvidersEnabled ? (\n <Suspense\n fallback={\n <CasinoGamesByCategorySkeleton\n favProvidersEnabled={favProvidersEnabled || false}\n />\n }\n >\n <FavoriteProviders showTitle={configs.showCategoryName} />\n </Suspense>\n ) : null}\n <LazyLoad\n initialCount={\n configs.groupAllByCategories\n ? Infinity\n : isMobile()\n ? LAZY_LOAD_INITIAL_COUNT_MOBILE\n : LAZY_LOAD_INITIAL_COUNT\n }\n loadCount={isMobile() ? 1 : LOAD_COUNT_DESKTOP}\n data={gamesData}\n renderer={(categoryGames: {\n id: string;\n count: string;\n games: NewCasinoGame[];\n categoryName: string;\n }) => (\n <Fragment key={categoryGames.id}>\n <GamesByCategory\n category={{\n id: categoryGames.id,\n name: categoryGames.categoryName,\n gamesCount: Number(categoryGames.count)\n }}\n data={categoryGames.games}\n parentRef={containerRef}\n />\n </Fragment>\n )}\n />\n </div>\n );\n};\n\nexport const CasinoGamesContent = memo(_CasinoGamesContent);\n","import { useEffect, useMemo, useState } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useQuery } from '@tanstack/react-query';\nimport { DEBOUNCE_DELAY } from 'utils/constants/app/magic-numbers-app';\nimport {\n CUSTOM_CATEGORIES,\n CUSTOM_CATEGORY_IDS_WITHOUT_PROVIDERS\n} from 'utils/constants/casino/custom-categories';\nimport { ECasinoQueryKey } from 'utils/constants/store/query-keys';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { showToastError } from 'utils/generic/show-toast-error';\nimport {\n NewCasinoGamesConfigs,\n NewCasinoGamesFetchingParams\n} from 'interfaces/new-casino';\nimport {\n getCasinoGames,\n getPromotedCasinoGames\n} from 'services/casino/casino-fetch-games-query';\nimport { useSelectedCategory } from './useSelectedCategory';\nimport { useDebounce } from 'hooks/useDebounce';\nimport { setEnhancedParams } from 'store/actions/new-casino';\nimport {\n getCanRequestCategoriesNestedData,\n getCanRequestProvidersNestedData\n} from 'store/selectors/new-casino';\nimport { getInitialFetchParams } from '../constants/fetch-params';\n\ntype UseGamesQueryProps = {\n configs: Partial<NewCasinoGamesConfigs>;\n params: Partial<NewCasinoGamesFetchingParams>;\n isFetchDisabled?: boolean;\n};\n\nconst MAX_CASINO_GAMES_QUERY_KEY_LENGTH = 3;\n\nexport const useGamesQuery = ({\n configs,\n params,\n isFetchDisabled: isFetchDisabledFromOuterScope\n}: UseGamesQueryProps) => {\n const categoriesFetched = useSelector(getCanRequestCategoriesNestedData);\n const providersFetched = useSelector(getCanRequestProvidersNestedData);\n const { selectedCategory } = useSelectedCategory({ configs });\n const dispatch = useDispatch();\n // ATTENTION: this array is also used for getting cache in useGamesCombinedData\n const [casinoGamesQueryKey, setCasinoGamesQueryKey] = useState(() => [\n ECasinoQueryKey.CasinoGames as string,\n configs.moduleId\n ]);\n\n const enhancedParams: Partial<NewCasinoGamesFetchingParams> = {\n ...getInitialFetchParams(configs),\n ...params\n };\n\n const paramsWithoutPagination = {\n ...enhancedParams,\n offset: undefined,\n limit: undefined\n };\n\n const offset = enhancedParams.offset || 0;\n\n const fetchEnabledBinding = useMemo(() => {\n // check possibility for request data from CMS in case of binding with other elements to keep requests' right order\n\n const isCategoryWithoutProvider =\n CUSTOM_CATEGORY_IDS_WITHOUT_PROVIDERS.includes(selectedCategory);\n\n // when bound to \"categories\" and \"providers\" elements\n if (configs.bindWithCategories && configs.bindWithProviders) {\n return (\n categoriesFetched && (providersFetched || isCategoryWithoutProvider)\n );\n }\n\n //when bound to \"categories\" element only\n if (configs.bindWithCategories) {\n return categoriesFetched;\n }\n\n //when bound to \"providers\" element only\n if (configs.bindWithProviders) {\n return providersFetched || isCategoryWithoutProvider;\n }\n\n //when not bound to any element\n return true;\n }, [\n configs.bindWithCategories,\n configs.bindWithProviders,\n categoriesFetched,\n providersFetched,\n selectedCategory\n ]);\n\n const fetchEnabledByQueryKey = useMemo(() => {\n if (configs.skipQueryKeysCheck) {\n return true;\n }\n\n // if query keys are less than 3, it means that there is no fetch for the data and query is decided to be a miss\n if (casinoGamesQueryKey.length < MAX_CASINO_GAMES_QUERY_KEY_LENGTH) {\n return false;\n }\n\n if (\n [CUSTOM_CATEGORIES.special.id, CUSTOM_CATEGORIES.specialLive.id].includes(\n selectedCategory\n )\n ) {\n return true;\n }\n\n const parsedParams = JSON.parse(casinoGamesQueryKey[2] as string);\n\n // check for parsedParams length is because react query has an in-between case where it has only one parameter\n // in that case there is no fetch for the data and query is decided to be a miss\n return Object.keys(parsedParams).length >= 2;\n }, [casinoGamesQueryKey, selectedCategory]);\n\n const fetchEnabledByPagination = Boolean(\n enhancedParams.offset !== undefined || enhancedParams.limit !== undefined\n );\n\n const isFetchEnabled =\n !SpringConfigs.MOCKED_DATA &&\n !isFetchDisabledFromOuterScope &&\n fetchEnabledBinding &&\n fetchEnabledByQueryKey &&\n fetchEnabledByPagination;\n\n const paramsWithoutPaginationStringified = JSON.stringify(\n paramsWithoutPagination,\n null\n );\n\n // ATTENTION: setCasinoGamesQueryKey is also used for getting cache in useGamesCombinedData. Modify it carefully\n const { isDebouncing } = useDebounce(\n () => {\n setCasinoGamesQueryKey([\n ECasinoQueryKey.CasinoGames,\n configs.moduleId,\n paramsWithoutPaginationStringified,\n offset\n ]);\n },\n DEBOUNCE_DELAY._10,\n [paramsWithoutPaginationStringified, offset, configs.moduleId]\n );\n\n const isPromotedCategory = [\n CUSTOM_CATEGORIES.special.id,\n CUSTOM_CATEGORIES.specialLive.id\n ].includes(selectedCategory);\n\n const getGames = isPromotedCategory ? getPromotedCasinoGames : getCasinoGames;\n\n const { data, error, isLoading } = useQuery({\n queryKey: casinoGamesQueryKey,\n queryFn: () => getGames(enhancedParams),\n retry: false,\n enabled: isFetchEnabled\n });\n\n useEffect(() => {\n dispatch(setEnhancedParams(enhancedParams));\n }, [JSON.stringify(enhancedParams)]);\n\n useEffect(() => {\n if (!error) {\n return;\n }\n\n showToastError(String(error));\n }, [error]);\n\n return {\n params,\n data,\n error,\n isLoading,\n isFetchEnabled,\n isDebouncing,\n paramsWithoutPaginationStringified\n };\n};\n","import { useMemo } from 'react';\nimport { useSelector } from 'react-redux';\nimport { NewCasinoGame } from 'interfaces/new-casino';\nimport {\n getCasinoOriginalCategories,\n getCasinoOriginalCategoriesSet,\n getCasinoOriginalCategoriesSetLeftSideBar\n} from 'store/selectors/new-casino';\nimport { useCasinoGamesConfigsValues } from '../providers/CasinoGamesConfigsContext';\n\ntype TUseGamesOrderProps = {\n games:\n | null\n | (null | {\n count: number;\n games: NewCasinoGame[];\n id: string;\n categoryName: string;\n })[];\n};\n\nexport const useGamesOrder = ({ games }: TUseGamesOrderProps) => {\n const { computedConfigs } = useCasinoGamesConfigsValues();\n\n const originalCategories = useSelector(getCasinoOriginalCategories);\n const originalCategoriesSet = useSelector(getCasinoOriginalCategoriesSet);\n const leftSideBarOriginalCategoriesSet = useSelector(\n getCasinoOriginalCategoriesSetLeftSideBar\n );\n\n const categoriesSet = useMemo(() => {\n return (\n (computedConfigs.leftSideBarAvailable\n ? leftSideBarOriginalCategoriesSet\n : originalCategoriesSet) ?? []\n );\n }, [\n computedConfigs.leftSideBarAvailable,\n originalCategoriesSet,\n leftSideBarOriginalCategoriesSet\n ]);\n\n const originalCategoriesSortArray = useMemo(() => {\n if (categoriesSet.length === 0) {\n return originalCategories?.map(category => category.id) || [];\n } else {\n return categoriesSet;\n }\n }, [originalCategories, categoriesSet]);\n\n const orderedGames = useMemo(\n () =>\n games?.sort((categoryGamesA, categoryGamesB) => {\n // sorting category games by actual categories order\n const categoryAIndex = originalCategoriesSortArray.indexOf(\n categoryGamesA?.id || ''\n );\n\n const categoryBIndex = originalCategoriesSortArray.indexOf(\n categoryGamesB?.id || ''\n );\n\n return categoryAIndex - categoryBIndex;\n }) || null,\n [games, originalCategoriesSortArray]\n );\n\n return { orderedGames };\n};\n","import { FC, Suspense, useMemo, useReducer, useState } from 'react';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { lazy } from 'utils/generic/lazy';\nimport { getInitialFetchParams } from './__partials/constants/fetch-params';\nimport { useSelectedCategory } from './__partials/hooks/useSelectedCategory';\nimport { CasinoGamesConditionalsProvider } from './__partials/providers/CasinoGamesConditionalsProvider';\nimport {\n CasinoGamesComputedConfigs,\n CasinoGamesConfigs,\n CasinoGamesConfigsProvider\n} from './__partials/providers/CasinoGamesConfigsContext';\nimport { CasinoGamesFetchDisabledProvider } from './__partials/providers/CasinoGamesFetchDisabledContext';\nimport { CasinoGamesFetchParamsProvider } from './__partials/providers/CasinoGamesFetchParamsContext';\nimport { casinoGamesConditionalsReducer } from './__partials/state/conditionals-reducer';\nimport { casinoGamesFetchingParamsReducer } from './__partials/state/reducer';\nimport {\n computeCasinoGamesArrowsEnabled,\n computeCasinoGamesCategoryNameVisible,\n computeCasinoGamesCountForSliderSkeleton,\n computeCasinoGamesLayoutType,\n computeCasinoGamesLimit,\n computeCasinoGamesLoadMoreButtonEnabled,\n computeCasinoGamesPerRow,\n computeCasinoGamesRows,\n computeCasinoLoadMoreButtonType,\n computeLeftSideBarCasinoAvailable\n} from './__partials/utils/compute-configs';\nimport { CasinoGamesContent } from './GamesContent';\nimport { useOptions } from '../hooks/useOptions';\n\nconst { FetchParamsUpdaterCategory } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterCategory\" */ './__partials/fetch-updaters/FetchParamsUpdaterCategory'\n )\n);\n\nconst { FetchParamsUpdaterProvider } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterProvider\" */ './__partials/fetch-updaters/FetchParamsUpdaterProvider'\n )\n);\n\nconst { FetchParamsUpdaterLimit } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterLimit\" */ './__partials/fetch-updaters/FetchParamsUpdaterLimit'\n )\n);\n\nconst { FetchParamsUpdaterOffset } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterOffset\" */ './__partials/fetch-updaters/FetchParamsUpdaterOffset'\n )\n);\n\nconst { FetchParamsUpdaterByKey } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterByKey\" */ './__partials/fetch-updaters/FetchParamsUpdaterByKey'\n )\n);\n\nconst { FetchParamsUpdaterLastPlayedGames } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterLastPlayedGames\" */ './__partials/fetch-updaters/FetchParamsUpdaterLastPlayedGames'\n )\n);\n\nconst { FetchParamsUpdaterSuggestedGames } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterSuggestedGames\" */ './__partials/fetch-updaters/FetchParamsUpdaterSuggestedGames'\n )\n);\n\nconst { FetchParamsUpdaterFavoriteGames } = lazy(\n () =>\n import(\n /* webpackChunkName: \"FetchParamsUpdaterFavoriteGames\" */ './__partials/fetch-updaters/FetchParamsUpdaterFavoriteGames'\n )\n);\n\nexport const CasinoGames: FC<{ configs: Partial<CasinoGamesConfigs> }> = ({\n configs\n}) => {\n useOptions({ shouldFetch: configs?.isFirstCasinoElement });\n const { selectedCategory } = useSelectedCategory({ configs });\n\n const [isFetchDisabled, setIsFetchDisabled] = useState(false);\n // useReducer type issue from react types\n // @ts-ignore\n const [fetchParams, dispatchFetchParams] = useReducer(\n casinoGamesFetchingParamsReducer,\n getInitialFetchParams(configs)\n );\n\n // useReducer type issue from react types\n // @ts-ignore\n const [conditionals, dispatchConditionals] = useReducer(\n casinoGamesConditionalsReducer,\n {}\n );\n\n const computedConfigs = useMemo<CasinoGamesComputedConfigs>(() => {\n const loadMoreButtonEnabled = computeCasinoGamesLoadMoreButtonEnabled(\n configs,\n selectedCategory\n );\n\n const loadMoreButtonType = computeCasinoLoadMoreButtonType(configs);\n const gamesPerRow = computeCasinoGamesPerRow(configs);\n const gamesRows = computeCasinoGamesRows(configs);\n const gamesCountForSkeleton =\n computeCasinoGamesCountForSliderSkeleton(configs);\n\n const gamesLimit = computeCasinoGamesLimit(configs);\n const arrowsEnabled = computeCasinoGamesArrowsEnabled(configs);\n const leftSideBarAvailable = computeLeftSideBarCasinoAvailable();\n const layoutType = computeCasinoGamesLayoutType(configs);\n const nextSlideOnHover = configs.nextSlideOnHover;\n\n const categoryNameVisible = computeCasinoGamesCategoryNameVisible(\n configs,\n selectedCategory\n );\n\n return {\n loadMoreButtonEnabled,\n loadMoreButtonType,\n gamesPerRow,\n gamesRows,\n gamesLimit,\n arrowsEnabled,\n categoryNameVisible,\n leftSideBarAvailable,\n gamesCountForSkeleton,\n layoutType,\n nextSlideOnHover\n };\n }, [configs, selectedCategory]);\n\n const contextProviderConfigsValue = {\n configs,\n computedConfigs\n };\n\n const contextProviderFetchDisabledValue = {\n isFetchDisabled,\n setIsFetchDisabled\n };\n\n const contextProviderFetchParamsValue = {\n fetchParams,\n dispatchFetchParams\n };\n\n return (\n <CasinoGamesConfigsProvider value={contextProviderConfigsValue}>\n <CasinoGamesFetchDisabledProvider\n value={contextProviderFetchDisabledValue}\n >\n <CasinoGamesFetchParamsProvider value={contextProviderFetchParamsValue}>\n <CasinoGamesConditionalsProvider\n value={{ conditionals, dispatchConditionals }}\n >\n {!SpringConfigs.MOCKED_DATA && (\n <Suspense>\n <FetchParamsUpdaterOffset />\n <FetchParamsUpdaterLimit />\n <FetchParamsUpdaterCategory />\n <FetchParamsUpdaterProvider />\n <FetchParamsUpdaterByKey />\n <FetchParamsUpdaterLastPlayedGames />\n <FetchParamsUpdaterSuggestedGames />\n <FetchParamsUpdaterFavoriteGames />\n </Suspense>\n )}\n <CasinoGamesContent />\n </CasinoGamesConditionalsProvider>\n </CasinoGamesFetchParamsProvider>\n </CasinoGamesFetchDisabledProvider>\n </CasinoGamesConfigsProvider>\n );\n};\n","import { useEffect, useState } from 'react';\n\nexport const useInView = (\n element: HTMLElement | Element | null | undefined,\n configs?: {\n options?: IntersectionObserverInit;\n destructOnFirstIntersect?: boolean;\n }\n): boolean => {\n const [inView, setInView] = useState(false);\n\n useEffect(() => {\n if (!element) {\n return;\n }\n\n const callback = ([entry]: IntersectionObserverEntry[]) => {\n if (configs?.destructOnFirstIntersect && entry.isIntersecting) {\n observer.unobserve(element);\n observer.disconnect();\n }\n\n setInView(prev => {\n if (prev === entry.isIntersecting) {\n return prev;\n }\n\n return entry.isIntersecting;\n });\n };\n\n const observer = new IntersectionObserver(callback, configs?.options);\n\n observer.observe(element);\n\n return () => {\n if (!element) {\n return;\n }\n\n observer.unobserve(element);\n observer.disconnect();\n };\n }, [element, configs?.options, configs?.destructOnFirstIntersect]);\n\n return inView;\n};\n","import axios, { AxiosResponse } from 'axios';\nimport { CasinoCommandNames } from 'utils/constants/casino/casino-command-names';\nimport { CASINO_LANG_EXCEPTIONS } from 'utils/constants/languages/language-format';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { GLOBALS } from 'utils/generic/global-variables';\nimport { isMobile } from 'utils/is-mobile';\nimport {\n IGetCasinoGamesResponse,\n NewCasinoGamesFetchingParams\n} from 'interfaces/new-casino';\n\nconst lang = SpringConfigs.CURRENT_LANGUAGE;\n\nconst fetchLang =\n GLOBALS.languageConfigs.casinoLangPrefix ||\n CASINO_LANG_EXCEPTIONS[lang] ||\n CASINO_LANG_EXCEPTIONS[lang.slice(0, 2)] ||\n SpringConfigs.LANGUAGE_PREFIX;\n\nconst defaultParams: Partial<NewCasinoGamesFetchingParams> = {\n partner_id: SpringConfigs.PARTNER_ID,\n is_mobile: Number(isMobile()),\n lang: fetchLang,\n use_webp: Number(SpringConfigs.IS_WEBP_SUPPORTED),\n offset: 0,\n country: SpringConfigs.CURRENT_COUNTRY_CODE\n};\n\nexport const getCasinoGames = async <T = IGetCasinoGamesResponse>(\n _params: Partial<NewCasinoGamesFetchingParams>\n) => {\n const url = SpringConfigs.DECENTRALIZED_CASINO_URL\n ? `${SpringConfigs.DECENTRALIZED_CASINO_URL}${CasinoCommandNames.GET_DECENTRALIZED_GAMES}`\n : `${SpringConfigs.CASINO_URL}/${CasinoCommandNames.GET_GAMES}`;\n\n const params = SpringConfigs.DECENTRALIZED_CASINO_URL\n ? {\n partnerId: SpringConfigs.DECENTRALIZED_CASINO_PARTNER_ID,\n lang: defaultParams.lang,\n categoryId: _params.category?.includes(',')\n ? undefined\n : _params.category,\n offset: _params.offset || 0,\n limit: _params.limit || SpringConfigs.CASINO_GAMES_FETCH_COUNT\n }\n : { ...defaultParams, ..._params, _all_categories: undefined };\n\n return await axios.get<T, AxiosResponse<T>>(url, { params });\n};\n\nexport const getPromotedCasinoGames = async <T = IGetCasinoGamesResponse>(\n _params: Partial<NewCasinoGamesFetchingParams>\n) => {\n const url = `${SpringConfigs.CASINO_URL}/${CasinoCommandNames.GET_PROMOTED_GAMES}`;\n\n const params = { ...defaultParams, ..._params };\n\n return await axios.get<T, AxiosResponse<T>>(url, { params });\n};\n"],"names":["FavoriteCasinoProviderCardSkeleton","_jsxs","className","children","_jsx","Skeleton","active","title","width","style","height","margin","paragraph","cc","SpringConfigs","IS_RTL","PersonalizedGameCard","_ref","game","games","onCheck","useContext","PersonalizedGamesContext","selected","length","find","item","id","isMobile","onClick","src","CASINO_HIGH_QUALITY_PICTURES","icon_3","icon_1","icon_2","VERSION","alt","name","loading","provider_title","Checkbox","checked","createContext","PersonalizedGamesProvider","value","Provider","CASINO_GAMES_SLIDER_LIMIT_MULTIPLIER","useSelectedCategory","_routeMatch$params","configs","location","useLocation","routeMatch","useSbRouteMatch","mountPoint","pathname","selectedCategory","bindWithCategories","groupAllByCategories","params","category","CUSTOM_CATEGORIES","all","categoryIds","CasinoGamesConditionalsContext","conditionals","dispatchConditionals","CasinoGamesConditionalsProvider","memo","props","useCasinoGamesConditionalsValues","CasinoGamesFetchDisabledContext","isFetchDisabled","setIsFetchDisabled","CasinoGamesFetchDisabledProvider","useCasinoGamesFetchDisabledValues","CasinoGamesFetchParamsContext","fetchParams","dispatchFetchParams","CasinoGamesFetchParamsProvider","useCasinoGamesFetchParamsValues","CasinoGamesConditionalsActionType","casinoGamesConditionalsReducer","state","action","type","payload","SET","RESET","CasinoGamesFetchingParamsActionType","casinoGamesFetchingParamsReducer","CasinoGamesDefaultConstants","LOAD_MORE_TYPE","CasinoGamesLoadMoreBtnType","BUTTON","GAMES_PER_ROW","GAMES_ROWS","CASINO_GAMES_LIMIT","LOAD_MORE_BUTTON_ENABLED","ARROWS_ENABLED","CATEGORY_NAME_VISIBLE","INITIAL_FETCH_PARAMS_STATE","by_key","ENewCasinoGamesFetchingParamsKey","Category","external_id","undefined","provider","INITIAL_FETCH_PARAMS_STATE_FOR_SKIP_QUERY_KEYS_CHECK_ALL_CATEGORY","Id","_fake_category","INITIAL_FETCH_PARAMS_STATE_FOR_SKIP_QUERY_KEYS_CHECK_LIVE_CASINO_CATEGORY","LIVE_CASINO_CATEGORY","INITIAL_FETCH_PARAMS_BY_SKIP_CATEGORY","getInitialFetchParams","skipQueryKeysCheck","computeCasinoLoadMoreButtonType","mobileCustomSettings","mobileLoadMoreType","loadMoreType","computeCasinoGamesPerRow","mobileGamesPerRow","gamesPerRow","computeCasinoGamesRows","mobileGamesRows","gamesRows","computeCasinoGamesLimit","mobileCasinoGamesLimit","casinoGamesLimit","EmptyCasinoGamesResult","useCasinoGamesConfigsValues","t","useTranslation","isFavoriteCategory","favorite","isLastPlayedCategory","lastPlayed","EmptyCasinoGames","USER_PERSONALIZATION_ENABLED","gameText","SeeAllGames","onViewAll","slidesPerView","window","innerWidth","useGamesLoadMore","computedConfigs","handleLoadMore","useCallback","offset","limit","queryLoading","gamesLimit","loadMoreButtonType","SLIDER","Math","min","CASINO_GAMES_FETCH_MAX_COUNT","CasinoGamesByCategorySkeleton","favProvidersEnabled","gamesByCategoryClasses","aspectRatio","toString","replace","sliderSkeletonGridTemplate","useMemo","gridTemplateRows","gridTemplateColumns","ceil","gamesCountForSkeleton","CategoryNameSkeleton","categoryNameVisible","FavoritePerRowMobile","FavoritePerRow","Array","from","v","i","map","createArray","key","CasinoGameCardSkeleton","SwiperSlider","lazy","_CasinoGamesCarousel","data","loadMoreFunctionalityAvailable","CasinoGameCard","viewAllEnabled","observableReference","setObservableReference","useState","scrollableReference","useRef","inView","useInView","destructOnFirstIntersect","options","threshold","observableIndexDiff","showArrows","arrowsEnabled","loadMoreGames","debouncedLoadMoreGames","callback","delay","arguments","timeoutDuration","DURATION_300","deps","ref","debounceId","RidGenerator","useEffect","current","debounce","func","_ref$current","call","useDebouncedCallback","DEBOUNCE_DELAY","_300","scrollableElement","loadMoreCalled","handleScroll","totalScrollWidth","scrollWidth","scrollLeft","clientWidth","addEventListener","removeEventListener","drawableData","res","divideArray","array","itemLength","itemsCount","ans","temp","push","a","group","groupIndex","dataArray","index","Suspense","fallback","bodyArrows","activeSlide","disableSwiping","alwaysShowArrows","spaceBetween","slideOnHover","nextSlideOnHover","fetchOnProgress","point","drawableTabs","CasinoGamesCarousel","GamesLazyLoad","_ref2","loadMoreContainerStyles","triggerCard","setTriggerCard","observer","IntersectionObserver","entry","isIntersecting","unobserve","target","disconnect","observe","_Fragment","elem","Loading","CasinoLoadMoreButton","namedLazy","_GamesByCategory","_configs$favorite","_customCategory$categ","_category$name","parentRef","favoriteProviders","useSelector","getFavoriteProviders","dispatch","useDispatch","history","useHistory","isLoadMoreButtonSlider","isLoadMoreButtonLazyLoad","LAZY_LOAD","customCategory","isSelected","CUSTOM_CATEGORY_IDS_WITHOUT_PROVIDERS","includes","CUSTOM_CATEGORIES_ARRAY","_customCategory","isPromotedCategory","special","specialLive","loadMoreButtonEnabled","gamesCount","loadMoreButtonAvailable","drawGamesWithCarousel","drawGamesFallback","arrows","isAlternativeTitle","useAlternativeTitle","isFavoriteMultiView","overflow","redirectPathToCasino","PAGE_URLS","casino","shouldRedirectToCasino","shouldRedirect","redirectPathToLiveCasino","shouldRedirectToLiveCasino","redirectPath","href","CASINO_MOUNT_PATH","_parentRef$current","scrollIntoView","search","layoutType","CasinoGamesLayoutType","CLASSIC","CasinoGameCardComponent","casinoPlayRealBtnSize","casinoNameSize","toLowerCase","createCategoryTitle","_customCategory$categ2","clearAllFavorite","marginRight","marginLeft","Fragment","GamesByCategory","checkIsSelectedCategoryFavorites","isGamesGroupedByCategory","isArray","isGamesGroupedById","total_count","isGamesDecentralized","count","generateCategoryAllSelectorKey","providers","useGamesCombinedData","_data","paramsWithoutPaginationStringified","queryClient","useQueryClientRQ","updateCrashGamesIds","useCasinoOnlinePlayers","crashGamesIds","getOnlinePlayersCrashGamesIds","crashGamesEffect","swarmCommand","CommandNames","GET_PROVIDER_CRASH_GAMES","game_ids","result","details","HasError","Result","forEach","GameId","onlinePlayerCount","OnlinePlayersCount","results","Results","slice","setOnlinePlayesCrashGamesData","useQuery","queryKey","ECasinoQueryKey","CasinoCrashGames","queryFn","refetchOnWindowFocus","refetchInterval","_20000","ids","setOnlinePlayersCrashGamesIds","Set","sort","combinedData","setCombinedData","isLoggedIn","getIsLoggedIn","favoriteGames","getFavoriteCasinoGames","useLayoutEffect","prevData","status","gameMapper","useCombineFavoriteGames","paramsWithoutPaginationStringifiedRef","_setUniqueGames","uniqueGames","uniqueGamesIds","categories","extearnal_game_id","setUniqueGames","MOCKED_DATA","selectedCategoryRef","CasinoGames","moduleId","cachedData","getQueryCache","findAll","exact","fetchStatus","parsedParams","JSON","parse","Object","keys","_data$config$url","checkBackendAnomaly","message","ENewCasinoFailedDataMessage","TimeoutError","emptyResults","config","gamesData","isCustomCategory","CUSTOM_CATEGORY_IDS","isCustomCategoryAll","isDecentralizedEndpoint","DECENTRALIZED_CASINO_URL","url","prevCombinedData","_gamesData$games","_gamesData$games$","_prevCombinedData$dat","_prevCombinedData$dat2","_prevCombinedData$dat3","_prevCombinedData$dat4","categoryId","mappedGames","CASINO_GAME_TEMPLATE","externalGameId","types","realMode","funMode","icon1","icon2","icon3","provider_badge","show_as_provider","cats","decentralizedGameCategoriesMapper","_gamesData$games2","_gamesData$games2$","_gamesData$games2$$ca","_gamesData$games2$$ca2","_prevCombinedData$dat5","_prevCombinedData$dat6","_prevCombinedData$dat7","_prevCombinedData$dat8","_prevCombinedData$dat9","_prevCombinedData$dat10","Number","_prevCombinedData$dat11","_prevCombinedData$dat12","entries","allGames","mergedGames","reduce","acc","_gamesData$games3","_gamesData$games3$cat","_gamesData$games4","_gamesData$games4$cat","MockInitializer","FavoriteProviders","_CasinoGamesContent","_combinedData$data2","_combinedData$data2$d","_combinedData$data3","_combinedData$data3$d","_configs$favorite2","containerRef","useCategories","leftSideBarCasinoMain","isLoading","isQueryLoading","isFetchDisabledFromOuterScope","categoriesFetched","getCanRequestCategoriesNestedData","providersFetched","getCanRequestProvidersNestedData","casinoGamesQueryKey","setCasinoGamesQueryKey","enhancedParams","paramsWithoutPagination","fetchEnabledBinding","isCategoryWithoutProvider","bindWithProviders","fetchEnabledByQueryKey","fetchEnabledByPagination","Boolean","isFetchEnabled","stringify","isDebouncing","useDebounce","_10","getGames","getPromotedCasinoGames","getCasinoGames","error","retry","enabled","setEnhancedParams","showToastError","String","useGamesQuery","setGamesConfigs","unorderedGames","_combinedData$data","_combinedData$data$da","_games$games","_games$games2","_games$games2$","_games$games2$$cats","_games$games2$$cats$","_games","providerIdsConfig","providerIds","filteredGames","CUSTOM_PROVIDERS","filter","categoryName","orderedGames","originalCategories","getCasinoOriginalCategories","originalCategoriesSet","getCasinoOriginalCategoriesSet","leftSideBarOriginalCategoriesSet","getCasinoOriginalCategoriesSetLeftSideBar","categoriesSet","leftSideBarAvailable","originalCategoriesSortArray","categoryGamesA","categoryGamesB","indexOf","useGamesOrder","isDisableProviders","disableProviders","orderMap","Map","sortedGames","b","has","get","Infinity","categoriesLength","isEmptyResults","isExternalLoading","favProvidersEnabledSetting","showTitle","showCategoryName","LazyLoad","initialCount","loadCount","renderer","categoryGames","CasinoGamesContent","FetchParamsUpdaterCategory","FetchParamsUpdaterProvider","FetchParamsUpdaterLimit","FetchParamsUpdaterOffset","FetchParamsUpdaterByKey","FetchParamsUpdaterLastPlayedGames","FetchParamsUpdaterSuggestedGames","FetchParamsUpdaterFavoriteGames","useOptions","shouldFetch","isFirstCasinoElement","useReducer","computeCasinoGamesLoadMoreButtonEnabled","mobileShowLoadMoreBtn","showLoadMoreBtn","computeCasinoGamesCountForSliderSkeleton","mobileShowArrow","showArrowForMobile","computeCasinoGamesArrowsEnabled","computeLeftSideBarCasinoAvailable","matchCasinoUrl","RegExp","match","LEFT_SIDE_BAR","LEFT_SIDE_BAR_CASINO","_configs$layoutType","computeCasinoGamesLayoutType","computeCasinoGamesCategoryNameVisible","contextProviderConfigsValue","contextProviderFetchDisabledValue","contextProviderFetchParamsValue","CasinoGamesConfigsProvider","element","setInView","prev","lang","CURRENT_LANGUAGE","fetchLang","GLOBALS","languageConfigs","casinoLangPrefix","CASINO_LANG_EXCEPTIONS","LANGUAGE_PREFIX","defaultParams","partner_id","PARTNER_ID","is_mobile","use_webp","IS_WEBP_SUPPORTED","country","CURRENT_COUNTRY_CODE","async","_params$category","CasinoCommandNames","GET_DECENTRALIZED_GAMES","CASINO_URL","GET_GAMES","partnerId","DECENTRALIZED_CASINO_PARTNER_ID","_params","CASINO_GAMES_FETCH_COUNT","_all_categories","axios","GET_PROMOTED_GAMES"],"sourceRoot":""}