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CADa,QACkB,GADlB,GAC3C+J,GAD2C,WACrC9J,EADqC,KAC9B7F,EAD8B,MAEhD2P,IAASP,EAAIhE,gBAAkBvF,IAAU,EAAIuJ,EAAI/D,aAAerL,IAAQoP,EAAI9D,YAChFnH,EAAIhI,OAAOS,GAAO0S,EAAOnY,QAAO,YAAe,IAAZiJ,EAAY,EAAZA,MAClC,OAAO+F,EAAAA,EAAAA,IAAuB/F,IAA2B,GAAjBgP,EAAI5J,WAAkB4J,EAAI7D,YAClE,IAEF,IAEMpH,CACP,CAiCmCyL,CAAqBP,GAAQ/M,EAChE,C,wkDCpCD,IA7BwC,SAAC,GAEnC,IADL3D,EACK,EADLA,SAAUkR,EACL,EADKA,OAAQC,EACb,EADaA,SAAUC,EACvB,EADuBA,UAAc3S,EACrC,qDAID4S,EAAAA,EAAAA,MAJC,IAEJ/Y,MAAS+L,EAFL,EAEKA,QAASzE,EAFd,EAEcA,MAAO0R,EAFrB,EAEqBA,WACdC,EAHP,EAGJvD,QAAWuD,SAHP,IAM6B5U,EAAAA,UAAe,GAN5C,GAME4N,EANF,KAMaiH,EANb,KAOL,OAAI5R,aAAA,EAAAA,EAAOnC,WAAW6T,aAAlB,EAAkBA,EAAYG,OAC1B,KAGD,gBAAC,IAAD,GACNlH,UAAWlG,GAAWkG,GAClB9L,EAFE,CAGN1C,QAAS,WACRyV,GAAa,GACbD,EAAS,CAAEJ,SAAAA,IAAY,EAAOD,GAC5B3L,MAAK,WACLiM,GAAa,GACbJ,GAAaA,GACb,GACF,IAEApR,EAEF,C","sources":["webpack://northern-tuna-portal/./ClientApp/components/Pages/Doctor/Locations.tsx","webpack://northern-tuna-portal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockTable.tsx","webpack://northern-tuna-portal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlock.tsx","webpack://northern-tuna-portal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockHeader.tsx","webpack://northern-tuna-portal/./ClientApp/components/UI/ScheduleAppointmentModal/ScheduleAppointment.tsx","webpack://northern-tuna-portal/./ClientApp/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock.ts","webpack://northern-tuna-portal/./common/react/components/Core/ItemsProvider/LoadMoreButton.tsx"],"sourcesContent":["import React from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { useNavigate } from 'react-router-dom';\n\nimport Tabs, { TabsProps } from 'antd/lib/tabs';\nimport Modal from 'antd/lib/modal';\nimport GoogleMapReact from 'google-map-react';\n\nimport { numberWithComma } from '@commonTuna/react/utils/NumberWithComma/NumberWithComma';\n\nimport { LocationPortal } from '@app/objects/CompanyPortal';\nimport { Location } from '@app/objects/Location';\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\nimport { getLocationName } from '@app/utils/Utils';\nimport Stars from '@app/components/UI/Stars/Stars';\n\nimport '@app/scss/components/locations.scss';\nimport LocationInfo from '@app/components/Pages/Doctor/LocationInfo';\n\ninterface IPros {\n\tlocations: Array;\n\tcontainerClassName?: string;\n\tcontent?: (location: LocationPortal) => JSX.Element;\n\treviews?: (location: LocationPortal) => React.ReactNode;\n\thideTitle?: boolean;\n\thideLink?: boolean;\n}\n\ninterface MapProps {\n\taddress: string;\n\taddressList?: Array;\n}\n\ninterface LocationNodeProps {\n\tcontent: any;\n\treviews?: (location: LocationPortal) => React.ReactNode;\n\titem: any;\n\thideLink?: boolean;\n\thideMap?: boolean;\n\taddressAsLink?: boolean;\n\tshowRate?: boolean;\n}\n\nexport const getAddress = (item) => {\n\treturn [item.addressEn, item.city, item.state, item.zip].filter((e) => e).join(', ');\n};\n\nconst getClinicAvatar = (location: Location): string => {\n\tif (location.portalOriginalAvatar) {\n\t\treturn `/remote/${location.portalOriginalAvatar}`;\n\t}\n\tif (location.portalAvatar) {\n\t\treturn `/remote/${location.portalAvatar}`;\n\t}\n\treturn '';\n};\n\nfunction codeAddress(map, maps, address: string, addressList?: Array, onLoad?: (address, result, openPopup, callback) => void) {\n\tconst geocoder = new maps.Geocoder();\n\tconst gedData = (item: string | Location) => {\n\t\tconst isLocation = typeof item !== 'string';\n\t\tconst currentAddress = !isLocation ? item : getAddress(item);\n\t\tgeocoder.geocode({ address: currentAddress }, (results, status) => {\n\t\t\tif (status === 'OK') {\n\t\t\t\tif (address === currentAddress) {\n\t\t\t\t\tmap.setCenter(results[0].geometry.location);\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\tconst marker = new maps.Marker({\n\t\t\t\t\tmap,\n\t\t\t\t\tposition: results[0].geometry.location,\n\t\t\t\t\tclickable: true,\n\t\t\t\t});\n\t\t\t\tif (isLocation) {\n\t\t\t\t\tconst locationName = getLocationName(item, false, true);\n\t\t\t\t\tconst avatar = getClinicAvatar(item);\n\t\t\t\t\tconst infowindow = new google.maps.InfoWindow({\n\t\t\t\t\t\tcontent: `${isLocation ? renderToString(
\n\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t{locationName}\n\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{avatar ?
\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\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\n\t\t\t\t\t\t\t\t\t{numberWithComma(item.averageReviewRate)}\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{item.totalReviewCount}\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{item.portalDescription\n\t\t\t\t\t\t\t\t&& \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t
) : currentAddress}`,\n\t\t\t\t\t\tariaLabel: '',\n\t\t\t\t\t});\n\t\t\t\t\tconst onClick = () => {\n\t\t\t\t\t\tinfowindow.open({\n\t\t\t\t\t\t\tanchor: marker,\n\t\t\t\t\t\t\tmap,\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tmarker.addListener('click', onClick);\n\t\t\t\t\tif (address === currentAddress) {\n\t\t\t\t\t\tonClick();\n\t\t\t\t\t}\n\t\t\t\t\tonLoad && onLoad(currentAddress, results[0].geometry.location, {\n\t\t\t\t\t\topen: onClick,\n\t\t\t\t\t\tclose: () => {\n\t\t\t\t\t\t\tinfowindow.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t}, () => {\n\t\t\t\t\t\tmarker.removeListener('click', onClick);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tonLoad && onLoad(currentAddress, results[0].geometry.location, undefined, () => undefined);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.log(`Geocode was not successful for the following reason: ${status}`);\n\t\t\t}\n\t\t});\n\t};\n\tconst list: any = addressList || [];\n\t(list?.map((item) => (typeof item === 'string' ? item : getAddress(item))).includes(address) ? list : address ? [address].concat(list) : list)\n\t\t.forEach(gedData);\n}\n\nexport const SimpleMap: React.FC = ({ address, addressList }) => {\n\tconst navigate = useNavigate();\n\tconst [maps, setMaps] = React.useState();\n\tconst [map, setMap] = React.useState();\n\tconst listenersRef = React.useRef([]);\n\tconst addressRef = React.useRef({});\n\tconst popupRef = React.useRef({});\n\tconst defaultProps = {\n\t\tcenter: { lat: -34.397, lng: 150.644 },\n\t\tzoom: 12,\n\t};\n\n\tReact.useEffect(() => {\n\t\tif (map && maps) {\n\t\t\tif (addressRef.current[address]) {\n\t\t\t\tmap.setCenter(addressRef.current[address]);\n\t\t\t\tif (popupRef.current[address]) {\n\t\t\t\t\tObject.values(popupRef.current).forEach((item: any) => {\n\t\t\t\t\t\titem?.close();\n\t\t\t\t\t});\n\t\t\t\t\tpopupRef.current[address]?.open();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcodeAddress(map, maps, address);\n\t\t\t}\n\t\t}\n\t}, [address]);\n\n\tReact.useEffect(() => {\n\t\tif (listenersRef.current.length) {\n\t\t\treturn () => listenersRef.current.forEach((callback) => callback());\n\t\t}\n\t}, []);\n\n\tconst renderMarker = (map, maps) => {\n\t\tsetMap(map);\n\t\tsetMaps(maps);\n\t\treturn codeAddress(map, maps, address, addressList, (address, result, openPopup, callback) => {\n\t\t\tlistenersRef.current.concat(callback);\n\t\t\taddressRef.current[address] = result;\n\t\t\tpopupRef.current[address] = openPopup;\n\t\t});\n\t};\n\n\treturn (\n\t\t
\n\t\t\t {\n\t\t\t\t\tconst target: any = e.event.target;\n\t\t\t\t\tif (target && target.dataset.link) {\n\t\t\t\t\t\te.event.preventDefault();\n\t\t\t\t\t\tnavigate(target.dataset.link);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tbootstrapURLKeys={{ key: 'AIzaSyB_Vis358nPu31ZjN8OUdxbMwr9H9JgSso' }}\n\t\t\t\tdefaultCenter={defaultProps.center}\n\t\t\t\tdefaultZoom={defaultProps.zoom}\n\t\t\t\tonGoogleApiLoaded={({ map, maps }) => renderMarker(map, maps)}\n\t\t\t/>\n\t\t
\n\t);\n};\n\ninterface ILocationModal {\n\tlocation: Location;\n\tbuttonClassName?: string;\n\tbuttonValue?: JSX.Element;\n}\n\nexport const LocationModal: React.FC = (props) => {\n\tconst [visible, setVisible] = React.useState(false);\n\tconst { location } = props;\n\n\tconst close = () => setVisible(false);\n\n\tconst open = () => setVisible(true);\n\tconst locationName = getLocationName(location, false, true);\n\tconst {\n\t\tbuttonValue = <>\n\t\t\t\n\t\t\t{' '}\n\t\t\t{locationName}\n\t\t,\n\t\tbuttonClassName,\n\t} = props;\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{locationName}\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\n\t\t\t\t\t\t{numberWithComma(location.averageReviewRate || 0)}\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t(\n\t\t\t\t\t\t{location.totalReviewCount || 0}\n\t\t\t\t\t\t)\n\t\t\t\t\t
\n\t\t\t\t}\n\t\t\t\twidth={600}\n\t\t\t\tclassName=\"location-popap\"\n\t\t\t\tfooter={null}\n\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport const LocationNode: React.FC = ({\n\titem, reviews, content, hideLink, hideMap = false, addressAsLink, showRate,\n}) => {\n\treturn
\n\t\t\n\t\t{hideMap ? null :
\n\t\t\t\n\t\t\t
\n\t\t\t\t{content && content(item)}\n\t\t\t
\n\t\t
}\n\t\t{reviews &&
\n\t\t\t{reviews && reviews(item)}\n\t\t
\n\t\t}\n\t
;\n};\n\nconst Locations: React.FC = ({\n\tlocations, containerClassName, content, reviews, hideTitle, hideLink,\n}) => {\n\tif (locations.length === 1) {\n\t\tconst item = locations[0];\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{hideTitle ? null :

\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\n\t\t\t\t\t\t\t{numberWithComma(item.averageReviewRate)}\n\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{item.totalReviewCount || 0}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t
\n\t\t\t\t\t\t{getLocationName(item, false)}\n\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\tconst items: TabsProps['items'] = locations.map((item, index) => {\n\t\treturn {\n\t\t\tkey: index.toString(),\n\t\t\tlabel: getLocationName(item, false),\n\t\t\tclassName: 'location-tab',\n\t\t\tchildren: ,\n\t\t};\n\t});\n\n\treturn (\n\t\tlocations.length > 0 ?
\n\t\t\t\n\t\t
: null\n\t);\n};\n\nexport default Locations;\n","import React from 'react';\n\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\n\nimport { DoctorBookedTime } from '@app/objects/Doctor';\nimport { Location } from '@app/objects/Location';\n\nimport '@app/scss/components/doctorBookedTimeBlockTable.scss';\nimport DoctorBookedTimeBlockHeader from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockHeader';\nimport { SelectedTimeIndex } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\n\ndayjs.extend(utc);\n\ninterface ComponentProps {\n\tbookedTime: DoctorBookedTime;\n\tonSelectTime: (day: dayjs.Dayjs, time: dayjs.Dayjs, selectedTimeIndex?: SelectedTimeIndex) => void;\n\tonSelectPreviousWeek: () => void;\n\tonSelectNextWeek: () => void;\n\tstartDate: number;\n\tlocationId: number;\n\tlocations?: Array;\n\tonSelectLocation?: (location: Location) => void;\n\tclassName?: string;\n\trowCount?: number;\n\tselectedTime?: number;\n\twithoutLocationButtons?: boolean;\n\twithHeader?: boolean;\n\tnearestTime: number | null;\n\tonNearestTimeClick?: () => void;\n\trange: number;\n}\n\nconst getInitialCount = (bookedTime: DoctorBookedTime, offset: number, selectedTime?: number): number => {\n\tif (!selectedTime) {\n\t\treturn 0;\n\t}\n\n\tfor (const [day, value] of Object.entries(bookedTime.values)) {\n\t\tif (dayjs.utc(selectedTime).isSame(dayjs(day), 'day')) {\n\t\t\tfor (const index in value) {\n\t\t\t\tconst time = bookedTime.values[day][index];\n\n\t\t\t\tif (dayjs(selectedTime).utc().format('HH:mm:ss') === time?.start) {\n\t\t\t\t\treturn Math.floor(+index / offset) * offset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0;\n};\n\nconst DoctorBookedTimeBlockTable: React.FC = ({\n\tbookedTime,\n\tonSelectTime,\n\tonSelectPreviousWeek,\n\tonSelectNextWeek,\n\tstartDate,\n\tlocationId,\n\tlocations,\n\tonSelectLocation,\n\tclassName,\n\trowCount,\n\tselectedTime,\n\twithoutLocationButtons,\n\twithHeader = true,\n\tnearestTime = null,\n\tonNearestTimeClick,\n\trange,\n}) => {\n\tconst [offset, setOffset] = React.useState(rowCount ?? 7);\n\tconst [count, setCount] = React.useState(getInitialCount(bookedTime, offset, selectedTime));\n\tconst [maxCount, setMaxCount] = React.useState(() => {\n\t\treturn Math.max(...Object.keys(bookedTime.values).map((day) => bookedTime.values[day]?.length ?? 0));\n\t});\n\n\tReact.useEffect(() => {\n\t\tif (rowCount && rowCount !== offset) {\n\t\t\tsetOffset(rowCount);\n\t\t\tsetCount(0);\n\t\t}\n\t}, [rowCount]);\n\n\tReact.useEffect(() => {\n\t\tsetMaxCount(Math.max(...Object.keys(bookedTime.values).map((day) => bookedTime.values[day]?.length ?? 0)));\n\t}, [bookedTime]);\n\n\tconst showMore = () => {\n\t\tsetCount(count + offset);\n\t};\n\n\tconst showPrev = () => {\n\t\tsetCount(count - offset);\n\t};\n\n\tconst renderItem = (index: number): Array => {\n\t\treturn Object.keys(bookedTime.values).slice(0, range).map((day) => {\n\t\t\tconst time = bookedTime.values[day][index];\n\t\t\tconst isSelected = !!selectedTime && dayjs.utc(selectedTime).isSame(dayjs(day), 'day')\n\t\t\t\t&& dayjs(selectedTime).utc().format('HH:mm:ss') === time?.start;\n\n\t\t\treturn time ? \n\t\t\t\t {\n\t\t\t\t\t\tonSelectTime(\n\t\t\t\t\t\t\tdayjs(day).utc(),\n\t\t\t\t\t\t\tdayjs(dayjs(`${dayjs().format('YYYY/MM/DD')} ${time.start}`), 'hh:mm a'),\n\t\t\t\t\t\t\t{ key: day, start: time.start },\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t
{dayjs(dayjs(`${dayjs().format('YYYY/MM/DD')} ${time.start}`), 'HH:mm:ss').format('hh:mm a')}
\n\t\t\t\t\n\t\t\t : -;\n\t\t});\n\t};\n\n\tconst renderItems = () => {\n\t\tlet index = count;\n\t\tconst result: Array = [];\n\t\tlet row;\n\n\t\tdo {\n\t\t\trow = renderItem(index++);\n\n\t\t\tresult.push(\n\t\t\t\t\n\t\t\t\t{row}\n\t\t\t\t\n\t\t\t);\n\t\t} while (index < (count + offset > maxCount ? maxCount : count + offset));\n\n\t\treturn result.map((node) => node);\n\t};\n\n\tconst leftChevronDisabled = dayjs(startDate).utc() <= dayjs(new Date()).utc();\n\n\treturn
\n\t\t
\n\t\t\t{!withoutLocationButtons && locations && locations.length && locations.map((location) =>\n\t\t\t\t onSelectLocation && onSelectLocation(location)}\n\t\t\t\t>\n\t\t\t\t\t{`${location.company?.name ? `${location.company?.name} - ` : ''}${location.nameEn}`}\n\t\t\t\t)\n\t\t\t}\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t{withHeader && }\n\t\t\t\t{!nearestTime && renderItems()}\n\t\t\t\n\t\t
\n\t\t{nearestTime && \n\t\t\tNearest available on\n\t\t\t{' '}\n\t\t\t{dayjs(nearestTime).utc().format('MMM DD')}\n\t\t}\n\t\t{!nearestTime && <>\n\t\t\t= maxCount}\n\t\t\t\ttitle=\"Next times\"\n\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\n\t\t}\n\t
;\n};\n\nexport default DoctorBookedTimeBlockTable;\n","import React from 'react';\n\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\n\nimport Message from 'antd/lib/message';\n\nimport LogoLoader, { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\n\nimport { request } from '@app/components/Api';\nimport { Location } from '@app/objects/Location';\nimport DoctorBookedTimeBlockTable from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockTable';\nimport { DoctorBookedTime } from '@app/objects/Doctor';\nimport {\n\tfilterDisabledTimes,\n\tgetStartDayInitial,\n\tresolveBookedTimes,\n} from '@app/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\nimport { SelectedTimeIndex } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\n\ndayjs.extend(utc);\n\ninterface ComponentProps {\n\tdoctorId: number;\n\tonSelect?: (time: number, location: Location, asNearestDate?: boolean, selectIndex?: SelectedTimeIndex) => void;\n\tlocations: Array;\n\tvalue?: DoctorBookedTime;\n\tclassName?: string;\n\tdays?: number;\n\trowCount?: number;\n\tonlyWorkingDays?: boolean;\n\tselectLocationById?: number;\n\tselectedTime?: number;\n\tinitStartDay?: number;\n\twithoutLocationButtons?: boolean;\n\twithHeader?: boolean;\n\tinterval?: number;\n\thideDisabledTimes?: boolean;\n\tnearestDateRedirect?: boolean;\n}\n\nconst DoctorBookedTimeBlock: React.FC = ({\n\tdoctorId,\n\tonSelect,\n\tlocations,\n\tvalue,\n\tclassName,\n\tdays,\n\trowCount,\n\tonlyWorkingDays = false,\n\tselectedTime,\n\tselectLocationById,\n\twithoutLocationButtons,\n\twithHeader,\n\tinterval: propsInterval,\n\thideDisabledTimes = true,\n\tnearestDateRedirect = false,\n\tinitStartDay,\n}) => {\n\tconst [selectedLocation, setSelectedLocation] = React.useState(selectLocationById\n\t\t? (locations.find((q) => q.id === selectLocationById) ?? locations[0])\n\t\t: locations[0]);\n\tconst [initDoctorId, setInitDoctorId] = React.useState(doctorId);\n\tconst [loading, setLoading] = React.useState(false);\n\tconst [range, setRange] = React.useState(days ?? 7);\n\tconst [interval, setInterval] = React.useState(propsInterval || 0);\n\tconst [startDay, setStartDay] = React.useState(initStartDay || getStartDayInitial(range, selectedTime));\n\tconst [startDate, setStartDate] = React.useState(startDay);\n\tconst [endDate, setEndDate] = React.useState(startDate);\n\tconst [bookedTimeRes, setBookedTimeRes] = React.useState(value || null);\n\tconst [nearestTime, setNearestDate] = React.useState(null);\n\tconst [solvedNearestTime, setSolvedNearestDate] = React.useState(nearestTime);\n\tconst nearestDate = solvedNearestTime || nearestTime;\n\n\tReact.useEffect(() => {\n\t\tif (propsInterval !== interval) {\n\t\t\tsetInterval(propsInterval || 0);\n\t\t}\n\t}, [propsInterval]);\n\n\tReact.useEffect(() => {\n\t\tsetBookedTimeRes(value || null);\n\t}, [value]);\n\n\tconst loadTimes = (from: number, interval: number, locationId: number, days?: number) => {\n\t\tsetLoading(true);\n\t\trequest('getDoctorBookedTime', {\n\t\t\tid: doctorId,\n\t\t\tlocationId,\n\t\t\tinterval,\n\t\t\tfrom,\n\t\t\tdaysRange: days || range,\n\t\t\tonlyWorkingDays,\n\t\t}).then((res) => {\n\t\t\tsetBookedTimeRes(res);\n\t\t\tsetStartDate(res.startDate);\n\t\t\tsetEndDate(res.endDate);\n\t\t\tsetNearestDate(res.nearestTime);\n\t\t}).catch((message) => {\n\t\t\tMessage.error(message);\n\t\t}).finally(() => {\n\t\t\tsetLoading(false);\n\t\t});\n\t};\n\n\tReact.useEffect(() => {\n\t\tif (value && JSON.stringify(value) !== JSON.stringify(bookedTimeRes)) {\n\t\t\tsetBookedTimeRes(value);\n\t\t\tsetStartDate(value.startDate);\n\t\t\tsetEndDate(value.endDate);\n\t\t\tsetNearestDate(value.nearestTime);\n\t\t}\n\t}, [value]);\n\n\tReact.useEffect(() => {\n\t\tif (value && (!selectedLocation || value.locationId === selectedLocation.id) && (Object.values(value.values).length || value.nearestTime)) {\n\t\t\tsetStartDate(value.startDate);\n\t\t\tsetEndDate(value.endDate);\n\t\t\tsetNearestDate(value.nearestTime);\n\t\t} else {\n\t\t\tselectedLocation?.id && loadTimes(startDate, interval, selectedLocation.id);\n\t\t}\n\t}, [interval]);\n\n\tReact.useEffect(() => {\n\t\tlet newSelectedLocation; let\n\t\t\tnewRage;\n\t\tif (selectLocationById && selectLocationById !== selectedLocation?.id) {\n\t\t\tnewSelectedLocation = selectLocationById\n\t\t\t\t? (locations.find((q) => q.id === selectLocationById) ?? locations[0])\n\t\t\t\t: locations[0];\n\t\t\tsetSelectedLocation(newSelectedLocation);\n\t\t}\n\n\t\tif (days && days !== range) {\n\t\t\tnewRage = days;\n\t\t\tsetRange(newRage);\n\t\t}\n\n\t\tif (newSelectedLocation || newRage || (initDoctorId !== doctorId)) {\n\t\t\tloadTimes(startDate, interval, (newSelectedLocation || selectedLocation)?.id, newRage || days);\n\t\t\tsetInitDoctorId(doctorId);\n\t\t}\n\t}, [selectLocationById, days, doctorId]);\n\n\tconst bookedTime = React.useMemo(() => {\n\t\tif (!bookedTimeRes) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst resolvedBookedTime = resolveBookedTimes(bookedTimeRes, propsInterval || interval);\n\t\treturn hideDisabledTimes ? filterDisabledTimes(resolvedBookedTime) : resolvedBookedTime;\n\t}, [propsInterval, interval, bookedTimeRes]);\n\n\tReact.useEffect(() => {\n\t\tconst dates = Object.keys(bookedTime?.values || {})\n\t\t\t.map((key) => (bookedTime?.values[key].length ? key : null));\n\t\tconst dateIndex = dates.findIndex((time) => time !== null);\n\n\t\tsetSolvedNearestDate(dateIndex + 1 > range ? +dayjs(dates[dateIndex]) : null);\n\t}, [range, nearestDate, bookedTime]);\n\n\tconst onSelectLocation = (location: Location) => {\n\t\tsetSelectedLocation(location);\n\n\t\tloadTimes(startDate, interval, location.id);\n\t};\n\n\tconst onSelectTime = (day, time, nearestDate?: number, selectedTimeIndex?: SelectedTimeIndex) => {\n\t\tonSelect && onSelect(\n\t\t\tnearestDate || day.add(time.hour(), 'hours').add(time.minute(), 'minutes').valueOf(),\n\t\t\tselectedLocation,\n\t\t\t!!nearestDate,\n\t\t\tselectedTimeIndex,\n\t\t);\n\t};\n\n\tconst selectNextWeek = () => {\n\t\tloadTimes(dayjs(endDate).add(1, 'day').valueOf(), interval, selectedLocation.id);\n\t};\n\n\tconst onSelectPreviousWeek = () => {\n\t\tloadTimes(dayjs(startDate).add(1, 'day').valueOf(), -interval, selectedLocation.id);\n\t};\n\n\tconst onNearestTimeClick = () => {\n\t\tconst solvedNearestDate = Object.keys(bookedTime?.values || {})\n\t\t\t.map((key) => (bookedTime?.values[key].length ? key : null))\n\t\t\t.find((time) => time !== null);\n\t\tconst date = solvedNearestDate ? +dayjs(solvedNearestDate) : nearestDate;\n\t\tif (date) {\n\t\t\tif (nearestDateRedirect) {\n\t\t\t\tconst time = dayjs.utc(date);\n\t\t\t\tonSelectTime(time, time, +time.hour(new Date().getHours()));\n\t\t\t} else {\n\t\t\t\tloadTimes(date, interval, selectedLocation.id);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (!bookedTime) {\n\t\treturn ;\n\t}\n\n\treturn
\n\t\t\n\t\t\t\tonSelectTime(day, time, undefined, selectIndexTime)}\n\t\t\tonSelectNextWeek={selectNextWeek}\n\t\t\tonSelectPreviousWeek={onSelectPreviousWeek}\n\t\t\tstartDate={startDate}\n\t\t\tlocations={locations}\n\t\t\tlocationId={selectedLocation.id}\n\t\t\tonSelectLocation={onSelectLocation}\n\t\t\trowCount={rowCount}\n\t\t\tselectedTime={selectedTime}\n\t\t\twithHeader={withHeader}\n\t\t\tclassName={className}\n\t\t\twithoutLocationButtons={withoutLocationButtons}\n\t\t\tnearestTime={nearestDate}\n\t\t\tonNearestTimeClick={onNearestTimeClick}\n\t\t/>\n\t\t{loading\n\t\t\t&&
\n\t\t\t\t\n\t\t\t
\n\t\t}\n\t
;\n};\n\nexport default DoctorBookedTimeBlock;\n","import React from 'react';\n\nimport { DoctorBookedValues } from '@app/objects/Doctor';\nimport { daysShort, monthsShort } from '@app/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\n\ninterface Props {\n\tleftChevronDisabled: boolean;\n\tonSelectPreviousWeek: () => void;\n\tonSelectNextWeek: () => void;\n\tcolumns: DoctorBookedValues;\n\tdisabledButtons?: boolean;\n\tdaysRange?: number;\n}\n\nconst DoctorBookedTimeBlockHeader: React.FC = ({\n\tleftChevronDisabled,\n\tonSelectNextWeek,\n\tonSelectPreviousWeek,\n\tcolumns,\n\tdisabledButtons,\n\tdaysRange,\n}) => {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{Object.keys(columns).slice(0, daysRange).map((day, index) => {\n\t\t\t\tconst [_, year, month, date] = day.match(/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)/) ?? [];\n\t\t\t\treturn \n\t\t\t\t\t{daysShort[new Date(+new Date(day) + new Date().getTimezoneOffset() * 60000).getDay()]}\n\t\t\t\t\t
\n\t\t\t\t\t{`${monthsShort[+month - 1]} ${date}`}\n\t\t\t\t;\n\t\t\t})}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default DoctorBookedTimeBlockHeader;\n","import React from 'react';\n\nimport * as Yup from 'yup';\nimport Select from 'antd/lib/select';\nimport Modal from 'antd/lib/modal';\n\nimport Button from '@common/react/components/Forms/Button';\nimport Autocomplete from '@common/react/components/Forms/Autocomplete/Autocomplete';\nimport { nonEmptyArray, notNullValidator, simpleStringValidator } from '@common/react/utils/validationHelpers';\nimport { getPopupContainer } from '@common/react/components/Utils/Utils';\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport { ItemEditor } from '@common/react/components/Core/ItemEditor/ItemEditor';\nimport { useApplicationContext } from '@common/react/components/Core/Application/Application';\nimport { clearListFields } from '@common/react/utils/utils';\nimport { useMobileView } from '@common/react/hooks/useMobileView';\n\nimport { dateToUtcString } from '@commonTuna/react/components/Utils';\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\n\nimport { Appointment, AppointmentProcedure } from '@app/objects/Appointment';\nimport { User } from '@app/objects/User';\nimport { Location } from '@app/objects/Location';\nimport { Doctor, DoctorBookedTime, DoctorProcedure } from '@app/objects/Doctor';\nimport LoginForm from '@app/components/UI/ScheduleAppointmentModal/LoginForm';\nimport DoctorBookedTimeBlockTable from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\nimport { getAppContainer, getLocationName } from '@app/utils/Utils';\n\ninterface ComponentProps {\n\tshowDoctor?: boolean;\n\tpatient: User | null;\n\tdoctorFixed?: boolean;\n\tdoctor?: Doctor;\n\tafterSubmit?: (items?: Array) => void;\n\tloadInvites?: () => void;\n\tscheduledTime?: number;\n\tselectedLocation?: Location | null;\n\tlocationItems?: Array;\n\tonModalClose?: () => void;\n\tasNearestDate?: boolean;\n\tdoctorProcedures?: Array;\n\tdoctorBookedTime?: DoctorBookedTime;\n\tdaysRange?: number;\n\tshowMobile?: boolean;\n\tdoctors?: Array;\n\tlocationId?: number;\n}\n\nexport interface SelectedTimeIndex {\n\tkey: string;\n\tstart: string;\n}\n\ninterface FormValues {\n\tid: number | null;\n\tfirstName: string | null;\n\tlastName: string | null;\n\tpatientId: number | null;\n\tpatient: User | null;\n\tscheduledTime: number | null;\n\tprocedures: Array;\n\tlocation: Location | null;\n\tlocationId: number | null;\n\tdoctorProcedureIds: Array;\n\tduration: string | null;\n\tnotes: string;\n\tdoctor: Doctor | null;\n\tdoctorProcedure: DoctorProcedure | null;\n\tselectedTimeIndex: SelectedTimeIndex | undefined;\n}\n\nconst getDuration = (timeSpan: string): string | null => {\n\tconst timeArr = timeSpan.split(':');\n\tif (timeArr.length === 3) {\n\t\tconst hours = +timeArr[0] ? `${+timeArr[0]} h ` : '';\n\t\tconst minutes = `${+timeArr[1]} m`;\n\t\treturn `${hours}${minutes}`;\n\t}\n\treturn null;\n};\n\nexport const getMinutesFromDuration = (duration: string) => {\n\tconst [h, m] = duration.split(':');\n\n\treturn +(h || 0) * 60 + +(m || 0);\n};\n\nconst { success, error } = Modal;\n\nconst Option = Select.Option;\n\nexport const dateStringRequiredValidator = Yup.string().matches(/([0-9]{2}-[0-9]{2}-[0-9]{4})/, 'Invalid date').required();\n\nconst validationSchemaWithPatientCreating = Yup.object().shape({\n\tlocationId: notNullValidator.required(),\n\tscheduledTime: notNullValidator.required(),\n\tduration: simpleStringValidator,\n\tprocedures: nonEmptyArray('Procedures should not be empty'),\n});\n\nexport const getDaysCount = () => {\n\tif (typeof window === 'undefined') return 3;\n\tif (window.innerWidth >= 1990) return 7;\n\tif (window.innerWidth >= 1770) return 6;\n\tif (window.innerWidth >= 1580) return 5;\n\tif (window.innerWidth >= 1366) return 4;\n\treturn 3;\n};\n\nexport const getDaysCountMobile = () => {\n\tif (typeof window === 'undefined') return 4;\n\n\tconst count = Math.floor((window.innerWidth - 160) / 82);\n\n\treturn count > 7 ? 7 : count < 2 ? 2 : count;\n};\n\nconst getRowsCount = () => {\n\tif (typeof window === 'undefined' || window.innerHeight >= 1000) {\n\t\treturn 11;\n\t}\n\n\tif (typeof window !== 'undefined' && window.innerWidth < 650) {\n\t\treturn 5;\n\t}\n\n\treturn Math.ceil((window.innerHeight - 650) / 50);\n};\n\nconst FormHandler: React.FC<{ formik, patient, doctor, formRef}> = ({\n\tformik, patient, doctor, formRef,\n}) => {\n\tReact.useEffect(() => {\n\t\tformik.setValues((prev) => ({\n\t\t\t...prev,\n\t\t\tpatientId: patient?.id || -1,\n\t\t\tpatient: patient || null,\n\t\t\tfirstName: patient?.firstName || '',\n\t\t\tlastName: patient?.lastName || '',\n\t\t}));\n\t}, [patient]);\n\n\tReact.useEffect(() => {\n\t\tif (doctor) {\n\t\t\tformik.setValues((prev) => ({\n\t\t\t\t...prev,\n\t\t\t\tdoctor: doctor || null,\n\t\t\t\tdoctorId: doctor?.id,\n\t\t\t}));\n\t\t}\n\t}, [doctor]);\n\n\tReact.useEffect(() => {\n\t\tif (formik) {\n\t\t\tformRef.current = formik;\n\t\t}\n\t}, [formik]);\n\n\treturn <>;\n};\n\nconst ScheduleAppointment: React.FC = ({\n\tshowDoctor,\n\tpatient,\n\tdoctor,\n\tdoctorFixed = false,\n\tafterSubmit,\n\tloadInvites,\n\tscheduledTime,\n\tselectedLocation,\n\tlocationItems,\n\tonModalClose,\n\tasNearestDate,\n\tdoctorProcedures,\n\tdoctorBookedTime,\n\tdaysRange,\n\tshowMobile,\n\tdoctors,\n\tlocationId,\n}) => {\n\tconst [locations, setLocations] = React.useState>(locationItems ?? []);\n\tconst [doctorBookedTimes, setDoctorBookedTimes] = React.useState(doctorBookedTime);\n\tconst [procedures, setProcedures] = React.useState>(doctorProcedures || []);\n\tconst [isLoading, setLoading] = React.useState(false);\n\tconst [visible, setVisible] = React.useState(false);\n\tconst [invites, setInvites] = React.useState>([]);\n\tconst [companyTemplateInvite, setCompanyTemplateInvite] = React.useState(null);\n\tconst [days, setDays] = React.useState(daysRange || (showMobile ? 4 : 3));\n\tconst [rowCount, setRowCount] = React.useState(11);\n\tconst formRef = React.useRef();\n\tconst { request } = useApplicationContext();\n\n\tconst initialValues = React.useMemo(() => {\n\t\tconst values = {} as FormValues;\n\t\treturn ({\n\t\t\t...{} as Appointment,\n\t\t\tpatientId: patient?.id || -1,\n\t\t\tpatient: patient || null,\n\t\t\tfirstName: patient?.firstName || '',\n\t\t\tlastName: patient?.lastName || '',\n\t\t\tdoctor: doctor || null,\n\t\t\tdoctorId: doctor?.id,\n\t\t\tduration: procedures[0]?.duration || null,\n\t\t\tscheduledTime: scheduledTime && !asNearestDate\n\t\t\t\t? scheduledTime\n\t\t\t\t: values.scheduledTime || null,\n\t\t\tnotes: values.notes || '',\n\t\t\tlocation: selectedLocation || (values.location || locations.length > 0 ? locations[0] : null),\n\t\t\tlocationId: locationId || (selectedLocation\n\t\t\t\t? selectedLocation.id\n\t\t\t\t: values.locationId || locations.length > 0 ? locations[0].id : -1),\n\t\t\tprocedures: values.procedures || [{\n\t\t\t\tid: -1,\n\t\t\t\tdeleted: false,\n\t\t\t\tdoctorProcedure: null,\n\t\t\t\tstartProcedureTime: scheduledTime || values.scheduledTime || null,\n\t\t\t\tappointmentId: null,\n\t\t\t\tcount: 1,\n\t\t\t} as unknown as AppointmentProcedure],\n\t\t\tdoctorProcedure: values.doctorProcedure || null,\n\t\t\tdoctorProcedureIds: values?.doctorProcedureIds ? values.doctorProcedureIds.length > 0 ? values.doctorProcedureIds : [] : [],\n\t\t\tselectedTimeIndex: undefined,\n\t\t});\n\t}, [patient, doctor?.id, scheduledTime, selectedLocation]);\n\n\tconst handleClose = React.useCallback(() => {\n\t\tsetVisible(false);\n\t\tonModalClose && onModalClose();\n\t}, []);\n\n\tconst afterLogin = () => {\n\t\thandleClose();\n\t\tModal.confirm({\n\t\t\ttitle: `You wanted to create an appointment with ${doctor?.nameEn} ${\n\t\t\t\tdateToUtcString(formRef.current?.values.scheduledTime, 'hh:mm a')}?`,\n\t\t\tcontent: '',\n\t\t\tclassName: 'schedule-confirm',\n\t\t\ticon: <>,\n\t\t\tokText: 'Yes',\n\t\t\tokType: 'primary',\n\t\t\tcancelText: 'No',\n\t\t\tokButtonProps: {\n\t\t\t\tclassName: 'btn btn-primary',\n\t\t\t},\n\t\t\tcancelButtonProps: {\n\t\t\t\tclassName: 'btn btn-default',\n\t\t\t},\n\t\t\tgetContainer: getAppContainer,\n\t\t\tonOk() {\n\t\t\t\tformRef.current?.submitForm();\n\t\t\t},\n\t\t\tonCancel: () => {\n\t\t\t\tfillDoctorProcedureFields(procedures[0]);\n\t\t\t\tformRef.current?.setFieldValue('scheduledTime', scheduledTime && !asNearestDate\n\t\t\t\t\t? scheduledTime\n\t\t\t\t\t: null);\n\t\t\t\tif (locations.length) {\n\t\t\t\t\tformRef.current?.setFieldValue('locationId', locations[0].id);\n\t\t\t\t\tformRef.current?.setFieldValue('location', locations[0]);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t};\n\n\tconst onSave = React.useCallback(() => {\n\t\tsuccess({\n\t\t\tcontent: <>\n\t\t\t\t\n\t\t\t\t{' '}\n\t\t\t\tAppointment has been successfully created.\n\t\t\t,\n\t\t\twrapClassName: 'success-modal',\n\t\t\ticon: null,\n\t\t});\n\t}, []);\n\n\tconst loadLocations = (doctorId?: number) => {\n\t\tconst locationData = {\n\t\t\ttext: '',\n\t\t\tdoctorId,\n\t\t};\n\t\trequest('locationList', locationData)\n\t\t\t.then((response: any) => {\n\t\t\t\tsetLocations(response.list);\n\t\t\t\tif (formRef.current && formRef.current.values.locationId === -1 && response.list.length > 0) {\n\t\t\t\t\tformRef.current?.setFieldValue('locationId', response.list[0].id);\n\t\t\t\t\tformRef.current?.setFieldValue('location', response.list[0]);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\terror({\n\t\t\t\t\ttitle: 'Error',\n\t\t\t\t\tcontent: `Something went wrong. ${err}`,\n\t\t\t\t});\n\t\t\t});\n\t};\n\n\tconst fillDoctorProcedureFields = (doctorProcedure: DoctorProcedure) => {\n\t\tformRef.current?.setFieldValue('doctorProcedureId', +doctorProcedure.id);\n\t\tformRef.current?.setFieldValue('doctorProcedureIds', [+doctorProcedure.id]);\n\t\tformRef.current?.setFieldValue('doctorProcedure', doctorProcedure);\n\t\tformRef.current?.setFieldValue('procedures', [{\n\t\t\tdoctorProcedure,\n\t\t\tdoctorProcedureId: +doctorProcedure.id,\n\t\t\tduration: formRef.current?.values.duration,\n\t\t\tstartProcedureTime: formRef.current?.values.scheduledTime,\n\t\t\tappointmentId: -1,\n\t\t}]);\n\t\tformRef.current?.setFieldValue('doctor', doctorProcedure.doctor);\n\t\tformRef.current?.setFieldValue('duration', doctorProcedure.duration);\n\t};\n\n\tconst loadProcedures = (doctorId?: number, locationId?: number) => {\n\t\tconst proceduresData = {\n\t\t\ttext: '',\n\t\t\tdoctorId,\n\t\t\tlocationId,\n\t\t\twithProcedure: true,\n\t\t\twithDoctor: true,\n\t\t\twithAppointmentType: true,\n\t\t\tpublished: true,\n\t\t\thasGlobalProcedure: true,\n\t\t\twithGlobalProcedure: true,\n\t\t};\n\n\t\trequest('doctorProcedureList', proceduresData)\n\t\t\t.then((response: any) => {\n\t\t\t\tconst list = response.list.filter((p) => p.procedure?.globalProcedureId);\n\t\t\t\tsetProcedures(list);\n\t\t\t\tif (formRef.current && list.length > 0) {\n\t\t\t\t\tfillDoctorProcedureFields(response.list[0]);\n\t\t\t\t}\n\t\t\t\tformRef.current?.setFieldValue('locationId', locationId);\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\terror({\n\t\t\t\t\ttitle: 'Error',\n\t\t\t\t\tcontent: `Something went wrong. ${err}`,\n\t\t\t\t});\n\t\t\t});\n\t};\n\n\tconst handleResize = () => {\n\t\tsetDays((showMobile ? getDaysCountMobile : getDaysCount)());\n\t\tsetRowCount(getRowsCount());\n\t};\n\n\tconst endDate = React.useMemo(() => {\n\t\tif (!doctorBookedTimes?.endDate) return;\n\t\tconst date = new Date(doctorBookedTimes.endDate);\n\t\treturn +new Date(date.getFullYear(), date.getMonth(), date.getDate() - (7 - days), date.getHours(), date.getMinutes(), date.getSeconds(), 0);\n\t}, [doctorBookedTimes?.endDate]);\n\tconst isMobile = useMobileView(undefined, handleResize);\n\n\tReact.useEffect(() => {\n\t\tif (!locationItems) {\n\t\t\tloadLocations(doctor?.id);\n\t\t}\n\n\t\tif (formRef.current?.values) {\n\t\t\tif (procedures.length > 0) {\n\t\t\t\tfillDoctorProcedureFields(procedures[0]);\n\t\t\t} else {\n\t\t\t\tloadProcedures(formRef.current?.values.doctor?.id || doctor?.id, formRef.current?.values.locationId || undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (doctorBookedTimes) {\n\t\t\tconst keys = Object.keys(doctorBookedTimes.values);\n\n\t\t\tif (!doctorBookedTimes.nearestTime && endDate && keys.every((key) => {\n\t\t\t\tif (endDate && +new Date(key) <= endDate) {\n\t\t\t\t\treturn doctorBookedTimes.values[key].length === 0;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t})) {\n\t\t\t\tconst nearestTimeKey = keys.find((key) =>\n\t\t\t\t\t(doctorBookedTimes.values[key]?.length > 0 ? doctorBookedTimes.values[key].some((value) => !value.booked) : false));\n\n\t\t\t\tif (nearestTimeKey) {\n\t\t\t\t\tconst tempNearestTime = +new Date(nearestTimeKey);\n\t\t\t\t\tif (endDate && tempNearestTime > endDate) {\n\t\t\t\t\t\tdoctorBookedTimes.nearestTime = tempNearestTime.valueOf();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst keysForRemove = endDate && Object.keys(doctorBookedTimes.values).map((key) => {\n\t\t\t\tif (endDate && +new Date(key) > endDate) {\n\t\t\t\t\treturn key;\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t});\n\n\t\t\tkeysForRemove && keysForRemove.length > 0 && keysForRemove.map((key) => {\n\t\t\t\tif (key) {\n\t\t\t\t\tdelete doctorBookedTimes.values[key];\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tsetDays(daysRange || (showMobile ? getDaysCountMobile : getDaysCount)());\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (scheduledTime && !asNearestDate && selectedLocation && formRef.current) {\n\t\t\tformRef.current?.setFieldValue('scheduledTime', scheduledTime);\n\t\t\tformRef.current?.setFieldValue('location', selectedLocation);\n\t\t\tformRef.current?.setFieldValue('locationId', selectedLocation.id);\n\t\t}\n\n\t\tif (scheduledTime && selectedLocation) {\n\t\t\tloadProcedures(formRef.current?.values.doctor?.id || doctor?.id, selectedLocation.id);\n\t\t}\n\t}, [scheduledTime, selectedLocation, asNearestDate]);\n\n\tconst value = React.useMemo(() => (doctorBookedTimes && endDate ? {\n\t\t...doctorBookedTimes,\n\t\tendDate,\n\t} : undefined), [doctorBookedTimes, endDate]);\n\n\treturn <>\n\t\t {\n\t\t\t\tconst data = {\n\t\t\t\t\t...values,\n\t\t\t\t\tpatient: null,\n\t\t\t\t\tdoctor: null,\n\t\t\t\t\tlocation: null,\n\t\t\t\t\troom: null,\n\t\t\t\t\tappointmentType: null,\n\t\t\t\t\tscheduledTime: values.scheduledTime!,\n\t\t\t\t\tprocedures: clearListFields(values.procedures, ['doctorProcedure', 'appointment', 'room', 'doctorPayer']),\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tid: -1,\n\t\t\t\t\tdoctorPath: doctor?.portalPathEn,\n\t\t\t\t\tappointments: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...data,\n\t\t\t\t\t\t\tscheduledTime: values.scheduledTime,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t} as any;\n\t\t\t}}\n\t\t>\n\t\t\t {\n\t\t\t\t\tif (values.patient) {\n\t\t\t\t\t\tsetLoading(true);\n\t\t\t\t\t\tsubmit()\n\t\t\t\t\t\t\t.then((response: any) => {\n\t\t\t\t\t\t\t\tonSave();\n\t\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\t\tsetVisible(false);\n\n\t\t\t\t\t\t\t\t// Try remove time block if appointment successfully scheduled\n\t\t\t\t\t\t\t\tif (doctorBookedTimes && values.selectedTimeIndex) {\n\t\t\t\t\t\t\t\t\tconst current = { ...doctorBookedTimes };\n\t\t\t\t\t\t\t\t\tcurrent.values[values.selectedTimeIndex.key] = current.values[values.selectedTimeIndex.key]\n\t\t\t\t\t\t\t\t\t\t.filter((q) => q.start !== values.selectedTimeIndex!.start);\n\t\t\t\t\t\t\t\t\tsetDoctorBookedTimes(current);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst newAppointment = response.appointments[0];\n\n\t\t\t\t\t\t\t\tif (newAppointment.invites?.length > 0) {\n\t\t\t\t\t\t\t\t\tconst companyInvite = newAppointment.invites.find((inv) => inv.isCompanyTemplate && !inv.answered);\n\t\t\t\t\t\t\t\t\tif (companyInvite) {\n\t\t\t\t\t\t\t\t\t\tsetCompanyTemplateInvite(companyInvite);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tsetInvites(newAppointment.invites.filter((inv) => !inv.isCompanyTemplate));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tafterSubmit && afterSubmit(newAppointment.invites);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((err: string) => {\n\t\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\ttitle: 'Error',\n\t\t\t\t\t\t\t\t\tcontent: err,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetVisible(true);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}}\n\t\t\t\tedit={(formik) =>
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t{doctors ? <>\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\tconst selectedDoctor = option?.item || doctors?.find((q) => q.id === value);\n\n\t\t\t\t\t\t\t\t\tif (selectedDoctor && formik.values.doctor?.id !== selectedDoctor?.id) {\n\t\t\t\t\t\t\t\t\t\tloadProcedures(value, formik.values.locationId);\n\n\t\t\t\t\t\t\t\t\t\tformik.setFieldValue('doctor', selectedDoctor);\n\n\t\t\t\t\t\t\t\t\t\tformik.setFieldValue('doctorProcedure', null);\n\t\t\t\t\t\t\t\t\t\tformik.setFieldValue('scheduleTime', null);\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\t{doctors?.map((doctor, index) =>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{doctor.nameEn}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t : null}\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\t\n\t\t\t\t\t
\n\t\t\t\t\t{formik.values.locationId && formik.values.doctor?.id && formik.values.duration && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdays={days}\n\t\t\t\t\t\t\t\trowCount={rowCount}\n\t\t\t\t\t\t\t\tinterval={formik.values.duration ? getMinutesFromDuration(formik.values.duration) : undefined}\n\t\t\t\t\t\t\t\tselectedTime={formik.values.scheduledTime || undefined}\n\t\t\t\t\t\t\t\tinitStartDay={(asNearestDate && scheduledTime) || undefined}\n\t\t\t\t\t\t\t\tselectLocationById={formik.values.locationId || undefined}\n\t\t\t\t\t\t\t\tonSelect={(time: number, location: Location, asNearestTime?: boolean, selectedTimeIndex?: SelectedTimeIndex) => {\n\t\t\t\t\t\t\t\t\tformik.setFieldValue('scheduledTime', time);\n\t\t\t\t\t\t\t\t\tif (formik.values.procedures?.length) {\n\t\t\t\t\t\t\t\t\t\tformik.setFieldValue('procedures[0].startProcedureTime', time);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tformik.setFieldValue('selectedTimeIndex', selectedTimeIndex);\n\t\t\t\t\t\t\t\t\t/* formik.setFieldValue('location', location);\n\t\t\t\t\t\t\t\t\tformik.setFieldValue('locationId', location.id); */\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t\twithoutLocationButtons\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\tSchedule Appointment\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;\n};\n\nexport default ScheduleAppointment;\n\ninterface ProcedureSelectComponentProps {\n\tformik: any;\n\tprocedures: Array;\n\tdoctorFixed: boolean;\n}\n\nconst ProcedureSelectComponent: React.FC = ({ formik, procedures, doctorFixed }) => {\n\treturn {\n\t\t\tformik.setFieldValue('doctorProcedureId', +value);\n\t\t\tformik.setFieldValue('doctorProcedureIds', [+value]);\n\t\t\tformik.setFieldValue('doctorProcedure', option.props.item);\n\t\t\tformik.setFieldValue('procedures', [{\n\t\t\t\tdoctorProcedure: option.props.item,\n\t\t\t\tdoctorProcedureId: +value,\n\t\t\t\tduration: formik.values.duration,\n\t\t\t\tstartProcedureTime: formik.values.scheduledTime,\n\t\t\t\tappointmentId: -1,\n\t\t\t}]);\n\t\t\tformik.setFieldValue('doctor', option.props.item.doctor);\n\t\t\tformik.setFieldValue('duration', option.props.item.duration);\n\t\t}}\n\t\tonChange={(value = -1) => {\n\t\t\tif (value === -1) {\n\t\t\t\tformik.setFieldValue('doctorProcedureId', null);\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\n\t\t\t}\n\t\t}}\n\t>\n\t\t{procedures.map((doctorProcedure) => {\n\t\t\tconst addInfo = `${doctorFixed ? ''\n\t\t\t\t: `${doctorProcedure!.doctor?.nameEn || '-'}, `}${getDuration(doctorProcedure!.duration) || '0 m'}`;\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{doctorProcedure.procedure.globalProcedure?.name}\n\t\t\t\t\t{' '}\n\t\t\t\t\t(\n\t\t\t\t\t{addInfo}\n\t\t\t\t\t)\n\t\t\t\t\n\t\t\t);\n\t\t})}\n\t;\n};\n\ninterface LocationSelectComponentProps {\n\tformik: any;\n\tlocations: Array;\n\tloadProcedures: (doctorId?: number, locationId?: number) => void;\n}\n\nconst LocationSelectComponent: React.FC = ({ formik, locations, loadProcedures }) => {\n\treturn {\n\t\t\tconst location = locations.find((q) => q.id === value);\n\n\t\t\tif (location && formik.values.locationId !== location?.id) {\n\t\t\t\tloadProcedures(formik.values.doctor?.id, location?.id);\n\n\t\t\t\tformik.setFieldValue('location', location);\n\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\n\t\t\t\tformik.setFieldValue('scheduleTime', null);\n\t\t\t}\n\t\t}}\n\t>\n\t\t{locations?.map((location, index) =>\n\t\t\t\n\t\t\t\t{getLocationName(location)}\n\t\t\t)}\n\t;\n};\n\ninterface AutocompleteDoctorComponentProps {\n\tformik: any;\n\tloadLocations: (doctorId?: number) => void;\n\tloadProcedures: (doctorId?: number, locationId?: number) => void;\n}\n\nconst AutocompleteDoctorComponent: React.FC = ({ formik, loadLocations, loadProcedures }) => {\n\treturn item.nameEn}\n\t\tvalue={formik.values.doctor ? formik.values.doctor.nameEn : ''}\n\t\tplaceholder=\"Doctor...\"\n\t\trenderOption={(autocompleteItem) => {\n\t\t\treturn ({\n\t\t\t\tkey: autocompleteItem.id.toString(),\n\t\t\t\tvalue: autocompleteItem.nameEn,\n\t\t\t\ttitle: autocompleteItem.nameEn,\n\t\t\t\titem: autocompleteItem,\n\t\t\t\tlabel: autocompleteItem.nameEn,\n\t\t\t});\n\t\t}}\n\t\tonSelect={(value, option) => {\n\t\t\tformik.setFieldValue('doctorProcedureId', -1);\n\t\t\tformik.setFieldValue('doctorProcedureIds', []);\n\t\t\tformik.setFieldValue('doctorProcedure', null);\n\t\t\tformik.setFieldValue('procedures', []);\n\t\t\tformik.setFieldValue('doctor', option.props.item);\n\t\t\tloadLocations(option.props.item.id || -1);\n\t\t\tif (option.props.item.id > 0 && formik.values.locationId) {\n\t\t\t\tloadProcedures(option.props.item.id, formik.values.locationId);\n\t\t\t}\n\t\t}}\n\t\tonChange={(value = '') => {\n\t\t\tif (value === '') {\n\t\t\t\tformik.setFieldValue('doctorProcedureId', null);\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\n\t\t\t\tformik.setFieldValue('doctor', null);\n\t\t\t\tloadLocations();\n\t\t\t}\n\t\t}}\n\t\tparams={{ locationId: formik.values.locationId }}\n\t\tloadOnFocus\n\t/>;\n};\n","import { DoctorBookedTime } from '@app/objects/Doctor';\nimport { getMinutesFromDuration } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\n\nconst dayMS = 3600 * 1000 * 24; // milliseconds in one day\n\nexport const daysShort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nexport const monthsShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];\n\nexport const getStartDayInitial = (range: number, selectedTime?: number): number => {\n\tconst now = +new Date();\n\n\tif (!selectedTime) {\n\t\treturn now;\n\t}\n\n\treturn now + Math.floor((selectedTime - now) / (dayMS * range)) * dayMS * range;\n};\n\nexport const filterDisabledTimes = (times: DoctorBookedTime): DoctorBookedTime => {\n\tconst res = { ...times, values: { ...times.values } };\n\n\tObject.entries(res.values).forEach(([key, blocks]) => {\n\t\tres.values[key] = blocks.filter(({ booked }) => !booked);\n\t});\n\n\treturn res;\n};\n\nexport const filterTimesBeforeNow = (times: DoctorBookedTime): DoctorBookedTime => {\n\tconst res = { ...times, values: { ...times.values } };\n\tconst now = new Date();\n\n\tObject.entries(res.values).forEach(([key, blocks]) => {\n\t\tconst [_, year, month, day] = key.match(/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)/) ?? [];\n\t\tif (+year === now.getFullYear() && +month === 1 + now.getMonth() && +day === now.getDate()) {\n\t\t\tres.values[key] = blocks.filter(({ start }) => {\n\t\t\t\treturn getMinutesFromDuration(start) >= now.getHours() * 60 + now.getMinutes();\n\t\t\t});\n\t\t}\n\t});\n\n\treturn res;\n};\n\nexport const changeBookedTimesByInterval = (times: DoctorBookedTime, interval: number): DoctorBookedTime => {\n\tconst res = { ...times, values: { ...times.values } };\n\n\tObject.entries(res.values).forEach(([key, blocks]) => {\n\t\tres.values[key] = blocks.map((currentBlock, index) => {\n\t\t\tlet duration = getMinutesFromDuration(currentBlock.end) - getMinutesFromDuration(currentBlock.start);\n\n\t\t\tif (duration >= interval || currentBlock.booked) {\n\t\t\t\treturn currentBlock;\n\t\t\t}\n\n\t\t\tfor (let i = index; blocks.length > i; i++) {\n\t\t\t\tif (duration < interval\n\t\t\t\t\t\t&& (!blocks[i + 1] || blocks[i].end !== blocks[i + 1]?.start || blocks[i + 1].booked)) {\n\t\t\t\t\treturn { ...currentBlock, booked: true };\n\t\t\t\t}\n\n\t\t\t\tduration += getMinutesFromDuration(blocks[i + 1].end) - getMinutesFromDuration(blocks[i + 1].start);\n\t\t\t\tif (duration >= interval) {\n\t\t\t\t\treturn currentBlock;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { ...currentBlock, booked: duration < interval };\n\t\t});\n\t});\n\n\treturn res;\n};\n\nexport const resolveBookedTimes = (times: DoctorBookedTime, interval: number): DoctorBookedTime => {\n\treturn changeBookedTimesByInterval(filterTimesBeforeNow(times), interval);\n};\n","import React from 'react';\n\nimport Button, { ButtonProps } from '@common/react/components/Forms/Button';\nimport { useItemsProviderContext } from '@common/react/components/Core/ItemsProvider/ItemsProvider';\n\ninterface Props extends ButtonProps {\n\tsilent?: boolean;\n\tpageSize?: number;\n\tafterLoad?: () => void;\n}\n\nconst LoadMoreButton: React.FC = ({\n\tchildren, silent, pageSize, afterLoad, ...props\n}) => {\n\tconst {\n\t\tstate: { loading, items, pagination },\n\t\tactions: { loadMore },\n\t} = useItemsProviderContext();\n\n\tconst [isLoading, setIsLoading] = React.useState(false);\n\tif (items?.length === pagination?.total) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\t\tsetIsLoading(true);\n\t\t\tloadMore({ pageSize }, false, silent)\n\t\t\t\t.then(() => {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\tafterLoad && afterLoad();\n\t\t\t\t});\n\t\t}}\n\t>\n\t\t{children}\n\t;\n};\n\nexport default LoadMoreButton;\n"],"names":["getAddress","item","addressEn","city","state","zip","filter","e","join","codeAddress","map","maps","address","addressList","onLoad","geocoder","Geocoder","list","includes","concat","forEach","isLocation","currentAddress","geocode","results","status","setCenter","geometry","location","marker","Marker","position","clickable","locationName","getLocationName","avatar","portalOriginalAvatar","portalAvatar","infowindow","google","InfoWindow","content","renderToString","className","style","cursor","portalPathEn","src","alt","value","averageReviewRate","numberWithComma","totalReviewCount","LocationNode","hideMap","hideLink","addressAsLink","portalDescription","dangerouslySetInnerHTML","__html","ariaLabel","onClick","open","anchor","addListener","close","removeListener","undefined","console","log","SimpleMap","navigate","useNavigate","React","setMaps","setMap","listenersRef","addressRef","popupRef","defaultProps","center","lat","lng","zoom","current","Object","values","length","callback","target","event","dataset","link","preventDefault","bootstrapURLKeys","key","defaultCenter","defaultZoom","onGoogleApiLoaded","result","openPopup","renderMarker","LocationModal","props","visible","setVisible","buttonValue","buttonClassName","type","onCancel","title","prefix","path","color","marginRight","width","footer","reviews","showRate","locations","containerClassName","hideTitle","items","index","toString","label","children","defaultActiveKey","dayjs","utc","bookedTime","onSelectTime","onSelectPreviousWeek","onSelectNextWeek","startDate","locationId","onSelectLocation","rowCount","selectedTime","withoutLocationButtons","withHeader","nearestTime","onNearestTimeClick","range","offset","setOffset","entries","day","isSame","time","format","start","Math","floor","getInitialCount","count","setCount","max","keys","maxCount","setMaxCount","renderItem","slice","isSelected","disabled","booked","leftChevronDisabled","Date","id","company","name","nameEn","DoctorBookedTimeBlockHeader","columns","daysRange","row","push","node","renderItems","doctorId","onSelect","days","onlyWorkingDays","selectLocationById","propsInterval","interval","hideDisabledTimes","nearestDateRedirect","initStartDay","find","q","selectedLocation","setSelectedLocation","initDoctorId","setInitDoctorId","loading","setLoading","setRange","setInterval","getStartDayInitial","startDay","setStartDate","endDate","setEndDate","bookedTimeRes","setBookedTimeRes","setNearestDate","solvedNearestTime","setSolvedNearestDate","nearestDate","loadTimes","from","request","then","res","message","Message","JSON","stringify","newSelectedLocation","newRage","resolvedBookedTime","resolveBookedTimes","filterDisabledTimes","dates","dateIndex","findIndex","selectedTimeIndex","add","hour","minute","valueOf","selectIndexTime","solvedNearestDate","date","getHours","LogoLoader","size","disabledButtons","match","month","padding","daysShort","getTimezoneOffset","getDay","monthsShort","getMinutesFromDuration","duration","split","success","Modal","error","Option","Select","validationSchemaWithPatientCreating","Yup","matches","required","shape","notNullValidator","scheduledTime","simpleStringValidator","procedures","nonEmptyArray","getDaysCount","window","innerWidth","getDaysCountMobile","FormHandler","formik","patient","doctor","formRef","setValues","prev","patientId","firstName","lastName","showDoctor","doctorFixed","afterSubmit","loadInvites","locationItems","onModalClose","asNearestDate","doctorProcedures","doctorBookedTime","showMobile","doctors","setLocations","doctorBookedTimes","setDoctorBookedTimes","setProcedures","isLoading","setInvites","setCompanyTemplateInvite","setDays","setRowCount","useApplicationContext","initialValues","notes","deleted","doctorProcedure","startProcedureTime","appointmentId","doctorProcedureIds","handleClose","onSave","fontSize","wrapClassName","icon","fillDoctorProcedureFields","setFieldValue","doctorProcedureId","loadProcedures","text","withProcedure","withDoctor","withAppointmentType","published","hasGlobalProcedure","withGlobalProcedure","response","p","procedure","globalProcedureId","err","getFullYear","getMonth","getDate","getMinutes","getSeconds","useMobileView","innerHeight","ceil","every","nearestTimeKey","some","tempNearestTime","keysForRemove","validationSchema","clearForSubmit","data","room","appointmentType","clearListFields","doctorPath","appointments","showMessages","beforeSubmit","actions","submit","newAppointment","invites","companyInvite","inv","isCompanyTemplate","answered","edit","htmlFor","marginBottom","placeholder","popupClassName","defaultValue","getPopupContainer","onChange","option","selectedDoctor","ProcedureSelectComponent","LocationSelectComponent","maxWidth","asNearestTime","afterLogin","dateToUtcString","okText","okType","cancelText","okButtonProps","cancelButtonProps","getContainer","getAppContainer","onOk","submitForm","addInfo","timeSpan","timeArr","hours","minutes","getDuration","globalProcedure","dayMS","now","times","blocks","currentBlock","end","i","changeBookedTimesByInterval","year","filterTimesBeforeNow","silent","pageSize","afterLoad","useItemsProviderContext","pagination","loadMore","setIsLoading","total"],"sourceRoot":""}