> {\r\n\t(dispatch: (action: TAction) => void, getState: () => TApplicationState): void;\r\n}\r\n","import { Action, Reducer } from 'redux';\r\n\r\nimport { addTask } from 'domain-task';\r\n\r\nimport { request } from '@common/react/components/Api';\r\n\r\n/* eslint-disable-next-line */\r\nimport { AppThunkAction } from '@app/store/index';\r\n\r\nexport interface PageItemState {\r\n\tpage: P | null;\r\n\tpath: string | null;\r\n\tisLoading: boolean;\r\n}\r\n\r\nexport enum TypeKeys {\r\n\tREQUESTPAGE = 'REQUESTPAGE',\r\n\tRECIEVEPAGE = 'RECIEVEPAGE'\r\n}\r\n\r\nexport interface RequestPageAction {\r\n\ttype: TypeKeys.REQUESTPAGE;\r\n\tstorageName: string | null;\r\n\tpath: string;\r\n}\r\n\r\nexport interface ReceivePageAction {\r\n\ttype: TypeKeys.RECIEVEPAGE;\r\n\tstorageName: string | null;\r\n\tpage: any;\r\n}\r\n\r\ntype KnownPageAction = RequestPageAction | ReceivePageAction;\r\n\r\nexport const actionCreators = ({\r\n\tloadPage: (storageName: string, path: string): AppThunkAction => (dispatch, getState) => {\r\n\t\tconst storeState = (getState() as any)[storageName];\r\n\r\n\t\tif (storeState.path !== path) {\r\n\t\t\tconst fetchTask = request(\r\n\t\t\t\t'pageLoader',\r\n\t\t\t\t{ path },\r\n\t\t\t\tgetState(),\r\n\t\t\t).then((data) => dispatch({ type: TypeKeys.RECIEVEPAGE, storageName, page: data }));\r\n\r\n\t\t\taddTask(fetchTask);\r\n\t\t\tdispatch({ type: TypeKeys.REQUESTPAGE, storageName, path });\r\n\r\n\t\t\treturn fetchTask;\r\n\t\t}\r\n\t},\r\n});\r\n\r\nexport const reducer = (storageName: string):Reducer> => {\r\n\treturn (state: PageItemState = { isLoading: false, page: null, path: '' }, incomingAction: Action) => {\r\n\t\tconst action = incomingAction as KnownPageAction;\r\n\t\tif (!action.storageName || action.storageName === storageName) {\r\n\t\t\tswitch (action.type) {\r\n\t\t\t\tcase TypeKeys.REQUESTPAGE:\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tisLoading: true,\r\n\t\t\t\t\t\tpage: state.page,\r\n\t\t\t\t\t\tpath: action.path,\r\n\t\t\t\t\t};\r\n\t\t\t\tcase TypeKeys.RECIEVEPAGE:\r\n\t\t\t\t\treturn { isLoading: false, page: action.page, path: action.page.path };\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tconst exhaustiveCheck: never = action;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn state;\r\n\t};\r\n};\r\n","import { addTask } from 'domain-task';\r\nimport { Action, Reducer } from 'redux';\r\n\r\nimport { List } from '@common/typescript/objects/List';\r\n\r\nimport { request } from '@app/components/Api';\r\nimport { Page } from '@app/objects/Page';\r\nimport { AppThunkAction } from '@app/store';\r\n\r\nexport interface MenuState {\r\n\tisLoading: boolean;\r\n\tloaded: boolean;\r\n\titems: Array;\r\n}\r\n\r\nexport enum TypeKeys {\r\n\tREQUESTPAGES = 'HOMEREQUESTPAGES',\r\n\tRECEIVEPAGES = 'HOMERECEIVEPAGES'\r\n}\r\n\r\nexport interface RequestMenuAction {\r\n\ttype: TypeKeys.REQUESTPAGES;\r\n}\r\n\r\nexport interface ReceiveMenuAction {\r\n\ttype: TypeKeys.RECEIVEPAGES;\r\n\titems: Array;\r\n}\r\n\r\ntype KnownPageAction = RequestMenuAction | ReceiveMenuAction;\r\n\r\nfunction loadItems(dispatch: any, getState: any, type: string, path: string, requestType: string, receiveType: string) {\r\n\tif (!getState().menu.loaded) {\r\n\t\tconst fetchTask = request>(path, {\r\n\r\n\t\t}, getState()).then((data) => {\r\n\t\t\tdispatch({ type: receiveType, items: data.list });\r\n\t\t});\r\n\r\n\t\taddTask(fetchTask);\r\n\t\tdispatch({ type: requestType });\r\n\t}\r\n}\r\n\r\nexport const actionCreators = {\r\n\treqPages: (): AppThunkAction => (dispatch, getState) => {\r\n\t\tloadItems(dispatch, getState, 'pages', 'menuList', TypeKeys.REQUESTPAGES, TypeKeys.RECEIVEPAGES);\r\n\t},\r\n};\r\n\r\nexport const reducer: Reducer = (\r\n\tstate: MenuState = { isLoading: false, loaded: false, items: [] },\r\n\tincomingAction: Action,\r\n) => {\r\n\tconst action = incomingAction as KnownPageAction;\r\n\tswitch (action.type) {\r\n\t\tcase TypeKeys.REQUESTPAGES:\r\n\t\t\treturn { ...state, isLoading: true };\r\n\t\tcase TypeKeys.RECEIVEPAGES:\r\n\t\t\treturn { isLoading: false, items: action.items, loaded: true };\r\n\t\tdefault:\r\n\t\t\tconst exhaustiveCheck: never = action;\r\n\t}\r\n\r\n\treturn state;\r\n};\r\n","import { ReducersMapObject } from 'redux';\r\n\r\nimport * as Items from '@common/react/store/ItemList';\r\nimport * as Item from '@common/react/store/Item';\r\nimport { BaseApplicationState, baseReducers } from '@common/react/store';\r\nimport { PageItemState, reducer as PageStateReducer } from '@common/react/store/PageItem';\r\nimport { BuildData } from '@common/react/objects/BuildData';\r\nimport { ItemsState as ItemsProviderStoreState, getReducer as getIPStoreReducer } from '@common/react/store/ItemsProviderStore';\r\n\r\nimport { User } from '@app/objects/User';\r\nimport { Location } from '@app/objects/Location';\r\nimport { MenuState, reducer as MenuReducer } from '@app/store/Menu';\r\nimport { Doctor } from '@app/objects/Doctor';\r\nimport { Company } from '@app/objects/Company';\r\n\r\n// The top-level state object\r\nexport interface ApplicationState extends Omit, 'chat'> {\r\n\tserverPage: PageItemState;\r\n\r\n\tbuildData: Item.ItemState;\r\n\tinitDoctors: ItemsProviderStoreState;\r\n\r\n\tmenu: MenuState;\r\n\r\n\toffices: Items.ItemsState;\r\n\r\n\tcompanySettings: Item.ItemState;\r\n}\r\n\r\n// Whenever an action is dispatched, Redux will update each top-level application state property using\r\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\r\n// acts on the corresponding ApplicationState property type.\r\nexport const reducers: ReducersMapObject = {\r\n\t...baseReducers,\r\n\r\n\tserverPage: PageStateReducer('serverPage'),\r\n\tinitDoctors: getIPStoreReducer('initDoctors'),\r\n\r\n\tmenu: MenuReducer,\r\n\r\n\toffices: Items.getReducer('offices'),\r\n\r\n\tcompanySettings: Item.getReducer('companySettings'),\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport interface AppThunkAction {\r\n\t(dispatch: (action: TAction) => void, getState: () => ApplicationState): void;\r\n}\r\n","import * as React from 'react';\r\n\r\nimport 'raf/polyfill';\r\n\r\nimport 'core-js/features/array/from';\r\nimport 'core-js/features/array/find';\r\nimport 'core-js/features/array/includes';\r\nimport 'core-js/features/set';\r\nimport 'core-js/features/map';\r\nimport 'core-js/features/weak-map';\r\nimport 'core-js/features/promise';\r\n\r\nimport {\r\n\tbootClient, renderApp,\r\n} from '@common/react/loadable/boot-client';\r\nimport { updateReducers } from '@common/react/configureStore';\r\n\r\nimport { routes } from '@app/routes';\r\n\r\nimport { ApplicationState, reducers } from '@app/store';\r\nimport { User } from '@app/objects/User';\r\n\r\nbootClient(routes, reducers);\r\n\r\n// Allow Hot Module Replacement\r\nif (module.hot) {\r\n\tmodule.hot.accept('@app/routes', () => {\r\n\t\trenderApp((require('@app/routes') as any).routes);\r\n\t});\r\n}\r\n\r\n// Enable Webpack hot module replacement for reducers\r\nif (module.hot) {\r\n\tmodule.hot.accept('@app/store', () => {\r\n\t\tconst nextRootReducer = require('@app/store');\r\n\t\tupdateReducers((nextRootReducer as any).reducers);\r\n\t});\r\n}\r\n","import * as React from 'react';\r\n\r\nimport { FieldProps, ErrorMessage, getIn } from 'formik';\r\n\r\nexport type FormikInputRenderFunc = (fieldProps: FieldProps, inputProps?: React.HTMLProps) => React.ReactElement;\r\n\r\nexport interface FormikInputProps {\r\n\tfieldProps: FieldProps;\r\n\tcontainerClassName?: string;\r\n\trender?: FormikInputRenderFunc;\r\n\ttitle?: string;\r\n\tinputId?: string;\r\n\tshowValidateAfterSubmit?: boolean;\r\n\tinputProps?: React.HTMLProps;\r\n\tErrorComponent?: React.FC<{error: string}>;\r\n\twithValidIndicator?: boolean;\r\n\tcustomValidCondition?: (errors, touched, value, form) => boolean;\r\n}\r\n\r\nexport interface ValidFieldWrapperProps {\r\n\tfieldName: string;\r\n\tform: FieldProps['form'];\r\n\tcustomValidCondition?: (errors, touched, value, form) => boolean;\r\n}\r\n\r\nexport const ValidFieldWrapper: React.FC = ({\r\n\tfieldName,\r\n\tform,\r\n\tchildren,\r\n\tcustomValidCondition = (errors, touched, value, form) => !errors && value,\r\n}) => {\r\n\tconst errors = getIn(form.errors, fieldName);\r\n\tconst touched = getIn(form.touched, fieldName);\r\n\tconst value = getIn(form.values, fieldName);\r\n\r\n\treturn <>\r\n\t\t{customValidCondition(errors, touched, value, form) ? : null}\r\n\t\t{children}\r\n\t>;\r\n};\r\n\r\nconst defaultRender = ({ form, field }: FieldProps, inputProps?: React.HTMLProps) =>\r\n\t;\r\n\r\nexport const defaultErrorComponent: React.FC<{error: string | object}> = ({ error }) =>\r\n\t\r\n\t\t{typeof error === 'string' ? error : Object.keys(error)\r\n\t\t\t.filter((key) => typeof error[key] === 'string')\r\n\t\t\t.map((key) => error[key])\r\n\t\t\t.join(', ')}\r\n\t
;\r\n\r\nexport const FormikInput: React.FC = ({\r\n\tfieldProps,\r\n\tcontainerClassName = 'form-group col-sm-6',\r\n\trender = defaultRender,\r\n\ttitle,\r\n\tinputId,\r\n\tshowValidateAfterSubmit = true,\r\n\tinputProps,\r\n\tErrorComponent = defaultErrorComponent,\r\n\twithValidIndicator,\r\n\tcustomValidCondition,\r\n}) => {\r\n\tconst { form, field } = fieldProps;\r\n\r\n\treturn \r\n\t\t{title &&
}\r\n\t\t
\r\n\t\t\t{(showValidateAfterSubmit ? form.submitCount > 0 : true) && (\r\n\t\t\t\t }\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{withValidIndicator ? : null}\r\n\t\t\t{render(fieldProps, inputProps)}\r\n\t\t
\r\n\t
;\r\n};\r\n","import * as Yup from 'yup';\r\n\r\nimport { WithDeleted } from '@common/typescript/objects/WithDeleted';\r\n\r\nexport const phoneRegexp = /(\\(([0-9]{3})\\)\\s([0-9]{3})[-]([0-9]{4})|\\+([0-9]{11}))/;\r\n\r\nexport const formattedPhoneRegexp = /^\\+[1-9]+ \\([1-9]\\d{2}\\) \\d\\d\\d-\\d\\d\\d\\d$/;\r\n\r\nexport const stringOnlyLettersRegexp = /^[a-zA-Z]*$/;\r\n\r\nexport const simpleStringValidator = Yup.string().required();\r\n\r\nexport const nullableStringValidator = Yup.string().nullable().required();\r\n\r\nexport const nullableStringNotRequiredValidator = Yup.string().nullable().notRequired();\r\n\r\nexport const stringOnlyLettersValidator = Yup.string().matches(stringOnlyLettersRegexp, 'Use only letters').required();\r\n\r\nexport const simpleNumberValidator = Yup.number().required();\r\n\r\nexport const positiveNumberValidator = Yup.number().positive('Required field!');\r\n\r\nexport const notEmptyPositiveNumberValidator = Yup.number().required().positive('Required field!');\r\n\r\nexport const notNullValidator = Yup.mixed().test('is-not-null', 'Required field!', (value) => value !== null);\r\n\r\nexport const notNullPositiveValidator = Yup.mixed().test('is-not-null', 'Required field!', (value) => value !== null && value >= 0);\r\n\r\nexport const emailValidator = Yup.string().email().required();\r\n\r\nexport const optionalEmailValidator = Yup.string().email().nullable().notRequired();\r\n\r\nexport const dateValidator = Yup.number().required().nullable();\r\n\r\nexport const phoneRequiredValidator = Yup.string().matches(phoneRegexp, 'Invalid phone number').required();\r\n\r\nexport const phoneValidator = Yup.string().test('is-valid', 'Invalid phone number', (value) =>\r\n\t!value || phoneRegexp.test(value));\r\n\r\nexport const formattedPhoneValidator = Yup.string().test('is-formatted-valid', 'Invalid phone number', (value) =>\r\n\t!value || formattedPhoneRegexp.test(value));\r\n\r\nexport const alphaDigitPasswordValidator = Yup.string().matches(/^([0-9a-zA-Z])+$/, 'Password should only contains digits and latin letters');\r\n\r\nexport const nonEmptyArray = (message: string) => Yup.array().test(\r\n\t'Non-empty array',\r\n\tmessage,\r\n\t(value: Array | undefined) => (value ? value.some((v) => !v.deleted) : false),\r\n);\r\n\r\nexport const nameValidator = Yup.string().test({\r\n\tname: 'is-valid-name',\r\n\ttest(value) {\r\n\t\tif (value && (!value.match(/[a-z]/i) || value.match(/[^a-z ]{2,}/i))) {\r\n\t\t\treturn this.createError({\r\n\t\t\t\tmessage: 'Invalid Name',\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n});\r\n\r\nexport const nameValidatorWithLenghtCheck = (maxNameLength) => nameValidator.max(maxNameLength, `max characters count: ${maxNameLength}`);\r\n\r\nexport const lengthValidator = (maxLength, customMessage?) => Yup.string().max(maxLength, customMessage);\r\n\r\nexport const lengthNullableValidator = (maxLength, customMessage?) => Yup.string().nullable().max(maxLength, customMessage);\r\n\r\nexport const lengthRequiredValidator = (maxLength, customMessage?) => Yup.string().max(maxLength, customMessage).required();\r\n\r\nexport const minNotNullValidator = (min) => Yup.mixed().test('min', `Must be >= ${min}`, (value) => value !== null && value >= min);\r\n\r\nexport const minMaxNotNullValidator = (min, max) => Yup.mixed().test('min', `Must be >= ${min}`, (value) => value !== null && value >= min)\r\n\t.test('max', `Must be <= ${max}`, (value) => value !== null && value <= max);\r\n\r\nexport const minMaxValidator = (min, max) => Yup.mixed().test('min', `Must be >= ${min}`, (value) => value === null || value >= min)\r\n\t.test('max', `Must be <= ${max}`, (value) => value === null || value <= max);\r\n","import * as React from 'react';\r\n\r\nexport const useMobileView = (size = 520) => {\r\n\tconst [isMobile, setIsMobile] = React.useState(false);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst resize = () => {\r\n\t\t\tsetIsMobile(window.innerWidth < size);\r\n\t\t};\r\n\r\n\t\tresize();\r\n\t\twindow.addEventListener('resize', resize);\r\n\t\treturn () => window.removeEventListener('resize', resize);\r\n\t}, []);\r\n\r\n\treturn isMobile;\r\n};\r\n","export enum Device {\r\n\tDesktop = 0,\r\n\tMobile = 1,\r\n\tAmp = 2\r\n}\r\n\r\nexport const DeviceTitle = {\r\n\t[Device.Desktop]: 'Desktop',\r\n\t[Device.Mobile]: 'Mobile',\r\n\t[Device.Amp]: 'AMP',\r\n};\r\n\r\nexport const DeviceIcon = {\r\n\t[Device.Desktop]: 'fa-television',\r\n\t[Device.Mobile]: 'fa-mobile fa-lg',\r\n\t[Device.Amp]: 'fa-flash',\r\n};\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport const TranslatedErrorMessage: React.FC<{ error: any } > = ({ error }) => {\r\n\tconst { t } = useTranslation();\r\n\tlet key = '';\r\n\tlet max = null;\r\n\r\n\tif (typeof error !== 'string') {\r\n\t\tkey = error.key;\r\n\t\tmax = error.value;\r\n\t}\r\n\r\n\treturn \r\n\t\t{typeof error !== 'string'\r\n\t\t\t? t(`errors.${key}`, { max })\r\n\t\t\t: t(`errors.${error}`)}\r\n\t
;\r\n};\r\n","import * as React from 'react';\r\n\r\nimport { Field, FieldProps } from 'formik';\r\n\r\nimport { FormikInput, FormikInputProps, FormikInputRenderFunc } from '@common/react/components/Forms/FormikInput/FormikInput';\r\n\r\ninterface DefaultRenders {\r\n\ttextarea: FormikInputRenderFunc;\r\n}\r\n\r\nconst defaultRenders: DefaultRenders = {\r\n\ttextarea: ({ field }: FieldProps) => ,\r\n};\r\n\r\nexport interface FormikFieldProps extends Omit {\r\n\tfieldName: string;\r\n\tdefaultRender?: keyof DefaultRenders;\r\n}\r\n\r\nconst FormikField: React.FC = (props) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t{(fieldProps: FieldProps) =>\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default FormikField;\r\n","import * as React from 'react';\r\n\r\nimport FormikField, { FormikFieldProps } from '@common/react/components/Forms/FormikField/FormikField';\r\n\r\nimport { TranslatedErrorMessage } from '@app/components/UI/TranslatedErrorMessage/TranslatedErrorMessage';\r\n\r\nconst TranslatedFormikField: React.FC = (props) => {\r\n\treturn ;\r\n};\r\n\r\nexport default TranslatedFormikField;\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { Lang } from '@common/typescript/objects/Lang';\r\n\r\nimport { Doctor } from '@app/objects/Doctor';\r\nimport Select from '@app/components/UI/BseSelect';\r\n\r\ninterface DoctorSelectProps {\r\n\titems: Array;\r\n\tlanguage: Lang;\r\n\tform: any;\r\n\tfield: any;\r\n\tatModal?: boolean;\r\n}\r\n\r\nconst DoctorSelect: React.FC = ({\r\n\titems,\r\n\tlanguage,\r\n\tform,\r\n\tfield,\r\n\tatModal,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\treturn