{"version":3,"file":"static/js/52461.6bc31508.chunk.js","mappings":"+KAOO,MAAMA,EAAiBC,IACxBC,EAAAA,GAAcC,sBAChBC,MAAMF,EAAAA,GAAcC,uBACjBE,MAAKC,GAAYA,EAASC,SAC1BF,MAAKG,IACJ,IAAIC,EAAmBC,OAAOC,OAAOH,GAIrC,GAFAC,GAAOG,EAAAA,EAAAA,GAAYF,OAAOC,OAAOF,KAE5BI,EAAAA,GAAQC,WAAWC,gBACtB,IAAK,MAAMC,KAAQP,EACjBO,EAAKC,eAAiBD,EAAKE,SAET,gBAAdF,EAAKG,OACPH,EAAKE,cAAWE,GAGA,MAAdJ,EAAKK,MACPX,OAAOY,OAAOpB,EAAAA,GAAcqB,UAAW,CACrCC,YAAaR,EAAKG,OAMtBjB,EAAAA,GAAcuB,8BAChBhB,EAAKiB,SAAQC,IACO,4BAAdA,EAAKC,OACPD,EAAKC,KAAO,iCACd,IAIJC,EAAAA,EAAMC,UAASC,EAAAA,EAAAA,IAAgBtB,IAC/BR,GAAcA,GAAW,EAAM,IAEhC+B,MAAMC,QAAQC,OAEjBjC,GAAcA,GAAW,EAC3B,C","sources":["utils/generic/fetch-menu-data.ts"],"sourcesContent":["import { sortByOrder } from 'utils/collection-manipulation/array-sort-by';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { AToZData } from 'interfaces/generic';\nimport { GLOBALS } from './global-variables';\nimport store from 'store';\nimport { setMenuJsonData } from 'store/actions/app-data';\n\nexport const fetchMenuData = (setLoading?: (arg: boolean) => void): void => {\n  if (SpringConfigs.A_TO_Z_MENU_DATA_PATH) {\n    fetch(SpringConfigs.A_TO_Z_MENU_DATA_PATH)\n      .then(responce => responce.json())\n      .then(resp => {\n        let data: AToZData[] = Object.values(resp);\n\n        data = sortByOrder(Object.values(data));\n\n        if (!GLOBALS.appConfigs.springPagesUrls) {\n          for (const elem of data) {\n            elem.categoryBottom = elem.category;\n\n            if (elem.type === 'live-casino') {\n              elem.category = undefined;\n            }\n\n            if (elem.path === '/') {\n              Object.assign(SpringConfigs.PAGE_URLS, {\n                homepageKey: elem.type\n              });\n            }\n          }\n        }\n\n        if (SpringConfigs.USER_PERSONALIZATION_ENABLED) {\n          data.forEach(item => {\n            if (item.icon === 'casino.colored.favorite') {\n              item.icon = 'casino.colored.personalization';\n            }\n          });\n        }\n\n        store.dispatch(setMenuJsonData(data));\n        setLoading && setLoading(false);\n      })\n      .catch(console.error);\n  } else {\n    setLoading && setLoading(false);\n  }\n};\n"],"names":["fetchMenuData","setLoading","SpringConfigs","A_TO_Z_MENU_DATA_PATH","fetch","then","responce","json","resp","data","Object","values","sortByOrder","GLOBALS","appConfigs","springPagesUrls","elem","categoryBottom","category","type","undefined","path","assign","PAGE_URLS","homepageKey","USER_PERSONALIZATION_ENABLED","forEach","item","icon","store","dispatch","setMenuJsonData","catch","console","error"],"sourceRoot":""}