main.6c7d07fb.chunk.js.map 53 KB

1
  1. {"version":3,"sources":["components/reusableComponents/Routes/PrivateRoute/index.tsx","components/reusableComponents/Routes/PublicRoute/index.tsx","redux/loading/selector/index.ts","components/reusableComponents/Loader/Loader.jsx","App.tsx","redux/messages/reducer/index.ts","redux/allMessages/reducer/index.ts","redux/contacts/reducer/index.ts","redux/chat/reducer/index.ts","redux/chats/reducer/index.ts","redux/control/reducer/index.ts","redux/loading/action/index.ts","redux/loading/reducer/index.ts","redux/authorization/reducer/index.ts","redux/rootReducer/index.ts","redux/store/index.ts","index.tsx","redux/authorization/action/index.ts","api-data/index.ts","redux/authorization/selector/index.ts","redux/chat/action/index.ts","redux/control/action/index.ts","redux/authorization/operations/index.ts","redux/messages/action/index.ts","redux/allMessages/action/index.ts","redux/contacts/action/index.ts","redux/chats/action/index.ts","components/reusableComponents/Loader/Loader.module.css","helpers/index.ts","redux/chat/selector/index.ts","App.module.css"],"names":["PrivateRoute","children","routeProps","token","useSelector","getToken","to","PublicRoute","restricted","shouldRedirect","getLoad","state","isLoading","CLoad","className","s","loader","type","color","height","width","timeout","Load","HomePage","lazy","AuthPage","App","companionId","getChat","dispatch","useDispatch","handleTypingClose","a","typingChat","useEffect","localStorage","isChecked","removeItem","setToken","set","asyncCurrentUser","handleKeepIn","asyncLogout","onlineUser","window","addEventListener","removeEventListener","handleTypingChat","onMouseLeave","appWrapper","utils","DateFnsUtils","fallback","exact","path","position","autoClose","hideProgressBar","newestOnTop","closeOnClick","rtl","pauseOnFocusLoss","draggable","pauseOnHover","reducerMessages","createReducer","total","limit","page","messages","actionGetMessagesSuccess","_","payload","actionGetMessagesReject","reducerAllMessages","actionGetAllMessagesSuccess","actionGetAllMessagesReject","reducerContacts","contacts","actionGetContactsSuccess","_state","actionGetContactsReject","initialState","name","lastName","originalName","originalLastName","avatarUrl","avatarsArr","online","lastMessage","lastMessageCreatedAt","mute","sort","seen","watched","typing","number","_id","owner","createdAt","updatedAt","__v","reducerChat","actionSelectChat","actionGetChatById","actionRemoveChat","reducerChats","chats","actionGetChatsSuccess","actionGetChatsReject","reducerControl","isOpen","scroll","actionIsOpen","actionScroll","actionIsLoading","createAction","value","reducerLoading","code","country","nightMode","reducerAuthorization","actionLogInSuccess","actionLogInReject","actionLogOutSuccess","actionLogOutReject","actionCurrentSuccess","actionCurrentReject","authorizationPersistConfig","key","storage","rootReducer","combineReducers","allMessages","chat","control","authorization","persistReducer","composeEnhancers","composeWithDevTools","store","createStore","applyMiddleware","thunk","persistor","persistStore","queryClient","QueryClient","ReactDOM","render","StrictMode","loading","QueryClientProvider","client","document","getElementById","axios","require","defaults","baseURL","prodBaseURL","headers","common","Authorization","unset","forbidden","message","slice","location","reload","authorizeUser","post","data","toast","success","progress","undefined","loginUser","patch","logoutUser","updateCredentials","body","updateUser","removeUserAvatar","index","delete","updateUserAvatar","formData","currentUser","get","addContact","removeContact","id","updateContact","getContacts","getChatById","_doc","startChat","removeChatForBoth","muteChat","sortChat","seenChat","getChats","removeMessageById","sentMessageById","sentImgMessageById","sentAudioMessageById","sentVideoMessageById","sentFileMessageById","getMessagesById","getAllMessages","getNumber","getState","asyncCreateUser","file","FormData","append","Promise","all","find","el","asyncLogin","cb","registered","Error","module","exports","format","split","join","trim","firstLetter","word","toUpperCase","slicedWord","max","from","length","timeStampEU","Date","toLocaleString","year","month","day","hour","minute","timeStampEUFilter","second","timeStampMessage","timeStampFilter","playNotification","url","Audio","play","notification","onClick","copied","text","playNotificationWithoutPermission","w","audioContext","AudioContext","webkitAudioContext","navigator","mediaDevices","getUserMedia","audio","then","source","createBufferSource","stop","close","request","XMLHttpRequest","open","responseType","onload","decodeAudioData","response","buffer","connect","destination","start","e","console","log","send","catch","reason","error","handleDownload","FileSaver","saveAs","handleSort","sortBy","b","sortByRecent","aCreatedAt","bCreatedAt","aTime","bTime","getChatMemo","createSelector"],"mappings":"sVAiBeA,MAXf,YAAmE,IAA3CC,EAA0C,EAA1CA,SAAaC,EAA6B,4BAC1DC,EAAQC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EAAE2D,qBAAuB3D,EAAEoE,UACjEwM,EAAaH,EAAE9M,qBAAuB8M,EAAE9M,qBAAuB8M,EAAErM,UACjEyM,EAAQrD,EAAkBmD,GAC1BG,EAAQtD,EAAkBoD,GAEhC,OADkB/M,EAAOgN,EAAQC,EAAOD,EAAQC,GAC7B,GAAK,MAGpB5I,EAAc,oC,gCCpIpB,gFAIMtI,EAAU,SAACjB,GAAD,OAAmBA,EAAM6H,MACnCuK,EAAcC,YAAe,CAACpR,IAAU,SAAA4G,GAAI,OAAIA,M,mBCJtD2F,EAAOC,QAAU,CAAC,WAAa,0B","file":"static/js/main.6c7d07fb.chunk.js","sourcesContent":["import { Route, Redirect } from 'react-router-dom';\nimport { useSelector } from 'react-redux';\n\nimport { IPrivateProps} from '../../../../typescript/components/Routes/interfaces';\nimport { getToken } from '../../../../redux/authorization/selector'\n\nfunction PrivateRoute({ children, ...routeProps }: IPrivateProps) {\n const token = useSelector(getToken)\n return (\n <Route {...routeProps}>\n {token ? children : <Redirect to=\"/w/\" />}\n </Route>\n );\n}\n\n\n\nexport default PrivateRoute\n","import { Route, Redirect } from 'react-router-dom';\nimport { useSelector } from 'react-redux';\n\nimport { IPublicProps } from '../../../../typescript/components/Routes/interfaces';\nimport { getToken } from '../../../../redux/authorization/selector'\n\nfunction PublicRoute({\n children,\n restricted = false,\n ...routeProps\n}: IPublicProps) {\n const token = useSelector(getToken)\n const shouldRedirect = token && restricted;\n\n return (\n <Route {...routeProps}>\n {shouldRedirect ? <Redirect to=\"/\" /> : children}\n </Route>\n );\n}\n\n\nexport default PublicRoute;\n","import { IState } from '../../../typescript/redux/interfaces'\nconst getLoad = (state:IState) => state.isLoading;\n\nexport { getLoad };\n","import 'react-loader-spinner/dist/loader/css/react-spinner-loader.css';\nimport Loader from 'react-loader-spinner';\nimport { useSelector } from 'react-redux';\n\nimport {getLoad} from '../../../redux/loading/selector'\nimport s from './Loader.module.css';\n\nconst CLoad = () => {\n const isLoading = useSelector(getLoad)\n return isLoading?(\n <Loader\n className={s.loader}\n type=\"Puff\"\n color=\"#0ca0f5\"\n height={100}\n width={100}\n timeout={300000}\n />\n ):null\n};\n\nconst Load = () => {\n return (\n <Loader\n className={s.loader}\n type=\"Puff\"\n color=\"#0ca0f5\"\n height={100}\n width={100}\n timeout={300000}\n />\n )\n};\n\nexport {CLoad,Load};\n\n\n\n","import { lazy, Suspense , useEffect } from 'react';\nimport { BrowserRouter, Switch } from 'react-router-dom';\nimport { ToastContainer } from 'react-toastify';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\nimport DateFnsUtils from '@date-io/date-fns';\n\nimport s from './App.module.css';\nimport { getToken } from './redux/authorization/selector'\nimport { getChat } from './redux/chat/selector'\nimport { asyncLogout, asyncCurrentUser } from './redux/authorization/operations'\nimport { setToken, onlineUser,typingChat } from './api-data'\nimport PrivateRoute from './components/reusableComponents/Routes/PrivateRoute';\nimport PublicRoute from './components/reusableComponents/Routes/PublicRoute';\nimport { Load,CLoad } from './components/reusableComponents/Loader/Loader';\n\nconst HomePage = lazy(\n () =>\n import(\n './components/HomePage' /* webpackChunkName: \"HomePage\" */\n ),\n);\n\nconst AuthPage = lazy(\n () =>\n import(\n './components/AuthPage' /* webpackChunkName: \"AuthPage\" */\n ),\n);\n\nfunction App() {\n const token = useSelector(getToken)\n const { companionId } = useSelector(getChat)\n const dispatch = useDispatch()\n const handleTypingClose = async () => {\n companionId&& await typingChat(companionId, false)\n }\n\n useEffect(() => {\n if (!localStorage.isChecked) localStorage.isChecked = 'true'\n localStorage.removeItem('isNew')\n }, [])\n\n useEffect(() => {\n if (token && localStorage.isChecked === 'true') {\n setToken.set(token)\n dispatch(asyncCurrentUser())\n }\n }, [dispatch, token])\n\n useEffect(() => {\n const handleKeepIn = async () => {\n if (localStorage.isChecked === 'false') {\n dispatch(asyncLogout())\n } else if (localStorage.isChecked === 'true') {\n await onlineUser()\n }\n }\n window.addEventListener(\"beforeunload\",handleKeepIn)\n return () => window.removeEventListener(\"beforeunload\", handleKeepIn)\n\n }, [dispatch])\n\n useEffect(() => {\n const handleTypingChat = async () => await typingChat(companionId,false)\n window.addEventListener(\"beforeunload\",handleTypingChat)\n return () => window.removeEventListener(\"beforeunload\", handleTypingChat)\n\n }, [companionId])\n\n return (\n <div onMouseLeave={handleTypingClose} className={s.appWrapper}>\n <MuiPickersUtilsProvider utils={DateFnsUtils}>\n <Suspense fallback={<Load/>}>\n <BrowserRouter>\n <Switch>\n <PrivateRoute exact path=\"/\">\n <HomePage/>\n </PrivateRoute>\n <PublicRoute path={'/w/'} restricted>\n <AuthPage />\n </PublicRoute>\n </Switch>\n </BrowserRouter>\n <CLoad/>\n </Suspense>\n <ToastContainer\n position=\"top-right\"\n autoClose={5000}\n hideProgressBar={false}\n newestOnTop={false}\n closeOnClick\n rtl={false}\n pauseOnFocusLoss\n draggable\n pauseOnHover\n /> \n </MuiPickersUtilsProvider>\n </div>\n)}\n\n\nexport default App;\n","import { createReducer } from '@reduxjs/toolkit';\r\nimport { IMessagesState, IMessagesPayload} from '../../../typescript/redux/messages/interfaces';\r\nimport {\r\n actionGetMessagesSuccess,\r\n actionGetMessagesReject\r\n} from '../action';\r\n\r\nconst initialState: IMessagesState = {\r\n total: \"0\",\r\n limit: \"0\",\r\n page: \"0\",\r\n messages: [],\r\n}\r\n\r\nconst reducerMessages = createReducer(initialState, {\r\n [actionGetMessagesSuccess.type]: (_, { payload }: IMessagesPayload) => {\r\n return payload;\r\n },\r\n [actionGetMessagesReject.type]: (state, _) => {\r\n return state;\r\n },\r\n});\r\n\r\nexport default reducerMessages;\r\n","import { createReducer } from '@reduxjs/toolkit';\r\nimport { IAllMessagesState, IAllMessagesPayload} from '../../../typescript/redux/allMessages/interfaces';\r\nimport {\r\n actionGetAllMessagesSuccess,\r\n actionGetAllMessagesReject,\r\n} from '../action';\r\n\r\nconst initialState: IAllMessagesState = {\r\n total: \"0\",\r\n limit: \"0\",\r\n page: \"0\",\r\n messages: [],\r\n}\r\n\r\nconst reducerAllMessages = createReducer(initialState, {\r\n [actionGetAllMessagesSuccess.type]: (_, { payload }: IAllMessagesPayload) => {\r\n return payload;\r\n },\r\n [actionGetAllMessagesReject.type]: (state, _) => {\r\n return state;\r\n },\r\n});\r\n\r\nexport default reducerAllMessages;\r\n","import { createReducer } from '@reduxjs/toolkit';\r\nimport { IContactsState,IContactsPayload} from '../../../typescript/redux/contacts/interfaces';\r\nimport {\r\n actionGetContactsSuccess,\r\n actionGetContactsReject\r\n} from '../action';\r\n\r\nconst initialState:IContactsState = {\r\n total: \"0\",\r\n limit: \"0\",\r\n page: \"0\",\r\n contacts: []\r\n}\r\n\r\nconst reducerContacts = createReducer(initialState, {\r\n [actionGetContactsSuccess.type]: (_state,{ payload}:IContactsPayload) => {\r\n return payload;\r\n },\r\n [actionGetContactsReject.type]: (state, _) => {\r\n return state;\r\n },\r\n});\r\n\r\nexport default reducerContacts;\r\n","import { createReducer } from '@reduxjs/toolkit';\r\nimport { IChatPayload } from '../../../typescript/redux/chat/interfaces';\r\nimport { TChat} from '../../../typescript/redux/chat/types';\r\n\r\nimport {\r\n actionSelectChat,\r\n actionGetChatById,\r\n actionRemoveChat\r\n} from '../action';\r\n\r\nconst initialState: TChat = {\r\n name: '',\r\n lastName: '',\r\n originalName: '',\r\n originalLastName: '',\r\n avatarUrl: '',\r\n avatarsArr: [],\r\n color: '',\r\n online: '',\r\n lastMessage: '',\r\n lastMessageCreatedAt:'',\r\n mute: false,\r\n sort:false,\r\n seen: 0,\r\n total: 0,\r\n watched: false,\r\n typing: false,\r\n number:'',\r\n _id: '',\r\n companionId: '',\r\n owner: '',\r\n createdAt: '',\r\n updatedAt: '',\r\n __v: 0,\r\n}\r\n\r\nconst reducerChat = createReducer(initialState, {\r\n [actionSelectChat.type]: (_,{ payload }:IChatPayload) => {\r\n return payload\r\n },\r\n [actionGetChatById.type]: (_,{ payload }:IChatPayload) => {\r\n return payload\r\n },\r\n [actionRemoveChat.type]: (_state,_) => {\r\n return initialState\r\n }, \r\n});\r\n\r\nexport default reducerChat;\r\n","import { createReducer } from '@reduxjs/toolkit';\r\nimport { IChatsState, IChatsPayload } from '../../../typescript/redux/chats/interfaces';\r\n\r\nimport {\r\n actionGetChatsSuccess,\r\n actionGetChatsReject,\r\n} from '../action';\r\n\r\nconst initialState: IChatsState = {\r\n total: \"0\",\r\n limit: \"0\",\r\n page: \"0\",\r\n chats: [],\r\n}\r\n\r\n\r\n\r\nconst reducerChats = createReducer(initialState, {\r\n [actionGetChatsSuccess.type]: (_,{ payload }:IChatsPayload) => {\r\n return payload\r\n },\r\n [actionGetChatsReject.type]: (state, _) => {\r\n return state;\r\n },\r\n});\r\n\r\nexport default reducerChats;\r\n","import { createReducer } from '@reduxjs/toolkit';\nimport { actionIsOpen,actionScroll } from '../action';\nimport { IControlState,IPayloadIsOpen,IPayloadScroll } from '../../../typescript/redux/control/interfaces'\n\nconst initialState:IControlState = {\n isOpen: '',\n scroll: false,\n}\n\nconst reducerControl = createReducer(initialState, {\n [actionIsOpen.type]: (state, { payload:isOpen }:IPayloadIsOpen) => {\n return {...state,isOpen}\n },\n [actionScroll.type]: (state, { payload:scroll }:IPayloadScroll) => {\n return {...state,scroll}\n }, \n});\n\nexport default reducerControl;\n","import { createAction } from '@reduxjs/toolkit';\n\nconst actionIsLoading = createAction('fetch/loading', (value:boolean) => ({\n payload: value,\n}));\n\nexport { actionIsLoading };\n","import { createReducer } from '@reduxjs/toolkit';\nimport { actionIsLoading } from '../action';\n\nconst reducerLoading = createReducer(false, {\n [actionIsLoading.type]: (_, { payload }: {payload : boolean}) => payload,\n});\n\nexport default reducerLoading;\n","import { createReducer } from '@reduxjs/toolkit';\r\nimport { IAuthorizationState , IAuthorizationPayload} from '../../../typescript/redux/authorization/interfaces';\r\nimport {\r\n actionLogInSuccess,\r\n actionLogInReject,\r\n actionLogOutSuccess,\r\n actionLogOutReject,\r\n actionCurrentSuccess,\r\n actionCurrentReject\r\n} from '../action';\r\n\r\nconst initialState:IAuthorizationState = {\r\n name: \"\",\r\n lastName: \"\",\r\n originalName: \"\",\r\n originalLastName: \"\",\r\n avatarUrl: \"\",\r\n avatarsArr: [],\r\n color: \"\",\r\n code: \"\",\r\n _id: \"\",\r\n token: \"\",\r\n online: \"\",\r\n number: \"\" ,\r\n country: \"\",\r\n sort: false,\r\n nightMode: false,\r\n createdAt: \"\",\r\n updatedAt: \"\",\r\n __v: 0,\r\n}\r\n\r\nconst reducerAuthorization = createReducer(initialState, {\r\n [actionLogInSuccess.type]: (state, { payload:token }: { payload: string }) => {\r\n return {...state,token};\r\n },\r\n [actionLogInReject.type]: (state, _) => {\r\n return state;\r\n },\r\n [actionLogOutSuccess.type]: (_state, _) => {\r\n return initialState;\r\n },\r\n [actionLogOutReject.type]: (state, _) => {\r\n return state;\r\n },\r\n [actionCurrentSuccess.type]: (_state, { payload }:IAuthorizationPayload) => {\r\n return payload\r\n },\r\n [actionCurrentReject.type]: (_state, _) => {\r\n return initialState;\r\n },\r\n});\r\n\r\nexport default reducerAuthorization;\r\n","import { combineReducers } from '@reduxjs/toolkit';\r\nimport { persistReducer } from 'redux-persist';\r\nimport storage from 'redux-persist/lib/storage';\r\n\r\nimport reducerMessages from '../messages/reducer'\r\nimport reducerAllMessages from '../allMessages/reducer'\r\nimport reducerContacts from '../contacts/reducer'\r\nimport reducerChat from '../chat/reducer'\r\nimport reducerChats from '../chats/reducer'\r\nimport reducerControl from '../control/reducer'\r\nimport reducerLoading from '../loading/reducer';\r\nimport reducerAuthorization from '../authorization/reducer';\r\n\r\nconst authorizationPersistConfig = {\r\n key: 'auth',\r\n storage: storage,\r\n};\r\n\r\nexport const rootReducer = combineReducers({\r\n isLoading: reducerLoading,\r\n messages: reducerMessages,\r\n allMessages: reducerAllMessages,\r\n chat:reducerChat,\r\n chats: reducerChats,\r\n contacts:reducerContacts,\r\n control: reducerControl,\r\n authorization: persistReducer(\r\n authorizationPersistConfig,\r\n reducerAuthorization,\r\n ),\r\n});\r\n","import { createStore, applyMiddleware } from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport { persistStore } from 'redux-persist';\r\nimport { composeWithDevTools } from 'redux-devtools-extension';\r\n\r\nimport { rootReducer } from '../rootReducer';\r\n\r\nconst composeEnhancers = composeWithDevTools({});\r\nconst store = createStore(\r\n rootReducer,\r\n composeEnhancers(applyMiddleware(thunk)),\r\n);\r\nconst persistor = persistStore(store);\r\nexport { store, persistor };\r\n","import React from 'react';\nimport { Provider } from 'react-redux';\nimport { PersistGate } from 'redux-persist/integration/react';\nimport ReactDOM from 'react-dom';\nimport 'video-react/dist/video-react.css';\nimport 'react-toastify/dist/ReactToastify.css';\nimport 'modern-normalize/modern-normalize.css';\nimport \"react-responsive-carousel/lib/styles/carousel.min.css\"\nimport './index.css';\nimport App from './App';\nimport { Load } from './components/reusableComponents/Loader/Loader'\nimport { store, persistor } from './redux/store';\nimport { QueryClient, QueryClientProvider } from 'react-query';\n\nconst queryClient = new QueryClient();\n\n\nReactDOM.render(\n <React.StrictMode>\n <PersistGate loading={<Load/>} persistor={persistor}>\n <Provider store={store}>\n <QueryClientProvider client={queryClient}>\n <App />\n </QueryClientProvider>\n </Provider>\n </PersistGate>\n </React.StrictMode>,\n document.getElementById('root'),\n);\n","import { createAction } from '@reduxjs/toolkit';\r\nimport {IAuthorizationState} from '../../../typescript/redux/authorization/interfaces'\r\n\r\nconst actionLogInSuccess = createAction('login/success', (value:string) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionLogInReject = createAction('login/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\nconst actionLogOutSuccess = createAction('logout/success', () => ({\r\n payload: null,\r\n}));\r\n\r\nconst actionLogOutReject = createAction('logout/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\nconst actionCurrentSuccess = createAction('current/success', (value:IAuthorizationState) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionCurrentReject = createAction('current/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\nexport {\r\n actionLogInSuccess,\r\n actionLogInReject,\r\n actionLogOutSuccess,\r\n actionLogOutReject,\r\n actionCurrentSuccess,\r\n actionCurrentReject\r\n};\r\n","import { toast } from 'react-toastify';\nimport { prodBaseURL } from '../helpers';\nconst axios = require('axios');\naxios.defaults.baseURL = `${prodBaseURL}/api`;\n\nconst error = (message:string) =>\n toast.error(`🔥 ${message}!`, {\n position: 'bottom-left',\n autoClose: 3000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n });\n\nconst success = (message:string) =>\n toast.success(`⚡ ${message}`, {\n position: 'bottom-left',\n autoClose: 3000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n });\n\nconst setToken = {\n set(token:string) {\n axios.defaults.headers.common.Authorization = `Bearer ${token}`;\n },\n unset() {\n axios.defaults.headers.common.Authorization = '';\n },\n};\n\nconst forbidden = ({ message }: any) => {\n if (message.slice(-3) === '403') {\n localStorage.removeItem('persist:auth')\n window.location.reload(true);\n }\n}\n\nconst authorizeUser = async (number:string,country:string):Promise<string | undefined> => {\n try {\n const { data : {data} } = await axios.post('/auth/register', { number,country });\n success(`code ${data}`);\n return data\n } catch (e) {\n return undefined\n }\n};\n\nconst loginUser = async <T>(number:string,code:string):Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.patch('/auth/login', { number,code });\n return data\n } catch (e) {\n return undefined\n }\n};\n\nconst logoutUser = async <T>():Promise<T | undefined> => {\n try {\n const { data } = await axios.patch('/auth/logout');\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst onlineUser = async <T>():Promise<T | undefined> => {\n try {\n const { data } = await axios.patch('/auth/online');\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst updateCredentials = async <T>(body:object):Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.patch('/users/current/credentials', body);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst updateUser = async <T>(body:object):Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.patch('/users/current/update', body);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst removeUserAvatar = async <T>(index:number):Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.delete(`/users/current/${index}`);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst updateUserAvatar = async <T>(formData: object): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.patch('/users/avatars', formData);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n } \n};\n\nconst currentUser = async <T>(): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.get('/users/current');\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n } \n};\n\nconst addContact = async <T>(number:string): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.post('/contacts', { number });\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst removeContact = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.delete(`/contacts/${id}`);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst updateContact = async <T>(id:string,_id:string,name:string,lastName:string,companionId:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.patch('/contacts', { id, _id, name, lastName,companionId });\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst getContacts = async <T>(): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.get('/contacts');\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst getChatById = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.get(`/chats/${id}`);\n return data._doc\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst startChat = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.post('/chats', { id });\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst removeChatForBoth = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.delete(`/chats/both/${id}`);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst muteChat = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.patch('/chats/mute', {id});\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst sortChat = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.patch('/chats/sort', {id});\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst seenChat = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.patch('/chats/seen', { id });\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst typingChat = async <T>(id:string,typing:boolean): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.patch('/chats/typing', { id,typing});\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst getChats = async <T>(): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.get('/chats');\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst removeMessageById = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.delete(`/messages/${id}`);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst sentMessageById = async <T>(id:string,message:any): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.post('/messages', { id, message });\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst sentImgMessageById = async <T>(id:string,formData: object): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.post(`/messages/image/${id}`, formData);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst sentAudioMessageById = async <T>(id:string,formData: object): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.post(`/messages/audio/${id}`, formData);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst sentVideoMessageById = async <T>(id:string,formData: object): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.post(`/messages/video/${id}`, formData);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst sentFileMessageById = async <T>(id:string,formData: object): Promise<T | undefined> => {\n try {\n const { data: { data } } = await axios.post(`/messages/file/${id}`, formData);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst getMessagesById = async <T>(id:string): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.get(`/messages/${id}`);\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nconst getAllMessages = async <T>(): Promise<T | undefined> => {\n try {\n const { data : {data} } = await axios.get('/messages');\n return data\n } catch (e) {\n forbidden(e)\n return undefined\n }\n};\n\nexport {\n setToken,\n error,\n success,\n authorizeUser,\n loginUser,\n logoutUser,\n onlineUser,\n updateCredentials,\n updateUser,\n removeUserAvatar,\n updateUserAvatar,\n currentUser,\n addContact,\n removeContact,\n updateContact,\n getContacts,\n startChat,\n removeChatForBoth,\n getChatById,\n muteChat,\n sortChat,\n seenChat,\n typingChat,\n getChats,\n removeMessageById,\n sentMessageById,\n sentImgMessageById,\n sentAudioMessageById,\n sentVideoMessageById,\n sentFileMessageById,\n getMessagesById,\n getAllMessages\n};\n","import {IState} from '../../../typescript/redux/interfaces'\r\n\r\nconst getToken = (state: IState) => state.authorization.token;\r\nconst getNumber = (state:IState) => state.authorization.number;\r\nconst getName = (state: IState) => state.authorization.name;\r\nconst getLastName = (state: IState) => state.authorization.lastName;\r\nconst getCountry = (state: IState) => state.authorization.country;\r\nconst getAvatarUrl = (state: IState) => state.authorization.avatarUrl;\r\nconst getId = (state: IState) => state.authorization._id;\r\nconst getSort= (state:IState) => state.authorization.sort;\r\nconst getState= (state:IState) => state.authorization;\r\n\r\nexport { getToken,getNumber,getName,getLastName,getCountry,getAvatarUrl,getId,getSort,getState };\r\n","import { createAction } from '@reduxjs/toolkit';\r\nimport { TChat } from '../../../typescript/redux/chat/types'\r\n\r\nconst actionSelectChat = createAction('selectChat/success', (value:TChat) => ({\r\n payload: value,\r\n}));\r\nconst actionGetChatById = createAction('getChatById/success', (value:TChat) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionRemoveChat = createAction('deleteChat/success', () => ({\r\n payload:{}\r\n}));\r\n\r\n\r\nexport {\r\n actionSelectChat,\r\n actionGetChatById,\r\n actionRemoveChat\r\n};\r\n","import { createAction } from '@reduxjs/toolkit';\nimport { TIsOpen,TScroll } from '../../../typescript/redux/control/types'\n\nconst actionIsOpen= createAction('control/isOpen', (value:TIsOpen) => ({\n payload: value,\n}));\n\nconst actionScroll= createAction('control/scroll', (value:TScroll) => ({\n payload: value,\n}));\n\n\nexport { actionIsOpen,actionScroll };\n","import {\r\n actionLogInSuccess,\r\n actionLogInReject,\r\n actionLogOutSuccess,\r\n actionLogOutReject,\r\n actionCurrentSuccess,\r\n actionCurrentReject\r\n} from '../action';\r\nimport { setToken, loginUser, logoutUser, updateCredentials, updateUserAvatar, currentUser } from '../../../api-data';\r\nimport { IAuthorizationState } from '../../../typescript/redux/authorization/interfaces'\r\nimport { TResPromiseAll } from '../../../typescript/redux/authorization/types'\r\n\r\nconst asyncCreateUser = (name:string, lastName: string,file:object) => async (dispatch:any) => {\r\n try {\r\n const formData: any = new FormData()\r\n formData.append(\"avatar\", file);\r\n const data = await Promise.all<TResPromiseAll>(\r\n [updateUserAvatar(formData), updateCredentials({ name, lastName, originalName:name, originalLastName:lastName})])\r\n const token = data.find(el => el?.token)?.token\r\n token&&dispatch(actionLogInSuccess(token))\r\n } catch (e) {\r\n dispatch(actionLogInReject())\r\n } \r\n};\r\n\r\nconst asyncLogin = (number:string, code: string,cb:() => void ) => async (dispatch:any) => {\r\n try {\r\n const data = await loginUser<{ token: string, registered: boolean }>(number, code);\r\n const token = data?.token\r\n const registered = data?.registered\r\n if (!token) return\r\n setToken.set(token)\r\n if (!registered) return cb()\r\n dispatch(actionLogInSuccess(token))\r\n } catch (e) {\r\n dispatch(actionLogInReject());\r\n cb()\r\n } \r\n};\r\n\r\nconst asyncLogout = () => async (dispatch:any) => {\r\n try {\r\n await logoutUser<object>();\r\n dispatch(actionLogOutSuccess());\r\n setToken.unset()\r\n } catch (e) {\r\n dispatch(actionLogOutReject());\r\n } \r\n};\r\n\r\nconst asyncCurrentUser = () => async (dispatch:any) => {\r\n try {\r\n const data = await currentUser<IAuthorizationState>()\r\n data && dispatch(actionCurrentSuccess(data));\r\n if(!data?.token) throw new Error('old token')\r\n } catch (e) {\r\n dispatch(actionCurrentReject());\r\n } \r\n};\r\n\r\nexport { asyncCreateUser, asyncLogin, asyncLogout, asyncCurrentUser };\r\n","import { createAction } from '@reduxjs/toolkit';\r\nimport { IMessagesState } from '../../../typescript/redux/messages/interfaces'\r\n\r\nconst actionGetMessagesSuccess = createAction('getMessages/success', (value:IMessagesState) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionGetMessagesReject = createAction('getMessages/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\n\r\nexport {\r\n actionGetMessagesSuccess,\r\n actionGetMessagesReject,\r\n};\r\n","import { createAction } from '@reduxjs/toolkit';\r\nimport { IAllMessagesState } from '../../../typescript/redux/allMessages/interfaces'\r\n\r\nconst actionGetAllMessagesSuccess = createAction('getAllMessages/success', (value:IAllMessagesState) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionGetAllMessagesReject = createAction('getAllMessages/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\n\r\nexport {\r\n actionGetAllMessagesSuccess,\r\n actionGetAllMessagesReject,\r\n};\r\n","import { createAction } from '@reduxjs/toolkit';\r\nimport { IContactsState } from '../../../typescript/redux/contacts/interfaces'\r\n\r\nconst actionGetContactsSuccess = createAction('getContacts/success', (value:IContactsState) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionGetContactsReject = createAction('getContacts/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\n\r\nexport {\r\n actionGetContactsSuccess,\r\n actionGetContactsReject\r\n};\r\n","import { createAction } from '@reduxjs/toolkit';\r\nimport { IChatsRes } from '../../../typescript/redux/chats/interfaces'\r\nimport { TChat } from '../../../typescript/redux/chats/types'\r\n\r\nconst actionGetChatsSuccess = createAction('getChats/success', (value:IChatsRes) => ({\r\n payload: value,\r\n}));\r\n\r\nconst actionGetChatsReject = createAction('getChats/reject', () => ({\r\n payload: null,\r\n}));\r\n\r\n\r\nexport {\r\n actionGetChatsSuccess,\r\n actionGetChatsReject,\r\n};\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"loader\":\"Loader_loader__2bvUw\"};","import { toast } from 'react-toastify';\r\nimport FileSaver from 'file-saver';\r\nimport { TChats } from '../typescript/redux/chats/types';\r\n\r\nconst format = (a: string) => a.split(' ').join('').trim()\r\n\r\nconst firstLetter = (word: string) => word.slice(0, 1).toUpperCase()\r\n\r\nconst slicedWord = (word: string, max: number, from: number = 0) =>\r\n word.length < max ? word.slice(from) : word.slice(from, max)\r\n \r\nconst timeStamp = (updatedAt: string) => new Date(updatedAt).toLocaleString(\"en-US\", {\r\n year:'numeric',\r\n month: 'short',\r\n day: 'numeric',\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n})\r\n\r\nconst timeStampEU = (updatedAt: string) => new Date(updatedAt).toLocaleString('en-GB', {\r\n year:'numeric',\r\n month: 'short',\r\n day: 'numeric',\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n})\r\n\r\nconst timeStampEUFilter = (updatedAt: string) => new Date(updatedAt).toLocaleString('en-GB', {\r\n year:'numeric',\r\n month: 'short',\r\n day: 'numeric',\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n})\r\n\r\nconst timeStampMessage = (updatedAt: string) => new Date(updatedAt).toLocaleString('en-GB',{\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n})\r\n\r\n\r\nconst timeStampFilter = (updatedAt: string) => new Date(updatedAt).toLocaleString(\"en-US\", {\r\n year:'numeric',\r\n month: 'short',\r\n day: 'numeric',\r\n})\r\n\r\n\r\nconst playNotification = (url:string) => {\r\n const audio = new Audio(url);\r\n audio.play();\r\n}\r\n\r\nconst notification = (name: string, onClick: () => void) => {\r\n toast(`🦄new message from ${name}`, {\r\n position: \"bottom-right\",\r\n autoClose: 5000,\r\n hideProgressBar: false,\r\n closeOnClick: true,\r\n pauseOnHover: true,\r\n draggable: true,\r\n progress: undefined,\r\n onClick\r\n });\r\n}\r\n\r\nconst copied = (text:string) => {\r\n toast(`${text} Copied`, {\r\n position: \"bottom-right\",\r\n autoClose: 2000,\r\n hideProgressBar: false,\r\n closeOnClick: true,\r\n pauseOnHover: true,\r\n draggable: true,\r\n progress: undefined,\r\n });\r\n}\r\n\r\nconst playNotificationWithoutPermission = (url: string) => {\r\n const w:any = window\r\n const audioContext: any = new (w.AudioContext || w.webkitAudioContext)();\r\n navigator.mediaDevices\r\n .getUserMedia({ audio: true })\r\n .then(() => {\r\n const source = audioContext.createBufferSource();\r\n source.addEventListener('ended', () => {\r\n source.stop();\r\n audioContext.close();\r\n });\r\n const request = new XMLHttpRequest();\r\n request.open('GET', url, true);\r\n request.responseType = 'arraybuffer';\r\n request.onload = () => {\r\n audioContext.decodeAudioData(\r\n request.response,\r\n (buffer:any) => {\r\n source.buffer = buffer;\r\n source.connect(audioContext.destination);\r\n source.start();\r\n },\r\n (e:any) => {\r\n console.log('Error with decoding audio data' + e.message);\r\n });\r\n }\r\n request.send();\r\n })\r\n .catch(reason => console.error(`Audio permissions denied: ${reason}`));\r\n}\r\n\r\nconst handleDownload = async (url: string, type: string) => await FileSaver.saveAs(url, type);\r\n\r\nconst handleSort = (sortBy: string, data: any,sort:boolean): any => {\r\n return [...data].sort(function (a: any, b: any) {\r\n if (sort?a[sortBy] > b[sortBy]:a[sortBy] < b[sortBy]) {\r\n return -1;\r\n } else if (sort?a[sortBy] < b[sortBy]:a[sortBy] > b[sortBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n};\r\n\r\nconst sortByRecent = (chats:TChats,sort:boolean) => [...chats].sort((a, b) => {\r\n const aCreatedAt = a.lastMessageCreatedAt ? a.lastMessageCreatedAt : a.createdAt\r\n const bCreatedAt = b.lastMessageCreatedAt ? b.lastMessageCreatedAt : b.createdAt\r\n const aTime = timeStampEUFilter(aCreatedAt)\r\n const bTime = timeStampEUFilter(bCreatedAt)\r\n const direction = sort ? aTime < bTime: aTime > bTime\r\n return direction ? 1 : -1\r\n})\r\n\r\nconst prodBaseURL = 'https://w-telegram.herokuapp.com'\r\n\r\nexport {\r\n format,\r\n firstLetter,\r\n slicedWord,\r\n timeStamp,\r\n timeStampEU,\r\n timeStampEUFilter,\r\n timeStampMessage,\r\n timeStampFilter,\r\n playNotification,\r\n notification,\r\n copied,\r\n playNotificationWithoutPermission,\r\n handleDownload,\r\n handleSort,\r\n sortByRecent,\r\n prodBaseURL,\r\n}","import { createSelector } from 'reselect';\r\nimport { IState } from '../../../typescript/redux/interfaces'\r\n\r\nconst getState = (state: IState) => state;\r\nconst getChat = (state: IState) => state.chat;\r\nconst getChatMemo = createSelector([getChat], chat => chat);\r\n\r\nexport { getChat,getState,getChatMemo };\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"appWrapper\":\"App_appWrapper__2lsaD\"};"],"sourceRoot":""}