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c,IACnC/B,EAAO+B,cAAc,SAAU0C,EAAOC,MAAMhI,MAC5CiF,EAAc8C,EAAOC,MAAMhI,KAAKrI,KAAO,GACnCoQ,EAAOC,MAAMhI,KAAKrI,GAAK,GAAK2L,EAAO5N,OAAOhB,YAC7C6Q,EAAewC,EAAOC,MAAMhI,KAAKrI,GAAI2L,EAAO5N,OAAOhB,WAEpD,EACDuT,SAAU,WACK,MADW,uDAAP,MAEjB3E,EAAO+B,cAAc,oBAAqB,MAC1C/B,EAAO+B,cAAc,kBAAmB,MACxC/B,EAAO+B,cAAc,SAAU,MAC/BJ,IAED,EACD8D,OAAQ,CAAErU,WAAY4O,EAAO5N,OAAOhB,YACpCsU,aAAW,GAEZ,C","sources":["webpack://NorthernTunaPortal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockTable.tsx","webpack://NorthernTunaPortal/./ClientApp/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock.ts","webpack://NorthernTunaPortal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlock.tsx","webpack://NorthernTunaPortal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockHeader.tsx","webpack://NorthernTunaPortal/./ClientApp/components/UI/ScheduleAppointmentModal/LoginForm.tsx","webpack://NorthernTunaPortal/./ClientApp/components/UI/ScheduleAppointmentModal/ScheduleAppointment.tsx"],"sourcesContent":["import React from 'react';\r\n\r\nimport moment, { Moment } from 'moment';\r\n\r\nimport { DoctorBookedTime } from '@app/objects/Doctor';\r\nimport { Location } from '@app/objects/Location';\r\n\r\nimport '@app/scss/components/doctorBookedTimeBlockTable.scss';\r\nimport DoctorBookedTimeBlockHeader from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockHeader';\r\nimport { SelectedTimeIndex } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\r\n\r\ninterface ComponentProps {\r\n\tbookedTime: DoctorBookedTime;\r\n\tonSelectTime: (day: Moment, time: Moment, selectedTimeIndex?: SelectedTimeIndex) => void;\r\n\tonSelectPreviousWeek: () => void;\r\n\tonSelectNextWeek: () => void;\r\n\tstartDate: number;\r\n\tlocationId: number;\r\n\tlocations?: Array;\r\n\tonSelectLocation?: (location: Location) => void;\r\n\tclassName?: string;\r\n\trowCount?: number;\r\n\tselectedTime?: number;\r\n\twithoutLocationButtons?: boolean;\r\n\twithHeader?: boolean;\r\n\tnearestTime: number | null;\r\n\tonNearestTimeClick?: () => void;\r\n\trange: number;\r\n}\r\n\r\nconst getInitialCount = (bookedTime: DoctorBookedTime, offset: number, selectedTime?: number): number => {\r\n\tif (!selectedTime) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tfor (const [day, value] of Object.entries(bookedTime.values)) {\r\n\t\tif (moment.utc(selectedTime).isSame(moment(day), 'day')) {\r\n\t\t\tfor (const index in value) {\r\n\t\t\t\tconst time = bookedTime.values[day][index];\r\n\r\n\t\t\t\tif (moment(selectedTime).utc().format('HH:mm:ss') === time?.start) {\r\n\t\t\t\t\treturn Math.floor(+index / offset) * offset;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 0;\r\n};\r\n\r\nconst DoctorBookedTimeBlockTable: React.FC = ({\r\n\tbookedTime,\r\n\tonSelectTime,\r\n\tonSelectPreviousWeek,\r\n\tonSelectNextWeek,\r\n\tstartDate,\r\n\tlocationId,\r\n\tlocations,\r\n\tonSelectLocation,\r\n\tclassName,\r\n\trowCount,\r\n\tselectedTime,\r\n\twithoutLocationButtons,\r\n\twithHeader = true,\r\n\tnearestTime = null,\r\n\tonNearestTimeClick,\r\n\trange,\r\n}) => {\r\n\tconst [offset, setOffset] = React.useState(rowCount ?? 7);\r\n\tconst [count, setCount] = React.useState(getInitialCount(bookedTime, offset, selectedTime));\r\n\tconst [maxCount, setMaxCount] = React.useState(() => {\r\n\t\treturn Math.max(...Object.keys(bookedTime.values).map((day) => bookedTime.values[day]?.length ?? 0));\r\n\t});\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (rowCount && rowCount !== offset) {\r\n\t\t\tsetOffset(rowCount);\r\n\t\t\tsetCount(0);\r\n\t\t}\r\n\t}, [rowCount]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetMaxCount(Math.max(...Object.keys(bookedTime.values).map((day) => bookedTime.values[day]?.length ?? 0)));\r\n\t}, [bookedTime]);\r\n\r\n\tconst showMore = () => {\r\n\t\tsetCount(count + offset);\r\n\t};\r\n\r\n\tconst showPrev = () => {\r\n\t\tsetCount(count - offset);\r\n\t};\r\n\r\n\tconst renderItem = (index: number): Array => {\r\n\t\treturn Object.keys(bookedTime.values).slice(0, range).map((day) => {\r\n\t\t\tconst time = bookedTime.values[day][index];\r\n\t\t\tconst isSelected = !!selectedTime && moment.utc(selectedTime).isSame(moment(day), 'day')\r\n\t\t\t\t&& moment(selectedTime).utc().format('HH:mm:ss') === time?.start;\r\n\r\n\t\t\treturn time ? \r\n\t\t\t\t {\r\n\t\t\t\t\t\tonSelectTime(moment(day).utc(), moment(time.start, 'hh:mm a'), { key: day, start: time.start });\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t
{moment(time.start, 'hh:mm a').format('hh:mm a')}
\r\n\t\t\t\t\r\n\t\t\t : -;\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderItems = () => {\r\n\t\tlet index = count;\r\n\t\tconst result: Array = [];\r\n\t\tlet row;\r\n\r\n\t\tdo {\r\n\t\t\trow = renderItem(index++);\r\n\r\n\t\t\tresult.push(\r\n\t\t\t\t\r\n\t\t\t\t{row}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t} while (index < (count + offset > maxCount ? maxCount : count + offset));\r\n\r\n\t\treturn result.map((node) => node);\r\n\t};\r\n\r\n\tconst leftChevronDisabled = moment(startDate).utc() <= moment(new Date()).utc();\r\n\r\n\treturn
\r\n\t\t
\r\n\t\t\t{!withoutLocationButtons && locations && locations.length && locations.map((location) =>\r\n\t\t\t\t onSelectLocation && onSelectLocation(location)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{`${location.company?.name ? `${location.company?.name} - ` : ''}${location.nameEn}`}\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{withHeader && }\r\n\t\t\t\t{!nearestTime && renderItems()}\r\n\t\t\t\r\n\t\t
\r\n\t\t{nearestTime && \r\n\t\t\tNearest available on\r\n\t\t\t{' '}\r\n\t\t\t{moment(nearestTime).utc().format('MMM DD')}\r\n\t\t}\r\n\t\t{!nearestTime && <>\r\n\t\t\t= maxCount}\r\n\t\t\t\ttitle=\"Next times\"\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t
;\r\n};\r\n\r\nexport default DoctorBookedTimeBlockTable;\r\n","import moment from 'moment';\r\n\r\nimport { DoctorBookedTime } from '@app/objects/Doctor';\r\nimport { getMinutesFromDuration } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\r\n\r\nconst dayMS = 3600 * 1000 * 24; // milliseconds in one day\r\n\r\nexport const getStartDayInitial = (range: number, selectedTime?: number): number => {\r\n\tconst now = moment.utc().valueOf();\r\n\r\n\tif (!selectedTime) {\r\n\t\treturn now;\r\n\t}\r\n\r\n\treturn now + Math.floor((selectedTime - now) / (dayMS * range)) * dayMS * range;\r\n};\r\n\r\nexport const filterDisabledTimes = (times: DoctorBookedTime): DoctorBookedTime => {\r\n\tconst res = { ...times, values: { ...times.values } };\r\n\r\n\tObject.entries(res.values).forEach(([key, blocks]) => {\r\n\t\tres.values[key] = blocks.filter(({ booked }) => !booked);\r\n\t});\r\n\r\n\treturn res;\r\n};\r\n\r\nexport const filterTimesBeforeNow = (times: DoctorBookedTime): DoctorBookedTime => {\r\n\tconst res = { ...times, values: { ...times.values } };\r\n\tconst now = moment(new Date());\r\n\r\n\tObject.entries(res.values).forEach(([key, blocks]) => {\r\n\t\tif (moment(key).utc().isSame(now, 'day')) {\r\n\t\t\tres.values[key] = blocks.filter(({ start }) => moment(start, 'HH:mm:ss').valueOf() >= now.valueOf());\r\n\t\t}\r\n\t});\r\n\r\n\treturn res;\r\n};\r\n\r\nexport const changeBookedTimesByInterval = (times: DoctorBookedTime, interval: number): DoctorBookedTime => {\r\n\tconst res = { ...times, values: { ...times.values } };\r\n\r\n\tObject.entries(res.values).forEach(([key, blocks]) => {\r\n\t\tres.values[key] = blocks.map((currentBlock, index) => {\r\n\t\t\tlet duration = getMinutesFromDuration(currentBlock.end) - getMinutesFromDuration(currentBlock.start);\r\n\r\n\t\t\tif (duration >= interval || currentBlock.booked) {\r\n\t\t\t\treturn currentBlock;\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = index; blocks.length > i; i++) {\r\n\t\t\t\tif (duration < interval\r\n\t\t\t\t\t\t&& (!blocks[i + 1] || blocks[i].end !== blocks[i + 1]?.start || blocks[i + 1].booked)) {\r\n\t\t\t\t\treturn { ...currentBlock, booked: true };\r\n\t\t\t\t}\r\n\r\n\t\t\t\tduration += getMinutesFromDuration(blocks[i + 1].end) - getMinutesFromDuration(blocks[i + 1].start);\r\n\t\t\t\tif (duration >= interval) {\r\n\t\t\t\t\treturn currentBlock;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn { ...currentBlock, booked: duration < interval };\r\n\t\t});\r\n\t});\r\n\r\n\treturn res;\r\n};\r\n\r\nexport const resolveBookedTimes = (times: DoctorBookedTime, interval: number): DoctorBookedTime => {\r\n\treturn changeBookedTimesByInterval(filterTimesBeforeNow(times), interval);\r\n};\r\n","import React from 'react';\r\n\r\nimport moment, { Moment } from 'moment';\r\n\r\nimport Message from 'antd/lib/message';\r\n\r\nimport LogoLoader, { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\r\n\r\nimport { request } from '@app/components/Api';\r\nimport { Location } from '@app/objects/Location';\r\nimport DoctorBookedTimeBlockTable from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockTable';\r\nimport { DoctorBookedTime } from '@app/objects/Doctor';\r\nimport {\r\n\tfilterDisabledTimes,\r\n\tgetStartDayInitial,\r\n\tresolveBookedTimes,\r\n} from '@app/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\r\nimport { SelectedTimeIndex } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\r\n\r\ninterface ComponentProps {\r\n\tdoctorId: number;\r\n\tonSelect?: (time: number, location: Location, asNearestDate?: boolean, selectIndex?: SelectedTimeIndex) => void;\r\n\tlocations: Array;\r\n\tvalue?: DoctorBookedTime;\r\n\tclassName?: string;\r\n\tdays?: number;\r\n\trowCount?: number;\r\n\tonlyWorkingDays?: boolean;\r\n\tselectLocationById?: number;\r\n\tselectedTime?: number;\r\n\tinitStartDay?: number;\r\n\twithoutLocationButtons?: boolean;\r\n\twithHeader?: boolean;\r\n\tinterval?: number;\r\n\thideDisabledTimes?: boolean;\r\n\tnearestDateRedirect?: boolean;\r\n}\r\n\r\nconst DoctorBookedTimeBlock: React.FC = ({\r\n\tdoctorId,\r\n\tonSelect,\r\n\tlocations,\r\n\tvalue,\r\n\tclassName,\r\n\tdays,\r\n\trowCount,\r\n\tonlyWorkingDays = false,\r\n\tselectedTime,\r\n\tselectLocationById,\r\n\twithoutLocationButtons,\r\n\twithHeader,\r\n\tinterval: propsInterval,\r\n\thideDisabledTimes = true,\r\n\tnearestDateRedirect = false,\r\n\tinitStartDay,\r\n}) => {\r\n\tconst [selectedLocation, setSelectedLocation] = React.useState(selectLocationById\r\n\t\t? (locations.find((q) => q.id === selectLocationById) ?? locations[0])\r\n\t\t: locations[0]);\r\n\tconst [loading, setLoading] = React.useState(false);\r\n\tconst [range, setRange] = React.useState(days ?? 7);\r\n\tconst [interval, setInterval] = React.useState(propsInterval || 0);\r\n\tconst [startDay, setStartDay] = React.useState(initStartDay || getStartDayInitial(range, selectedTime));\r\n\tconst [startDate, setStartDate] = React.useState(startDay);\r\n\tconst [endDate, setEndDate] = React.useState(startDate);\r\n\tconst [bookedTimeRes, setBookedTimeRes] = React.useState(value || null);\r\n\tconst [nearestTime, setNearestDate] = React.useState(null);\r\n\tconst [solvedNearestTime, setSolvedNearestDate] = React.useState(nearestTime);\r\n\tconst nearestDate = solvedNearestTime || nearestTime;\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (propsInterval !== interval) {\r\n\t\t\tsetInterval(propsInterval || 0);\r\n\t\t}\r\n\t}, [propsInterval]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetBookedTimeRes(value || null);\r\n\t}, [value]);\r\n\r\n\tconst loadTimes = (from: number, interval: number, locationId: number, days?: number) => {\r\n\t\tsetLoading(true);\r\n\t\trequest('getDoctorBookedTime', {\r\n\t\t\tid: doctorId,\r\n\t\t\tlocationId,\r\n\t\t\tinterval,\r\n\t\t\tfrom,\r\n\t\t\tdaysRange: days || range,\r\n\t\t\tonlyWorkingDays,\r\n\t\t}).then((res) => {\r\n\t\t\tsetBookedTimeRes(res);\r\n\t\t\tsetStartDate(res.startDate);\r\n\t\t\tsetEndDate(res.endDate);\r\n\t\t\tsetNearestDate(res.nearestTime);\r\n\t\t}).catch((message) => {\r\n\t\t\tMessage.error(message);\r\n\t\t}).finally(() => {\r\n\t\t\tsetLoading(false);\r\n\t\t});\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (value && JSON.stringify(value) !== JSON.stringify(bookedTimeRes)) {\r\n\t\t\tsetBookedTimeRes(value);\r\n\t\t\tsetStartDate(value.startDate);\r\n\t\t\tsetEndDate(value.endDate);\r\n\t\t\tsetNearestDate(value.nearestTime);\r\n\t\t}\r\n\t}, [value]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (value && (!selectedLocation || value.locationId === selectedLocation.id) && (Object.values(value.values).length || value.nearestTime)) {\r\n\t\t\tsetStartDate(value.startDate);\r\n\t\t\tsetEndDate(value.endDate);\r\n\t\t\tsetNearestDate(value.nearestTime);\r\n\t\t} else {\r\n\t\t\tselectedLocation?.id && loadTimes(startDate, interval, selectedLocation.id);\r\n\t\t}\r\n\t}, [interval]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tlet newSelectedLocation; let\r\n\t\t\tnewRage;\r\n\t\tif (selectLocationById && selectLocationById !== selectedLocation?.id) {\r\n\t\t\tnewSelectedLocation = selectLocationById\r\n\t\t\t\t? (locations.find((q) => q.id === selectLocationById) ?? locations[0])\r\n\t\t\t\t: locations[0];\r\n\t\t\tsetSelectedLocation(newSelectedLocation);\r\n\t\t}\r\n\r\n\t\tif (days && days !== range) {\r\n\t\t\tnewRage = days;\r\n\t\t\tsetRange(newRage);\r\n\t\t}\r\n\r\n\t\tif (newSelectedLocation || newRage) {\r\n\t\t\tloadTimes(startDate, interval, (newSelectedLocation || selectedLocation)?.id, newRage || days);\r\n\t\t}\r\n\t}, [selectLocationById, days]);\r\n\r\n\tconst bookedTime = React.useMemo(() => {\r\n\t\tif (!bookedTimeRes) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst resolvedBookedTime = resolveBookedTimes(bookedTimeRes, propsInterval || interval);\r\n\t\treturn hideDisabledTimes ? filterDisabledTimes(resolvedBookedTime) : resolvedBookedTime;\r\n\t}, [propsInterval, interval, bookedTimeRes]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst dates = Object.keys(bookedTime?.values || {})\r\n\t\t\t.map((key) => (bookedTime?.values[key].length ? key : null));\r\n\t\tconst dateIndex = dates.findIndex((time) => time !== null);\r\n\r\n\t\tsetSolvedNearestDate(dateIndex + 1 > range ? +moment(dates[dateIndex]) : null);\r\n\t}, [range, nearestDate, bookedTime]);\r\n\r\n\tconst onSelectLocation = (location: Location) => {\r\n\t\tsetSelectedLocation(location);\r\n\r\n\t\tloadTimes(startDate, interval, location.id);\r\n\t};\r\n\r\n\tconst onSelectTime = (day: Moment, time: Moment, nearestDate?: number, selectedTimeIndex?: SelectedTimeIndex) => {\r\n\t\tonSelect && onSelect(\r\n\t\t\tnearestDate || day.add(time.hours(), 'hours').add(time.minutes(), 'minutes').valueOf(),\r\n\t\t\tselectedLocation,\r\n\t\t\t!!nearestDate,\r\n\t\t\tselectedTimeIndex,\r\n\t\t);\r\n\t};\r\n\r\n\tconst selectNextWeek = () => {\r\n\t\tloadTimes(moment(endDate).add('day', 1).valueOf(), interval, selectedLocation.id);\r\n\t};\r\n\r\n\tconst onSelectPreviousWeek = () => {\r\n\t\tloadTimes(moment(startDate).add('day', -1).valueOf(), -interval, selectedLocation.id);\r\n\t};\r\n\r\n\tconst onNearestTimeClick = () => {\r\n\t\tconst solvedNearestDate = Object.keys(bookedTime?.values || {})\r\n\t\t\t.map((key) => (bookedTime?.values[key].length ? key : null))\r\n\t\t\t.find((time) => time !== null);\r\n\t\tconst date = solvedNearestDate ? +moment(solvedNearestDate) : nearestDate;\r\n\t\tif (date) {\r\n\t\t\tif (nearestDateRedirect) {\r\n\t\t\t\tconst time = moment.utc(date);\r\n\t\t\t\tonSelectTime(time, time, +time.hours(new Date().getHours()));\r\n\t\t\t} else {\r\n\t\t\t\tloadTimes(date, interval, selectedLocation.id);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tif (!bookedTime) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\treturn
\r\n\t\t\r\n\t\t\t\tonSelectTime(day, time, undefined, selectIndexTime)}\r\n\t\t\tonSelectNextWeek={selectNextWeek}\r\n\t\t\tonSelectPreviousWeek={onSelectPreviousWeek}\r\n\t\t\tstartDate={startDate}\r\n\t\t\tlocations={locations}\r\n\t\t\tlocationId={selectedLocation.id}\r\n\t\t\tonSelectLocation={onSelectLocation}\r\n\t\t\trowCount={rowCount}\r\n\t\t\tselectedTime={selectedTime}\r\n\t\t\twithHeader={withHeader}\r\n\t\t\tclassName={className}\r\n\t\t\twithoutLocationButtons={withoutLocationButtons}\r\n\t\t\tnearestTime={nearestDate}\r\n\t\t\tonNearestTimeClick={onNearestTimeClick}\r\n\t\t/>\r\n\t\t{loading\r\n\t\t\t&&
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t}\r\n\t
;\r\n};\r\n\r\nexport default DoctorBookedTimeBlock;\r\n","import React from 'react';\r\n\r\nimport moment from 'moment';\r\n\r\nimport { DoctorBookedValues } from '@app/objects/Doctor';\r\n\r\ninterface Props {\r\n\tleftChevronDisabled: boolean;\r\n\tonSelectPreviousWeek: () => void;\r\n\tonSelectNextWeek: () => void;\r\n\tcolumns: DoctorBookedValues;\r\n\tdisabledButtons?: boolean;\r\n\tdaysRange?: number;\r\n}\r\n\r\nconst DoctorBookedTimeBlockHeader: React.FC = ({\r\n\tleftChevronDisabled,\r\n\tonSelectNextWeek,\r\n\tonSelectPreviousWeek,\r\n\tcolumns,\r\n\tdisabledButtons,\r\n\tdaysRange,\r\n}) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{Object.keys(columns).slice(0, daysRange).map((day, index) =>\r\n\t\t\t\t\r\n\t\t\t\t\t{moment(day).utc().format('ddd')}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{moment(day).utc().format('MMM DD')}\r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default DoctorBookedTimeBlockHeader;\r\n","import * as React from 'react';\r\n\r\nimport { Link, Redirect } from 'react-router-dom';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\n\r\nimport Modal from 'antd/lib/modal';\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport LoginPage from '@common/react/components/Pages/Login/Login';\r\n\r\nimport { ApplicationState } from '@app/store';\r\nimport * as LoginState from '@app/store/Login';\r\n\r\ninterface Props {\r\n\tvisible: boolean;\r\n\thandleClose: () => void;\r\n\tafterLogin: () => void;\r\n}\r\n\r\ninterface FormValues {\r\n\tlogin: string;\r\n\tpassword: string;\r\n}\r\n\r\nconst LoginForm: React.FC = ({ visible, handleClose, afterLogin }) => {\r\n\tconst loginState = useSelector((state: ApplicationState) => state.login, shallowEqual);\r\n\tconst [afterLoginTrigger, setLoginTrigger] = React.useState(false);\r\n\r\n\tconst dispatch = useDispatch();\r\n\tconst loginActions: LoginState.LoginActionCreators = React.useMemo(() =>\r\n\t\tbindActionCreators(LoginState.getActionCreators(), dispatch), []);\r\n\r\n\tconst handleSubmit = (values: FormValues) => {\r\n\t\tloginActions.login(values.login, values.password, 'authPortal');\r\n\t\tsetLoginTrigger(true);\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (loginState.user && afterLoginTrigger) {\r\n\t\t\tafterLogin();\r\n\t\t\tsetLoginTrigger(false);\r\n\t\t}\r\n\t}, [!!loginState.user]);\r\n\r\n\treturn (\r\n\t\t document.querySelector('.app-container') || document.body}\r\n\t\t>\r\n\t\t\t
\r\n\t\t\t\t <>}\r\n\t\t\t\t\tonSubmit={handleSubmit}\r\n\t\t\t\t\twithFieldTitle\r\n\t\t\t\t\tbuttons={Register}\r\n\t\t\t\t/>\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default LoginForm;\r\n","import React from 'react';\r\n\r\nimport * as Yup from 'yup';\r\nimport * as moment from 'moment';\r\nimport Form from 'antd/lib/form';\r\nimport Select from 'antd/lib/select';\r\nimport Modal from 'antd/lib/modal';\r\nimport { CheckCircleFilled } from '@ant-design/icons';\r\nimport { useFormik } from 'formik';\r\n\r\nimport Button from '@common/react/components/Forms/Button';\r\nimport Autocomplete from '@common/react/components/Forms/Autocomplete/Autocomplete';\r\nimport { nonEmptyArray, notNullValidator, simpleStringValidator } from '@common/react/utils/validationHelpers';\r\nimport { getPopupContainer } from '@common/react/components/Utils/Utils';\r\n\r\nimport { TimeSpan } from '@commonTuna/react/components/UI/DayTimeSelectModal/DayTimeSelectModal';\r\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\r\n\r\nimport { Appointment, AppointmentProcedure } from '@app/objects/Appointment';\r\nimport { User } from '@app/objects/User';\r\nimport { request } from '@app/components/Api';\r\nimport { Location } from '@app/objects/Location';\r\nimport { Doctor, DoctorBookedTime, DoctorProcedure } from '@app/objects/Doctor';\r\nimport { Patient } from '@app/objects/Patient';\r\nimport LoginForm from '@app/components/UI/ScheduleAppointmentModal/LoginForm';\r\nimport DoctorBookedTimeBlockTable from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\r\nimport { dateToUtcString, getAppContainer } from '@app/components/Utils';\r\n\r\ninterface ComponentProps {\r\n\tpatient: User | null;\r\n\tdoctorFixed?: boolean;\r\n\tdoctor?: Doctor;\r\n\tafterSubmit?: (items?: Array) => void;\r\n\tloadInvites?: () => void;\r\n\tscheduledTime?: number;\r\n\tselectedLocation?: Location | null;\r\n\tlocationItems?: Array;\r\n\tonModalClose?: () => void;\r\n\tasNearestDate?: boolean;\r\n\tdoctorProcedures?: Array;\r\n\tdoctorBookedTime?: DoctorBookedTime;\r\n\tdaysRange?: number;\r\n\tshowMobile?: boolean;\r\n}\r\n\r\nexport interface SelectedTimeIndex {\r\n\tkey: string;\r\n\tstart: string;\r\n}\r\n\r\ninterface FormValues {\r\n\tid: number | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\tpatientId: number | null;\r\n\tpatient: User | null;\r\n\tscheduledTime: number | null;\r\n\tprocedures: Array;\r\n\tlocation: Location | null;\r\n\tlocationId: number | null;\r\n\tdoctorProcedureIds: Array;\r\n\tduration: string | null;\r\n\tnotes: string;\r\n\tdoctor: Doctor | null;\r\n\tdoctorProcedure: DoctorProcedure | null;\r\n\tselectedTimeIndex: SelectedTimeIndex | undefined;\r\n}\r\n\r\nconst getDuration = (timeSpan: string): string | null => {\r\n\tconst timeArr = timeSpan.split(':');\r\n\tif (timeArr.length === 3) {\r\n\t\tconst hours = +timeArr[0] ? `${+timeArr[0]} h ` : '';\r\n\t\tconst minutes = `${+timeArr[1]} m`;\r\n\t\treturn `${hours}${minutes}`;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nexport const getMinutesFromDuration = (duration: string) => {\r\n\tconst [h, m] = duration.split(':');\r\n\r\n\treturn +(h || 0) * 60 + +(m || 0);\r\n};\r\n\r\nconst { success, error } = Modal;\r\n\r\nconst Option = Select.Option;\r\n\r\nfunction strToTimeSpan(str: string): TimeSpan {\r\n\tconst numArr = str.split(':').map(Number);\r\n\treturn {\r\n\t\thour: numArr[0],\r\n\t\tminute: numArr[1],\r\n\t};\r\n}\r\n\r\nfunction clearListFields(items: Array, fields: Array) {\r\n\tif (!items) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst newValues = {};\r\n\tfields.forEach((field) => newValues[field] = null);\r\n\r\n\treturn items.map((item: T) => ({\r\n\t\t...item,\r\n\t\t...newValues,\r\n\t}));\r\n}\r\n\r\nexport const dateStringRequiredValidator = Yup.string().matches(/([0-9]{2}-[0-9]{2}-[0-9]{4})/, 'Invalid date').required();\r\n\r\nconst validationSchemaWithPatientCreating = Yup.object().shape({\r\n\tlocationId: notNullValidator.required(),\r\n\tscheduledTime: notNullValidator.required(),\r\n\tduration: simpleStringValidator,\r\n\tprocedures: nonEmptyArray('Procedures should not be empty'),\r\n\tdoctorProcedureId: notNullValidator,\r\n});\r\n\r\nexport const getDaysCount = () => {\r\n\tif (typeof window === 'undefined' || window.innerWidth >= 1920) {\r\n\t\treturn 7;\r\n\t}\r\n\r\n\tif (window.innerWidth > 1350) {\r\n\t\treturn Math.floor((0.4 * (window.innerWidth - 100) - 150) / 82);\r\n\t}\r\n\r\n\treturn 3;\r\n};\r\n\r\nexport const getDaysCountMobile = () => {\r\n\tif (typeof window === 'undefined') return 4;\r\n\r\n\tconst count = Math.floor((window.innerWidth - 160) / 82);\r\n\r\n\treturn count > 7 ? 7 : count < 2 ? 2 : count;\r\n};\r\n\r\nconst getRowsCount = () => {\r\n\tif (typeof window === 'undefined' || window.innerHeight >= 1000) {\r\n\t\treturn 11;\r\n\t}\r\n\r\n\treturn Math.ceil((window.innerHeight - 500) / 50);\r\n};\r\n\r\nconst ScheduleAppointment: React.FC = ({\r\n\tpatient,\r\n\tdoctor,\r\n\tdoctorFixed = false,\r\n\tafterSubmit,\r\n\tloadInvites,\r\n\tscheduledTime,\r\n\tselectedLocation,\r\n\tlocationItems,\r\n\tonModalClose,\r\n\tasNearestDate,\r\n\tdoctorProcedures,\r\n\tdoctorBookedTime,\r\n\tdaysRange,\r\n\tshowMobile,\r\n}) => {\r\n\tconst [locations, setLocations] = React.useState>(locationItems ?? []);\r\n\tconst [doctorBookedTimes, setDoctorBookedTimes] = React.useState(doctorBookedTime);\r\n\tconst [procedures, setProcedures] = React.useState>(doctorProcedures || []);\r\n\tconst [isLoading, setLoading] = React.useState(false);\r\n\tconst [visible, setVisible] = React.useState(false);\r\n\tconst [duration, setDuration] = React.useState(15);\r\n\tconst [invites, setInvites] = React.useState>([]);\r\n\tconst [companyTemplateInvite, setCompanyTemplateInvite] = React.useState(null);\r\n\tconst [days, setDays] = React.useState(daysRange || (showMobile ? getDaysCountMobile : getDaysCount)());\r\n\tconst [rowCount, setRowCount] = React.useState(getRowsCount());\r\n\tconst [isMobile, setIsMobile] = React.useState(typeof window !== 'undefined' ? window.innerWidth < 768 : false);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst resize = () => {\r\n\t\t\tsetIsMobile(window.innerWidth < 768);\r\n\t\t};\r\n\r\n\t\tresize();\r\n\t\twindow.addEventListener('resize', resize);\r\n\t\treturn () => window.removeEventListener('resize', resize);\r\n\t}, []);\r\n\r\n\tconst initialValues = React.useMemo(() => {\r\n\t\tconst values = {} as FormValues;\r\n\t\treturn ({\r\n\t\t\t...{} as Appointment,\r\n\t\t\tpatientId: patient?.id || -1,\r\n\t\t\tpatient: patient || null,\r\n\t\t\tfirstName: patient?.firstName || '',\r\n\t\t\tlastName: patient?.lastName || '',\r\n\t\t\tdoctor: doctor || null,\r\n\t\t\tdoctorId: doctor?.id,\r\n\t\t\tduration: procedures[0]?.duration || null,\r\n\t\t\tscheduledTime: scheduledTime && !asNearestDate\r\n\t\t\t\t? scheduledTime\r\n\t\t\t\t: values.scheduledTime || null,\r\n\t\t\tnotes: values.notes || '',\r\n\t\t\tlocation: selectedLocation || (values.location || locations.length > 0 ? locations[0] : null),\r\n\t\t\tlocationId: selectedLocation\r\n\t\t\t\t? selectedLocation.id\r\n\t\t\t\t: values.locationId || locations.length > 0 ? locations[0].id : -1,\r\n\t\t\tprocedures: values.procedures || [{\r\n\t\t\t\tid: -1,\r\n\t\t\t\tdeleted: false,\r\n\t\t\t\tdoctorProcedure: null,\r\n\t\t\t\tstartProcedureTime: scheduledTime || values.scheduledTime || null,\r\n\t\t\t\tappointmentId: null,\r\n\t\t\t\tcount: 1,\r\n\t\t\t} as unknown as AppointmentProcedure],\r\n\t\t\tdoctorProcedure: values.doctorProcedure || null,\r\n\t\t\tdoctorProcedureIds: values?.doctorProcedureIds ? values.doctorProcedureIds.length > 0 ? values.doctorProcedureIds : [] : [],\r\n\t\t\tselectedTimeIndex: undefined,\r\n\t\t});\r\n\t}, [patient, doctor?.id, scheduledTime, selectedLocation]);\r\n\r\n\tconst formik = useFormik({\r\n\t\tinitialValues,\r\n\t\tvalidationSchema: validationSchemaWithPatientCreating,\r\n\t\tonSubmit: (values: FormValues) => {\r\n\t\t\tif (values.patient) {\r\n\t\t\t\tsetLoading(true);\r\n\r\n\t\t\t\tconst data = {\r\n\t\t\t\t\t...values,\r\n\t\t\t\t\tpatient: null,\r\n\t\t\t\t\tdoctor: null,\r\n\t\t\t\t\tlocation: null,\r\n\t\t\t\t\troom: null,\r\n\t\t\t\t\tappointmentType: null,\r\n\t\t\t\t\tscheduledTime: values.scheduledTime!,\r\n\t\t\t\t\tprocedures: clearListFields(values.procedures, ['doctorProcedure', 'appointment', 'room', 'doctorPayer']),\r\n\t\t\t\t};\r\n\t\t\t\trequest('patient', {\r\n\t\t\t\t\tdoctorPath: doctor?.portalPathEn,\r\n\t\t\t\t\tappointments: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t...data,\r\n\t\t\t\t\t\t\tscheduledTime: values.scheduledTime,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t],\r\n\t\t\t\t}).then((response) => {\r\n\t\t\t\t\tonSave();\r\n\t\t\t\t\tsetLoading(false);\r\n\t\t\t\t\tsetVisible(false);\r\n\r\n\t\t\t\t\t// Try remove time block if appointment successfully scheduled\r\n\t\t\t\t\tif (doctorBookedTimes && values.selectedTimeIndex) {\r\n\t\t\t\t\t\tconst current = { ...doctorBookedTimes };\r\n\t\t\t\t\t\tcurrent.values[values.selectedTimeIndex.key] = current.values[values.selectedTimeIndex.key]\r\n\t\t\t\t\t\t\t.filter((q) => q.start !== values.selectedTimeIndex!.start);\r\n\t\t\t\t\t\tsetDoctorBookedTimes(current);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst newAppointment = response.appointments[0];\r\n\r\n\t\t\t\t\tif (newAppointment.invites?.length > 0) {\r\n\t\t\t\t\t\tconst companyInvite = newAppointment.invites.find((inv) => inv.isCompanyTemplate && !inv.answered);\r\n\t\t\t\t\t\tif (companyInvite) {\r\n\t\t\t\t\t\t\tsetCompanyTemplateInvite(companyInvite);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsetInvites(newAppointment.invites.filter((inv) => !inv.isCompanyTemplate));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tafterSubmit && afterSubmit(newAppointment.invites);\r\n\t\t\t\t})\r\n\t\t\t\t\t.catch((err: string) => {\r\n\t\t\t\t\t\tsetLoading(false);\r\n\t\t\t\t\t\terror({\r\n\t\t\t\t\t\t\ttitle: 'Error',\r\n\t\t\t\t\t\t\tcontent: err,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tsetVisible(true);\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n\r\n\tReact.useEffect(() => {\r\n\t\tformik.setValues((prev) => ({\r\n\t\t\t...prev,\r\n\t\t\tpatientId: patient?.id || -1,\r\n\t\t\tpatient: patient || null,\r\n\t\t\tfirstName: patient?.firstName || '',\r\n\t\t\tlastName: patient?.lastName || '',\r\n\t\t}));\r\n\t}, [patient]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (doctor) {\r\n\t\t\tformik.setValues((prev) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\tdoctor: doctor || null,\r\n\t\t\t\tdoctorId: doctor?.id,\r\n\t\t\t}));\r\n\t\t}\r\n\t}, [doctor]);\r\n\r\n\tconst handleClose = React.useCallback(() => {\r\n\t\tsetVisible(false);\r\n\t\tonModalClose && onModalClose();\r\n\t}, [formik]);\r\n\r\n\tconst afterLogin = () => {\r\n\t\thandleClose();\r\n\t\tModal.confirm({\r\n\t\t\ttitle: `You wanted to create an appointment with ${doctor?.nameEn} ${\r\n\t\t\t\tdateToUtcString(formik.values.scheduledTime, 'hh:mm a')}?`,\r\n\t\t\tcontent: '',\r\n\t\t\tclassName: 'schedule-confirm',\r\n\t\t\ticon: <>,\r\n\t\t\tokText: 'Yes',\r\n\t\t\tokType: 'primary',\r\n\t\t\tcancelText: 'No',\r\n\t\t\tokButtonProps: {\r\n\t\t\t\tclassName: 'btn btn-primary',\r\n\t\t\t},\r\n\t\t\tcancelButtonProps: {\r\n\t\t\t\tclassName: 'btn btn-default',\r\n\t\t\t},\r\n\t\t\tgetContainer: getAppContainer,\r\n\t\t\tonOk() {\r\n\t\t\t\tformik.submitForm();\r\n\t\t\t},\r\n\t\t\tonCancel: () => {\r\n\t\t\t\tfillDoctorProcedureFields(procedures[0]);\r\n\t\t\t\tformik.setFieldValue('scheduledTime', scheduledTime && !asNearestDate\r\n\t\t\t\t\t? scheduledTime\r\n\t\t\t\t\t: null);\r\n\t\t\t\tif (locations.length) {\r\n\t\t\t\t\tformik.setFieldValue('locationId', locations[0].id);\r\n\t\t\t\t\tformik.setFieldValue('location', locations[0]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t};\r\n\r\n\tconst onSave = React.useCallback(() => {\r\n\t\tsuccess({\r\n\t\t\tcontent: <>\r\n\t\t\t\t\r\n\t\t\t\t{' '}\r\n\t\t\t\tAppointment has been successfully created.\r\n\t\t\t,\r\n\t\t\twrapClassName: 'success-modal',\r\n\t\t\ticon: null,\r\n\t\t});\r\n\t}, []);\r\n\r\n\tconst loadLocations = (doctorId?: number) => {\r\n\t\tconst locationData = {\r\n\t\t\ttext: '',\r\n\t\t\tdoctorId,\r\n\t\t};\r\n\t\trequest('locationList', locationData)\r\n\t\t\t.then((response: any) => {\r\n\t\t\t\tsetLocations(response.list);\r\n\t\t\t\tif (formik && formik.values.locationId === -1 && response.list.length > 0) {\r\n\t\t\t\t\tformik.setFieldValue('locationId', response.list[0].id);\r\n\t\t\t\t\tformik.setFieldValue('location', response.list[0]);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\terror({\r\n\t\t\t\t\ttitle: 'Error',\r\n\t\t\t\t\tcontent: `Something went wrong. ${err}`,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst fillDoctorProcedureFields = (doctorProcedure: DoctorProcedure) => {\r\n\t\tformik.setFieldValue('doctorProcedureId', +doctorProcedure.id);\r\n\t\tformik.setFieldValue('doctorProcedureIds', [+doctorProcedure.id]);\r\n\t\tformik.setFieldValue('doctorProcedure', doctorProcedure);\r\n\t\tformik.setFieldValue('procedures', [{\r\n\t\t\tdoctorProcedure,\r\n\t\t\tdoctorProcedureId: +doctorProcedure.id,\r\n\t\t\tduration: formik.values.duration,\r\n\t\t\tstartProcedureTime: formik.values.scheduledTime,\r\n\t\t\tappointmentId: -1,\r\n\t\t}]);\r\n\t\tformik.setFieldValue('doctor', doctorProcedure.doctor);\r\n\t\tformik.setFieldValue('duration', doctorProcedure.duration);\r\n\t};\r\n\r\n\tconst loadProcedures = (doctorId?: number, locationId?: number) => {\r\n\t\tconst proceduresData = {\r\n\t\t\ttext: '',\r\n\t\t\tdoctorId,\r\n\t\t\tlocationId,\r\n\t\t\twithProcedure: true,\r\n\t\t\twithDoctor: true,\r\n\t\t\twithAppointmentType: true,\r\n\t\t\tpublished: true,\r\n\t\t\thasGlobalProcedure: true,\r\n\t\t\twithGlobalProcedure: true,\r\n\t\t};\r\n\r\n\t\trequest('doctorProcedureList', proceduresData)\r\n\t\t\t.then((response: any) => {\r\n\t\t\t\tconst list = response.list.filter((p) => p.procedure?.globalProcedureId);\r\n\t\t\t\tsetProcedures(list);\r\n\t\t\t\tif (formik && list.length > 0) {\r\n\t\t\t\t\tfillDoctorProcedureFields(response.list[0]);\r\n\t\t\t\t}\r\n\t\t\t\tformik.setFieldValue('locationId', locationId);\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\terror({\r\n\t\t\t\t\ttitle: 'Error',\r\n\t\t\t\t\tcontent: `Something went wrong. ${err}`,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst handleResize = () => {\r\n\t\tsetDays((showMobile ? getDaysCountMobile : getDaysCount)());\r\n\t\tsetRowCount(getRowsCount());\r\n\t};\r\n\r\n\tconst endDate = React.useMemo(() => doctorBookedTimes && moment(doctorBookedTimes.endDate).subtract(7 - days, 'days'), []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (!locationItems) {\r\n\t\t\tloadLocations(doctor?.id);\r\n\t\t}\r\n\r\n\t\tif (formik.values) {\r\n\t\t\tif (procedures.length > 0) {\r\n\t\t\t\tfillDoctorProcedureFields(procedures[0]);\r\n\t\t\t} else {\r\n\t\t\t\tloadProcedures(formik.values.doctor?.id || doctor?.id, formik.values.locationId || undefined);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (doctorBookedTimes) {\r\n\t\t\tconst keys = Object.keys(doctorBookedTimes.values);\r\n\r\n\t\t\tif (!doctorBookedTimes.nearestTime && endDate && keys.every((key) => {\r\n\t\t\t\tif (moment(key) <= endDate) {\r\n\t\t\t\t\treturn doctorBookedTimes.values[key].length === 0;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t})) {\r\n\t\t\t\tconst nearestTimeKey = keys.find((key) =>\r\n\t\t\t\t\t(doctorBookedTimes.values[key]?.length > 0 ? doctorBookedTimes.values[key].some((value) => !value.booked) : false));\r\n\r\n\t\t\t\tif (nearestTimeKey) {\r\n\t\t\t\t\tconst tempNearestTime = moment(nearestTimeKey);\r\n\t\t\t\t\tif (endDate && tempNearestTime > endDate) {\r\n\t\t\t\t\t\tdoctorBookedTimes.nearestTime = tempNearestTime.valueOf();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst keysForRemove = endDate && Object.keys(doctorBookedTimes.values).map((key) => {\r\n\t\t\t\tif (moment(key) > endDate) {\r\n\t\t\t\t\treturn key;\r\n\t\t\t\t}\r\n\t\t\t\treturn '';\r\n\t\t\t});\r\n\r\n\t\t\tkeysForRemove && keysForRemove.length > 0 && keysForRemove.map((key) => {\r\n\t\t\t\tif (key) {\r\n\t\t\t\t\tdelete doctorBookedTimes.values[key];\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\twindow.addEventListener('resize', handleResize);\r\n\r\n\t\treturn () => window.removeEventListener('resize', handleResize);\r\n\t}, []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (scheduledTime && !asNearestDate && selectedLocation && formik) {\r\n\t\t\tformik.setFieldValue('scheduledTime', scheduledTime);\r\n\t\t\tformik.setFieldValue('location', selectedLocation);\r\n\t\t\tformik.setFieldValue('locationId', selectedLocation.id);\r\n\t\t}\r\n\r\n\t\tif (scheduledTime && selectedLocation) {\r\n\t\t\tloadProcedures(formik?.values.doctor?.id || doctor?.id, selectedLocation.id);\r\n\t\t}\r\n\t}, [scheduledTime, selectedLocation, asNearestDate]);\r\n\r\n\tconst value = React.useMemo(() => (doctorBookedTimes && endDate && {\r\n\t\t...doctorBookedTimes,\r\n\t\tendDate: endDate.valueOf(),\r\n\t}), [doctorBookedTimes, endDate]);\r\n\r\n\treturn <>\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{!doctorFixed\r\n\t\t\t\t&& \r\n\t\t\t\t}\r\n\t\t\t
\r\n\t\t\t{formik.values.locationId && formik.values.doctor?.id && formik.values.duration && (\r\n\t\t\t\t
\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\tdays={days}\r\n\t\t\t\t\t\trowCount={rowCount}\r\n\t\t\t\t\t\tinterval={formik.values.duration ? getMinutesFromDuration(formik.values.duration) : undefined}\r\n\t\t\t\t\t\tselectedTime={formik.values.scheduledTime || undefined}\r\n\t\t\t\t\t\tinitStartDay={(asNearestDate && scheduledTime) || undefined}\r\n\t\t\t\t\t\tselectLocationById={formik.values.locationId || undefined}\r\n\t\t\t\t\t\tonSelect={(time: number, location: Location, asNearestTime?: boolean, selectedTimeIndex?: SelectedTimeIndex) => {\r\n\t\t\t\t\t\t\tformik.setFieldValue('scheduledTime', time);\r\n\t\t\t\t\t\t\tif (formik.values.procedures?.length) {\r\n\t\t\t\t\t\t\t\tformik.setFieldValue('procedures[0].startProcedureTime', time);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tformik.setFieldValue('selectedTimeIndex', selectedTimeIndex);\r\n\t\t\t\t\t\t\t/* formik.setFieldValue('location', location);\r\n\t\t\t\t\t\t\tformik.setFieldValue('locationId', location.id); */\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\twithoutLocationButtons\r\n\t\t\t\t\t/>\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\tSchedule Appointment\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t\t\r\n\t;\r\n};\r\n\r\nexport default ScheduleAppointment;\r\n\r\ninterface ProcedureSelectComponentProps {\r\n\tformik: any;\r\n\tprocedures: Array;\r\n\tdoctorFixed: boolean;\r\n}\r\n\r\nconst ProcedureSelectComponent: React.FC = ({ formik, procedures, doctorFixed }) => {\r\n\treturn {\r\n\t\t\tformik.setFieldValue('doctorProcedureId', +value);\r\n\t\t\tformik.setFieldValue('doctorProcedureIds', [+value]);\r\n\t\t\tformik.setFieldValue('doctorProcedure', option.props.item);\r\n\t\t\tformik.setFieldValue('procedures', [{\r\n\t\t\t\tdoctorProcedure: option.props.item,\r\n\t\t\t\tdoctorProcedureId: +value,\r\n\t\t\t\tduration: formik.values.duration,\r\n\t\t\t\tstartProcedureTime: formik.values.scheduledTime,\r\n\t\t\t\tappointmentId: -1,\r\n\t\t\t}]);\r\n\t\t\tformik.setFieldValue('doctor', option.props.item.doctor);\r\n\t\t\tformik.setFieldValue('duration', option.props.item.duration);\r\n\t\t}}\r\n\t\tonChange={(value = -1) => {\r\n\t\t\tif (value === -1) {\r\n\t\t\t\tformik.setFieldValue('doctorProcedureId', null);\r\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\t}\r\n\t\t}}\r\n\t>\r\n\t\t{procedures.map((doctorProcedure) => {\r\n\t\t\tconst addInfo = `${doctorFixed ? ''\r\n\t\t\t\t: `${doctorProcedure!.doctor?.nameEn || '-'}, `}${getDuration(doctorProcedure!.duration) || '0 m'}`;\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t{doctorProcedure.procedure.globalProcedure?.name}\r\n\t\t\t\t\t{' '}\r\n\t\t\t\t\t(\r\n\t\t\t\t\t{addInfo}\r\n\t\t\t\t\t)\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t})}\r\n\t;\r\n};\r\n\r\ninterface LocationSelectComponentProps {\r\n\tformik: any;\r\n\tlocations: Array;\r\n\tloadProcedures: (doctorId?: number, locationId?: number) => void;\r\n}\r\n\r\nconst LocationSelectComponent: React.FC = ({ formik, locations, loadProcedures }) => {\r\n\treturn {\r\n\t\t\tconst location = locations.find((q) => q.id === value);\r\n\r\n\t\t\tif (location) {\r\n\t\t\t\tloadProcedures(formik.values.doctor?.id, location?.id);\r\n\r\n\t\t\t\tformik.setFieldValue('location', location);\r\n\r\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\t\tformik.setFieldValue('scheduleTime', null);\r\n\t\t\t}\r\n\t\t}}\r\n\t>\r\n\t\t{locations?.map((location, index) =>\r\n\t\t\t\r\n\t\t\t\t{location.company ? `${location.company.name} - ` : ''}\r\n\t\t\t\t{location.nameEn}\r\n\t\t\t)}\r\n\t;\r\n};\r\n\r\ninterface AutocompleteDoctorComponentProps {\r\n\tformik: any;\r\n\tloadLocations: (doctorId?: number) => void;\r\n\tloadProcedures: (doctorId?: number, locationId?: number) => void;\r\n}\r\n\r\nconst AutocompleteDoctorComponent: React.FC = ({ formik, loadLocations, loadProcedures }) => {\r\n\treturn item.nameEn}\r\n\t\tvalue={formik.values.doctor ? formik.values.doctor.nameEn : ''}\r\n\t\tplaceholder=\"Doctor...\"\r\n\t\trenderOption={(autocompleteItem) => {\r\n\t\t\treturn ({\r\n\t\t\t\tkey: autocompleteItem.id.toString(),\r\n\t\t\t\tvalue: autocompleteItem.nameEn,\r\n\t\t\t\ttitle: autocompleteItem.nameEn,\r\n\t\t\t\titem: autocompleteItem,\r\n\t\t\t\tlabel: autocompleteItem.nameEn,\r\n\t\t\t});\r\n\t\t}}\r\n\t\tonSelect={(value, option) => {\r\n\t\t\tformik.setFieldValue('doctorProcedureId', -1);\r\n\t\t\tformik.setFieldValue('doctorProcedureIds', []);\r\n\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\tformik.setFieldValue('procedures', []);\r\n\t\t\tformik.setFieldValue('doctor', option.props.item);\r\n\t\t\tloadLocations(option.props.item.id || -1);\r\n\t\t\tif (option.props.item.id > 0 && formik.values.locationId) {\r\n\t\t\t\tloadProcedures(option.props.item.id, formik.values.locationId);\r\n\t\t\t}\r\n\t\t}}\r\n\t\tonChange={(value = '') => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\tformik.setFieldValue('doctorProcedureId', null);\r\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\t\tformik.setFieldValue('doctor', null);\r\n\t\t\t\tloadLocations();\r\n\t\t\t}\r\n\t\t}}\r\n\t\tparams={{ locationId: formik.values.locationId }}\r\n\t\tloadOnFocus\r\n\t/>;\r\n};\r\n"],"names":["bookedTime","onSelectTime","onSelectPreviousWeek","onSelectNextWeek","startDate","locationId","locations","onSelectLocation","className","rowCount","selectedTime","withoutLocationButtons","withHeader","nearestTime","onNearestTimeClick","range","React","offset","setOffset","Object","entries","values","day","value","moment","isSame","index","time","utc","format","start","Math","floor","getInitialCount","count","setCount","max","keys","map","length","maxCount","setMaxCount","renderItem","slice","isSelected","key","type","disabled","booked","onClick","e","leftChevronDisabled","Date","location","id","company","name","nameEn","DoctorBookedTimeBlockHeader","columns","daysRange","row","result","push","node","renderItems","title","dayMS","resolveBookedTimes","times","interval","res","forEach","blocks","currentBlock","duration","getMinutesFromDuration","end","i","changeBookedTimesByInterval","now","filter","valueOf","filterTimesBeforeNow","doctorId","onSelect","days","onlyWorkingDays","selectLocationById","propsInterval","hideDisabledTimes","nearestDateRedirect","initStartDay","find","q","selectedLocation","setSelectedLocation","loading","setLoading","setRange","setInterval","getStartDayInitial","startDay","setStartDate","endDate","setEndDate","bookedTimeRes","setBookedTimeRes","setNearestDate","solvedNearestTime","setSolvedNearestDate","nearestDate","loadTimes","from","request","then","message","Message","JSON","stringify","newSelectedLocation","newRage","resolvedBookedTime","dates","dateIndex","findIndex","selectedTimeIndex","add","hours","minutes","selectIndexTime","undefined","solvedNearestDate","date","getHours","LogoLoader","size","disabledButtons","style","padding","visible","handleClose","afterLogin","loginState","useSelector","state","login","shallowEqual","afterLoginTrigger","setLoginTrigger","dispatch","useDispatch","loginActions","bindActionCreators","LoginState","user","centered","open","onCancel","footer","width","destroyOnClose","maskClosable","getContainer","document","querySelector","body","Login","withoutServerPage","afterBaseRedirectUser","onSubmit","password","withFieldTitle","buttons","Link","to","split","success","Modal","error","Option","Select","clearListFields","items","fields","newValues","field","item","Yup","matches","required","validationSchemaWithPatientCreating","shape","notNullValidator","scheduledTime","simpleStringValidator","procedures","nonEmptyArray","doctorProcedureId","getDaysCount","window","innerWidth","getDaysCountMobile","getRowsCount","innerHeight","ceil","patient","doctor","doctorFixed","afterSubmit","loadInvites","locationItems","onModalClose","asNearestDate","doctorProcedures","doctorBookedTime","showMobile","setLocations","doctorBookedTimes","setDoctorBookedTimes","setProcedures","isLoading","setVisible","setInvites","setCompanyTemplateInvite","setDays","setRowCount","setIsMobile","resize","addEventListener","removeEventListener","initialValues","patientId","firstName","lastName","notes","deleted","doctorProcedure","startProcedureTime","appointmentId","doctorProcedureIds","formik","useFormik","validationSchema","data","room","appointmentType","doctorPath","portalPathEn","appointments","response","onSave","current","newAppointment","invites","companyInvite","inv","isCompanyTemplate","answered","err","content","setValues","prev","CheckCircleFilled","color","fontSize","wrapClassName","icon","loadLocations","locationData","text","list","setFieldValue","fillDoctorProcedureFields","loadProcedures","proceduresData","withProcedure","withDoctor","withAppointmentType","published","hasGlobalProcedure","withGlobalProcedure","p","procedure","globalProcedureId","handleResize","subtract","every","nearestTimeKey","some","tempNearestTime","keysForRemove","onFinish","handleSubmit","ProcedureSelectComponent","htmlFor","LocationSelectComponent","AutocompleteDoctorComponent","maxWidth","DoctorBookedTimeBlock","asNearestTime","Button","dateToUtcString","okText","okType","cancelText","okButtonProps","cancelButtonProps","getAppContainer","onOk","submitForm","marginBottom","placeholder","getPopupContainer","option","props","onChange","addInfo","timeSpan","timeArr","getDuration","toString","globalProcedure","popupClassName","defaultValue","Autocomplete","renderTitle","renderOption","autocompleteItem","label","params","loadOnFocus"],"sourceRoot":""}