>\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 { ReducersMapObject } from 'redux';\n\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';\nimport { Page } from '@commonTuna/react/objects/Page';\n\nimport { User } from '@app/objects/User';\n\n// The top-level state object\nexport interface ApplicationState extends BaseApplicationState {\n\tserverPage: PageItemState;\n\n\tbuildData: Item.ItemState;\n\tinitDoctors: ItemsProviderStoreState;\n\n\tmenu: ItemsProviderStoreState;\n\n\toffices: ItemsProviderStoreState;\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: getIPStoreReducer('menu'),\n\n\toffices: getIPStoreReducer('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 { clientRoutes } 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(clientRoutes, 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 &&
{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","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 React from 'react';\n\nimport { FormikProps } from 'formik';\n\ninterface FormikRefProps {\n\tformikRef: React.MutableRefObject | null>;\n\tformikBug: FormikProps;\n}\n\nconst FormikRef: React.FC = ({ formikRef, formikBug }) => {\n\tReact.useEffect(() => {\n\t\tif (formikRef) {\n\t\t\tformikRef.current = formikBug;\n\t\t}\n\t}, [formikBug]);\n\n\treturn <>>;\n};\n\nexport default FormikRef;\n","import React from 'react';\n\n// @eslint-disable-next-line\nimport { unstable_useBlocker as useBlocker } from 'react-router-dom';\n\nimport { Location } from 'history';\n\nimport { useModal } from '@common/react/components/Modal/ModalContextProvider';\nimport { BaseParams } from '@common/react/objects/BaseParams';\n\nexport interface LeaveConfirmationModalProps {\n\thandleBlockedNavigation: (nextLocation: Location) => boolean;\n\twhen?: boolean;\n\tonOk: (leaveLocation: () => void) => void;\n\tmessage?: string;\n\tcancelText?: string;\n\tokText?: string;\n\tonCancel?: () => void;\n\tconfirmProps?: BaseParams;\n}\n\nconst LeaveConfirmationModal: React.FC = ({\n\twhen, handleBlockedNavigation, onOk, cancelText = 'No', okText = 'Yes', onCancel, ...rest\n}) => {\n\tconst { message = 'Leave the page?' } = rest;\n\tconst modalContext = useModal();\n\tconst blocker = useBlocker(({ currentLocation, nextLocation }) => {\n\t\tif (!when) return false;\n\t\tif (`${currentLocation.pathname}${currentLocation.search}` === `${nextLocation.pathname}${nextLocation.search}`) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !handleBlockedNavigation(nextLocation);\n\t});\n\n\tReact.useEffect(() => {\n\t\tif (blocker.state === 'blocked' && !when) {\n\t\t\tblocker.reset();\n\t\t}\n\t\tif (blocker.state === 'blocked' && when) {\n\t\t\tmodalContext.openConfirm({\n\t\t\t\ttitle: '',\n\t\t\t\tcontent: message,\n\t\t\t\tcancelText: 'No',\n\t\t\t\tokText: 'Yes',\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tblocker.proceed?.();\n\t\t\t\t\tonCancel && onCancel();\n\t\t\t\t},\n\t\t\t\tonOk: () => {\n\t\t\t\t\tconst handleLeave = () => {\n\t\t\t\t\t\tblocker.proceed?.();\n\t\t\t\t\t};\n\t\t\t\t\tonOk(handleLeave);\n\t\t\t\t},\n\t\t\t\t...rest.confirmProps,\n\t\t\t});\n\t\t}\n\t}, [when, blocker]);\n\n\treturn (\n\t\t<>>\n\t);\n};\n\nexport default LeaveConfirmationModal;\n","/**\n * ## ItemEditor.tsx ##\n * This file contains ItemEditor component\n * @packageDocumentation\n * */\n\nimport React from 'react';\nimport { useLocation } from 'react-router-dom';\n\nimport {\n\tForm, Formik, FormikProps, FormikConfig, FormikHelpers,\n} from 'formik';\nimport { isEqual } from 'lodash';\n\nimport { WithDeleted } from '@common/typescript/objects/WithDeleted';\nimport { Loading } from '@common/react/components/UI/Loading/Loading';\nimport Button from '@common/react/components/Forms/Button';\nimport {\n\tuseItemProviderContext,\n\tItemProviderContextState,\n} from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\nimport FormikRef from '@common/react/components/Core/ItemEditor/FormikRef';\nimport LeaveConfirmationModal, { LeaveConfirmationModalProps } from '@common/react/components/Modal/LeaveConfirmationModal';\nimport { useModal } from '@common/react/components/Modal/ModalContextProvider';\n\ninterface State extends ItemProviderContextState {\n\tsuccess?: boolean;\n\thaveChanges?: boolean;\n}\n\n/**\n * This is the description of the interface. Requires ItemProvider wrapper\n *\n * @interface ItemEditorProps\n * @typeParam T - T Any WithDeleted entity\n */\ninterface ItemEditorProps {\n\t/**\n\t * render function in edit mode\n\t * @param formikBag - formik data object. FormikProps\n\t * @param deleteItem - function from the ItemProvider context. Submit a request to remove an item\n\t * @param state - itemProvider state,\n\t * @param toggleReadonly - function changing viewing mode\n\t * @return React.ReactNode\n\t */\n\tedit: (formikBag: FormikProps, deleteItem: () => void, state: State, toggleReadonly: () => void) => React.ReactNode;\n\t/**\n\t * render function in view mode\n\t * @param item - item from ItemProvider\n\t * @param toggleReadonly - function changing viewing mode\n\t * @return React.ReactNode\n\t */\n\tview?: (item: T, toggleReadonly: () => void) => React.ReactNode;\n\t/**\n\t * function that determines the initial value for the form\n\t * @param item - item from ItemProvider\n\t */\n\tgetInitialValues?: (item: T) => any;\n\t/**\n\t * element shown when loading. Default }/>\n\t */\n\tloadingNode?: React.ReactNode;\n\t/**\n\t * link to get formikBag outside the form\n\t */\n\tformRef?: any;\n\t/**\n\t * formik properties. It is possible to overwrite values such as initialValues, onSubmit, validationSchema\n\t */\n\tformikProps?: Partial>;\n\t/**\n\t * callback after item is saved\n\t * - For example: make some changes at state\n\t * @param item - saved item from ItemProvider\n\t * @param res - request response\n\t * @param values - form values before send\n\t */\n\tafterSubmit?: (item: T, res: any, values: T) => void;\n\t/**\n\t * callback before send request\n\t * - For example. You can show a modal confirmation before sending the request\n\t * @param values - current form values\n\t * @param actions - form actions\n\t * @param submit - item save function\n\t */\n\tbeforeSubmit?: (values: T, actions, submit: () => Promise) => void;\n\t/**\n\t * if true and customButtons are not defined, default buttons will be displayed\n\t */\n\twithButtons?: boolean;\n\t/**\n\t * function to handle cancel button click. If not defined, the cancel button will not be displayed\n\t */\n\tonCancel?: () => void;\n\t/**\n\t * function to show custom buttons\n\t * @param item - item from ItemProvider\n\t * @param formikBag - formik data object. FormikProps\n\t * @param disabled - disabled for save button\n\t * @param submit\n\t * @return React.ReactNode\n\t */\n\tcustomButtons?: (item: T, formikBag: FormikProps, disabled, submit: () => Promise) => React.ReactNode;\n\t/**\n\t * add some custom buttons near default submit button\n\t */\n\tbuttons?: React.ReactNode;\n\t/**\n\t * the time during which success messages will be displayed. Default 5000 ms\n\t */\n\tshowMessageDuration?: number;\n\t/**\n\t * by default 'Successfully saved'\n\t */\n\tsuccessMessage?: string;\n\t/**\n\t * determines whether the form values need to be reset after saving. Default true\n\t */\n\tresetFormAfterSubmit?: boolean;\n\t/**\n\t * determines whether error or success messages should be shown. Default true\n\t */\n\tshowMessages?: boolean;\n\t/**\n\t * readonly mode flag. Default value get from context\n\t */\n\treadonly?: boolean;\n\t/**\n\t * get request name before submit form\n\t */\n\tgetRequestName?: (values) => string;\n\t/**\n\t * the save button is disabled if there are no changes to the form\n\t */\n\tdetectChanges?: boolean;\n\t/**\n\t * text at default save button\n\t */\n\tsaveText?: string;\n\t/**\n\t * LeaveConfirmationModal component props\n\t */\n\tleaveConfirmationModalProps?: Omit;\n\t/**\n\t * custom equality check function. By default isEqual from lodash\n\t */\n\tcustomEqual?: (initialValues, values) => boolean;\n\t/**\n\t * custom formProps\n\t */\n\tformProps?: React.FormHTMLAttributes;\n}\n\nconst ItemEditorMessage: React.FC<{message: string}> = ({ message }) => {\n\tconst ref = React.useRef(null);\n\tReact.useEffect(() => {\n\t\tif (message) {\n\t\t\tref.current?.scrollIntoView({ block: 'center', behavior: 'auto' });\n\t\t}\n\t}, [message]);\n\n\treturn <>\n\t\t{message ? {message}
: null}\n\t>;\n};\n\n/**\n * ItemEditor component.\n *\n * @typeParam T - T Any {WithDeleted}\n * @param props - ItemEditorProps\n * @type {React.FC}\n * @returns React.ReactNode\n */\nexport const ItemEditor: (p: ItemEditorProps) => React.ReactElement = (props) => {\n\tconst context = useItemProviderContext();\n\n\tif (!context.state) throw 'Need ItemProvider context!';\n\n\tconst {\n\t\tstate: {\n\t\t\titem, loading, itemLoading, readonly: readonlyContext, error, validationSchema, type, message, transformAfterSave, getIdAfterSave,\n\t\t},\n\t\tactions: {\n\t\t\tupdate, deleteItem, setMessage, setError,\n\t\t},\n\t} = context;\n\tconst readonlyProps = props.readonly;\n\tconst preventAfterSubmit = React.useRef(false);\n\tconst ref = React.useRef>(null as any);\n\tconst location = useLocation();\n\n\tconst [readonly, setReadonly] = React.useState(readonlyProps ?? readonlyContext);\n\tconst {\n\t\tgetInitialValues = (item) => item,\n\t\tloadingNode = } />,\n\t\tformRef,\n\t\tformikProps,\n\t\tafterSubmit,\n\t\tview = () => {\n\t\t\treturn null;\n\t\t},\n\t\tedit,\n\t\twithButtons,\n\t\tonCancel,\n\t\tcustomButtons,\n\t\tbuttons,\n\t\tresetFormAfterSubmit = true,\n\t\tshowMessages = true,\n\t\tbeforeSubmit: defaultBeforeSubmit = null,\n\t\tshowMessageDuration = 5000,\n\t\tsuccessMessage = 'Successfully saved',\n\t\tgetRequestName,\n\t\tdetectChanges,\n\t\tsaveText = 'Save',\n\t\tleaveConfirmationModalProps = {},\n\t\tcustomEqual = isEqual,\n\t\tformProps,\n\t} = props;\n\n\tconst {\n\t\tmessage: leaveModalMessage = 'There is unsaved data on the current page. Save before leaving?',\n\t\thandleBlockedNavigation = (nextLocation) => nextLocation.pathname.includes(location.pathname),\n\t\t...otherLeaveConfirmationModalProps\n\t} = leaveConfirmationModalProps;\n\n\tconst modalContext = useModal();\n\n\tReact.useEffect(() => {\n\t\tconst callback = () => setReadonly(readonlyProps ?? readonlyContext);\n\t\tconst haveChanges = detectChanges ? !ref.current\n\t\t\t|| !customEqual(formikProps?.initialValues ?? ref.current.initialValues, ref.current.values) : false;\n\t\tif (haveChanges && ref.current && (readonlyProps ?? readonlyContext) && !readonly) {\n\t\t\tmodalContext.openConfirm({\n\t\t\t\tonCancel: callback,\n\t\t\t\tonOk: () => {\n\t\t\t\t\tpreventAfterSubmit.current = false;\n\t\t\t\t\tref.current?.submitForm()\n\t\t\t\t\t\t.then(() => callback());\n\t\t\t\t},\n\t\t\t\tcontent: leaveModalMessage,\n\t\t\t\tcancelText: otherLeaveConfirmationModalProps.cancelText || 'No',\n\t\t\t\tokText: otherLeaveConfirmationModalProps.okText || 'Yes',\n\t\t\t});\n\t\t} else {\n\t\t\tcallback();\n\t\t}\n\t}, [readonlyProps ?? readonlyContext, formikProps?.initialValues]);\n\n\tconst handleSubmit = (values: T, actions: FormikHelpers, beforeSubmit = defaultBeforeSubmit) => {\n\t\tconst submit = () => update(values, true, getRequestName ? getRequestName(values) : undefined)\n\t\t\t.then((res) => {\n\t\t\t\tsetMessage(successMessage);\n\t\t\t\thideSuccess();\n\t\t\t\tconst newValues = { ...transformAfterSave(values, res, item), id: getIdAfterSave(res, values) };\n\t\t\t\tif (resetFormAfterSubmit) {\n\t\t\t\t\tactions?.resetForm({\n\t\t\t\t\t\tvalues: getInitialValues(newValues),\n\t\t\t\t\t\tsubmitCount: 0,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t!preventAfterSubmit.current && afterSubmit && afterSubmit(newValues, res, values);\n\t\t\t\t\tpreventAfterSubmit.current = false;\n\t\t\t\t}, 0);\n\t\t\t});\n\n\t\treturn beforeSubmit == null ? submit() : beforeSubmit(values, actions, submit);\n\t};\n\n\tconst toggleReadonly = () => {\n\t\tsetReadonly((prev) => !prev);\n\t};\n\n\tconst hideSuccess = () => {\n\t\tsetTimeout(() => {\n\t\t\tsetMessage('');\n\t\t}, showMessageDuration < 500 ? 500 : showMessageDuration);\n\t};\n\n\tif (itemLoading || !item) {\n\t\treturn loadingNode;\n\t}\n\n\tif (readonly) {\n\t\treturn view(item, toggleReadonly);\n\t}\n\n\treturn {\n\t\t\tconst obj = new Proxy(values, {\n\t\t\t\tget: (target, prop) => {\n\t\t\t\t\tif (typeof prop === 'string' && !prop.includes('$')) {\n\t\t\t\t\t\tif (target && !(prop in target) && prop !== 'then' && prop !== 'catch') {\n\t\t\t\t\t\t\tsetError(`${prop} property is missing from Item`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn target[prop];\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn formikProps?.validate?.(obj) || validationSchema?.validate(obj, { abortEarly: false })\n\t\t\t\t.then(() => undefined)\n\t\t\t\t.catch((err) => {\n\t\t\t\t\tconst obj: any = {};\n\t\t\t\t\tif (typeof err === 'string') {\n\t\t\t\t\t\treturn err;\n\t\t\t\t\t}\n\t\t\t\t\tObject.keys(err)\n\t\t\t\t\t\t.filter((key) => err[key] !== 'ValidationError')\n\t\t\t\t\t\t.forEach((key) => {\n\t\t\t\t\t\t\tif (err[key]) obj[key] = err[key];\n\t\t\t\t\t\t});\n\t\t\t\t\treturn obj;\n\t\t\t\t});\n\t\t}}\n\t>\n\t\t{(formikBag: FormikProps) => {\n\t\t\tconst haveChanges = detectChanges ? !customEqual(formikProps?.initialValues ?? formikBag.initialValues, formikBag.values) : false;\n\t\t\tref.current = formikBag;\n\t\t\treturn ;\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 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 0 ? field.value : null}\n\t\tonChange={(value: any) => form.setFieldValue(field.name, +value?.value)}\n\t\toptions={items.map((doctor) => ({\n\t\t\tvalue: doctor.id,\n\t\t\tlabel: language === Lang.Es ? doctor.nameEs : doctor.nameEn,\n\t\t}))}\n\t/>;\n};\n\nexport default DoctorSelect;\n","import React, { PropsWithChildren } from 'react';\n\nimport { WithDeleted } from '@common/typescript/objects/WithDeleted';\nimport {\n\tItemsProvider,\n\tuseItemsProviderContext,\n\tItemsProviderProps,\n\tcreateItemsProviderContext,\n\tdefaultTransformFiltersBeforeHandleUrl,\n\tSortingDirection,\n\tItemsProviderContextActions,\n\tWithKey, ItemsProviderContext,\n} from '@common/react/components/Core/ItemsProvider/ItemsProvider';\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\nimport { getSearchParamsFromUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\n\nexport interface AdvancedItemsProviderProps extends ItemsProviderProps {\n\tfilterHandler: (item, filters) => boolean | Promise;\n\tdefaultSort?: [string, SortingDirection];\n\tsortHandler?: (item1, item2, filters) => number; // return number as function for Array.sort\n}\n\ninterface AdvancedItemsHandlerProps {\n\tfilterHandler: (item, filters) => any;\n\tdefaultSort?: [string, SortingDirection];\n\tsortHandler?: (item1, item2, filters) => number;\n\tadd?: (items: Array) => any;\n\taddedFirst?: boolean;\n}\n\nexport interface AdvancedItemsProviderContextActions extends ItemsProviderContextActions {\n\taddItem: (item: T) => void;\n\treloadItems: (params?: BaseParams) => void;\n\tdeleteItem: (item: Omit, 'id'> & WithDeleted) => void;\n}\n\nexport const checkFilterProp = (value: any) => {\n\tif (value === undefined || value === null || value === '') {\n\t\treturn false;\n\t}\n\tif (typeof value === 'number') {\n\t\treturn value > -1;\n\t}\n\tif (typeof value === 'string') {\n\t\tif (!isNaN(+value)) {\n\t\t\treturn +value > -1;\n\t\t}\n\t}\n\tif (Array.isArray(value)) {\n\t\treturn value.length > 0;\n\t}\n\treturn true;\n};\n\nexport const findId = (array, id) => {\n\treturn array.find((i) => +i === +id);\n};\n\nconst defaultSortHandler = (item1, item2, filters, defaultSort: [string, SortingDirection]) => {\n\tconst { column } = filters;\n\tif (column) {\n\t\tconst [prop, type] = column;\n\t\tif (type === SortingDirection.Ascending) {\n\t\t\treturn item1[prop] - item2[prop];\n\t\t}\n\t\tif (type === SortingDirection.Descending) {\n\t\t\treturn item2[prop] - item1[prop];\n\t\t}\n\t}\n\tconst [prop, type] = defaultSort;\n\tif (type === SortingDirection.Ascending) {\n\t\treturn item1[prop] - item2[prop];\n\t}\n\tif (type === SortingDirection.Descending) {\n\t\treturn item2[prop] - item1[prop];\n\t}\n\treturn 0;\n};\n\nexport const useAdvancedItemsProviderContext = () => useItemsProviderContext>();\n\nconst AdvancedItemsHandler = (p: PropsWithChildren) => {\n\tconst {\n\t\tchildren,\n\t\tfilterHandler,\n\t\tsortHandler,\n\t\tdefaultSort = ['sortOrder', SortingDirection.Ascending],\n\t} = p;\n\tconst ItemsContext = createItemsProviderContext();\n\n\tconst context = useItemsProviderContext();\n\n\tif (!context.state) throw 'Need ItemsProvider context!';\n\n\tconst {\n\t\tstate: {\n\t\t\titems: itemsProp, pagination, filters, loading, loaders, edits, errors, error,\n\t\t},\n\t\tactions: {\n\t\t\tsetItems, reload, load, setEdit,\n\t\t},\n\t} = context;\n\n\tconst [id, setId] = React.useState(-1);\n\n\tconst value = React.useMemo(() => {\n\t\tconst { pageSize, current } = pagination;\n\n\t\tconst isFirstPage = current === 1;\n\n\t\tconst items = itemsProp.slice(isFirstPage ? 0 : 1)\n\t\t\t.slice(0, pageSize - 2 + Object.keys(edits)\n\t\t\t\t.filter((key) => +key < 0).length);\n\n\t\tconst handledPagination = {\n\t\t\t...(pagination || { current: 1, pageSize: 10, total: 0 }),\n\t\t\tpageSize: pagination.pageSize ? pagination.pageSize - 2 : 10,\n\t\t};\n\n\t\tconst handleReload = (params) => {\n\t\t\tconst pageSize = params?.pageSize || pagination.pageSize - 2;\n\t\t\tconst current = params?.current || pagination.current;\n\t\t\tconst isFirstPage = current === 1;\n\n\t\t\treturn reload({\n\t\t\t\t...params,\n\t\t\t\tpageSize: params?.pageSize ? params.pageSize + 2 : undefined,\n\t\t\t\toffset: isFirstPage ? 0 : pageSize * (current - 1) - 1,\n\t\t\t});\n\t\t};\n\n\t\tconst addItem = (item) => {\n\t\t\tPromise.resolve(filterHandler(item, filters)).then((res) => {\n\t\t\t\tif (res) {\n\t\t\t\t\tconst newItems = sortHandler || defaultSort\n\t\t\t\t\t\t? itemsProp.concat(item)\n\t\t\t\t\t\t\t.sort((item1, item2) =>\n\t\t\t\t\t\t\t\t(sortHandler ? sortHandler(item1, item2, filters)\n\t\t\t\t\t\t\t\t\t: defaultSortHandler(item1, item2, filters, defaultSort)))\n\t\t\t\t\t\t: itemsProp.concat(item);\n\t\t\t\t\tif (itemsProp.length > pagination.pageSize) {\n\t\t\t\t\t\tnewItems.pop();\n\t\t\t\t\t}\n\t\t\t\t\tsetItems(newItems);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst add = (item?: any) => {\n\t\t\tsetId((id) => id - 1);\n\n\t\t\tconst newItem = item ? { ...item, id } : { ...p.add?.(itemsProp), id };\n\n\t\t\tconst newItems = p.addedFirst\n\t\t\t\t? isFirstPage ? [newItem].concat(itemsProp) : [...itemsProp.slice(0, 1), newItem, ...itemsProp.slice(1)]\n\t\t\t\t: [\n\t\t\t\t\t...itemsProp.slice(0, itemsProp.length - (isFirstPage ? 2 : 1)),\n\t\t\t\t\tnewItem,\n\t\t\t\t\t...itemsProp.slice(itemsProp.length - (isFirstPage ? 2 : 1)),\n\t\t\t\t];\n\n\t\t\tsetItems(newItems);\n\n\t\t\tsetEdit(newItem);\n\t\t\treturn newItem;\n\t\t};\n\n\t\tconst deleteItem = (id) => {\n\t\t\tsetItems(itemsProp.filter((item) => item.id !== id));\n\t\t};\n\n\t\tconst reloadItems = () => {\n\t\t\treturn load({ ...pagination, pageSizeOptions: undefined }, true);\n\t\t};\n\n\t\tconst updateItem = (item) => {\n\t\t\tsetItems(itemsProp.map((el) => (el.id === item.id ? { ...el, ...item } : el)));\n\t\t};\n\n\t\treturn {\n\t\t\tstate: {\n\t\t\t\t...context.state,\n\t\t\t\titems,\n\t\t\t\tpagination: handledPagination,\n\t\t\t\tadvancedItems: itemsProp,\n\t\t\t},\n\t\t\tactions: {\n\t\t\t\t...context.actions,\n\t\t\t\treload: handleReload,\n\t\t\t\taddItem,\n\t\t\t\treloadItems,\n\t\t\t\tupdateItem,\n\t\t\t\tdeleteItem,\n\t\t\t\tadd,\n\t\t\t},\n\t\t};\n\t}, [itemsProp, pagination, loading, filters, loaders, edits, errors, error, p.add]);\n\n\treturn (\n\t\t\n\t\t\t{typeof children === 'function' ? children(value) : children}\n\t\t \n\t);\n};\n\nconst AdvancedItemsProvider = (p: AdvancedItemsProviderProps) => {\n\tconst { children } = p;\n\n\tconst pagination = {\n\t\t...(p.pagination || { current: 1, pageSize: 12, total: 0 }),\n\t\tpageSize: p.pagination?.pageSize ? p.pagination.pageSize + 2 : 12,\n\t};\n\n\tconst transformFiltersBeforeHandleUrl = (filters) => {\n\t\tconst urlFilters = defaultTransformFiltersBeforeHandleUrl({\n\t\t\t...filters,\n\t\t\tpageSize: filters.pageSize ? filters.pageSize - 2 : undefined,\n\t\t\tcount: filters.pageSize || filters.count ? (filters.count || filters.pageSize) - 2 : undefined,\n\t\t});\n\n\t\treturn p.transformFiltersBeforeHandleUrl ? p.transformFiltersBeforeHandleUrl(urlFilters) : urlFilters;\n\t};\n\n\tconst searchParamsFromUrl = (location, prefix?: string) => {\n\t\tconst params = getSearchParamsFromUrl(location, prefix);\n\t\tconst pageSize = params[`${prefix || ''}pageSize`];\n\n\t\treturn {\n\t\t\t...params,\n\t\t\t[`${prefix || ''}pageSize`]: pageSize ? pageSize + 2 : 12,\n\t\t};\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{children}\n\t\t\t \n\t\t \n\t);\n};\n\nexport default AdvancedItemsProvider;\n","/**\n * ## ItemsProviderWithStore.tsx ##\n * This file contains ItemsProviderWithStore component\n * @packageDocumentation\n */\nimport React from 'react';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport { TypeKeys, ItemsState } from '@common/react/store/ItemsProviderStore';\n\nimport {\n\tItemsProvider,\n\tItemsProviderProps,\n\tuseItemsProviderContext,\n\tWithKey,\n\tItemsProviderContextState,\n\tSortingDirection,\n\tItemsProviderContextActions,\n} from '@common/react/components/Core/ItemsProvider/ItemsProvider';\nimport { equal } from '@common/typescript/Utils';\nimport AdvancedItemsProvider from '@common/react/components/Core/AdvancedItemsProvider/AdvancedItemsProvider';\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\n\ninterface ItemsHandlerProps extends ItemsProviderProps {\n\tchildren: React.ReactNode | ((state: ItemsProviderContextState, actions: ItemsProviderContextActions) => React.ReactNode);\n\tstoreName: string;\n\tinitLoad: boolean;\n\tstoreData: ItemsState;\n}\n\nexport interface ItemsProviderWithStoreProps extends ItemsProviderProps {\n\t/**\n\t * - 1. ReactElement to be wrapped in an ItemsProviderWithStore context\n\t * - 2. function with ItemsProviderWithStore state as first argument\n\t */\n\tchildren: React.ReactNode | ((state: ItemsProviderContextState) => React.ReactNode);\n\t/**\n\t * property in redux that stores data for ItemsProviderWithStore.\n\t */\n\tstoreName: string;\n\t/**\n\t * default element sorting. Used to define the position of a new element.\n\t *\n\t * (only for AdvancedItemsProvider)\n\t *\n\t * If defaultSort and filterHandler are present, AdvancedItemsProvider will be used.\n\t */\n\tdefaultSort?: [string, SortingDirection];\n\t/**\n\t * default element sorting. Determines whether a new element should be displayed with the current filters\n\t *\n\t * (only for AdvancedItemsProvider)\n\t *\n\t * If defaultSort and filterHandler are present, AdvancedItemsProvider will be used.\n\t */\n\tfilterHandler?: (item, filters) => boolean | Promise;\n\t/**\n\t * Custom sorting of elements after adding a new one.\n\t *\n\t * (only for AdvancedItemsProvider)\n\t *\n\t * If defaultSort and filterHandler are present, AdvancedItemsProvider will be used.\n\t */\n\tsortHandler?: (item1, item2, filters) => number;\n\t/**\n\t * init load option\n\t */\n\tskipInitLoad?: boolean;\n\t/**\n\t * the value from the store will be used directly and not just the starting state\n\t */\n\tsyncStoreItems?: boolean;\n}\n\nconst getParamsFromItemProvider = (filters, pagination) => {\n\treturn {\n\t\t...filters,\n\t\t...{\n\t\t\tcount: pagination?.pageSize || 10,\n\t\t\tcurrent: filters?.page || pagination?.current || 1,\n\t\t\tpageSize: undefined,\n\t\t\tpage: undefined,\n\t\t},\n\t};\n};\n\nconst ItemsHandler = ({\n\tstoreName, initLoad, storeData, ...p\n} : ItemsHandlerProps) => {\n\tconst { children } = p;\n\n\tconst context = useItemsProviderContext();\n\n\tconst {\n\t\tstate: {\n\t\t\titems,\n\t\t\tfilters,\n\t\t\tpagination,\n\t\t\terror,\n\t\t},\n\t\tactions: { load },\n\t} = context;\n\tconst [initUpdate, setInitUpdate] = React.useState(true);\n\n\tconst dispatch = useDispatch();\n\n\tReact.useEffect(() => {\n\t\tif (initLoad) {\n\t\t\tload({})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tif (typeof error === 'string' && error.includes('aborted')) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tload({})\n\t\t\t\t\t\t.catch((e) => {\n\t\t\t\t\t\t\tconsole.log(e);\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif ((!initUpdate || (storeData?.isEmpty && !initLoad))) {\n\t\t\tdispatch({\n\t\t\t\titems,\n\t\t\t\tparams: getParamsFromItemProvider({ ...p.unhandledFilters, ...filters }, pagination),\n\t\t\t\ttype: TypeKeys.SETITEMS,\n\t\t\t\tstorageName: storeName,\n\t\t\t\tobjectType: p.type,\n\t\t\t\ttotal: pagination.total || items?.length,\n\t\t\t\tcurrent: pagination.current,\n\t\t\t\tisEmpty: !!error,\n\t\t\t});\n\t\t}\n\t\tsetInitUpdate(false);\n\t}, [items, error]);\n\n\treturn (\n\t\t<>\n\t\t\t{typeof children === 'function' ? children(context.state, context.actions) : children}\n\t\t>\n\t);\n};\n\n/**\n * ItemsProviderWithStore component.\n *\n * usage examples:\n * - {React.ReactNode}\n * - {(state, actions) => React.ReactNode}\n * - SingleItem}/>\n *\n * if you need to use the AdvancedItemsProvider, you must provide a defaultSort and filterHandler.\n * - false}>{(state, actions) => React.ReactNode}\n *\n * @typeParam T - T Any {WithKey}\n * @param props - ItemsProviderWithStoreProps\n * @type {React.FC}\n * @returns React.ReactElement\n */\nconst ItemsProviderWithStore = (props: ItemsProviderWithStoreProps) => {\n\tconst { children, syncStoreItems } = props;\n\tconst {\n\t\tstoreName, defaultSort, filterHandler, sortHandler, skipInitLoad = false, ...p\n\t} = props;\n\tconst store = useSelector((state) => state[storeName], shallowEqual) as ItemsState;\n\tconst context = useItemsProviderContext();\n\tconst loading = context?.state?.type === p.type && (context?.state?.loading || store?.isEmpty);\n\tconst dispatch = useDispatch();\n\n\tconst itemsData = React.useMemo(() => {\n\t\tconst data = { items: p.items ?? store.items, pagination: p.pagination, fromStore: skipInitLoad };\n\t\tif (!store || skipInitLoad) {\n\t\t\treturn data;\n\t\t}\n\t\tconst currentParams = getParamsFromItemProvider({ ...p.unhandledFilters, ...p.filters }, p.pagination);\n\t\tconst storeParams = { ...store.params, count: store.params.count || 10, current: store.params.current || 1 };\n\n\t\treturn currentParams.count === storeParams.count && currentParams.count === storeParams.count\n\t\t&& equal(\n\t\t\t{ ...currentParams, count: undefined, current: undefined },\n\t\t\t{ ...storeParams, count: undefined, current: undefined },\n\t\t)\n\t\t\t? { items: p.items || store.items, pagination: p.pagination || store.pagination, fromStore: !store.isEmpty || !!p.items } : data;\n\t}, [!loading]);\n\n\tif (loading) {\n\t\treturn ;\n\t}\n\n\tconst onItemsChange = (items, filters, res) => {\n\t\tif (!syncStoreItems) return;\n\t\tdispatch({\n\t\t\titems,\n\t\t\tparams: getParamsFromItemProvider(filters, { current: filters?.current }),\n\t\t\ttype: TypeKeys.SETITEMS,\n\t\t\tstorageName: storeName,\n\t\t\tobjectType: p.type,\n\t\t\ttotal: res?.count || items?.length,\n\t\t\tcurrent: filters?.current,\n\t\t\tisEmpty: false,\n\t\t});\n\t};\n\n\treturn (\n\t\t!!defaultSort && !!filterHandler\n\t\t\t? (\n\t\t\t\t\n\t\t\t\t\tdefaultSort={defaultSort}\n\t\t\t\t\tfilterHandler={filterHandler}\n\t\t\t\t\tsortHandler={sortHandler}\n\t\t\t\t\t{...p}\n\t\t\t\t\titems={itemsData.items}\n\t\t\t\t\tuseSyncItemsInsteadHook={syncStoreItems}\n\t\t\t\t\tsyncItems={syncStoreItems ? store.items : undefined}\n\t\t\t\t\tonItemsChange={onItemsChange}\n\t\t\t\t\tskipInitLoad={syncStoreItems ? !!(itemsData.fromStore || p.items) : undefined}\n\t\t\t\t\tpagination={{ ...itemsData.pagination, current: itemsData.pagination?.current || 1 }}\n\t\t\t\t>\n\t\t\t\t\t{syncStoreItems\n\t\t\t\t\t\t? ((context) => (typeof children === 'function' ? (children as any)(context.state, context.actions) : children))\n\t\t\t\t\t\t: \n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t }\n\t\t\t\t \n\t\t\t)\n\t\t\t: (\n\t\t\t\t\n\t\t\t\t\t{...p}\n\t\t\t\t\titems={itemsData.items}\n\t\t\t\t\tpagination={itemsData.pagination}\n\t\t\t\t\tonItemsChange={onItemsChange}\n\t\t\t\t\tuseSyncItemsInsteadHook={syncStoreItems}\n\t\t\t\t\tsyncItems={syncStoreItems ? store.items : undefined}\n\t\t\t\t\tskipInitLoad={syncStoreItems ? !(itemsData.fromStore || p.items) : undefined}\n\t\t\t\t>\n\t\t\t\t\t{syncStoreItems\n\t\t\t\t\t\t? ((context) => (typeof children === 'function' ? (children as any)(context.state, context.actions) : children))\n\t\t\t\t\t\t: \n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t }\n\t\t\t\t \n\t\t\t)\n\t);\n};\n\nexport default ItemsProviderWithStore;\n","import * as React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport ItemsProviderWithStore from '@common/react/components/Core/ItemsProviderWithStore/ItemsProviderWithStore';\n\nimport { Location } from '@commonTuna/react/objects/BaseLocation';\n\nimport LocationName from '@app/components/UI/LocationName/LocationName';\nimport Select from '@app/components/UI/BseSelect';\n\ninterface LocationSelectProps {\n\titems: Array;\n\tform: any;\n\tfield: any;\n\tatModal?: boolean;\n}\n\nconst LocationSelect: React.FC = ({\n\titems,\n\tform,\n\tfield,\n\tatModal,\n}) => {\n\tconst { t } = useTranslation();\n\n\treturn \n\t\tstoreName=\"locations\"\n\t\titems={items}\n\t\ttype=\"location\"\n\t\tfilters={{ count: 100 }}\n\t\tpagination={{ current: 1, pageSize: 100 }}\n\t>\n\t\t{(state) => 0 ? field.value : undefined}\n\t\t\tonChange={(value: any) => {\n\t\t\t\tform.setFieldValue(field.name, +value?.value);\n\t\t\t\tform.setFieldValue('doctorId', -1);\n\t\t\t}}\n\t\t\taria-label=\"Locations\"\n\t\t\toptions={state.items.map((location) => ({\n\t\t\t\tvalue: location.id,\n\t\t\t\tlabel: ,\n\t\t\t}))}\n\t\t/>}\n\t ;\n};\n\nexport default LocationSelect;\n","import * as React from 'react';\nimport { useTranslation, WithTranslation, withTranslation } from 'react-i18next';\nimport { useLocation } from 'react-router-dom';\n\nimport {\n\tField, FieldProps, FormikProps,\n} from 'formik';\nimport * as Yup from 'yup';\n\nimport { useApplicationContext } from '@common/react/components/Core/Application/Application';\nimport Button from '@common/react/components/Forms/Button';\nimport { FormikInput } from '@common/react/components/Forms/FormikInput/FormikInput';\nimport { emailValidator, phoneRequiredValidator } from '@common/react/utils/validationHelpers';\nimport { FormikPhoneControl } from '@common/react/components/Forms/FormikPhoneControl/FormikPhoneControl';\nimport LazyDatePickerReact from '@common/react/components/base/DatePicker/LazyDatepicker';\nimport { useMobileView } from '@common/react/hooks/useMobileView';\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport { ItemEditor } from '@common/react/components/Core/ItemEditor/ItemEditor';\n\nimport { Device } from '@commonTuna/react/objects/Device';\nimport { Page, PageType } from '@commonTuna/react/objects/Page';\nimport { Gender } from '@commonTuna/react/objects/Enums';\nimport { Doctor } from '@commonTuna/react/objects/BaseDoctor';\nimport { Inquiry } from '@commonTuna/react/objects/Inquiry';\n\nimport { TranslatedErrorMessage } from '@app/components/UI/TranslatedErrorMessage/TranslatedErrorMessage';\nimport { getLangByName, getPageShortName } from '@app/components/Utils';\nimport TranslatedFormikField from '@app/components/Forms/TranslatedFormikField/TranslatedFormikField';\nimport DoctorSelect from '@app/components/UI/DoctorSelect/DoctorSelect';\nimport LocationSelect from '@app/components/UI/LocationSelect/LocationSelect';\nimport { useReduxContext } from '@app/hooks/useReduxContext';\nimport Select from '@app/components/UI/BseSelect';\n\nconst year = new Date().getFullYear();\n\nconst years = Array.from({ length: 83 }).map((_, i) => year - 100 + i);\n\nexport interface ContactsUsFormProps extends WithTranslation {\n\tclassName?: string;\n\tonSave?: () => void;\n\tdoctor?: Doctor;\n\tpageId?: number;\n\tlocationId?: number;\n\tcontrolsIdPrefix?: string;\n\tatModal?: boolean;\n}\n\nconst lengthValidator = (maxLength) => Yup.string().max(maxLength, { key: 'Must be less than character', value: maxLength });\n\nconst lengthRequiredValidator = (maxLength) => Yup.string().max(maxLength, { key: 'Must be less than character', value: maxLength }).required();\n\nconst validationSchema = Yup.object().shape({\n\tfirstName: lengthRequiredValidator(20),\n\tlastName: lengthRequiredValidator(20),\n\temail: emailValidator,\n\tphone: phoneRequiredValidator,\n\ttext: lengthValidator(200),\n});\n\nconst getMainPageId = (mainPageMenu: Array, id) => {\n\tconst findId = (mainPage: Page, id: number) => {\n\t\tif (mainPage?.id === id) return id;\n\t\treturn mainPage?.children?.list.length\n\t\t\t? mainPage.children.list\n\t\t\t\t.map((page) => (findId(page, id) > 0 ? id : -1))\n\t\t\t\t.find((id) => id > 0)\n\t\t\t: -1;\n\t};\n\n\treturn mainPageMenu?.filter((q) => q.pageType === PageType.SERVICE)\n\t\t.find((page) => findId(page, id) > 0)?.id || -1;\n};\n\nconst ContactUsForm: React.FC = (props) => {\n\tconst timer = React.useRef(null);\n\n\tconst {\n\t\tcompanySettings: { showDateOfBirth },\n\t\toffices,\n\t\tmenu,\n\t\tinitDoctors,\n\t} = useReduxContext();\n\n\tconst { getLang } = useApplicationContext();\n\tconst language = getLang();\n\n\tconst isMobile = useMobileView();\n\n\tconst { i18n } = useTranslation();\n\tconst ref = React.useRef(false);\n\tconst container = React.useRef(null);\n\n\tconst location = useLocation();\n\n\tconst [success, setSuccess] = React.useState<0 | 1 | 2>(0);\n\n\tconst mainPageMenu = menu.filter((q) => q.pageType === PageType.SERVICE);\n\n\tconst getValueForSelect = (value: number) => {\n\t\treturn value > 0 ? value : null;\n\t};\n\n\tconst mainPageId = getMainPageId(mainPageMenu, props.pageId);\n\n\tconst { t, doctor, controlsIdPrefix = '' } = props;\n\tconst doctors = React.useMemo(() => {\n\t\tif (!doctor) return initDoctors;\n\t\treturn doctor && initDoctors.find((item) => doctor?.id === item.id) ? initDoctors : [doctor];\n\t}, [doctor, initDoctors]);\n\tconst locationId = props.locationId || (doctor?.locations?.[0]?.locationId ?? (offices.length ? offices[0].id : -1));\n\n\tconst genderOptions = [\n\t\t{ value: Gender.Female, label: t('forms.Female') },\n\t\t{ value: Gender.Male, label: t('forms.Male') },\n\t\t{ value: Gender.Other, label: t('forms.Other') },\n\t];\n\n\tconst selectProps = {\n\t\ttheme: (theme) => ({\n\t\t\t...theme,\n\t\t\tcolors: {\n\t\t\t\t...theme.colors,\n\t\t\t\tprimary25: 'rgba(255, 255, 255, 0.3)',\n\t\t\t\tprimary: 'rgba(238, 174, 21, 0.5)',\n\t\t\t},\n\t\t}),\n\t\tstyles: {\n\t\t\toption: (base, state) => ({\n\t\t\t\t...base,\n\t\t\t\tcolor: state.isSelected ? '#fff !important' : 'inherit',\n\t\t\t\tbackgroundColor: props.atModal\n\t\t\t\t\t? state.isSelected ? '#a89567' : 'inherit'\n\t\t\t\t\t: state.isSelected ? '#5a4a2f' : 'inherit',\n\t\t\t}),\n\t\t},\n\t};\n\n\tconst init = {\n\t\tfirstName: '',\n\t\tlastName: '',\n\t\temail: '',\n\t\tphone: '',\n\t\tlocationId,\n\t\tmainPageId: mainPageId > 0\n\t\t\t? mainPageId\n\t\t\t: (mainPageMenu.length\n\t\t\t\t? mainPageMenu.filter((page) => {\n\t\t\t\t\treturn !doctor || doctor.pages.some((doctorPage) => doctorPage.pageId === page.id);\n\t\t\t\t})?.[0]?.id\n\t\t\t\t: -1),\n\t\tpageId: -1,\n\t\tdoctorId: doctor?.id || -1,\n\t\ttext: '',\n\t\tdate: null,\n\t\ttime: null,\n\t\tgender: Gender.Female,\n\t\t// timeInterval: null,\n\t\tpath: '',\n\t\tdevice: Device.Desktop,\n\t};\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\tid={-1}\n\t\t\t\tadd={init}\n\t\t\t\ttransformAfterSave={() => init}\n\t\t\t\ttype=\"inquiryRemote\"\n\t\t\t\treadonly={false}\n\t\t\t\tsaveRequest=\"inquiryRemote\"\n\t\t\t\tvalidationSchema={validationSchema}\n\t\t\t\tclearForSubmit={(values) => {\n\t\t\t\t\tconst lang = getLangByName(i18n.language);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...values,\n\t\t\t\t\t\tlocationId: (values.locationId as number) > 0 ? values.locationId : null,\n\t\t\t\t\t\tpageId: (values.pageId as number) > 0 ? values.pageId : null,\n\t\t\t\t\t\tmainPageId: (values.mainPageId as number) > 0 ? values.mainPageId : null,\n\t\t\t\t\t\tdoctorId: (values.doctorId as number) > 0 ? values.doctorId : null,\n\t\t\t\t\t\tlanguage: lang,\n\t\t\t\t\t\tdevice: isMobile ? Device.Mobile : Device.Desktop,\n\t\t\t\t\t\tpath: location.pathname,\n\t\t\t\t\t};\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{({ state: { loading, error }, actions: { setError } }) => \n\t\t\t\t\tbeforeSubmit={(values, actions, submit) => {\n\t\t\t\t\t\tsubmit()\n\t\t\t\t\t\t\t.catch((message) => {\n\t\t\t\t\t\t\t\tsetError(message);\n\n\t\t\t\t\t\t\t\ttimer.current = setTimeout(() => {\n\t\t\t\t\t\t\t\t\tsetError('');\n\t\t\t\t\t\t\t\t}, 5000);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t\tshowMessages={false}\n\t\t\t\t\tafterSubmit={() => {\n\t\t\t\t\t\tref.current = true;\n\t\t\t\t\t\tsetSuccess(1);\n\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tif (ref.current) {\n\t\t\t\t\t\t\t\tsetSuccess(2);\n\n\t\t\t\t\t\t\t\tprops.onSave && props.onSave();\n\t\t\t\t\t\t\t\tref.current = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 15000);\n\t\t\t\t\t}}\n\t\t\t\t\tedit={(formikBag: FormikProps) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t form.setFieldValue(field.name, e.currentTarget.value?.replace(/\\d/g, ''))}\n\t\t\t\t\t\t\t\t\t\t/>}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t form.setFieldValue(field.name, e.currentTarget.value?.replace(/\\d/g, ''))}\n\t\t\t\t\t\t\t\t\t\t/>}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\tform.setFieldValue(field.name, +(value.value));\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{showDateOfBirth\n\t\t\t\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t\t\t formikBag.setFieldValue(field.name, date)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>) : null}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
) =>\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\tform.setFieldValue(field.name, +(value?.value || -1));\n\t\t\t\t\t\t\t\t\t\t\t\tform.setFieldValue('pageId', -1);\n\t\t\t\t\t\t\t\t\t\t\t\tconst currentDoctor = doctors.find((doctor) => doctor.id === formikBag.values.doctorId);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!currentDoctor || !currentDoctor.pages.some((page) => page.pageId === +(value?.value || -1))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst newDoctor = doctors\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.filter((doctor) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoctor.pages.some((page) => page.pageId === +(value?.value || -1)))[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\tform.setFieldValue('doctorId', newDoctor?.id || -1);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\toptions={mainPageMenu.map((page) => ({\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: page.id,\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: getPageShortName(page, language),\n\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\taria-label={t('forms.Cosmetic or Dermatology')}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{(fieldProps: FieldProps) => {\n\t\t\t\t\t\t\t\t\t\tlet subpages: Array = [];\n\n\t\t\t\t\t\t\t\t\t\tconst mainId = +(formikBag.values.mainPageId as number);\n\n\t\t\t\t\t\t\t\t\t\tif (mainId > 0) {\n\t\t\t\t\t\t\t\t\t\t\tconst parent = menu.find((page) => page.id === mainId);\n\n\t\t\t\t\t\t\t\t\t\t\tif (parent && parent.children) {\n\t\t\t\t\t\t\t\t\t\t\t\tsubpages = parent.children.list;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\treturn \n\t\t\t\t\t\t\t\t\t\t\t\t form.setFieldValue(field.name, +(value?.value || -1))}\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={t('forms.Procedure of interest')}\n\t\t\t\t\t\t\t\t\t\t\t\t\toptions={subpages.map((page) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: page.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: getPageShortName(page, language),\n\t\t\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>;\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t q.locations\n\t\t\t\t\t\t\t\t\t\t\t\t.some((location) => location.locationId === formikBag.values.locationId)\n\t\t\t\t\t\t\t\t\t\t\t\t&& q.pages.some((page) => page.pageId === formikBag.values.mainPageId))}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tform={form}\n\t\t\t\t\t\t\t\t\t\t\tfield={field}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t formikBag.setFieldValue(field.name, date)}\n\t\t\t\t\t\t\t\t\t\t\tutc\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{t('forms.submit')} \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{t('forms.requestSuccess')}\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tref.current = false;\n\t\t\t\t\t\t\t\t\t\t\tsetSuccess(2);\n\t\t\t\t\t\t\t\t\t\t\tprops.onSave && props.onSave();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tOK\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{error && \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tOops!!!\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t{t('Something went wrong')}\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tsetError('');\n\t\t\t\t\t\t\t\t\t\t\tif (timer.current) {\n\t\t\t\t\t\t\t\t\t\t\t\tclearTimeout(timer.current);\n\t\t\t\t\t\t\t\t\t\t\t\ttimer.current = null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{t('Close')}\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
}\n\t\t\t\t\t\t>\n\t\t\t\t\t)}\n\t\t\t\t/>}\n\t\t\t \n\t\t
\n\t);\n};\n\nexport default withTranslation()(ContactUsForm);\n","/* eslint-disable */\nexport default {\n\ten: {\n\t\ttranslation: {\n\t\t\tforms: {\n\t\t\t\tlogin: 'Login',\n\t\t\t\temail: 'Email',\n\t\t\t\tpassword: 'Password',\n\t\t\t\trepeatPassword: 'Repeat password',\n\t\t\t\tpasswordMessage: 'Password successfully changed',\n\t\t\t\tsetupPassword: 'Setup password',\n\t\t\t\tenterPassword: 'Enter new password',\n\t\t\t\tfirstName: 'First Name',\n\t\t\t\tlastName: 'Last Name',\n\t\t\t\tphone: 'Phone',\n\t\t\t\tforgetPassword: 'Forget password?',\n\t\t\t\tregister: 'Register',\n\t\t\t\tsubmit: 'Submit',\n\t\t\t\tcaptcha: 'Enter the symbols',\n\t\t\t\temailSent: 'An email has been sent to you with further instructions.',\n\t\t\t\trecoverText: 'Enter the email you provided during registration and we will send you a password reset email',\n\t\t\t\trecover: 'Recover',\n\t\t\t\trecoverPassword: 'Recover password',\n\t\t\t\t'Cosmetic or Dermatology': 'Cosmetic or Dermatology',\n\t\t\t\t'Procedure of interest': 'Procedure of interest',\n\t\t\t\t'Location Preference': 'Location Preference',\n\t\t\t\t'Additional Comments': 'Additional Comments',\n\t\t\t\t'Age': 'Age',\n\t\t\t\t'Gender': 'Gender',\n\t\t\t\t'Height': 'Height',\n\t\t\t\t'Ethnicity': 'Ethnicity',\n\t\t\t\t'Weight': 'Weight',\n\t\t\t\t'Male': 'Male',\n\t\t\t\t'Female': 'Female',\n\t\t\t\t'Other': 'Other',\n\t\t\t\t'Filters': 'Filters',\n\t\t\t\t'Select doctor': 'Select doctor',\n\t\t\t\trequestSuccess: 'Your request has been sent successfully.\\n We will contact you as soon as possible',\n\t\t\t\t'Time': 'Time',\n\t\t\t\t'Date': 'Date of Visit',\n\t\t\t\tautocomplete: 'Select Service...',\n\t\t\t\t'Left Implant': 'Left Implant',\n\t\t\t\t'Right Implant': 'Right Implant',\n\t\t\t\t'Pre-op Size': 'Pre-op Size',\n\t\t\t\t'Post-op Size': 'Post-op Size',\n\t\t\t\t'Reset All': 'Reset All',\n\t\t\t\tsearch: 'Search...',\n\t\t\t\tnotFound: 'Not found',\n\t\t\t\t'Find More': 'Find More',\n\t\t\t\tcharacters: 'characters',\n\t\t\t\tbirthDate: 'Date of Birth',\n\t\t\t\t'Something went wrong': 'Something went wrong',\n\t\t\t\tClose: 'Close',\n\t\t\t},\n\t\t\terrors: {\n\t\t\t\t'Required field!': 'Required field!',\n\t\t\t\t'Required field': 'Required field!',\n\t\t\t\t'Invalid email': 'Invalid email',\n\t\t\t\t'Passwords are not equal': 'Passwords are not equal',\n\t\t\t\t'Invalid phone number': 'Invalid phone number',\n\t\t\t\t'Must be less than character': 'Must be less than {{max}} character',\n\t\t\t\t'Failed to load': 'Failed to load'\n\t\t\t},\n\t\t\tsite: {\n\t\t\t\t'Special Offers': 'Special Offers',\n\t\t\t\tDescription: 'Description',\n\t\t\t\tshort: 'Short',\n\t\t\t\tfull: 'Full',\n\t\t\t\tVideos: 'Videos',\n\t\t\t\tloading: 'Loading',\n\t\t\t\tSpecials: 'Specials',\n\t\t\t\thomeHeadline: 'Houston Dermatology & Plastic Surgery',\n\t\t\t\t'Plastic Surgery': 'Plastic Surgery',\n\t\t\t\t'Med Spa': 'Med Spa',\n\t\t\t\t'Monday': 'Monday',\n\t\t\t\t'Tuesday': 'Tuesday',\n\t\t\t\t'Wednesday': 'Wednesday',\n\t\t\t\t'Thursday': 'Thursday',\n\t\t\t\t'Friday': 'Friday',\n\t\t\t\t'Saturday': 'Saturday',\n\t\t\t\t'Sunday': 'Sunday',\n\t\t\t\t'Dermatology': 'Dermatology',\n\t\t\t\t'Before / After': 'Before / After',\n\t\t\t\t'Service Areas': 'Service Areas',\n\t\t\t\t'Schedule an Appointment Now': 'Schedule an Appointment',\n\t\t\t\t'To Main Page': 'To Main Page',\n\t\t\t\t'Schedule a visit': 'Schedule a visit',\n\t\t\t\t'Reviews': 'Reviews',\n\t\t\t\t'Profile': 'Profile',\n\t\t\t\t'Pages': 'Pages',\n\t\t\t\t'Services': 'Services',\n\t\t\t\t'Inquiries': 'Inquiries',\n\t\t\t\t'Cases': 'Cases',\n\t\t\t\t'Faqs': 'Faq',\n\t\t\t\t'Ethnicities': 'Ethnicities',\n\t\t\t\t'Users': 'Users',\n\t\t\t\t'Locations': 'Locations',\n\t\t\t\t'Doctors': 'Doctors',\n\t\t\t\t'Logout': 'Logout',\n\t\t\t\t'Reviews from our clients': 'Reviews from our clients',\n\t\t\t\t'Before and after': 'Before and after',\n\t\t\t\t'Professions': 'Professions',\n\t\t\t\t'Dashboard': 'Dashboard',\n\t\t\t\t'Calendar': 'Calendar',\n\t\t\t\t'Home': 'Home',\n\t\t\t\t'Schedule Consultation': 'Schedule Consultation',\n\t\t\t\t'Contacts': 'Contacts',\n\t\t\t\t'Read More': 'Read More',\n\t\t\t\t'Load More': 'Load More',\n\t\t\t\t'More About': 'More About',\n\t\t\t\t'Wizard': 'Wizard',\n\t\t\t\t'Our Team': 'Our Team',\n\t\t\t\t'Click to see results': 'Click to see results',\n\t\t\t\t'What can id do': 'WHAT CAN IT DO',\n\t\t\t\t'Anesthesia': 'Anesthesia',\n\t\t\t\t'Combine with': 'Combine with',\n\t\t\t\t'Operation length': 'Operation length',\n\t\t\t\t'Recovery Time': 'Recovery Time',\n\t\t\t\t'None': 'None',\n\t\t\t\t'General': 'General',\n\t\t\t\t'Sedation': 'Sedation',\n\t\t\t\t'Regional': 'Regional',\n\t\t\t\t'Local': 'Local',\n\t\t\t\tlearn: 'learn more',\n\t\t\t\t'Fast Preview': 'Fast Preview',\n\t\t\t\t'Buy': 'Buy',\n\t\t\t\tProducts: 'Products',\n\t\t\t\tProcedures: 'Procedures',\n\t\t\t\tWARNING: 'WARNING:',\n\t\t\t\tProviders: 'Providers',\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.'\n\t\t\t},\n\t\t\tseo: {\n\t\t\t\thomePage: {\n\t\t\t\t\ttitle: 'Houston Dermatology, Plastic Surgery & Med Spa',\n\t\t\t\t\tlink: '/'\n\t\t\t\t},\n\t\t\t\tdoctorsPage: {\n\t\t\t\t\ttitle: 'Our Doctors',\n\t\t\t\t\tlink: '/practice/doctors'\n\t\t\t\t},\n\t\t\t\tbeforeAndAfterPage: {\n\t\t\t\t\ttitle: 'Plastic Surgery Before & After Photos'\n\t\t\t\t},\n\t\t\t\tblogPage: {\n\t\t\t\t\ttitle: 'Blog',\n\t\t\t\t\tlink: '/blog'\n\t\t\t\t},\n\t\t\t\tfaqPage: {\n\t\t\t\t\ttitle: 'Faq',\n\t\t\t\t\tlink: '/faq'\n\t\t\t\t},\n\t\t\t\tpracticePage: {\n\t\t\t\t\ttitle: 'Practice',\n\t\t\t\t\tlink: '/practice'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tes: {\n\t\ttranslation: {\n\t\t\tforms: {\n\t\t\t\tlogin: 'Inicia sesión',\n\t\t\t\temail: 'Correo electrónico',\n\t\t\t\tpassword: 'Сontraseña',\n\t\t\t\trepeatPassword: 'Repite la contraseña',\n\t\t\t\tpasswordMessage: 'Contraseña cambiada correctamente',\n\t\t\t\tsetupPassword: 'Configurar contraseña',\n\t\t\t\tenterPassword: 'Introduzca nueva contraseña',\n\t\t\t\tfirstName: 'Nombre',\n\t\t\t\tlastName: 'Apellido',\n\t\t\t\tphone: 'Teléfono',\n\t\t\t\tforgetPassword: '¿Olvidaste tu contraseña?',\n\t\t\t\tregister: 'Registrate',\n\t\t\t\tsubmit: 'Enviar',\n\t\t\t\tcaptcha: 'Introduce los símbolos',\n\t\t\t\temailSent: 'Se le ha enviado un correo electrónico con más instrucciones.',\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',\n\t\t\t\trecover: 'Recuperar',\n\t\t\t\trecoverPassword: 'Recuperar contraseña',\n\t\t\t\t'Cosmetic or Dermatology': 'Cosmética o dermatológica',\n\t\t\t\t'Procedure of interest': 'Interes en procedimiento',\n\t\t\t\t'Location Preference': 'Preferente ubicación',\n\t\t\t\t'Additional Comments': 'Comentarios adicionales',\n\t\t\t\t'Age': 'Años',\n\t\t\t\t'Gender': 'Género',\n\t\t\t\t'Height': 'Altura',\n\t\t\t\t'Ethnicity': 'Etnicidad',\n\t\t\t\t'Weight': 'Peso',\n\t\t\t\t'Male': 'Masculino',\n\t\t\t\t'Female': 'Femenino',\n\t\t\t\t'Other': 'Otra',\n\t\t\t\t'Filters': 'Filtro',\n\t\t\t\t'Select doctor': 'Seleccionar doctor',\n\t\t\t\trequestSuccess: 'Su solicitud ha sido enviada con éxito.\\n Nos pondremos en contacto con usted tan pronto como sea posible',\n\t\t\t\t'Time': 'Hora',\n\t\t\t\t'Date': 'Fecha de visita',\n\t\t\t\tautocomplete: 'Seleccionar servicio...',\n\t\t\t\t'Left Implant': 'Implante Izquierdo',\n\t\t\t\t'Right Implant': 'Implante Derecho',\n\t\t\t\t'Pre-op Size': 'Tamaño preop.',\n\t\t\t\t'Post-op Size': 'Tamaño postop.',\n\t\t\t\t'Reset All': 'Reiniciar Todo',\n\t\t\t\tsearch: 'Buscar...',\n\t\t\t\tnotFound: 'Extraviado',\n\t\t\t\t'Find More': 'Encuentra más',\n\t\t\t\tcharacters: 'caracteres',\n\t\t\t\tbirthDate: 'Fecha de nacimiento',\n\t\t\t\t'Something went wrong': 'Algo salió mal',\n\t\t\t\tClose: 'Cerca',\n\t\t\t\tProviders: 'Proveedores',\n\t\t\t},\n\t\t\terrors: {\n\t\t\t\t'Required field!': '¡Campo requerido!',\n\t\t\t\t'Required field': '¡Campo requerido!',\n\t\t\t\t'Invalid email': 'Email inválido',\n\t\t\t\t'Passwords are not equal': 'Las contraseñas no son iguales',\n\t\t\t\t'Invalid phone number': 'Numero de telefono invalido',\n\t\t\t\t'Must be less than character': 'Debe tener menos de {{max}} carácter',\n\t\t\t\t'Failed to load': 'no se pudo cargar'\n\t\t\t},\n\t\t\tsite: {\n\t\t\t\t'Special Offers': 'Ofertas especiales',\n\t\t\t\tDescription: 'Descripción',\n\t\t\t\tshort: 'Corto',\n\t\t\t\tfull: 'Lleno',\n\t\t\t\tVideos: 'Vídeos',\n\t\t\t\tloading: 'Cargando',\n\t\t\t\tSpecials: 'Especiales',\n\t\t\t\thomeHeadline: 'Houston Dermatología y Cirugía Plástica',\n\t\t\t\t'Plastic Surgery': 'Cirujía plástica',\n\t\t\t\t'Med Spa': 'Spa Médico',\n\t\t\t\t'Monday': 'Lunes',\n\t\t\t\t'Tuesday': 'Martes',\n\t\t\t\t'Wednesday': 'Miércoles',\n\t\t\t\t'Thursday': 'Jueves',\n\t\t\t\t'Friday': 'Viernes',\n\t\t\t\t'Saturday': 'Sábado',\n\t\t\t\t'Sunday': 'Domingo',\n\t\t\t\t'Dermatology': 'Dermatología',\n\t\t\t\t'Before / After': 'Antes / Después',\n\t\t\t\t'Service Areas': 'Areas de Servicio',\n\t\t\t\t'Schedule an Appointment Now': 'Calendariza una cita ahora',\n\t\t\t\t'To Main Page': 'A la página principal',\n\t\t\t\t'Schedule a visit': 'Programe una visita',\n\t\t\t\t'Reviews': 'Comentarios',\n\t\t\t\t'Profile': 'Perfil',\n\t\t\t\t'Pages': 'Páginas',\n\t\t\t\t'Services': 'Servicios',\n\t\t\t\t'Inquiries': 'Consultas',\n\t\t\t\t'Cases': 'Casos',\n\t\t\t\t'Faqs': 'Preguntas más frecuentes',\n\t\t\t\t'Ethnicities': 'Etnias',\n\t\t\t\t'Users': 'Usuarios',\n\t\t\t\t'Locations': 'Ubicaciones',\n\t\t\t\t'Doctors': 'Doctores',\n\t\t\t\t'Logout': 'Cerrar sesión',\n\t\t\t\t'Reviews from our clients': 'Telegrama de nuestros clientes',\n\t\t\t\t'Before and after': 'Antes y después',\n\t\t\t\t'Dashboard': 'Tablero',\n\t\t\t\t'Calendar': 'El calendario',\n\t\t\t\t'Home': 'Casa',\n\t\t\t\t'Schedule Consultation': 'Consulta de horario',\n\t\t\t\t'Contacts': 'Contactos',\n\t\t\t\t'Read More': 'Leer Más',\n\t\t\t\t'Load More': 'Carga Más',\n\t\t\t\t'More About': 'Más acerca de',\n\t\t\t\t'Wizard': 'Wizard',\n\t\t\t\t'Our Team': 'Nuestro Equipo',\n\t\t\t\t'Click to see results': 'Click para ver resultados',\n\t\t\t\t'What can id do': 'QUÉ PUEDE HACER',\n\t\t\t\t'Anesthesia': 'Anestesia',\n\t\t\t\t'Combine with': 'Combinar con',\n\t\t\t\t'Operation length': 'Duración de la operación',\n\t\t\t\t'Recovery Time': 'Tiempo de recuperación',\n\t\t\t\t'None': 'Ninguno',\n\t\t\t\t'General': 'General',\n\t\t\t\t'Sedation': 'Sedación',\n\t\t\t\t'Regional': 'Regional',\n\t\t\t\t'Local': 'Local',\n\t\t\t\t'Fast Preview': 'Vista previa rápida',\n\t\t\t\t'Buy': 'Comprar',\n\t\t\t\tlearn: 'aprende más',\n\t\t\t\t'WARNING': 'ADVERTENCIA:',\n\t\t\t\tProducts: 'Productos',\n\t\t\t\tProcedures: 'Trámites',\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.'\n\t\t\t},\n\t\t\tseo: {\n\t\t\t\thomePage: {\n\t\t\t\t\ttitle: 'Houston Dermatología, Cirugía Plástica y Med Spa',\n\t\t\t\t\tlink: '/'\n\t\t\t\t},\n\t\t\t\tdoctorsPage: {\n\t\t\t\t\ttitle: 'Nuestros doctores',\n\t\t\t\t\tlink: '/practica/doctors'\n\t\t\t\t},\n\t\t\t\tbeforeAndAfterPage: {\n\t\t\t\t\ttitle: 'Fotos de antes y después de la cirugía plástica'\n\t\t\t\t},\n\t\t\t\tblogPage: {\n\t\t\t\t\ttitle: 'Blog',\n\t\t\t\t\tlink: '/blog'\n\t\t\t\t},\n\t\t\t\tfaqPage: {\n\t\t\t\t\ttitle: 'Faq',\n\t\t\t\t\tlink: '/faq'\n\t\t\t\t},\n\t\t\t\tpracticePage: {\n\t\t\t\t\ttitle: 'Práctica',\n\t\t\t\t\tlink: '/practica'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n/* eslint-enable */\n","import * as React from 'react';\n\nimport { I18nextProvider } from 'react-i18next';\n\nimport { Lang } from '@common/typescript/objects/Lang';\nimport { useApplicationContext } from '@common/react/components/Core/Application/Application';\n\nimport { initI18n } from '@app/i18n';\n\nconst InitI18n: React.FC = ({ children }) => {\n\tconst { getLang } = useApplicationContext();\n\tconst lang = getLang();\n\treturn \n\t\t{children}\n\t ;\n};\n\nexport default InitI18n;\n","import i18n from 'i18next';\n\nimport translation from '@app/translation';\n\nexport const initI18n = (initLang: string) => {\n\ti18n\n\t// load translation using xhr -> see /public/locales\n\t// learn more: https://github.com/i18next/i18next-xhr-backend\n\t// pass the i18n instance to react-i18next.\n\t// init i18next\n\t// for all options read: https://www.i18next.com/overview/configuration-options\n\t\t.init({\n\t\t\tresources: translation,\n\t\t\tfallbackLng: 'en',\n\t\t\tlng: initLang,\n\t\t\tdebug: false,\n\t\t\tinterpolation: {\n\t\t\t\tescapeValue: false, // not needed for react as it escapes by default\n\t\t\t},\n\t\t\treact: {\n\t\t\t\tuseSuspense: false,\n\t\t\t},\n\t\t});\n\n\treturn i18n;\n};\n","import * as React from 'react';\n\nimport loadable from '@loadable/component';\n\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\nimport '@common/react/yupLocaleSettings';\nimport { ErrorBoundaryWithLocation } from '@common/react/components/UI/ErrorBoundary/ErrorBoundary';\nimport { LoadingProvider } from '@common/react/components/Core/LoadingProvider/LoadingProvider';\nimport { NotFoundPageProvider } from '@common/react/components/Core/NotFoundPageProvider/NotFoundPageProvider';\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\nimport { RequestProvider } from '@common/react/components/RequestProvider/RequestProvider';\nimport Application from '@common/react/components/Core/Application/Application';\nimport BaseModalContextProvider from '@common/react/components/base/BaseModalContextProvider/BaseModalContextProvider';\n\nimport '@app/scss/style.scss';\nimport '@app/scss/vendor.scss';\nimport TranslatedLoading from '@app/components/UI/TranslatedLoading/TranslatedLoading';\nimport RouteChangeTracker from '@app/components/Routes/RouteChangeTracker';\nimport ReduxProvider from '@app/hooks/useReduxContext';\nimport { User } from '@app/objects/User';\nimport { Init } from '@app/objects/Init';\nimport InitI18n from '@app/components/InitLang';\n\nconst paramsTranslated = {\n\tfallback: ,\n};\n\nconst CustomNotFoundPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"CustomNotFoundPage\" */ '@app/components/Pages/NotFoundPage/NotFoundPage')), paramsTranslated);\n\nconst Layout: React.FC = ({ children }) => \n\t
\n\t\t\n\t\t\t{({ companySettings: { googleAnalyticsId } }) =>\n\t\t\t\t\n\t\t\t\t\t }}>\n\t\t\t\t\t\t withoutSignalR>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t ) as any}>\n\t\t\t\t\t\t\t\t\t }>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t \n\t \n
;\n\nexport default Layout;\n","import * as React from 'react';\n\nimport loadable from '@loadable/component';\n\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\n\nimport Header from '@app/components/UI/Header/Header';\nimport Footer from '@app/components/UI/Footer/Footer';\n\nconst FormStyle = loadable(\n\t() =>\n\t\tloadableDelay(import(/* webpackChunkName: \"FormStyle\" */ '@app/components/Forms/ContactUs/FormStyles')),\n\t{ fallback: <>> },\n);\n\nexport const MainLayout: React.FC = (props) => {\n\tconst [showPodium, setShowPodium] = React.useState(false);\n\n\tReact.useEffect(() => {\n\t\tif (showPodium) {\n\t\t\tconst script = document.getElementById('podium-widget');\n\n\t\t\tif (!script) {\n\t\t\t\tconst script = document.createElement('script');\n\n\t\t\t\tscript.src = 'https://connect.podium.com/widget.js#API_TOKEN=087a7109-04c1-4a4e-a315-f789368a2d06';\n\t\t\t\tscript.async = true;\n\t\t\t\tscript.id = 'podium-widget';\n\t\t\t\tscript.setAttribute('data-api-token', '087a7109-04c1-4a4e-a315-f789368a2d06');\n\n\t\t\t\tdocument.body.appendChild(script);\n\t\t\t}\n\t\t}\n\t}, [showPodium]);\n\n\tconst handler = React.useCallback(() => setShowPodium(true), []);\n\n\tReact.useEffect(() => {\n\t\twindow.addEventListener('scroll', () => {\n\t\t\thandler();\n\t\t\twindow.removeEventListener('scroll', handler);\n\t\t});\n\t}, []);\n\n\treturn \n\t\t{showPodium ?
: null}\n\t\t
\n\t\t
\n\t\t\t{props.children}\n\t\t
\n\t\t
\n\t
;\n};\n","import * as React from 'react';\nimport { Outlet } from 'react-router-dom';\n\nimport { ErrorBoundaryWithLocation } from '@common/react/components/UI/ErrorBoundary/ErrorBoundary';\n\nimport { MainLayout } from '@app/components/Layouts/MainLayout';\n\ninterface Props {\n\tcomponent?: any;\n}\n\nexport const MainRoute: React.FC = ({ component: Component }) => (\n\t\n\t\t\n\t\t\t{Component ? : }\n\t\t \n\t \n);\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';\nimport { useLocation } from 'react-router-dom';\n\nimport GA4React from 'ga-4-react';\n\ninterface RouteChangeTrackerProps {\n\tid: string;\n}\n\nconst RouteChangeTracker: React.FC = ({ id, children }) => {\n\tconst ga4Ref = React.useRef(null);\n\tconst location = useLocation();\n\n\tReact.useEffect(() => {\n\t\tif (process.env.NODE_ENV === 'production' && id && id.trim() !== '') {\n\t\t\tconst ga4react = new GA4React(id);\n\n\t\t\tga4react.initialize().then((ga4) => {\n\t\t\t\tga4.pageview(window.location.pathname + window.location.search);\n\n\t\t\t\tga4Ref.current = ga4react;\n\t\t\t}, console.error);\n\t\t}\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (ga4Ref.current && GA4React.isInitialized()) {\n\t\t\tga4Ref.current.pageview(location.pathname + location.search);\n\t\t\tga4Ref.current.gtag('set', 'page', location.pathname);\n\t\t}\n\t}, [location]);\n\n\treturn <>{children}>;\n};\n\nexport default RouteChangeTracker;\n","import React from 'react';\n\nimport { Props } from 'react-select';\n\nimport Select from '@common/react/components/base/BaseSelect/BaseSelect';\n\nexport const selectProps = {\n\ttheme: (theme) => ({\n\t\t...theme,\n\t\tcolors: {\n\t\t\t...theme.colors,\n\t\t\tprimary25: 'rgba(255, 255, 255, 0.3)',\n\t\t\tprimary: 'rgba(238, 174, 21, 0.5)',\n\t\t},\n\t}),\n\tstyles: {\n\t\toption: (base, state) => ({\n\t\t\t...base,\n\t\t\tcolor: state.isSelected ? '#fff !important' : 'inherit',\n\t\t\tbackgroundColor: state.isSelected ? '#5a4a2f' : 'inherit',\n\t\t}),\n\t},\n};\n\nconst BaseSelect: React.FC = (props) => {\n\treturn ({\n\t\t\t...theme,\n\t\t\tcolors: {\n\t\t\t\t...theme.colors,\n\t\t\t\tprimary25: 'rgba(255, 255, 255, 0.3)',\n\t\t\t\tprimary: 'rgba(238, 174, 21, 0.5)',\n\t\t\t},\n\t\t})}\n\t\tstyles={{\n\t\t\toption: (base, state) => ({\n\t\t\t\t...base,\n\t\t\t\tcolor: state.isSelected ? '#fff !important' : 'inherit',\n\t\t\t\tbackgroundColor: props.atModal\n\t\t\t\t\t? state.isSelected ? '#a89567' : 'inherit'\n\t\t\t\t\t: state.isSelected ? '#5a4a2f' : 'inherit',\n\t\t\t}),\n\t\t}}\n\t/>;\n};\n\nexport default BaseSelect;\n","import * as React from 'react';\nimport { withTranslation } from 'react-i18next';\n\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\n\nimport SocialIcons from '@app/components/UI/SocialIcons/SocialIcons';\n\nconst Footer: React.FC = (props) => {\n\treturn ;\n};\n\nexport default withTranslation()(Footer);\n","import React from 'react';\nimport { createPortal } from 'react-dom';\n\nimport '@common/react/scss/components/base/drawer.scss';\n\ninterface Props {\n\topen: boolean;\n\tonClose?: (open: boolean) => void;\n}\n\nconst Drawer: React.FC = (props) => {\n\tconst {\n\t\topen,\n\t\tonClose,\n\t} = props;\n\tconst [currentOpen, setOpen] = React.useState(false);\n\tconst [init, setInit] = React.useState(true);\n\tconst [container, setContainer] = React.useState();\n\n\tReact.useEffect(() => {\n\t\tif (!container) {\n\t\t\tsetContainer(document.getElementById('react-app'));\n\t\t}\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (currentOpen !== open && !init) {\n\t\t\tsetOpen(open);\n\t\t}\n\t\tif (currentOpen !== open && init) {\n\t\t\tsetInit(false);\n\t\t}\n\t}, [open, init]);\n\n\tif (init || !container) return null;\n\n\treturn createPortal(\n\t\t
onClose && onClose(false)} />\n\t\t
\n\t\t\t{props.children}\n\t\t
\n\t
, container);\n};\n\nexport default Drawer;\n","import * as React from 'react';\nimport { WithTranslation, withTranslation } from 'react-i18next';\n\nimport { debounce } from '@common/typescript/Utils';\n\ninterface Props extends WithTranslation {\n\tonClick: () => void;\n}\n\nconst BottomButton: React.FC
= ({ t, onClick }) => {\n\tconst [buttonVisible, changeButtonVisibility] = React.useState(false);\n\n\tReact.useEffect(\n\t\t() => {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tconst header = document.querySelector('.header-container');\n\n\t\t\t\tif (header) {\n\t\t\t\t\tchangeButtonVisibility(window.scrollY > header.clientHeight + 15);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\twindow.addEventListener('scroll', debounce(handleScroll, 300));\n\n\t\t\treturn () => window.removeEventListener('scroll', debounce(handleScroll, 300));\n\t\t},\n\t\t[debounce],\n\t);\n\n\treturn \n\t\t\n\t\t\t{t('site.Schedule Consultation')}\n\t\t \n\t
;\n};\n\nexport default withTranslation()(BottomButton);\n","import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\nimport _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';\nimport _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport { useRef, useState, useEffect, useCallback } from 'react';\nimport { L as handleInputChange } from './index-a301f526.esm.js';\n\nvar _excluded = [\"defaultOptions\", \"cacheOptions\", \"loadOptions\", \"options\", \"isLoading\", \"onInputChange\", \"filterOption\"];\nfunction useAsync(_ref) {\n var _ref$defaultOptions = _ref.defaultOptions,\n propsDefaultOptions = _ref$defaultOptions === void 0 ? false : _ref$defaultOptions,\n _ref$cacheOptions = _ref.cacheOptions,\n cacheOptions = _ref$cacheOptions === void 0 ? false : _ref$cacheOptions,\n propsLoadOptions = _ref.loadOptions;\n _ref.options;\n var _ref$isLoading = _ref.isLoading,\n propsIsLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,\n propsOnInputChange = _ref.onInputChange,\n _ref$filterOption = _ref.filterOption,\n filterOption = _ref$filterOption === void 0 ? null : _ref$filterOption,\n restSelectProps = _objectWithoutProperties(_ref, _excluded);\n var propsInputValue = restSelectProps.inputValue;\n var lastRequest = useRef(undefined);\n var mounted = useRef(false);\n var _useState = useState(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined),\n _useState2 = _slicedToArray(_useState, 2),\n defaultOptions = _useState2[0],\n setDefaultOptions = _useState2[1];\n var _useState3 = useState(typeof propsInputValue !== 'undefined' ? propsInputValue : ''),\n _useState4 = _slicedToArray(_useState3, 2),\n stateInputValue = _useState4[0],\n setStateInputValue = _useState4[1];\n var _useState5 = useState(propsDefaultOptions === true),\n _useState6 = _slicedToArray(_useState5, 2),\n isLoading = _useState6[0],\n setIsLoading = _useState6[1];\n var _useState7 = useState(undefined),\n _useState8 = _slicedToArray(_useState7, 2),\n loadedInputValue = _useState8[0],\n setLoadedInputValue = _useState8[1];\n var _useState9 = useState([]),\n _useState10 = _slicedToArray(_useState9, 2),\n loadedOptions = _useState10[0],\n setLoadedOptions = _useState10[1];\n var _useState11 = useState(false),\n _useState12 = _slicedToArray(_useState11, 2),\n passEmptyOptions = _useState12[0],\n setPassEmptyOptions = _useState12[1];\n var _useState13 = useState({}),\n _useState14 = _slicedToArray(_useState13, 2),\n optionsCache = _useState14[0],\n setOptionsCache = _useState14[1];\n var _useState15 = useState(undefined),\n _useState16 = _slicedToArray(_useState15, 2),\n prevDefaultOptions = _useState16[0],\n setPrevDefaultOptions = _useState16[1];\n var _useState17 = useState(undefined),\n _useState18 = _slicedToArray(_useState17, 2),\n prevCacheOptions = _useState18[0],\n setPrevCacheOptions = _useState18[1];\n if (cacheOptions !== prevCacheOptions) {\n setOptionsCache({});\n setPrevCacheOptions(cacheOptions);\n }\n if (propsDefaultOptions !== prevDefaultOptions) {\n setDefaultOptions(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined);\n setPrevDefaultOptions(propsDefaultOptions);\n }\n useEffect(function () {\n mounted.current = true;\n return function () {\n mounted.current = false;\n };\n }, []);\n var loadOptions = useCallback(function (inputValue, callback) {\n if (!propsLoadOptions) return callback();\n var loader = propsLoadOptions(inputValue, callback);\n if (loader && typeof loader.then === 'function') {\n loader.then(callback, function () {\n return callback();\n });\n }\n }, [propsLoadOptions]);\n useEffect(function () {\n if (propsDefaultOptions === true) {\n loadOptions(stateInputValue, function (options) {\n if (!mounted.current) return;\n setDefaultOptions(options || []);\n setIsLoading(!!lastRequest.current);\n });\n }\n // NOTE: this effect is designed to only run when the component mounts,\n // so we don't want to include any hook dependencies\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n var onInputChange = useCallback(function (newValue, actionMeta) {\n var inputValue = handleInputChange(newValue, actionMeta, propsOnInputChange);\n if (!inputValue) {\n lastRequest.current = undefined;\n setStateInputValue('');\n setLoadedInputValue('');\n setLoadedOptions([]);\n setIsLoading(false);\n setPassEmptyOptions(false);\n return;\n }\n if (cacheOptions && optionsCache[inputValue]) {\n setStateInputValue(inputValue);\n setLoadedInputValue(inputValue);\n setLoadedOptions(optionsCache[inputValue]);\n setIsLoading(false);\n setPassEmptyOptions(false);\n } else {\n var request = lastRequest.current = {};\n setStateInputValue(inputValue);\n setIsLoading(true);\n setPassEmptyOptions(!loadedInputValue);\n loadOptions(inputValue, function (options) {\n if (!mounted) return;\n if (request !== lastRequest.current) return;\n lastRequest.current = undefined;\n setIsLoading(false);\n setLoadedInputValue(inputValue);\n setLoadedOptions(options || []);\n setPassEmptyOptions(false);\n setOptionsCache(options ? _objectSpread(_objectSpread({}, optionsCache), {}, _defineProperty({}, inputValue, options)) : optionsCache);\n });\n }\n }, [cacheOptions, loadOptions, loadedInputValue, optionsCache, propsOnInputChange]);\n var options = passEmptyOptions ? [] : stateInputValue && loadedInputValue ? loadedOptions : defaultOptions || [];\n return _objectSpread(_objectSpread({}, restSelectProps), {}, {\n options: options,\n isLoading: isLoading || propsIsLoading,\n onInputChange: onInputChange,\n filterOption: filterOption\n });\n}\n\nexport { useAsync as u };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport { S as Select } from '../../dist/Select-49a62830.esm.js';\nimport { u as useStateManager } from '../../dist/useStateManager-7e1e8489.esm.js';\nimport { u as useAsync } from '../../dist/useAsync-ba7c6b77.esm.js';\nexport { u as useAsync } from '../../dist/useAsync-ba7c6b77.esm.js';\nimport '@babel/runtime/helpers/objectSpread2';\nimport '@babel/runtime/helpers/classCallCheck';\nimport '@babel/runtime/helpers/createClass';\nimport '@babel/runtime/helpers/inherits';\nimport '@babel/runtime/helpers/createSuper';\nimport '@babel/runtime/helpers/toConsumableArray';\nimport '../../dist/index-a301f526.esm.js';\nimport '@emotion/react';\nimport '@babel/runtime/helpers/slicedToArray';\nimport '@babel/runtime/helpers/objectWithoutProperties';\nimport '@babel/runtime/helpers/typeof';\nimport '@babel/runtime/helpers/taggedTemplateLiteral';\nimport '@babel/runtime/helpers/defineProperty';\nimport 'react-dom';\nimport '@floating-ui/dom';\nimport 'use-isomorphic-layout-effect';\nimport 'memoize-one';\n\nvar AsyncSelect = /*#__PURE__*/forwardRef(function (props, ref) {\n var stateManagedProps = useAsync(props);\n var selectProps = useStateManager(stateManagedProps);\n return /*#__PURE__*/React.createElement(Select, _extends({\n ref: ref\n }, selectProps));\n});\nvar AsyncSelect$1 = AsyncSelect;\n\nexport { AsyncSelect$1 as default };\n","import * as React from 'react';\nimport { useNavigate } from 'react-router-dom';\n\nimport AsyncSelect from 'react-select/async';\nimport { useTranslation } from 'react-i18next';\n\nimport { Lang } from '@common/typescript/objects/Lang';\nimport useRequest from '@common/react/hooks/useRequest';\nimport { List } from '@common/typescript/objects/List';\n\nimport { Page } from '@commonTuna/react/objects/Page';\n\nimport { getPageShortName, getLangByName } from '@app/components/Utils';\n\nconst HeaderSearch: React.FC = () => {\n\tconst [searchVisible, changeSearchVisibility] = React.useState(true);\n\tconst request = useRequest();\n\tconst [value, setValue] = React.useState();\n\tconst [initLoad, setInitLoad] = React.useState(true);\n\tconst [loading, setLoading] = React.useState(false);\n\tconst [defaultOptions, setDefaultOptions] = React.useState([]);\n\n\tconst navigate = useNavigate();\n\tconst { t, i18n } = useTranslation();\n\tconst lang = getLangByName(i18n.language);\n\n\tconst loadOptions = (inputValue: string, callback: (options) => void) => {\n\t\trequest>('serviceListRemote', { text: inputValue })\n\t\t\t.then((res) => {\n\t\t\t\tcallback(res.list.map((autocompleteItem: Page) => {\n\t\t\t\t\tconst name = getPageShortName(autocompleteItem, lang);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttitle: name,\n\t\t\t\t\t\tvalue: (lang === Lang.Es ? autocompleteItem.shortNameEs : autocompleteItem.shortNameEn) || '',\n\t\t\t\t\t\tlabel: (lang === Lang.Es ? autocompleteItem.shortNameEs : autocompleteItem.shortNameEn) || '',\n\t\t\t\t\t\titem: autocompleteItem,\n\t\t\t\t\t};\n\t\t\t\t}));\n\t\t\t});\n\t};\n\n\tconst onFocus = () => {\n\t\tif (initLoad && !loading) {\n\t\t\tsetLoading(true);\n\n\t\t\tloadOptions('', (list) => {\n\t\t\t\tsetDefaultOptions(list);\n\t\t\t\tsetLoading(false);\n\t\t\t\tsetInitLoad(false);\n\t\t\t});\n\t\t}\n\t};\n\n\treturn \n\t\t
'general-form-select-dropdown',\n\t\t\t\tclearIndicator: () => 'autocomplete-component-clear',\n\t\t\t\tdropdownIndicator: () => 'autocomplete-component-dropdown-indicator',\n\t\t\t\tcontrol: () => 'autocomplete-component-control',\n\t\t\t\tinput: () => 'autocomplete-component-input',\n\t\t\t\tplaceholder: () => 'autocomplete-component-placeholder',\n\t\t\t\tindicatorSeparator: () => 'autocomplete-component-indicatorSeparator',\n\t\t\t\tnoOptionsMessage: () => 'autocomplete-component-empty',\n\t\t\t\toption: () => 'autocomplete-component-option',\n\t\t\t\tsingleValue: () => 'autocomplete-component-value',\n\t\t\t}}\n\t\t\tid=\"header-select\"\n\t\t\ttheme={(theme) => ({\n\t\t\t\t...theme,\n\t\t\t\tcolors: {\n\t\t\t\t\t...theme.colors,\n\t\t\t\t\tprimary25: 'rgba(255, 255, 255, 0.3)',\n\t\t\t\t\tprimary: 'rgba(238, 174, 21, 0.5)',\n\t\t\t\t},\n\t\t\t})}\n\t\t\tdefaultOptions={defaultOptions}\n\t\t\tvalue={value}\n\t\t\tclassName=\"autocomplete-component\"\n\t\t\tplaceholder={t('forms.search')}\n\t\t\tcacheOptions\n\t\t\tloadOptions={loadOptions}\n\t\t\tisClearable\n\t\t\tisLoading={loading}\n\t\t\tonFocus={onFocus}\n\t\t\tonChange={(value: any) => {\n\t\t\t\tsetValue(value);\n\t\t\t\tif (value?.item) {\n\t\t\t\t\tnavigate(`/${(lang === Lang.Es ? `es/${value.item.fullPathEs}` : value.item.fullPath)}`);\n\t\t\t\t}\n\t\t\t}}\n\t\t/>\n\t\t \n\t ;\n};\n\nexport default HeaderSearch;\n","import * as React from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport { MenuItem } from '@common/react/objects/MenuItem';\nimport '@common/react/scss/components/menu.scss';\n\ninterface MenuItemProps extends Omit{\n\titem: MenuItem & { ariaLabel?: string };\n\trenderSubmenuOnHover?: boolean;\n}\n\ninterface MenuProps {\n\tclassName?: string;\n\titems: Array;\n\twithChildren?: boolean;\n\tbasePath?: string;\n\tpathKey?: string;\n\tdefaultOpen?: boolean;\n\trenderSubmenuOnHover?: boolean;\n}\n\nexport const Item: React.FC = (props) => {\n\tconst {\n\t\tdefaultOpen, item, basePath, pathKey, withChildren, renderSubmenuOnHover,\n\t} = props;\n\tconst [open, setOpen] = React.useState(defaultOpen || (typeof item.isOpen !== 'undefined' ? item.isOpen : false));\n\tconst [showSubmenu, setShowSubmenu] = React.useState(!renderSubmenuOnHover);\n\n\tconst toggleMenu = () => setOpen((prev) => !prev);\n\n\tconst condition = withChildren && item.children && item.children.list && item.children.list.length > 0;\n\n\tconst path = item[pathKey || 'path'];\n\n\tconst { exact = false } = item;\n\n\tconst className = `menu-component__item ${\n\t\topen && condition ? 'menu-component__item_open' : ''\n\t} ${\n\t\tcondition ? 'menu-component__item_with-children' : ''\n\t} ${item.className || ''}`;\n\n\treturn (\n\t\t setShowSubmenu(true)}>\n\t\t\t{path ? item.externalLink\n\t\t\t\t? (\n\t\t\t\t\t\n\t\t\t\t\t\t{item.name}\n\t\t\t\t\t \n\t\t\t\t)\n\t\t\t\t: (\n\t\t\t\t\t `menu-component__item-link ${isActive ? 'menu-component__item-link_active' : ''}`}\n\t\t\t\t\t\taria-label={item.ariaLabel}\n\t\t\t\t\t>\n\t\t\t\t\t\t{item.name}\n\t\t\t\t\t \n\t\t\t\t)\n\t\t\t\t: (\n\t\t\t\t\t\n\t\t\t\t\t\t{item.name}\n\t\t\t\t\t \n\t\t\t\t)\n\t\t\t}\n\t\t\t{condition && showSubmenu\n\t\t\t\t&& <>\n\t\t\t\t\t{!renderSubmenuOnHover && }\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{item.children && item.children.list.map((child, index) =>\n\t\t\t\t\t\t\t\t )}\n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t>\n\t\t\t}\n\t\t \n\t);\n};\n\nexport const Menu: React.FC = (props) => {\n\tconst {\n\t\tclassName = '', items, withChildren = false, basePath, pathKey, defaultOpen, renderSubmenuOnHover,\n\t} = props;\n\tconst menuItems = items || [];\n\n\treturn \n\t\t{menuItems.map((item, index) =>\n\t\t\t )}\n\t ;\n};\n","import * as React from 'react';\nimport { useLocation, NavLink } from 'react-router-dom';\nimport Sticky from 'react-sticky-el';\nimport { useTranslation } from 'react-i18next';\n\nimport { useApplicationContext } from '@common/react/components/Core/Application/Application';\nimport { Lang } from '@common/typescript/objects/Lang';\nimport { MenuItem } from '@common/react/objects/MenuItem';\nimport { replaceExceptNumber } from '@common/typescript/Utils';\nimport { parseQuery } from '@common/typescript/utils/url';\nimport { transformArrayToList } from '@common/typescript/objects/List';\nimport { phoneFormat } from '@common/react/components/Forms/FormikPhoneControl/FormikPhoneControl';\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\nimport Drawer from '@common/react/components/base/Drawer/Drawer';\nimport Modal from '@common/react/components/base/Modal/Modal';\nimport LinkWithLang from '@common/react/components/UI/lang/LinkWithLang/LinkWithLang';\nimport { useModal } from '@common/react/components/Modal/ModalContextProvider';\n\nimport { Page } from '@commonTuna/react/objects/Page';\n\nimport { getGoogleMapLink, getPageShortName } from '@app/components/Utils';\nimport SocialIcons from '@app/components/UI/SocialIcons/SocialIcons';\nimport BottomButton from '@app/components/UI/BottomButton/BottomButton';\nimport HeaderSearch from '@app/components/UI/Header/HeaderSearch';\nimport LocationName from '@app/components/UI/LocationName/LocationName';\nimport { Menu as CustomMenu } from '@app/components/UI/Header/Menu';\nimport ContactUsForm from '@app/components/Forms/ContactUs/ContactUsForm';\nimport { useReduxContext } from '@app/hooks/useReduxContext';\n\nconst langImg = [\n\t{\n\t\tlang: Lang.En,\n\t\timage: '/images/united-states.png',\n\t\ttitle: 'English',\n\t},\n\t{\n\t\tlang: Lang.Es,\n\t\timage: '/images/spain.webp',\n\t\ttitle: 'Spanish',\n\t},\n];\n\nconst transformMenuRecursively = (items: Array, lang: Lang, checkSubChildren?: boolean) => {\n\treturn items.map((item) => {\n\t\tconst newItem: Partial = {\n\t\t\tpath: lang === Lang.Es ? `/es/${item.fullPath}` : `/${item.fullPath}`,\n\t\t\tname: getPageShortName(item, lang),\n\t\t\texact: true,\n\t\t};\n\n\t\tif (item.children && item.children.list) {\n\t\t\tif (item.children.list.length > 12) {\n\t\t\t\tnewItem.className = 'three-columns-menu';\n\t\t\t}\n\n\t\t\tif (checkSubChildren && item.children.list.some((child) => child.children && child.children.list && child.children.list.length > 0)) {\n\t\t\t\tnewItem.className = 'with-sub-children';\n\t\t\t}\n\n\t\t\tnewItem.children = {\n\t\t\t\t...item.children,\n\t\t\t\tlist: transformMenuRecursively(item.children.list, lang),\n\t\t\t};\n\t\t} else {\n\t\t\tnewItem.children = transformArrayToList([]);\n\t\t}\n\n\t\treturn newItem as MenuItem;\n\t});\n};\n\nconst Header: React.FC = () => {\n\tconst menuContainer = React.useRef(null);\n\tconst [isMenuOpen, setMenuOpen] = React.useState(false);\n\tconst [modalVisible, setModalVisible] = React.useState(false);\n\tconst ref = React.useRef(null);\n\tconst { renderModal } = useModal();\n\n\tconst location = useLocation();\n\tconst { i18n, t } = useTranslation();\n\tconst {\n\t\toffices,\n\t\tmenu,\n\t} = useReduxContext();\n\tconst { getLang, setLang } = useApplicationContext();\n\tconst lang = getLang();\n\n\tReact.useEffect(() => {\n\t\twindow.scrollTo(0, 0);\n\t\tsetMenuOpen(false);\n\t\tmenuContainer.current && menuContainer.current.classList.toggle('closed-menu');\n\t\tsetTimeout(() => menuContainer.current?.classList.toggle('closed-menu'), 0);\n\t}, [location.pathname, parseQuery(location.search).page]);\n\n\tconst changeLang = (lng: string) => {\n\t\tconst lang = Lang[lng];\n\n\t\ti18n.changeLanguage(lng.toLowerCase());\n\t\tsetLang(lang);\n\t};\n\n\tconst menuItems = React.useMemo(() => {\n\t\treturn transformMenuRecursively(menu, lang, true);\n\t}, [menu, lang]);\n\n\tconst toggleMenu = () => setMenuOpen((prev) => !prev);\n\n\tconst openDialog = React.useCallback(() => {\n\t\tsetModalVisible(true);\n\t}, []);\n\tconst closeDialog = React.useCallback(() => setModalVisible(false), []);\n\tconst handleLogoClick = () => {\n\t\tif (ref.current) {\n\t\t\tref.current.scrollIntoView({ behavior: 'smooth' });\n\t\t}\n\t};\n\n\treturn <>\n\t\t
\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{offices.length > 0 ? offices.map((item, index) =>
\n\t\t\t\t\t\t\t\t\t\t\t{index > 0 && }\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t \n \n\t\t\t\t\t\t\t\t\t\t\t\t{phoneFormat(item.phone)} \n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t ) :
&nbrp; }\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tlangImg.map((item) =>
changeLang(Lang[lang] === 'Es' ? 'En' : 'Es')}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tSale\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t\t\t\t\texact: true,\n\t\t\t\t\t\t\t\t\t\t} as any)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{t('site.Schedule Consultation')}\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t \n\t\t\t \n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlangImg.map((item) =>
changeLang(Lang[lang] === 'Es' ? 'En' : 'Es')}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t{offices.map((item) => (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t))}\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\ttoggleMenu();\n\t\t\t\t\t\t\topenDialog();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t \n \n\t\t\t\t\t\t{t('site.Schedule Consultation')}\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t{t('site.Special Offers')}\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t\t \n\t\t \n\t\t{renderModal(modalVisible, () => setMenuOpen(false), {\n\t\t\ttitle: t('site.Schedule an Appointment Now'),\n\t\t\tstyle: { width: 'min(950px, 100vw - 50px, 100%)' },\n\t\t\tafterClose: closeDialog,\n\t\t\tchildren: ,\n\t\t})}\n\t\t \n\t>;\n};\n\nexport default Header;\n","export interface List {\n\tcount: number;\n\texecution: number;\n\toffset: number;\n\tlist: Array;\n}\n\nexport type Rows = List;\n\nexport const transformArrayToList = (items: any[]): List => ({count: items.length, list: items, offset: 0, execution: 0});\n\nexport const isList = (arg: any) => arg.list !== undefined;\n","import React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport LinkWithLang from '@common/react/components/UI/lang/LinkWithLang/LinkWithLang';\n\nimport { Location } from '@commonTuna/react/objects/BaseLocation';\n\nimport { capitalizeFirstLetter } from '@app/components/Utils';\n\ninterface Props {\n\titem: Location;\n\twithoutLink?: boolean;\n\tcolor?: string;\n}\n\nconst LocationName: React.FC = ({ item, withoutLink, color = '#ecbc3f' }) => {\n\tconst code = item?.shortState;\n\tconst { i18n } = useTranslation();\n\tconst langName: 'En' | 'Es' = capitalizeFirstLetter(i18n.language);\n\n\tconst name = `${item?.[`name${langName}`]}${code ? `, ${code}` : ''}`;\n\n\treturn <>\n\t\t{' '}\n\t\t{item[`path${langName}`] && !withoutLink\n\t\t\t? \n\t\t\t\t{name}\n\t\t\t \n\t\t\t: name}\n\t>;\n};\n\nexport default LocationName;\n","import * as React from 'react';\n\nimport { useReduxContext } from '@app/hooks/useReduxContext';\n\ninterface Props {\n\tclassName?: string;\n\tsvgIconFill?: string;\n\tlocationId?: number;\n\ticons?: Array<{key: string, icon: React.ReactNode, title: string }>;\n\tsocialMedias?: Array<{ link: string }>;\n}\n\nconst getRSLogo = (fill: string = '#342e20') => {\n\treturn \n\t\t \n\t\t \n\t\t \n\t ;\n};\n\nconst defaultIcons = [\n\t{\n\t\tkey: 'facebook',\n\t\ticon: ,\n\t\ttitle: 'facebook link',\n\t},\n\t{\n\t\tkey: 'instagram',\n\t\ticon: ,\n\t\ttitle: 'instagram link',\n\t},\n\t{\n\t\tkey: 'realself',\n\t\ticon: ,\n\t\ttitle: 'realself link',\n\t},\n\t{\n\t\tkey: 'twitter',\n\t\ticon: ,\n\t\ttitle: 'twitter link',\n\t},\n];\n\nconst SocialIcons: React.FC = ({\n\tclassName, svgIconFill, locationId, icons = defaultIcons, socialMedias: socialMediasProps,\n}) => {\n\tconst { offices } = useReduxContext();\n\tconst socialMedias = socialMediasProps\n\t\t|| (locationId ? offices?.find((item) => item.id === locationId)?.socialMedias : offices?.[0]?.socialMedias);\n\treturn ;\n};\n\nexport default SocialIcons;\n","import * as React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { Loading } from '@common/react/components/UI/Loading/Loading';\n\nconst TranslatedLoading: React.FC = () => {\n\tconst { t } = useTranslation();\n\n\treturn ;\n};\n\nexport default TranslatedLoading;\n","import { WithLangs } from '@common/typescript/objects/Page';\nimport { Lang } from '@common/typescript/objects/Lang';\n\nimport { Page, PageInfo } from '@commonTuna/react/objects/Page';\n\nexport const phoneMask = ['+', '1', ' ', '(', /[1-9]/, /\\d/, /\\d/, ')', ' ', /\\d/, /\\d/, /\\d/, '-', /\\d/, /\\d/, /\\d/, /\\d/];\n\nexport function capitalizeFirstLetter(string) {\n\treturn string[0].toUpperCase() + string.slice(1);\n}\n\nexport const sliderSettings = {\n\tdots: false,\n\tinfinite: true,\n\tslidesToScroll: 1,\n\tautoplay: true,\n\tautoplaySpeed: 4000,\n\tswipeToSlide: true,\n\tresponsive: [\n\t\t{\n\t\t\tbreakpoint: 767,\n\t\t\tsettings: {\n\t\t\t\tslidesToShow: 1,\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport const reviewsSliderSettings = {\n\t...sliderSettings,\n\tslidesToShow: 3,\n\tadaptiveHeight: false,\n\tresponsive: [\n\t\t{\n\t\t\tbreakpoint: 1200,\n\t\t\tsettings: {\n\t\t\t\tslidesToShow: 2,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tbreakpoint: 767,\n\t\t\tsettings: {\n\t\t\t\tslidesToShow: 1,\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport const getMoneyString = (value: number, currencyPrefix = '$') => {\n\treturn `${currencyPrefix}${value.toFixed(2).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')}`;\n};\n\nexport const isEmptyOrSpaces = (str: string) => {\n\treturn !str || str.match(/^ *$/) !== null;\n};\n\nexport const getGoogleMapLink = (address: string): string => {\n\treturn `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;\n};\n\nexport const getPageInfo = (item: WithLangs, lang: Lang): PageInfo | undefined => {\n\treturn item.langs.length > 0 ? (item.langs.find((langItem) => langItem.language === lang) || item.langs[0]) : undefined;\n};\n\nexport const getPageShortName = (item: Page, lang: Lang): string => {\n\treturn lang === Lang.Es\n\t\t? item?.shortNameEs || item?.shortNameEn || item?.name\n\t\t: item?.shortNameEn || item?.shortNameEs || item?.name;\n};\n\nexport const getLangByName = (language: string): Lang => {\n\treturn (Lang[capitalizeFirstLetter(language.toLowerCase())] || Lang.En) as Lang;\n};\n","import * as React from 'react';\nimport { shallowEqual, useSelector } from 'react-redux';\n\n// eslint-disable-next-line\nimport once from 'lodash/once';\n// eslint-disable-next-line\nimport isEmpty from 'lodash/isEmpty';\n\nimport { Company } from '@commonTuna/react/objects/Company';\nimport { Location } from '@commonTuna/react/objects/BaseLocation';\nimport { Doctor } from '@commonTuna/react/objects/BaseDoctor';\nimport { Page } from '@commonTuna/react/objects/Page';\n\nimport { ApplicationState } from '@app/store';\n\nexport interface ReduxContext {\n\tcompanySettings: Company;\n\toffices: Array;\n\tmenu: Array;\n\tinitDoctors: Array;\n}\n\nexport const createReduxContext = once(() => React.createContext({} as ReduxContext));\n\nexport const useReduxContext: () => ReduxContext = () => {\n\tconst context: ReduxContext = React.useContext(createReduxContext());\n\n\tif (isEmpty(context)) throw 'Need Redux Context!';\n\n\treturn context;\n};\n\nconst ReduxProvider: React.FC = ({\n\tchildren,\n}) => {\n\tconst ReduxProvider = createReduxContext();\n\n\tconst value = useSelector((state: ApplicationState) => ({\n\t\tcompanySettings: state.companySettings.item,\n\t\toffices: state.offices.items,\n\t\tmenu: state.menu.items,\n\t\tinitDoctors: state.initDoctors.items,\n\t}), shallowEqual);\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t{typeof children === 'function' ? children(value) : children}\n\t\t\t \n\t\t>\n\t);\n};\n\nexport default ReduxProvider;\n","import * as React from 'react';\nimport { Routes, Route, Outlet } from 'react-router-dom';\n\nimport loadable from '@loadable/component';\n\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\nimport NotFoundRoute from '@common/react/components/Routes/NotFoundRoute';\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\n\nimport Layout from '@app/components/Layout';\nimport { MainRoute } from '@app/components/Routes/MainRoute';\n\nconst paramsTranslated = {\n\tfallback: ,\n};\n\nconst base = '/:locale(en|es)?';\n\nconst Home = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"HomePage\" */\n\t\t'@app/components/Pages/Home/Home'\n\t)), paramsTranslated);\nconst Contacts = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ContactsPage\" */\n\t\t'@app/components/Pages/Contacts/Contacts'\n\t)), paramsTranslated);\nconst Section = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"SectionPage\" */\n\t\t'@app/components/Pages/Section/Section'\n\t)), paramsTranslated);\nconst DoctorList = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DoctorListPage\" */\n\t\t'@app/components/Pages/DoctorList/DoctorList'\n\t)), paramsTranslated);\nconst BeforeAfter = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"BeforeAfterPage\" */\n\t\t'@app/components/Pages/BeforeAfterList/BeforeAfter'\n\t)), paramsTranslated);\nconst DoctorPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DoctorPage\" */\n\t\t'@app/components/Pages/DoctorList/DoctorPage'\n\t)), paramsTranslated);\nconst ClinicPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ClinicPage\" */\n\t\t'@app/components/Pages/Clinic/ClinicPage'\n\t)), paramsTranslated);\nconst BlogPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"BlogPage\" */\n\t\t'@app/components/Pages/Blog/Blog'\n\t)), paramsTranslated);\nconst FaqListPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"FaqListPage\" */\n\t\t'@app/components/Pages/Faq/Faq'\n\t)), paramsTranslated);\nconst SingleFaq = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"SingleFaqPage\" */\n\t\t'@app/components/Pages/Faq/FaqPage'\n\t)), paramsTranslated);\nconst Specials = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Specials\" */\n\t\t'@app/components/Pages/Specials/Specials'\n\t)), paramsTranslated);\nconst Sale = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Sale\" */\n\t\t'@app/components/Pages/Sale/Sale'\n\t)), paramsTranslated);\n\nexport const baseRoutes = (\n\t<>\n\t\t }\n\t\t>\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\t } />\n\t\t\n\t\t } />\n\t>\n);\n\nexport const clientRoutes = (\n\t\t \n\t}\n>\n\t{baseRoutes}\n );\n\nexport const routes = (\n\t\n\t\t{baseRoutes}\n\t \n );\n","import { fetch } from 'domain-task';\n\nimport { BaseApplicationState } from '@common/react/store';\nimport { BaseUser } from '@common/react/objects/BaseUser';\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\n\ninterface Message {\n\tsuccess: number;\n\tresponse: T;\n\tsession: string;\n}\n\nexport interface ResponseError {\n\tmessage: string;\n\tcode: number;\n\tname?: string;\n}\n\nconst baseRequest = <\n\tT,\n\tTUser extends BaseUser,\n\tTApplicationState extends BaseApplicationState\n>(type: string, data: BaseParams = {}, state?: TApplicationState, signal?: AbortSignal): Promise => {\n\treturn fetch('api/post', {\n\t\tcredentials: 'same-origin',\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-type': 'application/json; charset=utf-8',\n\t\t\tCookie: `session=${state ? state.login.session : ''}`,\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\ttype,\n\t\t\tdata: JSON.stringify(data),\n\t\t}),\n\t\tsignal,\n\t})\n\t\t.then((response) => response.json() as Message)\n\t\t.then((data: Message) => {\n\t\t\tif (!data.success) {\n\t\t\t\tthrow data.response as ResponseError;\n\t\t\t}\n\n\t\t\treturn data.response as T;\n\t\t});\n};\n\nconst request = <\n\tT,\n\tTUser extends BaseUser,\n\tTApplicationState extends BaseApplicationState\n\t>(type: string, data: BaseParams = {}, state?: TApplicationState, signal?: AbortSignal): Promise => {\n\treturn baseRequest(type, data, state, signal)\n\t\t.catch((error: ResponseError) => {\n\t\t\tif (error.name === 'AbortError') {\n\t\t\t\tthrow new Error('Aborted');\n\t\t\t}\n\t\t\tif (error.message === 'Access denied' && window) {\n\t\t\t\twindow.location.href = '/';\n\t\t\t}\n\n\t\t\tconsole.log(error.message);\n\t\t\tthrow error.message as string;\n\t\t});\n};\n\nexport { baseRequest, request };\n","/*! js-cookie v3.0.1 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (key, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n key = encodeURIComponent(key)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n key + '=' + converter.write(value, key) + stringifiedAttributes)\n }\n\n function get (key) {\n if (typeof document === 'undefined' || (arguments.length && !key)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var foundKey = decodeURIComponent(parts[0]);\n jar[foundKey] = converter.read(value, foundKey);\n\n if (key === foundKey) {\n break\n }\n } catch (e) {}\n }\n\n return key ? jar[key] : jar\n }\n\n return Object.create(\n {\n set: set,\n get: get,\n remove: function (key, attributes) {\n set(\n key,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport default api;\n","import { HubConnection } from '@microsoft/signalr';\n\nlet hub: HubConnection | null = null;\n\nexport const getSignalR = (): Promise => {\n\treturn import('@microsoft/signalr' /* webpackChunkName: \"signalR\" */).then((signalR) => {\n\t\tif (hub) {\n\t\t\treturn Promise.resolve(hub);\n\t\t}\n\n\t\thub = new signalR.HubConnectionBuilder()\n\t\t\t.withUrl('/notificationHub')\n\t\t\t.withAutomaticReconnect()\n\t\t\t.build();\n\n\t\thub.start().catch((err) => console.error(err));\n\n\t\treturn Promise.resolve(hub);\n\t}).catch((e) => {\n\t\tconsole.error(e);\n\t\treturn Promise.reject(e);\n\t});\n};\n\nexport const callWithConnectionOnce = (callback: (connectionId: string | undefined | null) => void) => {\n\tgetSignalR().then((hub) => {\n\t\tconst hubConnection = (hub as HubConnection);\n\n\t\tif (!hubConnection.connectionId) {\n\t\t\thubConnection.stop().then(() => hubConnection.start().then(() => callback(hubConnection.connectionId)));\n\t\t} else {\n\t\t\tcallback(hubConnection.connectionId);\n\t\t}\n\t});\n};\n","import * as React from 'react';\n\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport { bindActionCreators } from 'redux';\n\nimport once from 'lodash/once';\nimport isEmpty from 'lodash/isEmpty';\n\nimport Cookies from 'js-cookie';\n\nimport { BaseUser } from '@common/typescript/objects/BaseUser';\nimport { BaseApplicationState } from '@common/react/store';\nimport { getSignalR } from '@common/react/utils/configureSignarR';\nimport useRequest from '@common/react/hooks/useRequest';\nimport { BuildData } from '@common/react/objects/BuildData';\nimport BaseHostOptions from '@common/react/store/BaseHostOptions';\nimport { BaseInit } from '@common/react/objects/BaseInit';\nimport { Lang } from '@common/typescript/objects/Lang';\nimport { RequestType } from '@common/react/components/RequestProvider/RequestProvider';\nimport { getActionCreators } from '@common/react/store/Login';\n\nexport interface ApplicationContext {\n\tonTransmutation: () => void;\n\tgetTransmutationFlag: () => boolean;\n\tgetUser: () => TUser;\n\tupdateUser: (data: any, getUser?: (user) => any) => void;\n\tgetHostOptions: () => THostOptions;\n\tgetBuildData: () => TBuildData;\n\tgetLang: () => Lang;\n\tsetLang: (lang: Lang) => void;\n\trequest: RequestType;\n\tsubscribe: (handle: (notify: any) => void) => () => void;\n\tcheckUserAccess: (roles: Array, props?: any) => boolean;\n\tmemoUntilLogout: (factory: () => unknown, deps?: React.DependencyList | undefined) => any;\n\tsubscribeUntilLogout: (handle: (notify: any) => void, deps?: React.DependencyList | undefined) => void;\n\thandleLogin: >(init: TInit) => void;\n\tlogout: (clearState?: boolean) => void;\n\tgetUserUtcOffset: () => string | undefined;\n}\n\nexport interface AuthResult> {\n\tinitObject: TInit;\n}\n\ninterface Props> {\n\tchildren?: React.ReactNode;\n\tinitCustomHandler?: ((dispatch: any, init: TInit) => void);\n\ttransmutationHandler?: () => void;\n\tcheckUserAccess?: (user: TUser, roles: Array, props?: any) => boolean;\n\t/*\n\t* must be constant (affects the number of hooks)\n\t* */\n\twithoutSignalR?: boolean;\n}\n\nexport const subscribe = (handle: (notify: any) => void) => () => {\n\tgetSignalR().then((connection) => connection.on('handle', handle));\n\n\treturn () => {\n\t\tgetSignalR().then((connection) => connection.off('handle', handle));\n\t};\n};\n\nexport const createApplicationContext = once(() => React.createContext({} as ApplicationContext));\n\nexport const useApplicationContext: () => ApplicationContext = () => {\n\tconst context : ApplicationContext = React.useContext(createApplicationContext());\n\n\tif (isEmpty(context)) throw 'Need Application context!';\n\n\treturn context;\n};\n\nconst Application: >(\n\tp: Props,\n) => React.ReactElement = >({\n\tchildren,\n\tinitCustomHandler,\n\ttransmutationHandler,\n\tcheckUserAccess,\n\twithoutSignalR,\n}: Props) => {\n\tconst ApplicationContext = createApplicationContext();\n\n\tconst onTransmutation = transmutationHandler ?? (() => window.location.replace('/dashboard'));\n\tconst getUser = () =>\n\t\tuseSelector((state: BaseApplicationState) => state.login.user! as TUser, shallowEqual);\n\tconst getHostOptions = () =>\n\t\tuseSelector((state: any) => (state.hostOptions.item), shallowEqual) as THostOptions;\n\tconst getBuildData = () =>\n\t\tuseSelector((state: any) => (state.buildData.item), shallowEqual) as TBuildData;\n\tconst getTransmutationFlag = () =>\n\t\tuseSelector((state: BaseApplicationState) => state.login.transmuted, shallowEqual);\n\tconst getLang: () => Lang = () => useSelector((state: BaseApplicationState) => state.login.lang, shallowEqual);\n\tconst request = useRequest();\n\tconst getUserUtcOffset = () => getUser().baseUtcOffset || undefined;\n\n\tconst user = getUser() as TUser;\n\tconst _checkUserAccess = (roles, props) => (checkUserAccess && checkUserAccess(user!, roles, props)) || false;\n\tconst dispatch = useDispatch();\n\n\tconst {\n\t\tlogoff,\n\t\tupdateUser,\n\t\tsetUserAndSession,\n\t\tsetLang,\n\t} = React.useMemo(() => bindActionCreators(getActionCreators(), dispatch), [user]);\n\n\tconst logout = (clearState?: boolean) => logoff(clearState);\n\n\tconst memoUntilLogout = (factory: () => unknown, deps?: React.DependencyList | undefined) =>\n\t\tReact.useMemo(factory, deps ? [user].concat(deps) : [user]);\n\n\tconst subscribeUntilLogout = (handler: (notify: any) => void, deps?: React.DependencyList | undefined) =>\n\t\tReact.useEffect(subscribe(handler), deps ? [user].concat(deps) : [user]);\n\n\tconst handleSession = >(data: TInit) => {\n\t\tconst sessionGuid = data.guid as string;\n\t\t// It is necessary to put a cookie on the frontend at the time of receiving a notification\n\t\t// if the connection to the signalR has been lost (when login)\n\t\tCookies.set('session', sessionGuid);\n\t\tsetUserAndSession(data.user as BaseUser, sessionGuid);\n\t};\n\n\tconst handleLogin = (init) => {\n\t\tif (init && init.user && init.guid) {\n\t\t\t!user && initCustomHandler && initCustomHandler(dispatch, init);\n\t\t\thandleSession(init);\n\t\t}\n\t};\n\n\tconst baseHandler = (notification) => {\n\t\tswitch (notification.objectType) {\n\t\t\tcase 'Init':\n\t\t\t\t// it is necessary to reload all pages of the user if he transmuted into another\n\t\t\t\tif (user && notification.data?.user?.id !== user.id) {\n\t\t\t\t\tonTransmutation();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\thandleLogin(notification.data);\n\t\t\t\tbreak;\n\t\t\tcase 'UserSession':\n\t\t\t\thandleSession(notification.data);\n\t\t\t\tbreak;\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handle = (notification) => {\n\t\tswitch (notification.objectType) {\n\t\t\tcase 'NotificationUser':\n\t\t\t\tif (user && notification.service && user.unviewedNotificationsCount > 0) {\n\t\t\t\t\tupdateUser({ unviewedNotificationsCount: user.unviewedNotificationsCount - 1 });\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ReadAllNotification':\n\t\t\t\tif (notification.service) {\n\t\t\t\t\tupdateUser({ unviewedNotificationsCount: 0 });\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UserStateNotificationObject':\n\t\t\t\tif (user && notification.service) {\n\t\t\t\t\tconst status = notification.data.userStatuses.find((q) => q.id === user.id)?.status;\n\t\t\t\t\tstatus && updateUser({ status: status.status });\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (user && !notification.service) {\n\t\t\t\t\tupdateUser({ unviewedNotificationsCount: user.unviewedNotificationsCount + 1 });\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tif (!withoutSignalR) {\n\t\tReact.useEffect(subscribe(baseHandler), [!user]);\n\t\tsubscribeUntilLogout(handle);\n\t}\n\n\treturn <>\n\t\t\n\t\t\t{children}\n\t\t \n\t>;\n};\n\ninterface AfterLogoutProps {\n\tcallback: () => void\n}\n\nexport const AfterLogout: React.FC = ({\n\tcallback,\n}) => {\n\tconst { getUser } = useApplicationContext();\n\tconst user = getUser();\n\n\tReact.useEffect(() => {\n\t\tuser == null && callback && callback();\n\t}, [user]);\n\n\treturn <>>;\n};\n\nexport default Application;\n","/**\n * ## ItemProvider.tsx ##\n * This file contains ItemProvider component\n * @packageDocumentation\n */\n\nimport * as React from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nimport once from 'lodash/once';\nimport isEmpty from 'lodash/isEmpty';\nimport { AnySchema, ValidationError } from 'yup';\n\nimport { WithDeleted } from '@common/typescript/objects/WithDeleted';\nimport useRequest from '@common/react/hooks/useRequest';\nimport { BaseParams } from '@common/react/objects/BaseParams';\nimport { ClearValue } from '@common/react/utils/utils';\nimport { useRequestProviderContext } from '@common/react/components/RequestProvider/RequestProvider';\nimport useAbortController from '@common/react/hooks/useAbortController';\n\nexport enum Mode {\n\tView,\n\tEdit\n}\n\n/**\n * This is the description of the interface\n *\n * @interface ItemProviderProps\n * @typeParam T - T Any WithDeleted entity\n */\nexport interface ItemProviderProps {\n\t/**\n\t * Element ID. Used as load param\n\t */\n\tid: number;\n\t/**\n\t * ReactElement to be wrapped in an ItemProvider context\n\t */\n\tchildren: React.ReactNode | ((context: ItemProviderContext) => React.ReactNode);\n\t/**\n\t * Schema for checking element before saving.\n\t *\n\t * - Need to set a default value for the property that will be validated\n\t */\n\tvalidationSchema?: AnySchema;\n\t/**\n\t * By default determines which item to load and how to save it\n\t */\n\ttype: string;\n\t/**\n\t * Defines the default element if id < 0.\n\t * Ignored if withoutAdd is set to true\n\t */\n\tadd?: Partial;\n\t/**\n\t * Defines the default element.\n\t * Ignored if withoutAdd is set to false and id < 0\n\t */\n\titem?: T | undefined;\n\t/**\n\t * load request name. The default is made up of type.\n\t */\n\tloadRequest?: string;\n\t/**\n\t * load request name. The default is made up of type.\n\t */\n\tsaveRequest?: string;\n\t/**\n\t * transform item before send to server\n\t * @param item - element before submit\n\t * @return the element to be sent in the request\n\t */\n\tclearForSubmit?: (item: T) => ClearValue | T;\n\t/**\n\t * error handling function\n\t * @param error - error text\n\t */\n\tonRequestError?: ((error: string) => void);\n\t/**\n\t * get error message\n\t * @param error - error text\n\t */\n\ttransformErrorMessage?: ((error: string) => string);\n\t/**\n\t * error handling function for load request\n\t * @param error - error text\n\t * @default onRequestError\n\t */\n\tonLoadRequestError?: ((error: string) => void);\n\t/**\n\t * error handling function for save\n\t * @param error - error text\n\t * @default onRequestError\n\t */\n\tonSaveRequestError?: ((error: string) => void);\n\t/**\n\t * validation error handling function\n\t * @param item - not valid element\n\t * @param err - solved error\n\t * @param error - original error object\n\t */\n\tonValidationError?: ((item: T, err, error: ValidationError) => void);\n\t/**\n\t * view mode\n\t */\n\treadonly?: boolean;\n\t/**\n\t * function to be called after load\n\t * @param res - request response\n\t */\n\tonLoad?: (res: T) => void;\n\t/**\n\t * load params\n\t */\n\tadditionalParams?: BaseParams;\n\t/**\n\t * function to be called after item change\n\t * @param item - new element\n\t */\n\tupdateItem?: (item: T) => void;\n\t/**\n\t * a function that converts an element after saving\n\t * @param item - element\n\t * @param response - request response\n\t * @param prevItem - item before edit\n\t * @return Partial\n\t */\n\ttransformAfterSave?: (item: T | undefined, response: T, prevItem: T) => Partial;\n\t/**\n\t * init load condition\n\t */\n\tskipInitLoad?: boolean;\n\t/**\n\t * init error\n\t */\n\terror?: string;\n\t/**\n\t * defines the default value if element id < 0\n\t */\n\twithoutAdd?: boolean;\n\t/**\n\t * a function that converts an element after saving\n\t * @param response - request response\n\t * @param item - element\n\t * @return number\n\t */\n\tgetIdAfterSave?: (response: T, data: T) => number;\n\t/**\n\t * a function that handles the url\n\t * @param response - request response\n\t * @param item - element\n\t * @return number\n\t */\n\thandleUrlAfterSave?: (response: T, data: T, navigate, location) => void;\n\t/**\n\t * function to be called after save\n\t * @param item - saved item\n\t * @param res - request response\n\t */\n\tonSave?: (item: T, response?: T) => void;\n\t/**\n\t * time to live (ms) for cached response at RequestProvider if cache is available\n\t */\n\tttl?: number;\n}\n\nexport interface ItemProviderContextState {\n\t/**\n\t * stored element\n\t */\n\titem: T;\n\t/**\n\t * loading state for ItemProvider requests (save, update, delete), it will be true if itemProvider making that request\n\t */\n\tloading: boolean;\n\t/**\n\t * stored save or load error message\n\t */\n\terror: string;\n\t/**\n\t * type from props\n\t */\n\ttype: string;\n\t/**\n\t * view mode\n\t */\n\treadonly: boolean;\n\t/**\n\t * Schema for checking element before saving.\n\t *\n\t * - Need to set a default value for the property that will be validated\n\t */\n\tvalidationSchema?: AnySchema;\n\t/**\n\t * loading state for load request, it will be true, if ItemProvider try to load item\n\t */\n\titemLoading: boolean;\n\t/**\n\t * success message state\n\t */\n\tmessage: string;\n\t/**\n\t * a function that converts an element after saving\n\t * @param response - request response\n\t * @param item - element\n\t * @return number\n\t */\n\tgetIdAfterSave: (response: T, data: T) => number;\n\t/**\n\t * a function that converts an element after saving\n\t * @param item - element\n\t * @param response - request response\n\t * @param prevItem - item before edit\n\t * @return Partial\n\t */\n\ttransformAfterSave: (item: T | undefined, response: T, prevItem: T) => Partial;\n}\n\ninterface LoadOptions {\n\tsilent: boolean;\n}\n\ninterface ItemProviderContextActions {\n\t/**\n\t * load new item for ItemProvider\n\t * @param params - load params\n\t * @param options - LoadOptions\n\t * @return Promise\n\t */\n\tload: (params?: BaseParams, options?: LoadOptions) => Promise;\n\t/**\n\t * send save request\n\t * @param item - new item\n\t * @param skipValidation - ignore validation or no. By default is undefined\n\t * @param requestName\n\t * @return Promise\n\t */\n\tupdate: (item: T, skipValidation?: boolean, requestName?: string) => Promise;\n\t/**\n\t * update stored item without request\n\t * @param value - React.SetStateAction\n\t */\n\tsetItem: (value: React.SetStateAction) => void;\n\t/**\n\t * sent delete item request\n\t */\n\tdeleteItem: () => void;\n\t/**\n\t * update message state\n\t * @param value - React.SetStateAction\n\t */\n\tsetMessage: (value) => void;\n\t/**\n\t * update error state\n\t * @param error - error message\n\t */\n\tsetError: (error: string) => void;\n}\n\nexport interface ItemProviderContext {\n\tstate: ItemProviderContextState;\n\tactions: ItemProviderContextActions;\n}\n\nexport const createItemProviderContext = once(() => React.createContext({} as ItemProviderContext));\n\n/**\n * useItemProviderContext - get ItemProviderContext\n * @typeParam T - T Any {WithKey}\n * @param required - if true throw exception when context is empty\n * @returns ItemProviderContext\n */\nexport const useItemProviderContext = (required = true) => {\n\tconst context : ItemProviderContext = React.useContext(createItemProviderContext());\n\n\tif (required && isEmpty(context)) throw 'Need ItemProvider context!';\n\n\treturn context;\n};\n\n/**\n * defaultGetIdAfterSave - get element id\n * @param response - request response\n * @param data - element\n * @returns res\n */\nconst defaultGetIdAfterSave = (response, data) => response.id as number;\n\n/**\n * defaultHandleUrlAfterSave - get element id\n * @param response - request response\n * @param data - element\n * @param navigate\n * @param location\n */\nconst defaultHandleUrlAfterSave = (response, data, navigate, location) => {\n\tif (data.id < 0) {\n\t\twindow.setTimeout(() => {\n\t\t\tnavigate({\n\t\t\t\t...location,\n\t\t\t\tpathname: location.pathname.replace('/-1', `/${response.id}`),\n\t\t\t}, { replace: true });\n\t\t}, 0);\n\t}\n};\n\n/**\n * ItemProvider component.\n *\n * usage examples:\n * - {React.ReactNode} \n * - {(context) => React.ReactNode} \n * - {({ state: { itemLoading }}) => itemLoading ? : React.ReactNode} \n * use itemLoading when you need to show something before the item is loaded\n *\n * @typeParam T - T Any {WithKey}\n * @param props - ItemProviderProps\n * @type {React.FC}\n * @returns React.ReactElement\n */\n\nexport const ItemProvider: (p: ItemProviderProps) => React.ReactElement = (\n\t{\n\t\titem = undefined,\n\t\ttype,\n\t\tloadRequest = type,\n\t\tsaveRequest = type,\n\t\tchildren,\n\t\tvalidationSchema,\n\t\tclearForSubmit = (item) => item,\n\t\tonRequestError,\n\t\tonLoadRequestError = onRequestError,\n\t\tonSaveRequestError = onRequestError,\n\t\tonValidationError,\n\t\treadonly = true,\n\t\tonLoad,\n\t\tadditionalParams = {},\n\t\tupdateItem,\n\t\ttransformAfterSave = (item, response) => item as T,\n\t\tid = -1,\n\t\tskipInitLoad = false,\n\t\terror: initError = '',\n\t\tadd = {},\n\t\twithoutAdd = false,\n\t\tgetIdAfterSave = defaultGetIdAfterSave,\n\t\thandleUrlAfterSave = defaultHandleUrlAfterSave,\n\t\tonSave,\n\t\tttl,\n\t\ttransformErrorMessage = (err) => err,\n\t} : ItemProviderProps,\n) => {\n\tconst ItemContext = createItemProviderContext();\n\n\tconst [_item, _setItem] = React.useState(!withoutAdd && +id < 0 ? { id, ...add } as T : item as T);\n\tconst [loading, setLoading] = React.useState(false);\n\tconst [error, setError] = React.useState(initError);\n\tconst [message, setMessage] = React.useState('');\n\tconst [itemLoading, setItemLoading] = React.useState(+id < 0 ? false : !item || !skipInitLoad);\n\tconst data = React.useRef(skipInitLoad ? id : 0);\n\tconst location = useLocation();\n\tconst navigate = useNavigate();\n\tconst request = useRequest();\n\tconst requestContext = useRequestProviderContext();\n\tconst [abortController, setAbortController] = useAbortController();\n\n\tReact.useEffect(() => {\n\t\tif ((!_item || +id !== +data.current) && +id >= 0) {\n\t\t\tsetItemLoading(true);\n\t\t\tconst oldId = data.current;\n\t\t\tdata.current = +id;\n\t\t\tload()\n\t\t\t\t.then(() => {\n\t\t\t\t\tsetError((prev) => {\n\t\t\t\t\t\tif (prev) {\n\t\t\t\t\t\t\tdata.current = oldId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn prev;\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch((err) => (typeof err !== 'string' || !err?.includes('aborted')) && console.log(err));\n\t\t}\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tif (skipInitLoad && _item && +id >= 0 && +id === _item.id && requestContext?.actions?.updateCache) {\n\t\t\trequestContext.actions.updateCache(\n\t\t\t\tloadRequest,\n\t\t\t\t{ ...additionalParams, id },\n\t\t\t\titem,\n\t\t\t\tttl,\n\t\t\t);\n\t\t}\n\t\treturn () => {\n\t\t\tabortController.abort();\n\t\t};\n\t}, []);\n\n\tconst setItem = (value: React.SetStateAction) => {\n\t\t_setItem((prev) => {\n\t\t\tconst newItem = typeof value === 'function' ? value(prev) : value;\n\t\t\tdata.current = newItem.id;\n\t\t\tupdateItem && updateItem(newItem);\n\t\t\treturn newItem;\n\t\t});\n\t};\n\n\tconst load = (params?: BaseParams, options?: LoadOptions) => {\n\t\tsetError('');\n\n\t\treturn request(\n\t\t\tloadRequest,\n\t\t\t{ ...additionalParams, ...params, id },\n\t\t\t() => !options?.silent && setItemLoading(true),\n\t\t\tttl,\n\t\t\tabortController.signal,\n\t\t)\n\t\t\t.then((res: T) => {\n\t\t\t\tsetItem(res);\n\t\t\t\t!options?.silent && setItemLoading(false);\n\t\t\t\tonLoad && onLoad(res);\n\t\t\t\treturn res;\n\t\t\t}).catch((error) => {\n\t\t\t\tif (typeof error === 'string' && error.includes('aborted')) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\t!options?.silent && setItemLoading(false);\n\n\t\t\t\tonLoadRequestError && onLoadRequestError(error);\n\t\t\t\tsetError(transformErrorMessage(error));\n\t\t\t\treturn item as T;\n\t\t\t});\n\t};\n\n\tconst saveItem = (data: T, requestName: string = saveRequest) => {\n\t\tconst item = { ...data, ...clearForSubmit(data) };\n\n\t\tsetLoading(true);\n\t\tsetError('');\n\n\t\treturn request(requestName, item)\n\t\t\t.then((response) => {\n\t\t\t\tsetItem({ ...data, ...transformAfterSave(data, response, _item), id: getIdAfterSave(response, data) });\n\n\t\t\t\thandleUrlAfterSave(response, data, navigate, location);\n\t\t\t\tonSave && onSave(item, response);\n\t\t\t\treturn response;\n\t\t\t}).catch((error: string) => {\n\t\t\t\tonSaveRequestError && onSaveRequestError(error);\n\t\t\t\tsetError(transformErrorMessage(error));\n\n\t\t\t\tthrow error;\n\t\t\t}).finally(() => setLoading(false));\n\t};\n\n\tconst update = (item : T, skipValidation?: boolean, requestName: string = saveRequest) => {\n\t\tif (!item.deleted && validationSchema && !skipValidation) {\n\t\t\treturn validationSchema?.validate(item, { abortEarly: false }).then(() => {\n\t\t\t\treturn saveItem(item, requestName);\n\t\t\t}).catch((err) => {\n\t\t\t\tif (err.inner) {\n\t\t\t\t\tconst er = {};\n\t\t\t\t\tfor (let i = 0; i < err.inner.length; i++) {\n\t\t\t\t\t\ter[err.inner[i].path] = err.inner[i].errors[0];\n\t\t\t\t\t}\n\n\t\t\t\t\tsetError(err.message);\n\n\t\t\t\t\tonValidationError && onValidationError(item, er, err);\n\t\t\t\t} else {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}) as Promise;\n\t\t}\n\n\t\treturn saveItem(item, requestName);\n\t};\n\n\tconst deleteItem = () => {\n\t\t_item && saveItem({ ..._item, deleted: true });\n\t};\n\n\tconst value: ItemProviderContext = {\n\t\tstate: {\n\t\t\titem: _item,\n\t\t\tloading,\n\t\t\terror,\n\t\t\ttype,\n\t\t\tvalidationSchema,\n\t\t\treadonly,\n\t\t\titemLoading,\n\t\t\tmessage,\n\t\t\ttransformAfterSave,\n\t\t\tgetIdAfterSave,\n\t\t},\n\t\tactions: {\n\t\t\tload,\n\t\t\tupdate,\n\t\t\tsetItem,\n\t\t\tdeleteItem,\n\t\t\tsetMessage,\n\t\t\tsetError,\n\t\t},\n\t};\n\n\treturn (\n\t\t\n\t\t\t{typeof children === 'function' ? children(value) : children}\n\t\t \n\t);\n};\n","import { BaseParams } from '@common/typescript/objects/BaseParams';\n\nexport const addPrefix = (obj: object, prefix: string) => {\n\treturn Object.entries(obj)\n\t\t.reduce((acc, [key, value]) => ({ ...acc, [`${prefix}${key}`]: value }), {});\n};\n\nexport const removePrefix = (obj: object, prefix: string) => {\n\treturn Object.entries(obj)\n\t\t.reduce((acc, [key, value]) => {\n\t\t\tif (key.indexOf(prefix) !== 0 || prefix === '') {\n\t\t\t\treturn { ...acc, [key]: value };\n\t\t\t}\n\t\t\treturn { ...acc, [key.slice(prefix.length)]: value };\n\t\t}, {});\n};\n\nexport const filterByPrefix = (obj: object, prefix: string) => {\n\treturn Object.entries(obj)\n\t\t.reduce((acc, [key, value]) => (\n\t\t\tkey.indexOf(prefix) !== 0\n\t\t\t\t? acc : { ...acc, [key]: value }\n\t\t), {});\n};\n\nexport const getKeysByPrefix = (obj: BaseParams, prefix?: string): BaseParams => {\n\tif (!prefix) {\n\t\treturn obj;\n\t}\n\n\treturn removePrefix(filterByPrefix(obj, prefix), prefix);\n};\n","/**\r\n * ## ItemsProvider.tsx ##\r\n * This file contains ItemsProvider component\r\n * @packageDocumentation\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\r\n\r\nimport once from 'lodash/once';\r\nimport { AnySchema, ValidationError } from 'yup';\r\n\r\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\r\nimport {\r\n\taddPrefix,\r\n\tgetKeysByPrefix,\r\n} from '@common/react/utils/ObjectKeysPrefix/objectKeysPrefix';\r\nimport { ClearValue, generateGUID } from '@common/react/utils/utils';\r\n\r\nimport { List } from '@common/typescript/objects/List';\r\nimport { WithDeleted } from '@common/typescript/objects/WithDeleted';\r\nimport { handleUrl, getSearchParamsFromUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\nimport { useRequestProviderContext } from '@common/react/components/RequestProvider/RequestProvider';\r\nimport useAbortController from '@common/react/hooks/useAbortController';\r\nimport { useModal } from '@common/react/components/Modal/ModalContextProvider';\r\n\r\nexport enum Mode {\r\n\tView,\r\n\tEdit\r\n}\r\n\r\nexport enum SortingDirection {\r\n\tDefault = 0,\r\n\tAscending = 1,\r\n\tDescending = 2\r\n}\r\n\r\n/**\r\n * used to define sorting\r\n */\r\nexport interface ColumnFilter {\r\n\tcaption: string;\r\n\tdirection: SortingDirection;\r\n}\r\n\r\nexport interface WithKey extends WithDeleted {\r\n\tkeyGUID?: string;\r\n}\r\n\r\ninterface Edits {\r\n\t[key: string]: T;\r\n}\r\n\r\ninterface Loaders {\r\n\t[key: string]: boolean;\r\n}\r\n\r\ninterface Errors {\r\n\t[key: string]: {\r\n\t\terr: BaseParams,\r\n\t\tsubmitCount: number;\r\n\t};\r\n}\r\n\r\ninterface FiltersRef {\r\n\tfilters: BaseParams;\r\n\tsilent?: boolean;\r\n\tconcatResult?: boolean;\r\n\tresetFilters?: boolean;\r\n}\r\n\r\n/**\r\n * defines pagination\r\n */\r\nexport interface PaginationState {\r\n\t/**\r\n\t * Current page number\r\n\t */\r\n\tcurrent: number;\r\n\t/**\r\n\t * Number of data items per page\r\n\t */\r\n\tpageSize: number;\r\n\t/**\r\n\t * Total number of data items\r\n\t */\r\n\ttotal: number;\r\n}\r\n\r\nexport type PaginationOptions = Partial\r\n\r\n/**\r\n * type of second argument RenderItem\r\n */\r\nexport interface RenderItemProps {\r\n\t/**\r\n\t * item loading state\r\n\t */\r\n\tloading: boolean;\r\n\t/**\r\n\t * callback to save the passed element\r\n\t * @param item - data that will replace the element and will be sent in the request\r\n\t * @param saveRequest - custom request name, if you need a request different from the request in ItemsProvider\r\n\t */\r\n\tsave: (item?: T, saveRequest?: string) => void;\r\n\t/**\r\n\t * update the current element without request\r\n\t * @param item - partial data that will replace the value in the element\r\n\t */\r\n\tupdate: (item: Partial) => void;\r\n\t/**\r\n\t * callback to update and save the current element\r\n\t * @param item - partial data that will replace the value in the element before sending the request\r\n\t * @param saveRequest - custom request name, if you need a request different from the request in ItemsProvider\r\n\t */\r\n\tupdateAndSave: (item: Partial, saveRequest?: string) => void;\r\n\t/**\r\n\t * callback to reload ItemsProvider data\r\n\t * @param pagination - new pagination options\r\n\t * @param resetFilters - determines whether filters need to be reset to default\r\n\t */\r\n\treload: (p: Partial, resetFilters?: boolean | undefined) => Promise>;\r\n\t/**\r\n\t * callback to add new items at ItemsProvider\r\n\t * @param item - new item data\r\n\t */\r\n\tadd: (item?: Partial) => void;\r\n}\r\n\r\ntype StringBoolNumber = string | boolean | number;\r\n\r\n/**\r\n * filter value change object\r\n */\r\nexport interface HandleChangeEventElement {\r\n\tcurrentTarget: {\r\n\t\tname: string;\r\n\t\tvalue: Nullable>;\r\n\t};\r\n}\r\n\r\n/**\r\n * @typeParam T - T Any WithKey entity\r\n * This is function type. Used to render the list element.\r\n * The function accepts tho argument - item and props.\r\n * item - The element for which the render is called.\r\n * props - The element state and action parameters\r\n */\r\nexport type RenderItem