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MhB,OAAOqB,EACH,CAACI,EAAYI,EAASQ,KAAAA,CAAtB,CAAiCF,EAAWC,EAA5C,CAAqDE,MAArD,CAA4DC,SAC5D,CAACH,EAASD,EAAWV,EAAYI,EAASQ,KAAAA,CAA1C,EAAqDC,MAArD,CAA4DC,QAFhE,EAKK,SAASC,EAATC,CAAA,CAAsD,KAAAC,EAAAD,EAAnCpB,UAAmC,CACrDI,EAAYC,CAAAA,EAAAA,EAAAA,EAAAA,EAAaC,EAAAA,EAAD,EAE9BgB,EAAsCC,EAAAA,QAAA,CAAe,YAArDC,EAAA,GAAAC,EAAArC,CAAA,EAAAkC,EAAA,GAAOI,EAAPF,CAAA,IAAoBG,EAApBH,CAAA,IAEMI,EAAU7B,EAL2CsB,KAAA,IAAAA,GAAAA,GAOxCQ,EAAnBC,CAAyCC,EAAAA,EAAAA,CAAAA,EAAqB,CAC5DC,MAAO,MADqD,GAAtDC,SAAR,CAWA,MAPAC,CAAAA,EAAAA,EAAAA,SAAAA,EAAU,UAAM,CACT9B,GAAasB,YAAAA,IAChBC,EAAe,YACfE,IAEH,EAAE,CAACzB,EAAWsB,EALN,EAQP,GAAAzC,EAAAC,GAAA,EAAAiD,EAAA/C,CAAA,EAAKgD,GAAI,CAAEC,GAAI,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAhB,EAAfC,SACE,GAAArD,EAAAC,GAAA,EAACqD,EAAAnD,CAAD,EACEoD,WAAYd,EACZe,SAAU,SAACC,CAAD,CAAIC,CAAJ,CAAc,CACtBhB,EAAegB,EAChB,EACDX,MAAO,OACPvC,IAAK,CACHmD,cAAe,CACbC,QAAS,OACTC,eAAgB,gBAChBC,aAAc,CAHD,CADZ,EANPT,SAcGV,CAdH,EADF,EAmBH,CAED,IAAAoB,EAAe7B","sources":["webpack://_N_E/./components/features/common/Bets/hooks/useAllBets.tsx","webpack://_N_E/./components/features/common/Bets/hooks/useLuckyBets.tsx","webpack://_N_E/./components/features/common/Bets/helper.ts","webpack://_N_E/./components/features/common/Bets/TotalBetsStat.tsx","webpack://_N_E/./components/features/common/Bets/index.tsx","webpack://_N_E/"],"sourcesContent":["import { useBetColumns } from './useBetColumns';\nimport { getAllBets, getBetRecordHighRoller } from '@/apis/bet-record';\nimport useGeneralBetRecordData from '@/components/features/common/Bets/hooks/useGeneralBetRecordData';\nimport queryKeysFactory from '@/reactQueryKeys/keysFactory';\nimport { WebSocketCommandsEnum } from '@/types/WS';\n\nexport const useAllBets = () => {\n const columns = useBetColumns();\n\n const { data, isLoading } = useGeneralBetRecordData(\n queryKeysFactory.casino.queryAllBets(),\n getAllBets,\n WebSocketCommandsEnum.GLOBAL_BET_HISTORY_COMMAND,\n );\n\n return {\n data: data.list,\n columns,\n isLoading,\n };\n};\n","import { useBetColumns } from './useBetColumns';\nimport { getAllBets, getLuckyBets } from '@/apis/bet-record';\nimport useGeneralBetRecordData from '@/components/features/common/Bets/hooks/useGeneralBetRecordData';\nimport queryKeysFactory from '@/reactQueryKeys/keysFactory';\nimport { WebSocketCommandsEnum } from '@/types/WS';\n\nexport const useLuckyBets = () => {\n const columns = useBetColumns();\n\n const { data, isLoading } = useGeneralBetRecordData(\n queryKeysFactory.casino.queryLuckyBets(),\n getLuckyBets,\n WebSocketCommandsEnum.LUCKY_BET_HISTORY_COMMAND,\n );\n\n return {\n data: data.list,\n columns,\n isLoading,\n };\n};\n","export const tableContainerSX = {\n '&.MuiPaper-root': {\n backgroundColor: 'transparent !important',\n backgroundImage: 'none !important',\n },\n '& .MuiTableHead-root': {\n backgroundColor: 'transparent !important',\n backgroundImage: 'none !important',\n\n '.MuiTableCell-root': {\n backgroundImage: 'none !important',\n backgroundColor: '#1E1E24',\n borderBottom: 'none',\n },\n },\n '& .MuiTableBody-root': {\n '.MuiTableCell-root': {\n borderBottom: '1px solid #2D2D37',\n },\n },\n};\n","import WrappedTable from '@/components/ui/WrappedTable';\nimport React from 'react';\nimport { useAllBets } from '@/components/features/common/Bets/hooks/useAllBets';\nimport { useLuckyBets } from '@/components/features/common/Bets/hooks/useLuckyBets';\nimport useTheme from '@/theme/useTheme';\nimport { tableContainerSX } from '@/components/features/common/Bets/helper';\nimport { uniqBy } from 'lodash-es';\n\nexport function AllBets() {\n const { data, columns, isLoading } = useAllBets();\n const { theme } = useTheme();\n const uniqueDataByDataId = uniqBy(data, 'id');\n\n return (\n d.id}\n sxs={{\n containerSX: {\n maxHeight: '50vh',\n },\n tableContainerSX,\n }}\n />\n );\n}\n\nexport function LuckyBets() {\n const { data, columns, isLoading } = useLuckyBets();\n const { theme } = useTheme();\n return (\n d.id}\n sxs={{\n containerSX: {\n maxHeight: '50vh',\n },\n tableContainerSX,\n }}\n />\n );\n}\n","import { useTranslation } from 'next-i18next';\nimport React, { useEffect } from 'react';\nimport WrappedTabs from '@/components/ui/WrappedTab';\nimport {\n AllBets,\n LuckyBets,\n} from '@/components/features/common/Bets/TotalBetsStat';\nimport { useAtomValue } from 'jotai';\nimport { isLoggedIn } from '@/state/userInfo';\nimport { Box } from '@mui/material';\nimport { useChangeQueryString } from '@/components/ui/WrappedTab/helper';\nimport MyBetsTable from '@/components/features/casino/MyBetsTable';\nimport useTheme from '@/theme/useTheme';\nimport { tableContainerSX } from '@/components/features/common/Bets/helper';\n\ninterface BetsBoxProp {\n inGamePage?: boolean;\n}\n\nconst useBetsTabList = (inGamePage: boolean) => {\n const { t } = useTranslation();\n\n const userLogin = useAtomValue(isLoggedIn);\n const { theme } = useTheme();\n\n const myBets = {\n title: t('My Bets'),\n name: 'my-bets',\n content: (\n \n ),\n disabled: !userLogin,\n };\n const luckyBets = {\n title: t('Lucky Bets'),\n name: 'lucky-bets',\n content: ,\n };\n const allBets = {\n title: t('All Bets'),\n name: 'all-bets',\n content: ,\n };\n\n return inGamePage\n ? [userLogin ? myBets : undefined, luckyBets, allBets].filter(Boolean)\n : [allBets, luckyBets, userLogin ? myBets : undefined].filter(Boolean);\n};\n\nexport function BetsBox({ inGamePage = false }: BetsBoxProp) {\n const userLogin = useAtomValue(isLoggedIn);\n\n const [selectedTab, setSelectedTab] = React.useState('all-bets');\n\n const tabList = useBetsTabList(inGamePage);\n\n const { handleURL: handleQueryString } = useChangeQueryString({\n label: 'bets',\n });\n\n useEffect(() => {\n if (!userLogin && selectedTab === 'my-bets') {\n setSelectedTab('all-bets');\n handleQueryString();\n }\n }, [userLogin, selectedTab]);\n\n return (\n \n {\n setSelectedTab(value);\n }}\n label={'bets'}\n sxs={{\n tabsWrapperSX: {\n display: 'flex',\n justifyContent: 'space-between',\n marginBottom: 1,\n },\n }}\n >\n {tabList}\n \n \n );\n}\n\nexport default BetsBox;\n"],"names":["useAllBets","columns","useBetColumns","_useGeneralBetRecordD","useGeneralBetRecordData","queryKeysFactory","getAllBets","WebSocketCommandsEnum","data","isLoading","list","useLuckyBets","getLuckyBets","tableContainerSX","backgroundColor","backgroundImage","borderBottom","AllBets","_useAllBets","useTheme","theme","uniqueDataByDataId","uniqBy","jsx_runtime","jsx","WrappedTable","Z","loading","getRowKey","d","id","sxs","containerSX","maxHeight","LuckyBets","_useLuckyBets","_useTheme2","useBetsTabList","inGamePage","t","_useTranslation","useTranslation","userLogin","useAtomValue","isLoggedIn","_useTheme","myBets","title","name","content","MyBetsTable","disabled","luckyBets","allBets","undefined","filter","Boolean","BetsBox","_ref","_ref$inGamePage","_React$useState","React","_React$useState2","slicedToArray","selectedTab","setSelectedTab","tabList","handleQueryString","_useChangeQueryString","useChangeQueryString","label","handleURL","useEffect","Box","sx","mt","children","WrappedTab","currentTab","onChange","e","value","tabsWrapperSX","display","justifyContent","marginBottom","Bets"],"sourceRoot":""}