> {\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 { AppThunkAction } from '@app/store/index';\r\nimport { request } from '@app/components/Api';\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","var locale = {\n locale: 'es_ES',\n today: 'Hoy',\n now: 'Ahora',\n backToToday: 'Volver a hoy',\n ok: 'Aceptar',\n clear: 'Limpiar',\n month: 'Mes',\n year: 'Año',\n timeSelect: 'Seleccionar hora',\n dateSelect: 'Seleccionar fecha',\n monthSelect: 'Elegir un mes',\n yearSelect: 'Elegir un año',\n decadeSelect: 'Elegir una década',\n yearFormat: 'YYYY',\n dateFormat: 'D/M/YYYY',\n dayFormat: 'D',\n dateTimeFormat: 'D/M/YYYY HH:mm:ss',\n monthBeforeYear: true,\n previousMonth: 'Mes anterior (PageUp)',\n nextMonth: 'Mes siguiente (PageDown)',\n previousYear: 'Año anterior (Control + left)',\n nextYear: 'Año siguiente (Control + right)',\n previousDecade: 'Década anterior',\n nextDecade: 'Década siguiente',\n previousCentury: 'Siglo anterior',\n nextCentury: 'Siglo siguiente'\n};\nexport default locale;","const locale = {\n placeholder: 'Seleccionar hora'\n};\nexport default locale;","import CalendarLocale from \"rc-picker/es/locale/es_ES\";\nimport TimePickerLocale from '../../time-picker/locale/es_ES';\n// Merge into a locale object\nconst locale = {\n lang: Object.assign({\n placeholder: 'Seleccionar fecha',\n rangePlaceholder: ['Fecha inicial', 'Fecha final']\n }, CalendarLocale),\n timePickerLocale: Object.assign({}, TimePickerLocale)\n};\n// All settings at:\n// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json\nexport default locale;","import * as React from 'react';\r\n\r\nimport { FieldProps, ErrorMessage } 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}\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}) => {\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{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 lengthValidator = (maxLength, customMessage?) => Yup.string().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 Select from 'antd/lib/select';\r\n\r\nimport { Lang } from '@common/typescript/objects/Lang';\r\n\r\nimport { Doctor } from '@app/objects/Doctor';\r\n\r\ninterface DoctorSelectProps {\r\n\titems: Array;\r\n\tlanguage: Lang;\r\n\tform: any;\r\n\tfield: any;\r\n\tgetPopupContainer?: (node) => HTMLElement;\r\n}\r\n\r\nconst Option = Select.Option;\r\n\r\nconst DoctorSelect: React.FC = ({\r\n\titems,\r\n\tlanguage,\r\n\tform,\r\n\tfield,\r\n\tgetPopupContainer,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\treturn ;\r\n};\r\n\r\nexport default DoctorSelect;\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\nimport { WithDeleted } from '@common/typescript/objects/WithDeleted';\r\nimport {\r\n\tItemsProvider,\r\n\tuseItemsProviderContext,\r\n\tItemsProviderProps,\r\n\tcreateItemsProviderContext,\r\n\tdefaultTransformFiltersBeforeHandleUrl,\r\n\tSortingDirection,\r\n\tItemsProviderContextActions,\r\n\tWithKey, ItemsProviderContext,\r\n} from '@common/react/components/Core/ItemsProvider/ItemsProvider';\r\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\r\nimport { getSearchParamsFromUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\r\n\r\nexport interface AdvancedItemsProviderProps extends ItemsProviderProps {\r\n\tfilterHandler: (item, filters) => boolean | Promise;\r\n\tdefaultSort?: [string, SortingDirection];\r\n\tsortHandler?: (item1, item2, filters) => number; // return number as function for Array.sort\r\n}\r\n\r\ninterface AdvancedItemsHandlerProps {\r\n\tfilterHandler: (item, filters) => any;\r\n\tdefaultSort?: [string, SortingDirection];\r\n\tsortHandler?: (item1, item2, filters) => number;\r\n\tadd?: (items: Array) => any;\r\n\taddedFirst?: boolean;\r\n}\r\n\r\nexport interface AdvancedItemsProviderContextActions extends ItemsProviderContextActions {\r\n\taddItem: (item: T) => void;\r\n\treloadItems: (params?: BaseParams) => void;\r\n\tdeleteItem: (item: Omit, 'id'> & WithDeleted) => void;\r\n}\r\n\r\nexport const checkFilterProp = (value: any) => {\r\n\tif (value === undefined || value === null || value === '') {\r\n\t\treturn false;\r\n\t}\r\n\tif (typeof value === 'number') {\r\n\t\treturn value > -1;\r\n\t}\r\n\tif (typeof value === 'string') {\r\n\t\tif (!isNaN(+value)) {\r\n\t\t\treturn +value > -1;\r\n\t\t}\r\n\t}\r\n\tif (Array.isArray(value)) {\r\n\t\treturn value.length > 0;\r\n\t}\r\n\treturn true;\r\n};\r\n\r\nexport const findId = (array, id) => {\r\n\treturn array.find((i) => +i === +id);\r\n};\r\n\r\nconst defaultSortHandler = (item1, item2, filters, defaultSort: [string, SortingDirection]) => {\r\n\tconst { column } = filters;\r\n\tif (column) {\r\n\t\tconst [prop, type] = column;\r\n\t\tif (type === SortingDirection.Ascending) {\r\n\t\t\treturn item1[prop] - item2[prop];\r\n\t\t}\r\n\t\tif (type === SortingDirection.Descending) {\r\n\t\t\treturn item2[prop] - item1[prop];\r\n\t\t}\r\n\t}\r\n\tconst [prop, type] = defaultSort;\r\n\tif (type === SortingDirection.Ascending) {\r\n\t\treturn item1[prop] - item2[prop];\r\n\t}\r\n\tif (type === SortingDirection.Descending) {\r\n\t\treturn item2[prop] - item1[prop];\r\n\t}\r\n\treturn 0;\r\n};\r\n\r\nexport const useAdvancedItemsProviderContext = () => useItemsProviderContext>();\r\n\r\nconst AdvancedItemsHandler = (p: PropsWithChildren) => {\r\n\tconst {\r\n\t\tchildren,\r\n\t\tfilterHandler,\r\n\t\tsortHandler,\r\n\t\tdefaultSort = ['sortOrder', SortingDirection.Ascending],\r\n\t} = p;\r\n\tconst ItemsContext = createItemsProviderContext();\r\n\r\n\tconst context = useItemsProviderContext();\r\n\r\n\tif (!context.state) throw 'Need ItemsProvider context!';\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\titems: itemsProp, pagination, filters, loading, loaders, edits, errors, error,\r\n\t\t},\r\n\t\tactions: {\r\n\t\t\tsetItems, reload, load, setEdit,\r\n\t\t},\r\n\t} = context;\r\n\r\n\tconst [id, setId] = React.useState(-1);\r\n\r\n\tconst value = React.useMemo(() => {\r\n\t\tconst { pageSize, current } = pagination;\r\n\r\n\t\tconst isFirstPage = current === 1;\r\n\r\n\t\tconst items = itemsProp.slice(isFirstPage ? 0 : 1)\r\n\t\t\t.slice(0, pageSize - 2 + Object.keys(edits)\r\n\t\t\t\t.filter((key) => +key < 0).length);\r\n\r\n\t\tconst handledPagination = {\r\n\t\t\t...(pagination || { current: 1, pageSize: 10, total: 0 }),\r\n\t\t\tpageSizeOptions: (pagination?.pageSizeOptions || [12, 22, 32, 42]).map((size) => `${+size - 2}`),\r\n\t\t\tpageSize: pagination.pageSize ? pagination.pageSize - 2 : 10,\r\n\t\t};\r\n\r\n\t\tconst handleReload = (params) => {\r\n\t\t\tconst pageSize = params?.pageSize || pagination.pageSize - 2;\r\n\t\t\tconst current = params?.current || pagination.current;\r\n\t\t\tconst isFirstPage = current === 1;\r\n\r\n\t\t\treturn reload({\r\n\t\t\t\t...params,\r\n\t\t\t\tpageSize: params?.pageSize ? params.pageSize + 2 : undefined,\r\n\t\t\t\toffset: isFirstPage ? 0 : pageSize * (current - 1) - 1,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tconst addItem = (item) => {\r\n\t\t\tPromise.resolve(filterHandler(item, filters)).then((res) => {\r\n\t\t\t\tif (res) {\r\n\t\t\t\t\tconst newItems = sortHandler || defaultSort\r\n\t\t\t\t\t\t? itemsProp.concat(item)\r\n\t\t\t\t\t\t\t.sort((item1, item2) =>\r\n\t\t\t\t\t\t\t\t(sortHandler ? sortHandler(item1, item2, filters)\r\n\t\t\t\t\t\t\t\t\t: defaultSortHandler(item1, item2, filters, defaultSort)))\r\n\t\t\t\t\t\t: itemsProp.concat(item);\r\n\t\t\t\t\tif (itemsProp.length > pagination.pageSize) {\r\n\t\t\t\t\t\tnewItems.pop();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsetItems(newItems);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tconst add = (item?: any) => {\r\n\t\t\tsetId((id) => id - 1);\r\n\r\n\t\t\tconst newItem = item ? { ...item, id } : { ...p.add?.(itemsProp), id };\r\n\r\n\t\t\tconst newItems = p.addedFirst\r\n\t\t\t\t? isFirstPage ? [newItem].concat(itemsProp) : [...itemsProp.slice(0, 1), newItem, ...itemsProp.slice(1)]\r\n\t\t\t\t: [\r\n\t\t\t\t\t...itemsProp.slice(0, itemsProp.length - (isFirstPage ? 2 : 1)),\r\n\t\t\t\t\tnewItem,\r\n\t\t\t\t\t...itemsProp.slice(itemsProp.length - (isFirstPage ? 2 : 1)),\r\n\t\t\t\t];\r\n\r\n\t\t\tsetItems(newItems);\r\n\r\n\t\t\tsetEdit(newItem);\r\n\t\t\treturn newItem;\r\n\t\t};\r\n\r\n\t\tconst deleteItem = (id) => {\r\n\t\t\tsetItems(itemsProp.filter((item) => item.id !== id));\r\n\t\t};\r\n\r\n\t\tconst reloadItems = () => {\r\n\t\t\treturn load({ ...pagination, pageSizeOptions: undefined }, true);\r\n\t\t};\r\n\r\n\t\tconst updateItem = (item) => {\r\n\t\t\tsetItems(itemsProp.map((el) => (el.id === item.id ? { ...el, ...item } : el)));\r\n\t\t};\r\n\r\n\t\treturn {\r\n\t\t\tstate: {\r\n\t\t\t\t...context.state,\r\n\t\t\t\titems,\r\n\t\t\t\tpagination: handledPagination,\r\n\t\t\t\tadvancedItems: itemsProp,\r\n\t\t\t},\r\n\t\t\tactions: {\r\n\t\t\t\t...context.actions,\r\n\t\t\t\treload: handleReload,\r\n\t\t\t\taddItem,\r\n\t\t\t\treloadItems,\r\n\t\t\t\tupdateItem,\r\n\t\t\t\tdeleteItem,\r\n\t\t\t\tadd,\r\n\t\t\t},\r\n\t\t};\r\n\t}, [itemsProp, pagination, loading, filters, loaders, edits, errors, error]);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{typeof children === 'function' ? children(value) : children}\r\n\t\t\r\n\t);\r\n};\r\n\r\nconst AdvancedItemsProvider = (p: AdvancedItemsProviderProps) => {\r\n\tconst { children } = p;\r\n\r\n\tconst pagination = {\r\n\t\t...(p.pagination || { current: 1, pageSize: 12, total: 0 }),\r\n\t\tpageSizeOptions: (p.pagination?.pageSizeOptions || [10, 20, 30, 40]).map((size) => `${+size + 2}`),\r\n\t\tpageSize: p.pagination?.pageSize ? p.pagination.pageSize + 2 : 12,\r\n\t};\r\n\r\n\tconst transformFiltersBeforeHandleUrl = (filters) => {\r\n\t\tconst urlFilters = defaultTransformFiltersBeforeHandleUrl({\r\n\t\t\t...filters,\r\n\t\t\tpageSize: filters.pageSize ? filters.pageSize - 2 : undefined,\r\n\t\t\tcount: filters.pageSize || filters.count ? (filters.count || filters.pageSize) - 2 : undefined,\r\n\t\t});\r\n\r\n\t\treturn p.transformFiltersBeforeHandleUrl ? p.transformFiltersBeforeHandleUrl(urlFilters) : urlFilters;\r\n\t};\r\n\r\n\tconst searchParamsFromUrl = (location, prefix?: string) => {\r\n\t\tconst params = getSearchParamsFromUrl(location, prefix);\r\n\t\tconst pageSize = params[`${prefix || ''}pageSize`];\r\n\r\n\t\treturn {\r\n\t\t\t...params,\r\n\t\t\t[`${prefix || ''}pageSize`]: pageSize ? pageSize + 2 : 12,\r\n\t\t};\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{children}\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default AdvancedItemsProvider;\r\n","/**\r\n * ## ItemsProviderWithStore.tsx ##\r\n * This file contains ItemsProviderWithStore component\r\n * @packageDocumentation\r\n */\r\nimport React from 'react';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\n\r\nimport { TypeKeys, ItemsState } from '@common/react/store/ItemsProviderStore';\r\n\r\nimport {\r\n\tItemsProvider,\r\n\tItemsProviderProps,\r\n\tuseItemsProviderContext,\r\n\tWithKey,\r\n\tItemsProviderContextState,\r\n\tSortingDirection,\r\n\tItemsProviderContextActions,\r\n} from '@common/react/components/Core/ItemsProvider/ItemsProvider';\r\nimport { equal } from '@common/typescript/Utils';\r\nimport AdvancedItemsProvider from '@common/react/components/Core/AdvancedItemsProvider/AdvancedItemsProvider';\r\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\r\n\r\ninterface ItemsHandlerProps extends ItemsProviderProps {\r\n\tchildren: React.ReactNode | ((state: ItemsProviderContextState, actions: ItemsProviderContextActions) => React.ReactNode);\r\n\tstoreName: string;\r\n\tinitLoad: boolean;\r\n\tstoreData: ItemsState;\r\n}\r\n\r\nexport interface ItemsProviderWithStoreProps extends ItemsProviderProps {\r\n\t/**\r\n\t * - 1. ReactElement to be wrapped in an ItemsProviderWithStore context\r\n\t * - 2. function with ItemsProviderWithStore state as first argument\r\n\t */\r\n\tchildren: React.ReactNode | ((state: ItemsProviderContextState) => React.ReactNode);\r\n\t/**\r\n\t * property in redux that stores data for ItemsProviderWithStore.\r\n\t */\r\n\tstoreName: string;\r\n\t/**\r\n\t * default element sorting. Used to define the position of a new element.\r\n\t *\r\n\t * (only for AdvancedItemsProvider)\r\n\t *\r\n\t * If defaultSort and filterHandler are present, AdvancedItemsProvider will be used.\r\n\t */\r\n\tdefaultSort?: [string, SortingDirection];\r\n\t/**\r\n\t * default element sorting. Determines whether a new element should be displayed with the current filters\r\n\t *\r\n\t * (only for AdvancedItemsProvider)\r\n\t *\r\n\t * If defaultSort and filterHandler are present, AdvancedItemsProvider will be used.\r\n\t */\r\n\tfilterHandler?: (item, filters) => boolean | Promise;\r\n\t/**\r\n\t * Custom sorting of elements after adding a new one.\r\n\t *\r\n\t * (only for AdvancedItemsProvider)\r\n\t *\r\n\t * If defaultSort and filterHandler are present, AdvancedItemsProvider will be used.\r\n\t */\r\n\tsortHandler?: (item1, item2, filters) => number;\r\n\t/**\r\n\t * init load option\r\n\t */\r\n\tskipInitLoad?: boolean;\r\n}\r\n\r\nconst getParamsFromItemProvider = (filters, pagination) => {\r\n\treturn {\r\n\t\t...filters,\r\n\t\t...{\r\n\t\t\tcount: pagination?.pageSize || 10,\r\n\t\t\tcurrent: filters?.page || pagination?.current || 1,\r\n\t\t\tpageSize: undefined,\r\n\t\t\tpage: undefined,\r\n\t\t},\r\n\t};\r\n};\r\n\r\nconst ItemsHandler = ({\r\n\tstoreName, initLoad, storeData, ...p\r\n} : ItemsHandlerProps) => {\r\n\tconst { children } = p;\r\n\r\n\tconst context = useItemsProviderContext();\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\titems,\r\n\t\t\tfilters,\r\n\t\t\tpagination,\r\n\t\t\terror,\r\n\t\t},\r\n\t\tactions: { load },\r\n\t} = context;\r\n\tconst [initUpdate, setInitUpdate] = React.useState(true);\r\n\r\n\tconst dispatch = useDispatch();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (initLoad) {\r\n\t\t\tload()\r\n\t\t\t\t.catch((error) => {\r\n\t\t\t\t\tif (typeof error === 'string' && error.includes('aborted')) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tload()\r\n\t\t\t\t\t\t.catch((e) => {\r\n\t\t\t\t\t\t\tconsole.log(e);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t}\r\n\t}, []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif ((!initUpdate || (storeData?.isEmpty && !initLoad))) {\r\n\t\t\tdispatch({\r\n\t\t\t\titems,\r\n\t\t\t\tparams: getParamsFromItemProvider({ ...p.unhandledFilters, ...filters }, pagination),\r\n\t\t\t\ttype: TypeKeys.SETITEMS,\r\n\t\t\t\tstorageName: storeName,\r\n\t\t\t\tobjectType: p.type,\r\n\t\t\t\ttotal: pagination.total || items?.length,\r\n\t\t\t\tcurrent: pagination.current,\r\n\t\t\t\tisEmpty: !!error,\r\n\t\t\t});\r\n\t\t}\r\n\t\tsetInitUpdate(false);\r\n\t}, [items, error]);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{typeof children === 'function' ? children(context.state, context.actions) : children}\r\n\t\t>\r\n\t);\r\n};\r\n\r\n/**\r\n * ItemsProviderWithStore component.\r\n *\r\n * usage examples:\r\n * - {React.ReactNode}\r\n * - {(state, actions) => React.ReactNode}\r\n * - SingleItem}/>\r\n *\r\n * if you need to use the AdvancedItemsProvider, you must provide a defaultSort and filterHandler.\r\n * - false}>{(state, actions) => React.ReactNode}\r\n *\r\n * @typeParam T - T Any {WithKey}\r\n * @param props - ItemsProviderWithStoreProps\r\n * @type {React.FC}\r\n * @returns React.ReactElement\r\n */\r\nconst ItemsProviderWithStore = (props: ItemsProviderWithStoreProps) => {\r\n\tconst { children } = props;\r\n\tconst {\r\n\t\tstoreName, defaultSort, filterHandler, sortHandler, skipInitLoad = false, ...p\r\n\t} = props;\r\n\tconst store = useSelector((state) => state[storeName], shallowEqual) as ItemsState;\r\n\tconst context = useItemsProviderContext();\r\n\tconst loading = context?.state?.type === p.type && (context?.state?.loading || store?.isEmpty);\r\n\r\n\tconst itemsData = React.useMemo(() => {\r\n\t\tconst data = { items: p.items ?? store.items, pagination: p.pagination, fromStore: skipInitLoad };\r\n\t\tif (!store || skipInitLoad) {\r\n\t\t\treturn data;\r\n\t\t}\r\n\t\tconst currentParams = getParamsFromItemProvider({ ...p.unhandledFilters, ...p.filters }, p.pagination);\r\n\t\tconst storeParams = { ...store.params, count: store.params.count || 10, current: store.params.current || 1 };\r\n\r\n\t\treturn currentParams.count === storeParams.count && currentParams.count === storeParams.count\r\n\t\t&& equal(\r\n\t\t\t{ ...currentParams, count: undefined, current: undefined },\r\n\t\t\t{ ...storeParams, count: undefined, current: undefined },\r\n\t\t)\r\n\t\t\t? { items: p.items || store.items, pagination: p.pagination || store.pagination, fromStore: !store.isEmpty || !!p.items } : data;\r\n\t}, [!loading]);\r\n\r\n\tif (loading) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\treturn (\r\n\t\t!!defaultSort && !!filterHandler\r\n\t\t\t? (\r\n\t\t\t\t\r\n\t\t\t\t\tdefaultSort={defaultSort}\r\n\t\t\t\t\tfilterHandler={filterHandler}\r\n\t\t\t\t\tsortHandler={sortHandler}\r\n\t\t\t\t\t{...p}\r\n\t\t\t\t\titems={itemsData.items}\r\n\t\t\t\t\tpagination={{ ...itemsData.pagination, current: itemsData.pagination?.current || 1 }}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{children}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)\r\n\t\t\t: (\r\n\t\t\t\t {...p} items={itemsData.items} pagination={itemsData.pagination}>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{children}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)\r\n\t);\r\n};\r\n\r\nexport default ItemsProviderWithStore;\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Select from 'antd/lib/select';\r\n\r\nimport ItemsProviderWithStore from '@common/react/components/Core/ItemsProviderWithStore/ItemsProviderWithStore';\r\nimport { Lang } from '@common/typescript/objects/Lang';\r\n\r\nimport { Location } from '@app/objects/Location';\r\nimport LocationName from '@app/components/UI/LocationName/LocationName';\r\n\r\ninterface LocationSelectProps {\r\n\titems: Array;\r\n\tlanguage: Lang;\r\n\tform: any;\r\n\tfield: any;\r\n\tgetPopupContainer?: (node) => HTMLElement;\r\n}\r\n\r\nconst Option = Select.Option;\r\n\r\nconst LocationSelect: React.FC = ({\r\n\titems,\r\n\tlanguage,\r\n\tform,\r\n\tfield,\r\n\tgetPopupContainer,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\r\n\treturn \r\n\t\tstoreName=\"locations\"\r\n\t\titems={items}\r\n\t\ttype=\"location\"\r\n\t\tfilters={{ count: 100 }}\r\n\t\tpagination={{ current: 1, pageSize: 100, pageSizeOptions: [100] }}\r\n\t>\r\n\t\t{(state) => }\r\n\t;\r\n};\r\n\r\nexport default LocationSelect;\r\n","import * as React from 'react';\r\nimport { useTranslation, WithTranslation, withTranslation } from 'react-i18next';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport {\r\n\tField, FieldProps, Form, Formik, FormikProps,\r\n} from 'formik';\r\nimport * as Yup from 'yup';\r\nimport Select from 'antd/lib/select';\r\nimport es from 'antd/es/date-picker/locale/es_ES';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\n\r\nimport Button from '@common/react/components/Forms/Button';\r\nimport { FormikInput } from '@common/react/components/Forms/FormikInput/FormikInput';\r\nimport { emailValidator, phoneRequiredValidator } from '@common/react/utils/validationHelpers';\r\nimport { Lang } from '@common/typescript/objects/Lang';\r\nimport { FormikPhoneControl } from '@common/react/components/Forms/FormikPhoneControl/FormikPhoneControl';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\n\r\nimport { useMobileView } from '@commonTuna/react/utils/useMobileView';\r\nimport { Device } from '@commonTuna/react/objects/Device';\r\n\r\nimport { TranslatedErrorMessage } from '@app/components/UI/TranslatedErrorMessage/TranslatedErrorMessage';\r\nimport {\r\n\tgetLangByName, getPageShortName, Page, PageType,\r\n} from '@app/objects/Page';\r\nimport { ApplicationState } from '@app/store';\r\nimport { Inquiry } from '@app/objects/Inquiry';\r\nimport { Gender } from '@app/objects/Case';\r\nimport TranslatedFormikField from '@app/components/Forms/TranslatedFormikField/TranslatedFormikField';\r\nimport DoctorSelect from '@app/components/UI/DoctorSelect/DoctorSelect';\r\nimport LocationSelect from '@app/components/UI/LocationSelect/LocationSelect';\r\nimport { Doctor } from '@app/objects/Doctor';\r\nimport LazyDatepicker from '@app/components/Forms/ContactUs/LazyDatepicker';\r\n\r\ninterface ValuesInquiry extends Inquiry {\r\n\ttimeInterval: number | null;\r\n}\r\n\r\ntype FormValues = Omit;\r\n\r\nexport interface ContactsUsFormProps extends WithTranslation {\r\n\tclassName?: string;\r\n\tonSave?: () => void;\r\n\tdoctor?: Doctor;\r\n\tpageId?: number;\r\n\tlocationId?: number;\r\n\tcontrolsIdPrefix?: string;\r\n}\r\n\r\nconst lengthValidator = (maxLength) => Yup.string().max(maxLength, { key: 'Must be less than character', value: maxLength });\r\n\r\nconst lengthRequiredValidator = (maxLength) => Yup.string().max(maxLength, { key: 'Must be less than character', value: maxLength }).required();\r\n\r\nconst validationSchema = Yup.object().shape({\r\n\tfirstName: lengthRequiredValidator(20),\r\n\tlastName: lengthRequiredValidator(20),\r\n\temail: emailValidator,\r\n\tphone: phoneRequiredValidator,\r\n\ttext: lengthValidator(200),\r\n});\r\n\r\ninterface ContactsUsFormState {\r\n\tisLoading: boolean;\r\n\tsuccess: 0 | 1 | 2;\r\n\terror: null | string;\r\n\tloaders: {\r\n\t\ttimes: boolean;\r\n\t};\r\n}\r\n\r\nconst Option = Select.Option;\r\n\r\ntype Props = ContactsUsFormProps;\r\n\r\nconst getMainPageId = (mainPageMenu: Array, id) => {\r\n\tconst findId = (mainPage: Page, id: number) => {\r\n\t\tif (mainPage?.id === id) return id;\r\n\t\treturn mainPage?.children?.list.length\r\n\t\t\t? mainPage.children.list\r\n\t\t\t\t.map((page) => (findId(page, id) > 0 ? id : -1))\r\n\t\t\t\t.find((id) => id > 0)\r\n\t\t\t: -1;\r\n\t};\r\n\r\n\treturn mainPageMenu?.filter((q) => q.pageType === PageType.SERVICE)\r\n\t\t.find((page) => findId(page, id) > 0)?.id || -1;\r\n};\r\n\r\nconst getPopupContainer = (node) => node.closest('.contact-us-form') || document.body;\r\n\r\nconst ContactUsForm: React.FC = (props) => {\r\n\tconst {\r\n\t\toffices, language, menu, initDoctors,\r\n\t} = useSelector((state: ApplicationState) => ({\r\n\t\tmenu: state.menu,\r\n\t\tlanguage: state.login.lang,\r\n\t\tinitDoctors: state.initDoctors,\r\n\t\toffices: state.offices,\r\n\t}), shallowEqual);\r\n\tconst request = useRequest();\r\n\r\n\tconst isMobile = useMobileView();\r\n\r\n\tconst { i18n } = useTranslation();\r\n\tconst ref = React.useRef(false);\r\n\tconst container = React.useRef(null);\r\n\r\n\tconst history = useHistory();\r\n\r\n\tconst [state, setState] = React.useState({\r\n\t\tisLoading: false,\r\n\t\terror: null,\r\n\t\tsuccess: 0,\r\n\t\tloaders: {\r\n\t\t\ttimes: false,\r\n\t\t},\r\n\t});\r\n\r\n\tconst mainPageMenu = menu.items.filter((q) => q.pageType === PageType.SERVICE);\r\n\r\n\tconst getValueForSelect = (value: number) => {\r\n\t\treturn value > 0 ? value : undefined;\r\n\t};\r\n\r\n\tconst onSubmit = (values: FormValues, { resetForm }) => {\r\n\t\tsetState((state) => ({ ...state, isLoading: true }));\r\n\r\n\t\tconst lang = getLangByName(i18n.language);\r\n\r\n\t\t/* this.setTimeToDate(values); */\r\n\r\n\t\tconst newValues = {\r\n\t\t\t...values,\r\n\t\t\tlocationId: (values.locationId as number) > 0 ? values.locationId : null,\r\n\t\t\tpageId: (values.pageId as number) > 0 ? values.pageId : null,\r\n\t\t\tmainPageId: (values.mainPageId as number) > 0 ? values.mainPageId : null,\r\n\t\t\tdoctorId: (values.doctorId as number) > 0 ? values.doctorId : null,\r\n\t\t\tlanguage: lang,\r\n\t\t\tdevice: isMobile ? Device.Mobile : Device.Desktop,\r\n\t\t\tpath: history.location.pathname,\r\n\t\t};\r\n\r\n\t\trequest('inquiryRemote', newValues).then(() => {\r\n\t\t\tsetState((state) => ({\r\n\t\t\t\t...state,\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\tsuccess: 1,\r\n\t\t\t\terror: null,\r\n\t\t\t}));\r\n\r\n\t\t\tresetForm();\r\n\t\t\tref.current = true;\r\n\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tif (ref.current) {\r\n\t\t\t\t\tsetState((state) => ({ ...state, success: 2 }));\r\n\r\n\t\t\t\t\tprops.onSave && props.onSave();\r\n\t\t\t\t\tref.current = false;\r\n\t\t\t\t}\r\n\t\t\t}, 15000);\r\n\t\t}).catch((message: string) => {\r\n\t\t\tsetState((state) => ({\r\n\t\t\t\t...state,\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\terror: message,\r\n\t\t\t}));\r\n\t\t});\r\n\t};\r\n\r\n\tconst mainPageId = getMainPageId(mainPageMenu, props.pageId);\r\n\r\n\tconst { success, isLoading } = state;\r\n\r\n\tconst { t, doctor, controlsIdPrefix = '' } = props;\r\n\tconst doctors = React.useMemo(() => {\r\n\t\tif (!doctor) return initDoctors.items;\r\n\t\treturn doctor && initDoctors.items.find((item) => doctor?.id === item.id) ? initDoctors.items : [doctor];\r\n\t}, [doctor, initDoctors]);\r\n\tconst locationId = props.locationId || (doctor?.locations?.[0]?.locationId ?? (offices.items.length ? offices.items[0].id : -1));\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t
0 ? mainPageId : (mainPageMenu.length ? mainPageMenu?.[0].id : -1),\r\n\t\t\t\t\tpageId: -1,\r\n\t\t\t\t\tdoctorId: doctor?.id || -1,\r\n\t\t\t\t\ttext: '',\r\n\t\t\t\t\tdate: null,\r\n\t\t\t\t\ttime: null,\r\n\t\t\t\t\tgender: Gender.Female,\r\n\t\t\t\t\ttimeInterval: null,\r\n\t\t\t\t\tpath: '',\r\n\t\t\t\t\tdevice: Device.Desktop,\r\n\t\t\t\t}}\r\n\t\t\t\tonSubmit={onSubmit}\r\n\t\t\t\tvalidationSchema={validationSchema}\r\n\t\t\t>\r\n\t\t\t\t{(formikBag: FormikProps) => (\r\n\t\t\t\t\t\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 withTranslation()(ContactUsForm);\r\n","import React from 'react';\r\n\r\nimport loadable from '@loadable/component';\r\nimport Select from 'antd/lib/select';\r\n\r\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\r\n\r\nconst Loader = React.forwardRef((props, ref) => {\r\n\treturn \r\n\t\t\r\n\t
;\r\n});\r\n\r\nconst DatepickerEs = loadable(\r\n\t() =>\r\n\t\tloadableDelay(import(/* webpackChunkName: \"DatepickerEs\" */ '@app/components/Forms/ContactUs/DatepickerEs')),\r\n\t{\r\n\t\tfallback: ,\r\n\t},\r\n);\r\n\r\ninterface Props {\r\n\tvalue: null | number;\r\n\tminDateToday?: boolean;\r\n\tonChange: (value: null | number) => void;\r\n\tantdProps: {placeholder?: string, placement};\r\n\tlocale: any;\r\n}\r\n\r\nconst LazyDatepicker: React.FC = (props) => {\r\n\tconst ref = React.useRef(null);\r\n\tconst [visible, setVisible] = React.useState(false);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (ref.current) {\r\n\t\t\tconst intersectionObserver = new IntersectionObserver((entries) => {\r\n\t\t\t\tif (entries[0].isIntersecting) {\r\n\t\t\t\t\tsetVisible(true);\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\trootMargin: '30px',\r\n\t\t\t\tthreshold: 0.01,\r\n\t\t\t});\r\n\r\n\t\t\tintersectionObserver.observe(ref.current);\r\n\t\t\treturn () => intersectionObserver.disconnect();\r\n\t\t}\r\n\t}, []);\r\n\r\n\treturn visible ? : ;\r\n};\r\n\r\nexport default LazyDatepicker;\r\n","/* eslint-disable */\r\nexport default {\r\n\ten: {\r\n\t\ttranslation: {\r\n\t\t\tforms: {\r\n\t\t\t\tlogin: 'Login',\r\n\t\t\t\temail: 'Email',\r\n\t\t\t\tpassword: 'Password',\r\n\t\t\t\trepeatPassword: 'Repeat password',\r\n\t\t\t\tpasswordMessage: 'Password successfully changed',\r\n\t\t\t\tsetupPassword: 'Setup password',\r\n\t\t\t\tenterPassword: 'Enter new password',\r\n\t\t\t\tfirstName: 'First Name',\r\n\t\t\t\tlastName: 'Last Name',\r\n\t\t\t\tphone: 'Phone',\r\n\t\t\t\tforgetPassword: 'Forget password?',\r\n\t\t\t\tregister: 'Register',\r\n\t\t\t\tsubmit: 'Submit',\r\n\t\t\t\tcaptcha: 'Enter the symbols',\r\n\t\t\t\temailSent: 'An email has been sent to you with further instructions.',\r\n\t\t\t\trecoverText: 'Enter the email you provided during registration and we will send you a password reset email',\r\n\t\t\t\trecover: 'Recover',\r\n\t\t\t\trecoverPassword: 'Recover password',\r\n\t\t\t\t'Cosmetic or Dermatology': 'Cosmetic or Dermatology',\r\n\t\t\t\t'Procedure of interest': 'Procedure of interest',\r\n\t\t\t\t'Location Preference': 'Location Preference',\r\n\t\t\t\t'Additional Comments': 'Additional Comments',\r\n\t\t\t\t'Age': 'Age',\r\n\t\t\t\t'Gender': 'Gender',\r\n\t\t\t\t'Height': 'Height',\r\n\t\t\t\t'Ethnicity': 'Ethnicity',\r\n\t\t\t\t'Weight': 'Weight',\r\n\t\t\t\t'Male': 'Male',\r\n\t\t\t\t'Female': 'Female',\r\n\t\t\t\t'Other': 'Other',\r\n\t\t\t\t'Filters': 'Filters',\r\n\t\t\t\t'Select doctor': 'Select doctor',\r\n\t\t\t\trequestSuccess: 'Your request has been sent successfully.\\n We will contact you as soon as possible',\r\n\t\t\t\t'Time': 'Time',\r\n\t\t\t\t'Date': 'Date of Visit',\r\n\t\t\t\tautocomplete: 'Select Service...',\r\n\t\t\t\t'Left Implant': 'Left Implant',\r\n\t\t\t\t'Right Implant': 'Right Implant',\r\n\t\t\t\t'Pre-op Size': 'Pre-op Size',\r\n\t\t\t\t'Post-op Size': 'Post-op Size',\r\n\t\t\t\t'Reset All': 'Reset All',\r\n\t\t\t\tsearch: 'Search...',\r\n\t\t\t\tnotFound: 'Not found',\r\n\t\t\t\t'Find More': 'Find More',\r\n\t\t\t\tcharacters: 'characters',\r\n\t\t\t},\r\n\t\t\terrors: {\r\n\t\t\t\t'Required field!': 'Required field!',\r\n\t\t\t\t'Required field': 'Required field!',\r\n\t\t\t\t'Invalid email': 'Invalid email',\r\n\t\t\t\t'Passwords are not equal': 'Passwords are not equal',\r\n\t\t\t\t'Invalid phone number': 'Invalid phone number',\r\n\t\t\t\t'Must be less than character': 'Must be less than {{max}} character'\r\n\t\t\t},\r\n\t\t\tsite: {\r\n\t\t\t\tDescription: 'Description',\r\n\t\t\t\tshort: 'Short',\r\n\t\t\t\tfull: 'Full',\r\n\t\t\t\tloading: 'Loading',\r\n\t\t\t\thomeHeadline: 'Houston Dermatology
& Plastic Surgery',\r\n\t\t\t\t'Plastic Surgery': 'Plastic Surgery',\r\n\t\t\t\t'Med Spa': 'Med Spa',\r\n\t\t\t\t'Monday': 'Monday',\r\n\t\t\t\t'Tuesday': 'Tuesday',\r\n\t\t\t\t'Wednesday': 'Wednesday',\r\n\t\t\t\t'Thursday': 'Thursday',\r\n\t\t\t\t'Friday': 'Friday',\r\n\t\t\t\t'Saturday': 'Saturday',\r\n\t\t\t\t'Sunday': 'Sunday',\r\n\t\t\t\t'Dermatology': 'Dermatology',\r\n\t\t\t\t'Before / After': 'Before / After',\r\n\t\t\t\t'Service Areas': 'Service Areas',\r\n\t\t\t\t'Schedule an Appointment Now': 'Schedule an Appointment',\r\n\t\t\t\t'To Main Page': 'To Main Page',\r\n\t\t\t\t'Schedule a visit': 'Schedule a visit',\r\n\t\t\t\t'Reviews': 'Reviews',\r\n\t\t\t\t'Profile': 'Profile',\r\n\t\t\t\t'Pages': 'Pages',\r\n\t\t\t\t'Services': 'Services',\r\n\t\t\t\t'Inquiries': 'Inquiries',\r\n\t\t\t\t'Cases': 'Cases',\r\n\t\t\t\t'Faqs': 'Faq',\r\n\t\t\t\t'Ethnicities': 'Ethnicities',\r\n\t\t\t\t'Users': 'Users',\r\n\t\t\t\t'Locations': 'Locations',\r\n\t\t\t\t'Doctors': 'Doctors',\r\n\t\t\t\t'Logout': 'Logout',\r\n\t\t\t\t'Reviews from our clients': 'Reviews from our clients',\r\n\t\t\t\t'Before and after': 'Before and after',\r\n\t\t\t\t'Professions': 'Professions',\r\n\t\t\t\t'Dashboard': 'Dashboard',\r\n\t\t\t\t'Calendar': 'Calendar',\r\n\t\t\t\t'Home': 'Home',\r\n\t\t\t\t'Schedule Consultation': 'Schedule Consultation',\r\n\t\t\t\t'Contacts': 'Contacts',\r\n\t\t\t\t'Read More': 'Read More',\r\n\t\t\t\t'Load More': 'Load More',\r\n\t\t\t\t'Wizard': 'Wizard',\r\n\t\t\t\t'Our Team': 'Our Team',\r\n\t\t\t\t'Click to see results': 'Click to see results',\r\n\t\t\t\t'What can id do': 'WHAT CAN IT DO',\r\n\t\t\t\t'Anesthesia': 'Anesthesia',\r\n\t\t\t\t'Combine with': 'Combine with',\r\n\t\t\t\t'Operation length': 'Operation length',\r\n\t\t\t\t'Recovery Time': 'Recovery Time',\r\n\t\t\t\t'None': 'None',\r\n\t\t\t\t'General': 'General',\r\n\t\t\t\t'Sedation': 'Sedation',\r\n\t\t\t\t'Regional': 'Regional',\r\n\t\t\t\t'Local': 'Local',\r\n\t\t\t\tlearn: 'learn more',\r\n\t\t\t\t'Fast Preview': 'Fast Preview',\r\n\t\t\t\t'Buy': 'Buy',\r\n\t\t\t\tWARNING: 'WARNING:',\r\n\t\t\t\t'This feature contains nudity': 'This feature contains nudity. Please click OK to confirm you are at least 18 years of age and are not offended by such material.'\r\n\t\t\t},\r\n\t\t\tseo: {\r\n\t\t\t\thomePage: {\r\n\t\t\t\t\ttitle: 'Houston Dermatology, Plastic Surgery & Med Spa',\r\n\t\t\t\t\tlink: '/'\r\n\t\t\t\t},\r\n\t\t\t\tdoctorsPage: {\r\n\t\t\t\t\ttitle: 'Our Doctors',\r\n\t\t\t\t\tlink: '/practice/doctors'\r\n\t\t\t\t},\r\n\t\t\t\tbeforeAndAfterPage: {\r\n\t\t\t\t\ttitle: 'Plastic Surgery Before & After Photos'\r\n\t\t\t\t},\r\n\t\t\t\tblogPage: {\r\n\t\t\t\t\ttitle: 'Blog',\r\n\t\t\t\t\tlink: '/blog'\r\n\t\t\t\t},\r\n\t\t\t\tfaqPage: {\r\n\t\t\t\t\ttitle: 'Faq',\r\n\t\t\t\t\tlink: '/faq'\r\n\t\t\t\t},\r\n\t\t\t\tpracticePage: {\r\n\t\t\t\t\ttitle: 'Practice',\r\n\t\t\t\t\tlink: '/practice'\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tes: {\r\n\t\ttranslation: {\r\n\t\t\tforms: {\r\n\t\t\t\tlogin: 'Inicia sesión',\r\n\t\t\t\temail: 'Correo electrónico',\r\n\t\t\t\tpassword: 'Сontraseña',\r\n\t\t\t\trepeatPassword: 'Repite la contraseña',\r\n\t\t\t\tpasswordMessage: 'Contraseña cambiada correctamente',\r\n\t\t\t\tsetupPassword: 'Configurar contraseña',\r\n\t\t\t\tenterPassword: 'Introduzca nueva contraseña',\r\n\t\t\t\tfirstName: 'Nombre',\r\n\t\t\t\tlastName: 'Apellido',\r\n\t\t\t\tphone: 'Teléfono',\r\n\t\t\t\tforgetPassword: '¿Olvidaste tu contraseña?',\r\n\t\t\t\tregister: 'Registrate',\r\n\t\t\t\tsubmit: 'Enviar',\r\n\t\t\t\tcaptcha: 'Introduce los símbolos',\r\n\t\t\t\temailSent: 'Se le ha enviado un correo electrónico con más instrucciones.',\r\n\t\t\t\trecoverText: 'Ingrese el correo electrónico que proporcionó durante el registro y le enviaremos un correo electrónico de restablecimiento de contraseña',\r\n\t\t\t\trecover: 'Recuperar',\r\n\t\t\t\trecoverPassword: 'Recuperar contraseña',\r\n\t\t\t\t'Cosmetic or Dermatology': 'Cosmética o dermatológica',\r\n\t\t\t\t'Procedure of interest': 'Interes en procedimiento',\r\n\t\t\t\t'Location Preference': 'Preferente ubicación',\r\n\t\t\t\t'Additional Comments': 'Comentarios adicionales',\r\n\t\t\t\t'Age': 'Años',\r\n\t\t\t\t'Gender': 'Género',\r\n\t\t\t\t'Height': 'Altura',\r\n\t\t\t\t'Ethnicity': 'Etnicidad',\r\n\t\t\t\t'Weight': 'Peso',\r\n\t\t\t\t'Male': 'Masculino',\r\n\t\t\t\t'Female': 'Femenino',\r\n\t\t\t\t'Other': 'Otra',\r\n\t\t\t\t'Filters': 'Filtro',\r\n\t\t\t\t'Select doctor': 'Seleccionar doctor',\r\n\t\t\t\trequestSuccess: 'Su solicitud ha sido enviada con éxito.\\n Nos pondremos en contacto con usted tan pronto como sea posible',\r\n\t\t\t\t'Time': 'Hora',\r\n\t\t\t\t'Date': 'Fecha de visita',\r\n\t\t\t\tautocomplete: 'Seleccionar servicio...',\r\n\t\t\t\t'Left Implant': 'Implante Izquierdo',\r\n\t\t\t\t'Right Implant': 'Implante Derecho',\r\n\t\t\t\t'Pre-op Size': 'Tamaño preop.',\r\n\t\t\t\t'Post-op Size': 'Tamaño postop.',\r\n\t\t\t\t'Reset All': 'Reiniciar Todo',\r\n\t\t\t\tsearch: 'Buscar...',\r\n\t\t\t\tnotFound: 'Extraviado',\r\n\t\t\t\t'Find More': 'Encuentra más',\r\n\t\t\t\tcharacters: 'caracteres'\r\n\t\t\t},\r\n\t\t\terrors: {\r\n\t\t\t\t'Required field!': '¡Campo requerido!',\r\n\t\t\t\t'Required field': '¡Campo requerido!',\r\n\t\t\t\t'Invalid email': 'Email inválido',\r\n\t\t\t\t'Passwords are not equal': 'Las contraseñas no son iguales',\r\n\t\t\t\t'Invalid phone number': 'Numero de telefono invalido',\r\n\t\t\t\t'Must be less than character': 'Debe tener menos de {{max}} carácter'\r\n\t\t\t},\r\n\t\t\tsite: {\r\n\t\t\t\tDescription: 'Descripción',\r\n\t\t\t\tshort: 'Corto',\r\n\t\t\t\tfull: 'Lleno',\r\n\t\t\t\tloading: 'Cargando',\r\n\t\t\t\thomeHeadline: 'Houston Dermatología
y Cirugía Plástica',\r\n\t\t\t\t'Plastic Surgery': 'Cirujía plástica',\r\n\t\t\t\t'Med Spa': 'Spa Médico',\r\n\t\t\t\t'Monday': 'Lunes',\r\n\t\t\t\t'Tuesday': 'Martes',\r\n\t\t\t\t'Wednesday': 'Miércoles',\r\n\t\t\t\t'Thursday': 'Jueves',\r\n\t\t\t\t'Friday': 'Viernes',\r\n\t\t\t\t'Saturday': 'Sábado',\r\n\t\t\t\t'Sunday': 'Domingo',\r\n\t\t\t\t'Dermatology': 'Dermatología',\r\n\t\t\t\t'Before / After': 'Antes / Después',\r\n\t\t\t\t'Service Areas': 'Areas de Servicio',\r\n\t\t\t\t'Schedule an Appointment Now': 'Calendariza una cita ahora',\r\n\t\t\t\t'To Main Page': 'A la página principal',\r\n\t\t\t\t'Schedule a visit': 'Programe una visita',\r\n\t\t\t\t'Reviews': 'Comentarios',\r\n\t\t\t\t'Profile': 'Perfil',\r\n\t\t\t\t'Pages': 'Páginas',\r\n\t\t\t\t'Services': 'Servicios',\r\n\t\t\t\t'Inquiries': 'Consultas',\r\n\t\t\t\t'Cases': 'Casos',\r\n\t\t\t\t'Faqs': 'Preguntas más frecuentes',\r\n\t\t\t\t'Ethnicities': 'Etnias',\r\n\t\t\t\t'Users': 'Usuarios',\r\n\t\t\t\t'Locations': 'Ubicaciones',\r\n\t\t\t\t'Doctors': 'Doctores',\r\n\t\t\t\t'Logout': 'Cerrar sesión',\r\n\t\t\t\t'Reviews from our clients': 'Telegrama de nuestros clientes',\r\n\t\t\t\t'Before and after': 'Antes y después',\r\n\t\t\t\t'Dashboard': 'Tablero',\r\n\t\t\t\t'Calendar': 'El calendario',\r\n\t\t\t\t'Home': 'Casa',\r\n\t\t\t\t'Schedule Consultation': 'Consulta de horario',\r\n\t\t\t\t'Contacts': 'Contactos',\r\n\t\t\t\t'Read More': 'Leer Más',\r\n\t\t\t\t'Load More': 'Carga Más',\r\n\t\t\t\t'Wizard': 'Wizard',\r\n\t\t\t\t'Our Team': 'Nuestro Equipo',\r\n\t\t\t\t'Click to see results': 'Click para ver resultados',\r\n\t\t\t\t'What can id do': 'QUÉ PUEDE HACER',\r\n\t\t\t\t'Anesthesia': 'Anestesia',\r\n\t\t\t\t'Combine with': 'Combinar con',\r\n\t\t\t\t'Operation length': 'Duración de la operación',\r\n\t\t\t\t'Recovery Time': 'Tiempo de recuperación',\r\n\t\t\t\t'None': 'Ninguno',\r\n\t\t\t\t'General': 'General',\r\n\t\t\t\t'Sedation': 'Sedación',\r\n\t\t\t\t'Regional': 'Regional',\r\n\t\t\t\t'Local': 'Local',\r\n\t\t\t\t'Fast Preview': 'Vista previa rápida',\r\n\t\t\t\t'Buy': 'Comprar',\r\n\t\t\t\tlearn: 'aprende más',\r\n\t\t\t\t'WARNING': 'ADVERTENCIA:',\r\n\t\t\t\t'This feature contains nudity': 'Esta función contiene desnudos. Haga clic en Aceptar para confirmar que tiene al menos 18 años de edad y que dicho material no le ofende.'\r\n\t\t\t},\r\n\t\t\tseo: {\r\n\t\t\t\thomePage: {\r\n\t\t\t\t\ttitle: 'Houston Dermatología, Cirugía Plástica y Med Spa',\r\n\t\t\t\t\tlink: '/'\r\n\t\t\t\t},\r\n\t\t\t\tdoctorsPage: {\r\n\t\t\t\t\ttitle: 'Nuestros doctores',\r\n\t\t\t\t\tlink: '/practica/doctors'\r\n\t\t\t\t},\r\n\t\t\t\tbeforeAndAfterPage: {\r\n\t\t\t\t\ttitle: 'Fotos de antes y después de la cirugía plástica'\r\n\t\t\t\t},\r\n\t\t\t\tblogPage: {\r\n\t\t\t\t\ttitle: 'Blog',\r\n\t\t\t\t\tlink: '/blog'\r\n\t\t\t\t},\r\n\t\t\t\tfaqPage: {\r\n\t\t\t\t\ttitle: 'Faq',\r\n\t\t\t\t\tlink: '/faq'\r\n\t\t\t\t},\r\n\t\t\t\tpracticePage: {\r\n\t\t\t\t\ttitle: 'Práctica',\r\n\t\t\t\t\tlink: '/practica'\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n/* eslint-enable */\r\n","import * as React from 'react';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\n\r\nimport { I18nextProvider } from 'react-i18next';\r\n\r\nimport { Lang } from '@common/typescript/objects/Lang';\r\n\r\nimport { initI18n } from '@app/i18n';\r\nimport { ApplicationState } from '@app/store';\r\n\r\nconst InitI18n: React.FC = ({ children }) => {\r\n\tconst lang = useSelector((state: ApplicationState) => state.login.lang, shallowEqual);\r\n\treturn \r\n\t\t{children}\r\n\t;\r\n};\r\n\r\nexport default InitI18n;\r\n","import i18n from 'i18next';\r\n\r\nimport translation from '@app/translation';\r\n\r\nexport const initI18n = (initLang: string) => {\r\n\ti18n\r\n\t// load translation using xhr -> see /public/locales\r\n\t// learn more: https://github.com/i18next/i18next-xhr-backend\r\n\t// pass the i18n instance to react-i18next.\r\n\t// init i18next\r\n\t// for all options read: https://www.i18next.com/overview/configuration-options\r\n\t\t.init({\r\n\t\t\tresources: translation,\r\n\t\t\tfallbackLng: 'en',\r\n\t\t\tlng: initLang,\r\n\t\t\tdebug: false,\r\n\t\t\tinterpolation: {\r\n\t\t\t\tescapeValue: false, // not needed for react as it escapes by default\r\n\t\t\t},\r\n\t\t\treact: {\r\n\t\t\t\tuseSuspense: false,\r\n\t\t\t},\r\n\t\t});\r\n\r\n\treturn i18n;\r\n};\r\n","import * as React from 'react';\r\n\r\nimport loadable from '@loadable/component';\r\n\r\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\r\nimport '@common/react/yupLocaleSettings';\r\nimport ErrorBoundary from '@common/react/components/UI/ErrorBoundary/ErrorBoundary';\r\nimport { LoadingProvider } from '@common/react/components/Core/LoadingProvider/LoadingProvider';\r\nimport { NotFoundPageProvider } from '@common/react/components/Core/NotFoundPageProvider/NotFoundPageProvider';\r\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\r\nimport { RequestProvider } from '@common/react/components/RequestProvider/RequestProvider';\r\n\r\nimport '@app/scss/style.scss';\r\nimport '@app/scss/vendor.scss';\r\nimport TranslatedLoading from '@app/components/UI/TranslatedLoading/TranslatedLoading';\r\nimport RouteChangeTracker from '@app/components/Routes/RouteChangeTracker';\r\nimport Gtm from '@app/components/UI/Gtm';\r\nimport CompanySettingsProvider from '@app/components/UI/CompanySettingsProvider';\r\n\r\nconst paramsTranslated = {\r\n\tfallback: ,\r\n};\r\n\r\nconst CustomNotFoundPage = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"CustomNotFoundPage\" */ '@app/components/Pages/NotFoundPage/NotFoundPage')), paramsTranslated);\r\n\r\nconst Layout: React.FC = ({ children }) => \r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t ) as any}>\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t{children}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n
;\r\n\r\nexport default Layout;\r\n","import * as React from 'react';\r\n\r\nimport loadable from '@loadable/component';\r\n\r\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\r\n\r\nimport Header from '@app/components/UI/Header/Header';\r\nimport Footer from '@app/components/UI/Footer/Footer';\r\n\r\nconst FormStyle = loadable(\r\n\t() =>\r\n\t\tloadableDelay(import(/* webpackChunkName: \"FormStyle\" */ '@app/components/Forms/ContactUs/FormStyles')),\r\n\t{ fallback: <>> },\r\n);\r\n\r\nexport const MainLayout: React.FC = (props) => {\r\n\tconst [showPodium, setShowPodium] = React.useState(false);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (showPodium) {\r\n\t\t\tconst script = document.getElementById('podium-widget');\r\n\r\n\t\t\tif (!script) {\r\n\t\t\t\tconst script = document.createElement('script');\r\n\r\n\t\t\t\tscript.src = 'https://connect.podium.com/widget.js#API_TOKEN=087a7109-04c1-4a4e-a315-f789368a2d06';\r\n\t\t\t\tscript.async = true;\r\n\t\t\t\tscript.id = 'podium-widget';\r\n\t\t\t\tscript.setAttribute('data-api-token', '087a7109-04c1-4a4e-a315-f789368a2d06');\r\n\r\n\t\t\t\tdocument.body.appendChild(script);\r\n\t\t\t}\r\n\t\t}\r\n\t}, [showPodium]);\r\n\r\n\tconst handler = React.useCallback(() => setShowPodium(true), []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\twindow.addEventListener('scroll', () => {\r\n\t\t\thandler();\r\n\t\t\twindow.removeEventListener('scroll', handler);\r\n\t\t});\r\n\t}, []);\r\n\r\n\treturn \r\n\t\t{showPodium ?
: null}\r\n\t\t
\r\n\t\t
\r\n\t\t\t{props.children}\r\n\t\t
\r\n\t\t
\r\n\t
;\r\n};\r\n","import * as React from 'react';\r\nimport { Route, RouteProps } from 'react-router-dom';\r\n\r\nimport ErrorBoundary from '@common/react/components/UI/ErrorBoundary/ErrorBoundary';\r\n\r\nimport { MainLayout } from '@app/components/Layouts/MainLayout';\r\n\r\ninterface Props extends RouteProps {\r\n\tcomponent: any;\r\n}\r\n\r\nexport const MainRoute: React.FC = ({ component: Component, ...rest }) => (\r\n\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t/>\r\n);\r\n","import React, { useState, useEffect } from 'react';\n\nvar GA4ReactGlobalIndex = '__ga4React__';\n/**\r\n * @desc class required to manage google analitycs 4\r\n * @class GA4React\r\n * */\n\nclass GA4React {\n constructor(gaCode, gaConfig, additionalGaCode, timeout, options) {\n this.gaCode = gaCode;\n this.gaConfig = gaConfig;\n this.additionalGaCode = additionalGaCode;\n this.timeout = timeout;\n this.options = options;\n this.scriptSyncId = 'ga4ReactScriptSync';\n this.scriptAsyncId = 'ga4ReactScriptAsync';\n this.nonceAsync = '';\n this.nonceSync = '';\n this.gaConfig = gaConfig ? gaConfig : {};\n this.gaCode = gaCode;\n this.timeout = timeout || 5000;\n this.additionalGaCode = additionalGaCode;\n this.options = options;\n\n if (this.options) {\n var {\n nonce\n } = this.options;\n this.nonceAsync = nonce && nonce[0] ? nonce[0] : '';\n this.nonceSync = nonce && nonce[1] ? nonce[1] : '';\n }\n }\n /**\r\n * @desc output on resolve initialization\r\n */\n\n\n outputOnResolve() {\n return {\n pageview: this.pageview,\n event: this.event,\n gtag: this.gtag\n };\n }\n /**\r\n * @desc Return main function for send ga4 events, pageview etc\r\n * @returns {Promise}\r\n */\n\n\n initialize() {\n return new Promise((resolve, reject) => {\n if (GA4React.isInitialized()) {\n reject(new Error('GA4React is being initialized'));\n } // in case of retry logics, remove previous scripts\n\n\n var previousScriptAsync = document.getElementById(this.scriptAsyncId);\n\n if (previousScriptAsync) {\n previousScriptAsync.remove();\n }\n\n var head = document.getElementsByTagName('head')[0];\n var scriptAsync = document.createElement('script');\n scriptAsync.setAttribute('id', this.scriptAsyncId);\n scriptAsync.setAttribute('async', '');\n\n if (this.nonceAsync && typeof this.nonceAsync === 'string' && this.nonceAsync.length > 0) {\n scriptAsync.setAttribute('nonce', this.nonceAsync);\n }\n\n scriptAsync.setAttribute('src', \"https://www.googletagmanager.com/gtag/js?id=\" + this.gaCode);\n\n scriptAsync.onload = () => {\n var target = document.getElementById(this.scriptSyncId);\n\n if (target) {\n target.remove();\n } // in case of retry logics, remove previous script sync\n\n\n var previousScriptSync = document.getElementById(this.scriptSyncId);\n\n if (previousScriptSync) {\n previousScriptSync.remove();\n }\n\n var scriptSync = document.createElement('script');\n scriptSync.setAttribute('id', this.scriptSyncId);\n\n if (this.nonceSync && typeof this.nonceSync === 'string' && this.nonceSync.length > 0) {\n scriptSync.setAttribute('nonce', this.nonceSync);\n }\n\n var scriptHTML = \"window.dataLayer = window.dataLayer || [];\\n function gtag(){dataLayer.push(arguments);};\\n gtag('js', new Date());\\n gtag('config', '\" + this.gaCode + \"', \" + JSON.stringify(this.gaConfig) + \");\";\n\n if (this.additionalGaCode) {\n this.additionalGaCode.forEach(code => {\n scriptHTML += \"\\ngtag('config', '\" + code + \"', \" + JSON.stringify(this.gaConfig) + \");\";\n });\n }\n\n scriptSync.innerHTML = scriptHTML;\n head.appendChild(scriptSync);\n var resolved = this.outputOnResolve();\n Object.assign(window, {\n [GA4ReactGlobalIndex]: resolved\n });\n resolve(resolved);\n };\n\n scriptAsync.onerror = event => {\n if (typeof event === 'string') {\n reject(\"GA4React intialization failed \" + event);\n } else {\n var error = new Error();\n error.name = 'GA4React intialization failed';\n error.message = JSON.stringify(event, ['message', 'arguments', 'type', 'name']);\n reject(error);\n }\n };\n\n var onChangeReadyState = () => {\n switch (document.readyState) {\n case 'interactive':\n case 'complete':\n if (!GA4React.isInitialized()) {\n head.appendChild(scriptAsync);\n document.removeEventListener('readystatechange', onChangeReadyState);\n }\n\n break;\n }\n };\n\n if (document.readyState !== 'complete') {\n document.addEventListener('readystatechange', onChangeReadyState);\n } else {\n onChangeReadyState();\n }\n\n setTimeout(() => {\n reject(new Error('GA4React Timeout'));\n }, this.timeout);\n });\n }\n /**\r\n * @desc send pageview event to gtag\r\n * @param path\r\n */\n\n\n pageview(path, location, title) {\n return this.gtag('event', 'page_view', {\n page_path: path,\n page_location: location || window.location,\n page_title: title || document.title\n });\n }\n /**\r\n * @desc set event and send to gtag\r\n * @param action\r\n * @param label\r\n * @param category\r\n * @param nonInteraction\r\n */\n\n\n event(action, label, category, nonInteraction) {\n if (nonInteraction === void 0) {\n nonInteraction = false;\n }\n\n return this.gtag('event', action, {\n event_label: label,\n event_category: category,\n non_interaction: nonInteraction\n });\n }\n /**\r\n * @desc direct access to gtag\r\n * @param args\r\n */\n\n\n gtag() {\n //@ts-ignore\n return window.gtag(...arguments);\n }\n /**\r\n * @desc ga is initialized?\r\n */\n\n\n static isInitialized() {\n switch (typeof window[GA4ReactGlobalIndex] !== 'undefined') {\n case true:\n return true;\n\n default:\n return false;\n }\n }\n /**\r\n * @desc get ga4react from global\r\n */\n\n\n static getGA4React() {\n if (GA4React.isInitialized()) {\n return window[GA4ReactGlobalIndex];\n } else {\n console.error(new Error('GA4React is not initialized'));\n }\n }\n\n}\n\nvar outputGA4 = (children, setComponents, ga4) => {\n setComponents(React.Children.map(children, (child, index) => {\n if (!React.isValidElement(child)) {\n return React.createElement(React.Fragment, null, child);\n } //@ts-ignore\n\n\n if (child.type && typeof child.type.name !== 'undefined') {\n return React.cloneElement(child, {\n //@ts-ignore\n ga4: ga4,\n index\n });\n } else {\n return child;\n }\n }));\n};\n\nvar GA4R = (_ref) => {\n var {\n code,\n timeout,\n config,\n additionalCode,\n children,\n options\n } = _ref;\n var [components, setComponents] = useState(null);\n useEffect(() => {\n if (!GA4React.isInitialized()) {\n var ga4manager = new GA4React(\"\" + code, config, additionalCode, timeout, options);\n ga4manager.initialize().then(ga4 => {\n outputGA4(children, setComponents, ga4);\n }, err => {\n console.error(err);\n });\n } else {\n var ga4 = GA4React.getGA4React();\n\n if (ga4) {\n outputGA4(children, setComponents, ga4);\n }\n }\n }, []);\n return React.createElement(React.Fragment, null, components);\n};\n\nvar useGA4React = (gaCode, gaConfig, gaAdditionalCode, gaTimeout, options) => {\n var [ga4, setGA4] = useState(undefined);\n useEffect(() => {\n if (gaCode) {\n switch (GA4React.isInitialized()) {\n case false:\n var ga4react = new GA4React(\"\" + gaCode, gaConfig, gaAdditionalCode, gaTimeout, options);\n ga4react.initialize().then(ga4 => {\n setGA4(ga4);\n }, err => {\n console.error(err);\n });\n break;\n\n case true:\n setGA4(GA4React.getGA4React());\n break;\n }\n } else {\n setGA4(GA4React.getGA4React());\n }\n }, [gaCode]);\n return ga4;\n};\n\nfunction withTracker(MyComponent) {\n return props => {\n var {\n path,\n location,\n title,\n gaCode,\n gaTimeout,\n gaConfig,\n gaAdditionalCode,\n options\n } = props;\n useEffect(() => {\n switch (GA4React.isInitialized()) {\n case true:\n var ga4 = GA4React.getGA4React();\n\n if (ga4) {\n ga4.pageview(path, location, title);\n }\n\n break;\n\n default:\n case false:\n var ga4react = new GA4React(\"\" + gaCode, gaConfig, gaAdditionalCode, gaTimeout, options);\n ga4react.initialize().then(ga4 => {\n ga4.pageview(path, location, title);\n }, err => {\n console.error(err);\n });\n break;\n }\n });\n return React.createElement(MyComponent, Object.assign({}, props));\n };\n}\n\nexport default GA4React;\nexport { GA4R, GA4React, useGA4React, withTracker };\n//# sourceMappingURL=ga-4-react.esm.js.map\n","import React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport GA4React from 'ga-4-react';\r\n\r\nimport { useCompanySettingsContext } from '@app/components/UI/CompanySettingsProvider';\r\n\r\nconst RouteChangeTracker: React.FC = ({\r\n\tchildren,\r\n}) => {\r\n\tconst { companySettings: { googleAnalyticsId } } = useCompanySettingsContext();\r\n\r\n\tconst history = useHistory();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (process.env.NODE_ENV === 'production' && googleAnalyticsId && googleAnalyticsId.trim() !== '') {\r\n\t\t\tconst ga4react = new GA4React(googleAnalyticsId);\r\n\r\n\t\t\tga4react.initialize().then((ga4) => {\r\n\t\t\t\tga4.pageview(window.location.pathname + window.location.search);\r\n\r\n\t\t\t\thistory.listen((location, action) => {\r\n\t\t\t\t\tif (GA4React.isInitialized()) {\r\n\t\t\t\t\t\tga4react.pageview(location.pathname + location.search);\r\n\t\t\t\t\t\tga4react.gtag('set', 'page', location.pathname);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}, console.error);\r\n\t\t}\r\n\t}, []);\r\n\r\n\treturn <>{children}>;\r\n};\r\n\r\nexport default RouteChangeTracker;\r\n","import * as React from 'react';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\n\r\n// eslint-disable-next-line\r\nimport once from 'lodash/once';\r\n// eslint-disable-next-line\r\nimport isEmpty from 'lodash/isEmpty';\r\n\r\nimport { ApplicationState } from '@app/store';\r\nimport { Company } from '@app/objects/Company';\r\n\r\nexport interface CompanySettingsContext {\r\n\tcompanySettings: Company;\r\n}\r\n\r\nexport const createCompanySettingsContext = once(() => React.createContext({} as CompanySettingsContext));\r\n\r\nexport const useCompanySettingsContext: () => CompanySettingsContext = () => {\r\n\tconst context: CompanySettingsContext = React.useContext(createCompanySettingsContext());\r\n\r\n\tif (isEmpty(context)) throw 'Need CompanySettings context!';\r\n\r\n\treturn context;\r\n};\r\n\r\nconst CompanySettingsProvider: React.FC = ({\r\n\tchildren,\r\n}) => {\r\n\tconst CompanySettingsContext = createCompanySettingsContext();\r\n\r\n\tconst companySettings = useSelector((state: ApplicationState) => state.companySettings.item, shallowEqual);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{children}\r\n\t\t\t\r\n\t\t>\r\n\t);\r\n};\r\n\r\nexport default CompanySettingsProvider;\r\n","import * as React from 'react';\r\nimport { withTranslation } from 'react-i18next';\r\n\r\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\r\n\r\nimport SocialIcons from '@app/components/UI/SocialIcons/SocialIcons';\r\n\r\nconst Footer: React.FC = (props) => {\r\n\treturn ;\r\n};\r\n\r\nexport default withTranslation()(Footer);\r\n","import React from 'react';\r\nimport TagManager from 'react-gtm-module';\r\n\r\nimport { useCompanySettingsContext } from '@app/components/UI/CompanySettingsProvider';\r\n\r\nconst Gtm: React.FC = () => {\r\n\tconst { companySettings: { googleTagManagerId } } = useCompanySettingsContext();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (process.env.NODE_ENV === 'production' && googleTagManagerId && googleTagManagerId.trim() !== '') {\r\n\t\t\tTagManager.initialize({ gtmId: googleTagManagerId });\r\n\t\t}\r\n\t}, [googleTagManagerId]);\r\n\r\n\treturn <>>;\r\n};\r\n\r\nexport default Gtm;\r\n","import * as React from 'react';\r\nimport { WithTranslation, withTranslation } from 'react-i18next';\r\n\r\nimport { debounce } from '@common/typescript/Utils';\r\n\r\ninterface Props extends WithTranslation {\r\n\tonClick: () => void;\r\n}\r\n\r\nconst BottomButton: React.FC = ({ t, onClick }) => {\r\n\tconst [buttonVisible, changeButtonVisibility] = React.useState(false);\r\n\r\n\tReact.useEffect(\r\n\t\t() => {\r\n\t\t\tconst handleScroll = () => {\r\n\t\t\t\tconst header = document.querySelector('.header-container');\r\n\r\n\t\t\t\tif (header) {\r\n\t\t\t\t\tchangeButtonVisibility(window.scrollY > header.clientHeight + 15);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\twindow.addEventListener('scroll', debounce(handleScroll, 300));\r\n\r\n\t\t\treturn () => window.removeEventListener('scroll', debounce(handleScroll, 300));\r\n\t\t},\r\n\t\t[debounce],\r\n\t);\r\n\r\n\treturn \r\n\t\t\r\n\t
;\r\n};\r\n\r\nexport default withTranslation()(BottomButton);\r\n","import * as React from 'react';\r\n\r\nimport AutoComplete, { AutoCompleteProps } from 'antd/lib/auto-complete';\r\nimport { SelectValue } from 'antd/es/select';\r\nimport { DefaultOptionType } from 'antd/lib/select';\r\nimport Empty from 'antd/lib/empty';\r\n\r\nimport { request } from '@common/react/components/Api';\r\nimport { Rows } from '@common/typescript/objects/List';\r\nimport { debounce } from '@common/typescript/Utils';\r\nimport { getPopupContainer as getDefaultPopupContainer } from '@common/react/components/Utils/Utils';\r\nimport { WithId } from '@common/typescript/objects/WithId';\r\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\r\nimport { BaseUser } from '@common/react/objects/BaseUser';\r\nimport { BaseApplicationState } from '@common/react/store';\r\nimport { isFunction, isUndefined } from '@common/react/utils/guards';\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\nimport SimpleLoader from '@common/react/components/UI/SimpleLoader/SimpleLoader';\r\n\r\nexport const Option = AutoComplete.Option;\r\n\r\ninterface AutocompleteState {\r\n\titems: Array;\r\n\tvalue: string;\r\n\tisLoading: boolean;\r\n\tloadedForParams: Nullable