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